diff --git a/product_category_tax/__manifest__.py b/product_category_tax/__manifest__.py index 92828e0..5326d39 100644 --- a/product_category_tax/__manifest__.py +++ b/product_category_tax/__manifest__.py @@ -12,7 +12,7 @@ 'description': "", 'author': 'Akretion', 'website': 'http://www.akretion.com', - 'depends': ['account'], + 'depends': ['account', 'base_suspend_security'], 'data': ['product_view.xml'], 'installable': True, } diff --git a/product_category_tax/product.py b/product_category_tax/product.py index a82154b..732b5b5 100644 --- a/product_category_tax/product.py +++ b/product_category_tax/product.py @@ -36,11 +36,15 @@ class ProductCategTaxMixin(models.AbstractModel): @api.model def create(self, vals): + # suspend_security() is needed to read/set taxes in all companies + self = self.suspend_security() self.write_or_create(vals) return super(ProductCategTaxMixin, self).create(vals) @api.multi def write(self, vals): + # suspend_security() is needed to read/set taxes in all companies + self = self.suspend_security() self.write_or_create(vals) return super(ProductCategTaxMixin, self).write(vals)