diff --git a/product_category_tax/models/product_product.py b/product_category_tax/models/product_product.py index 16c41a503..afc712d47 100644 --- a/product_category_tax/models/product_product.py +++ b/product_category_tax/models/product_product.py @@ -8,7 +8,7 @@ class ProductProduct(models.Model): _inherit = "product.product" @api.onchange("categ_id") - def onchange_categ_id(self): + def _onchange_categ_id_set_taxes(self): if self.categ_id: self.set_tax_from_category() diff --git a/product_category_tax/models/product_template.py b/product_category_tax/models/product_template.py index e8e838530..f950db002 100644 --- a/product_category_tax/models/product_template.py +++ b/product_category_tax/models/product_template.py @@ -10,7 +10,7 @@ class ProductTemplate(models.Model): taxes_updeatable_from_category = fields.Boolean(default=True) @api.onchange("categ_id") - def onchange_categ_id(self): + def _onchange_categ_id_set_taxes(self): if self.categ_id: self.set_tax_from_category() diff --git a/product_category_tax/tests/test_product_category_tax.py b/product_category_tax/tests/test_product_category_tax.py index 9d1d0b2b6..cfbe1a84f 100644 --- a/product_category_tax/tests/test_product_category_tax.py +++ b/product_category_tax/tests/test_product_category_tax.py @@ -52,8 +52,8 @@ class ProductCategoryTax(common.SavepointCase): self.product_test = self.product_obj.create( {"name": "TEST 01", "categ_id": test_categ.id, "list_price": 155.0} ) - self.product_test.product_tmpl_id.onchange_categ_id() - self.assertEqual(self.product_test.supplier_taxes_id, self.tax_purchase) + self.product_test.product_tmpl_id._onchange_categ_id_set_taxes() + self.assertEquals(self.product_test.supplier_taxes_id, self.tax_purchase) def test_02_update_taxes(self): """Default update"""