summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2015-08-14 16:02:31 +0200
committerChristophe Simonis <chs@odoo.com>2015-08-14 16:02:31 +0200
commite95e9f887852b0e76783a78cdb8eefa68d0dc3d4 (patch)
tree2f6791e1f5f574cf99495836ac334764e21c0624
parent4b1496fdd318f2350013f0e1b484b243ccbce6ad (diff)
parent11cd8ba06c27014d2d73279601f4ca9be9dba7a0 (diff)
[MERGE] forward port of branch 7.0 up to 11cd8ba
-rw-r--r--addons/account/account_bank.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/account/account_bank.py b/addons/account/account_bank.py
index acb0e640a7a..71c126530d4 100644
--- a/addons/account/account_bank.py
+++ b/addons/account/account_bank.py
@@ -69,7 +69,8 @@ class bank(osv.osv):
# No liquidity account exists, no template available
if not ids: continue
- ref_acc_bank = obj_acc.browse(cr, uid, ids[0], context=context).parent_id
+ sibbling_acc_bank = obj_acc.browse(cr, uid, ids[0], context=context)
+ ref_acc_bank = sibbling_acc_bank.parent_id
while True:
new_code = str(ref_acc_bank.code.ljust(dig-len(str(current_num)), '0')) + str(current_num)
ids = obj_acc.search(cr, uid, [('code', '=', new_code), ('company_id', '=', bank.company_id.id)])
@@ -81,7 +82,7 @@ class bank(osv.osv):
'name': name,
'code': new_code,
'type': 'liquidity',
- 'user_type': ref_acc_bank.user_type.id,
+ 'user_type': sibbling_acc_bank.user_type.id,
'reconcile': False,
'parent_id': ref_acc_bank.id,
'company_id': bank.company_id.id,