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

Module: Contract Price Revision

Entity: contract.line

Compute Method: _compute_price_can_be_revised

Inputs Method Outputs
date_start = self.env.context.get("date_start", fields.Date.context_today(self))
lines_can_be_revised = self.filtered(
            lambda line: not line.never_revise_price
            and not line.automatic_price
            and not line.successor_contract_line_id
            and line.recurring_next_date
            and not line.display_type
            and (not line.date_end or line.date_end >= date_start)
        )
lines_can_be_revised.price_can_be_revised = True
(self - lines_can_be_revised).price_can_be_revised = False

Back to entity