Commit 44ef3b0c authored by Yusei Tahara's avatar Yusei Tahara

[erp5_base] Fix Delivery_getLedgerItemList to make it work with non-Delivery...

[erp5_base] Fix Delivery_getLedgerItemList to make it work with non-Delivery Type portal type documents.
parent 21ab3fd3
......@@ -6,6 +6,10 @@ This will return only ledgers allowed in the delivery type definition.
portal = context.getPortalObject()
ledger_item_list = context.Base_getPreferredCategoryChildItemList(portal.portal_categories.ledger)
allowed_ledger_list = portal.portal_types[context.getPortalType()].getLedgerList()
return [('', '')] + [item for item in ledger_item_list if item[1] in allowed_ledger_list]
type_info = portal.portal_types[context.getPortalType()]
if getattr(type_info, 'getLedgerList', None) is not None:
allowed_ledger_list = type_info.getLedgerList()
return [('', '')] + [item for item in ledger_item_list if item[1] in allowed_ledger_list]
else:
return ledger_item_list
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