Commit 0b9513d7 authored by Aurel's avatar Aurel

modify way to import bank account inventory to follow their new

structure 


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17920 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2e22ce4e
......@@ -478,16 +478,18 @@ class BaobabConduit(ERP5Conduit):
### handle bank account inventory objects
elif portal_type == 'Bank Account Inventory':
if bank_account_inventory_module == None: return None
subobject = bank_account_inventory_module.newContent( portal_type = 'Bank Account Inventory'
subobject = bank_account_inventory_module.newContent( portal_type = 'Bank Account Inventory Group'
, id = object_id
)
### handle bank account inventory line objects
elif portal_type == 'Bank Account Inventory Line':
subobject = object.newContent( portal_type = 'Bank Account Inventory Line'
subobject = object.newContent( portal_type = 'Bank Account Inventory'
, id = object_id
)
subsubobject = subobject.newContent( portal_type = 'Bank Account Inventory Line'
, id = 'line'
)
return subobject
......@@ -610,14 +612,18 @@ class BaobabConduit(ERP5Conduit):
### Bank Account Inventory Line objects needs two properties to get the right bank account object
# This part is only usefull for bank account inventory line, it is not used for most portal types
if object.getPortalType() == 'Bank Account Inventory Line':
if object.getPortalType() == 'Bank Account Inventory':
line = object['line']
# Make sure variables will be defined
currency_id = None
bank_account_number = None
for k,v in kw.items():
if k == 'currency' : currency_id = v
if k == 'account_number': bank_account_number = v
if k == "amount" : quantity = float(v)
# try to find the bank account
line.setQuantity(quantity)
if bank_account_number != None:
bank_account_object = None
# We use here the catalog in order to find very quickly
......
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