[FIX] account: duplicate journal entry

When a journal entry includes taxes, it is impossible to duplicate it
because of an unbalanced entry error.
Indeed, by default the taxes are computed at the creation of the account
move lines, leading to the creation of a new tax line, therefore
unbalancing the account move.

Fixes #11919
opw-676788
This commit is contained in:
Nicolas Martinelli
2016-06-09 10:03:05 +02:00
parent dd1e67d263
commit af2c69f0e5
+4
View File
@@ -101,6 +101,10 @@ class AccountMove(models.Model):
move.assert_balanced()
return move
@api.multi
def copy(self, default=None):
return super(AccountMove, self.with_context(dont_create_taxes=True)).copy(default)
@api.multi
def write(self, vals):
if 'line_ids' in vals: