Commit 4a03df22 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_trade: it can return Unauthorized

why ?
parent dbceb98d
from zExceptions import Unauthorized
portal = context.getPortalObject()
getCurrentInventoryList = portal.portal_simulation.getCurrentInventoryList
newContent = context.newContent
......@@ -24,6 +26,11 @@ inventory_list = getCurrentInventoryList(**kw)
line_tag = '%s:lineUpdateTotalAssetPrice' % relative_url
#only after all calculation are finished then change report state
for inventory in inventory_list:
#XXXXXXXXXXXXXXXXXX
try:
inventory.getResource()
except Unauthorized:
continue
inventory_report_line = newContent(portal_type='Inventory Report Line')
inventory_report_line.edit(
resource = inventory.getResource(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment