I am working from the customer section in the sales module, I have this code.
is_client = fields.Boolean(compute='_customize_filter', string="is a cliente")
is_prospect= fields.Boolean(compute='_customize_filter', string="is a prospect")
is_contact = fields.Boolean(compute='_customize_filter', string="is a contact")
def _customize_filter(self):
for partner in self:
partner.is_client = True if partner.total_invoiced > 0 else False
partner.is_prospect = True if partner.sale_order_count > 0 else False
partner.is_contact = True if partner.parent_id else False
How can I put a double validation in the is_prospect field to tell it to deactivate if the is_client field is True and only activate if it has sales but no invoices?
Odoo 13 community, thank you.