Files
enterprise-addons/pos_pricer/models/product_supplierinfo.py
T

18 lines
534 B
Python

from odoo import models
class PricerProductSupplierInfo(models.Model):
_inherit = 'product.supplierinfo'
def write(self, vals):
res = super().write(vals)
# If we change the supplier product reference, update Pricer tags
if ('product_code' in vals):
self.mapped('product_id').filtered_domain([
('pricer_tag_ids', '!=', False),
('pricer_store_id', '!=', False),
]).sudo().write({'pricer_product_to_create_or_update': True})
return res