[FIX] account: create taxes at reconciliation
- Create an excluded tax of 20 %
- Create a customer invoice of 1000
- Create a payment of 900
- Make the matching between the invoice and the payment:
Write-off of 83.33, with the 20 % tax
Error: 'Cannot create unbalanced journal entry'
After commit 89cbef8540, the tax are by default not created
automatically anymore. We should make sure to pass the context key
`apply_taxes`.
opw-744266
This commit is contained in:
@@ -962,7 +962,7 @@ class AccountMoveLine(models.Model):
|
||||
second_line_dict['amount_currency'] = -second_line_dict['amount_currency']
|
||||
|
||||
# Create the move
|
||||
writeoff_move = self.env['account.move'].create({
|
||||
writeoff_move = self.env['account.move'].with_context(apply_taxes=True).create({
|
||||
'journal_id': vals['journal_id'],
|
||||
'date': vals['date'],
|
||||
'state': 'draft',
|
||||
|
||||
Reference in New Issue
Block a user