[FIX] sale: fix archived tax on sales orders

When archiving a Tax, you do not want that action to
invalidate Sales Orders and Invoices confirmed in the past
and that were using it.

The purpose of Archiving it is that it would not appear
or be proposed to new items created.

Until now, we had an inconsistency between Sales Orders and Invoices
when a Tax was archived.
The tax "disappeared" from old SOs,
but the amounts remained unchanged, which created an inconsitency.

The domain in the field definition no longer works
because a custom domain in the view is shadowing the current domain.

task-2745094

closes odoo/odoo#83712

X-original-commit: 09f6d682669e4e9d898f89706fece3fa9ce59da3
Signed-off-by: Laurent Smet <las@odoo.com>
This commit is contained in:
John Laterre (jol)
2022-02-01 11:53:00 +00:00
parent 0707554baa
commit 1f24bd28aa
+1 -1
View File
@@ -253,7 +253,7 @@ class SaleOrderLine(models.Model):
tax_id = fields.Many2many(
'account.tax', string='Taxes',
compute='_compute_tax_id', store=True, readonly=False, precompute=True,
domain=['|', ('active', '=', False), ('active', '=', True)])
context={'active_test': False})
discount = fields.Float(
string='Discount (%)', digits='Discount',