[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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user