From 1def9911df74c3df4d28b8a609d537cb156f0952 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 19 May 2016 12:10:32 +0200 Subject: [PATCH] [FIX] account: duplicate journal should not use the same bank account There is several override of create and write that assumes that a bank account is present on only one account (see 4530e5d). It is very hard to change or remove the account bank once linked to a journal (see 4a65bc38) so it should not be set in the first place when duplicating a journal. opw-676374 --- addons/account/models/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account.py b/addons/account/models/account.py index d0b770c1df9..3e98bdf40d7 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -251,7 +251,7 @@ class AccountJournal(models.Model): loss_account_id = fields.Many2one('account.account', string='Loss Account', domain=[('deprecated', '=', False)], help="Used to register a loss when the ending balance of a cash register differs from what the system computes") # Bank journals fields - bank_account_id = fields.Many2one('res.partner.bank', string="Bank Account", ondelete='restrict') + bank_account_id = fields.Many2one('res.partner.bank', string="Bank Account", ondelete='restrict', copy=False) display_on_footer = fields.Boolean("Show in Invoices Footer", help="Display this bank account on the footer of printed documents like invoices and sales orders.") bank_statements_source = fields.Selection([('manual', 'Record Manually')], string='Bank Feeds') bank_acc_number = fields.Char(related='bank_account_id.acc_number')