Commit 557c29fe authored by Sebastien Robin's avatar Sebastien Robin

the gid generator has moved from the configuration of the subscription to the conduit itself

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17962 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 215051b3
......@@ -1075,3 +1075,26 @@ class BaobabConduit(ERP5Conduit):
"""
ERP5Conduit.newObject(self, object=object, xml=xml, simulate=simulate,
reset_local_roles=reset_local_roles, reset_workflow=reset_workflow)
def getGidFromObject(self, object):
"""
return the Gid composed with the object informations
"""
script = None
parent = object.aq_parent
while not (parent.id.endswith('_xml') or (parent.id.endswith('_module'))):
parent = parent.aq_parent
if parent.id == 'bank_account_inventory_xml':
script = getattr(object, 'BankAccountInventory_getMasterGid')
elif parent.id == 'customers_xml':
script = getattr(object, 'Oracle_getGid')
elif parent.id == 'cash_inventory_xml':
script = getattr(object, 'Inventory_getMasterGid')
elif object.getPortalType() == 'Bank Account Inventory Group':
script = getattr(object, 'BankAccountInventory_getGid')
elif object.getPortalType() == 'Cash Inventory Group':
script = getattr(object, 'Inventory_getClientGid')
else:
script = getattr(object, 'Baobab_getGid')
return script()
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