Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.
Module: Sale Blanket Orders
Entity: sale.blanket.order
Compute Method: _compute_state
| Inputs | Method | Outputs |
|---|---|---|
|
+ today = fields.Date.today() + precision = self.env["decimal.precision"].precision_get( + "Product Unit of Measure" + ) + for order in self: + if not order.confirmed: + order.state = "draft" + elif order.validity_date <= today: + order.state = "expired" + elif float_is_zero( + sum( + order.line_ids.filtered(lambda line: not line.display_type).mapped( + "remaining_uom_qty" + ) + ), + precision_digits=precision, + ): + order.state = "done" + else: + order.state = "open" |
|
