[FIX] purchase: tax inactives not shown on search

Issue: Currently if we have taxes for our Purchase no matter if we set
the tax to inactive or we archive it, we will have access to it on the
purchase_order_line.

Steps to reproduce:

- Install Purchase
- Create a new Tax and set it to inactive.
- Now create a new RfQ and in the lines add any product.
- Try to change the tax for this product.

Solution: since we need this weird behavior for the cases where the tax
was applied to a RfQ and afterwards this tax was archived for example,
we should implement the needed domain to the view so we cannot access
to apply it anymore after inactive but it will still be visible where it
was applied beforehand.

opw-3776871

closes odoo/odoo#158077

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit is contained in:
Maruan Aguerdouh (magm)
2024-03-21 18:35:46 +00:00
parent 849edf60df
commit 2afcba1748
+1 -1
View File
@@ -257,7 +257,7 @@
<field name="product_packaging_id" invisible="not product_id" context="{'default_product_id': product_id, 'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}" groups="product.group_stock_packaging" optional="show"/>
<field name="price_unit" readonly="qty_invoiced != 0"/>
<button name="action_purchase_history" type="object" icon="fa-history" title="Purchase History" invisible="not id"/>
<field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use', '=', 'purchase'), ('company_id', 'parent_of', parent.company_id), ('country_id', '=', parent.tax_country_id)]" context="{'default_type_tax_use': 'purchase', 'search_view_ref': 'account.account_tax_view_search'}" options="{'no_create': True}" optional="show"/>
<field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use', '=', 'purchase'), ('company_id', 'parent_of', parent.company_id), ('country_id', '=', parent.tax_country_id), ('active', '=', True)]" context="{'default_type_tax_use': 'purchase', 'search_view_ref': 'account.account_tax_view_search'}" options="{'no_create': True}" optional="show"/>
<field name="discount" string="Disc.%" readonly="qty_invoiced != 0" optional="hide"/>
<field name="price_subtotal" string="Tax excl."/>
<field name="price_total"