Skip to content

Commit

Permalink
[FIX] account: avoid wrong taxes quick encoding
Browse files Browse the repository at this point in the history
How to reproduce:
- Activate l10n_be and go on a Belgian Company
- Activate Quick Encoding on Bills
- Setup account 600000 with taxes 12% (Sales) and 12% M (Purchase)
- Create a Bill
- Put 112 as the amount Tax Incl.
=> Both taxes are put on the line, which makes no sense, resulting
a sale tax on a purchase document.

It was forgotten in odoo@85d89a9

closes odoo#120318

Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
  • Loading branch information
gawa-odoo committed May 3, 2023
1 parent 3bdf3f4 commit 04287db
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions addons/account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -2599,9 +2599,11 @@ def _get_quick_edit_suggestions(self):
taxes = self.env['account.tax'].browse(tax_ids)
else:
account_id = self.journal_id.default_account_id.id
if self.journal_id.default_account_id.tax_ids:
taxes = self.journal_id.default_account_id.tax_ids
if self.is_sale_document(include_receipts=True):
taxes = self.journal_id.default_account_id.tax_ids.filtered(lambda tax: tax.type_tax_use == 'sale')
else:
taxes = self.journal_id.default_account_id.tax_ids.filtered(lambda tax: tax.type_tax_use == 'purchase')
if not taxes:
taxes = (
self.journal_id.company_id.account_sale_tax_id
if self.journal_id.type == 'sale' else
Expand Down

0 comments on commit 04287db

Please sign in to comment.