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

18 lines
507 B
Python

from odoo import models
class ProductTemplate(models.Model):
_inherit = 'product.template'
def write(self, vals):
"""
Called whenever we update a product template price and click "save"
We need to update all the products variants
"""
if 'list_price' in vals:
for record in self:
for product in record.product_variant_ids:
product.pricer_product_to_create_or_update = True
return super().write(vals)