[IMP] product_category_tax: prevent write when onchange is triggered

This commit is contained in:
JordiMForgeFlow
2023-01-03 13:09:38 +01:00
committed by Joan Sisquella
parent 6168a4e030
commit 348cf2a9d4

View File

@@ -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())