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.document

Compute Method: _compute_variant_attribute_value_ids

View 20.0
Inputs Method Outputs
  • res_model
  • res_id
+ Product = self.env['product.product']
+ self.variant_attribute_value_ids = False
+ for document in self:
+             if document.res_model == 'product.product' and document.res_id:
+                 product = Product.browse(document.res_id)
+                 document.variant_attribute_value_ids = product.product_template_attribute_value_ids
  • variant_attribute_value_ids

Back to entity