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

Module: Purchase

Entity: product.template

Compute Method: _compute_purchase_method

View 17.0 View 20.0
Inputs Method Outputs
  • detailed_type
  • type
- default_purchase_method = self.env['product.template'].default_get(['purchase_method']).get('purchase_method')
+ default_purchase_method = self.env['product.template'].default_get(['purchase_method']).get('purchase_method', 'receive')
for product in self:
-             if product.detailed_type == 'service':
+             if product.type == 'service':
                product.purchase_method = 'purchase'
            else:
                product.purchase_method = default_purchase_method
  • purchase_method

Back to entity