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

Module: Base eBill Payment Contract

Entity: ebill.payment.contract

Compute Method: _compute_is_valid

Inputs Method Outputs
"""Check that the contract is valid

        It is valid if the contract is opened and its start date is in the past
        And his end date is in the future or not set.
        """
today = fields.Date.today()
for contract in self:
            contract.is_valid = (
                contract.state == "open"
                and contract.date_start
                and contract.date_start <= today
                and (not contract.date_end or contract.date_end >= today)
            )

Back to entity