[FIX] account : account_bank - post_write method not single id safe

lp bug: https://launchpad.net/bugs/888135 fixed

bzr revid: bde@tinyerp.com-20111115064057-osliuwprypaawyy5
This commit is contained in:
Yannick Vaucher 2011-11-15 12:10:57 +05:30 committed by Bharat (OpenERP)
parent 9f1a608819
commit b9f57dfef7
1 changed files with 4 additions and 0 deletions

View File

@ -44,6 +44,10 @@ class bank(osv.osv):
def post_write(self, cr, uid, ids, context={}):
obj_acc = self.pool.get('account.account')
obj_data = self.pool.get('ir.model.data')
if isinstance(ids, (int, long)):
ids = [ids]
for bank in self.browse(cr, uid, ids, context):
if bank.company_id and not bank.journal_id:
# Find the code and parent of the bank account to create