From d0d6825babac5f4765fcae750ad0026502a30111 Mon Sep 17 00:00:00 2001 From: JordiMForgeFlow Date: Tue, 3 Jan 2023 13:09:38 +0100 Subject: [PATCH] [IMP] product_category_tax: prevent write when onchange is triggered --- product_category_tax/models/product_template.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/product_category_tax/models/product_template.py b/product_category_tax/models/product_template.py index 083ca1c09..da613f6e1 100644 --- a/product_category_tax/models/product_template.py +++ b/product_category_tax/models/product_template.py @@ -14,7 +14,8 @@ class ProductTemplate(models.Model): @api.onchange("categ_id") def _onchange_categ_id_set_taxes(self): if self.categ_id: - self.set_tax_from_category() + self.taxes_id = [(6, 0, self.categ_id.taxes_id.ids)] + self.supplier_taxes_id = [(6, 0, self.categ_id.supplier_taxes_id.ids)] def set_tax_from_category(self): records_by_categ = defaultdict(lambda: self.browse())