product_category_tax: set taxes in all companies
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user