From d1c4d16a3a54aa41a460d879c04c985e551c624a Mon Sep 17 00:00:00 2001 From: Matthieu Dietrich Date: Fri, 8 May 2015 09:31:44 +0200 Subject: [PATCH] [FIX] account: Don't copy many2many when copying statement line When duplicating confirmed bank statement lines, the many2many `move_ids` links were preserved, and, therefore, there were links between the duplicated lines and the move entries of the original lines. Closes #6617 --- addons/account/account_bank_statement.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 1971019d464..b469c49deb2 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -577,6 +577,13 @@ class account_bank_statement_line(osv.osv): 'type': 'general', } + def copy(self, cr, uid, id, default=None, context=None): + if default is None: + default = {} + default = dict(default, move_ids=[]) + return super(account_bank_statement_line, self).copy( + cr, uid, id, default=default, context=context) + account_bank_statement_line() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: