OdooMindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
for template in self:
if not template.invoice_policy:
template.invoice_policy = self.env.company.sale_invoice_policy
elif template.type == "consu":
template.invoice_policy = "order"