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

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

Back to entity