Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Products & Pricelists

Entity: product.attribute.value

Compute Method: _compute_default_extra_price_changed

Inputs Method Outputs
company_domain = self.env['product.template']._check_company_domain(self.env.companies)
ptavs_by_pav = self.env['product.template.attribute.value'].sudo().search_fetch([
            ('product_attribute_value_id', 'in', self.ids),
            ('product_tmpl_id', 'any', company_domain),
        ], ['price_extra', 'product_attribute_value_id']).grouped('product_attribute_value_id')
for pav in self:
            ptavs = ptavs_by_pav.get(pav, [])
            pav.default_extra_price_changed = (
                pav.default_extra_price != pav._origin.default_extra_price
                or any(pav.default_extra_price != ptav.price_extra for ptav in ptavs)
            )

Back to entity