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

Module: Contract Payment Mode

Entity: contract.contract

Compute Method: _compute_payment_mode_id

Inputs Method Outputs
  • company_id
  • contract_type
for rec in self:
            partner = rec.with_company(rec.company_id).partner_id
            if rec.contract_type == "purchase":
                rec.payment_mode_id = partner.supplier_payment_mode_id.id
            else:
                rec.payment_mode_id = partner.customer_payment_mode_id.id

Back to entity