[FIX] account: account_bank.post_write() accepts a single id, just like write().

bzr revid: vmt@openerp.com-20111115124226-v7lb3r5kpr1p3eis
This commit is contained in:
Vo Minh Thu 2011-11-15 13:42:26 +01:00
commit b860abd1c2
1 changed files with 4 additions and 0 deletions

View File

@ -42,8 +42,12 @@ class bank(osv.osv):
return (bank.bank_name or '') + ' ' + bank.acc_number
def post_write(self, cr, uid, ids, context={}):
if isinstance(ids, (int, long)):
ids = [ids]
obj_acc = self.pool.get('account.account')
obj_data = self.pool.get('ir.model.data')
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