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

Module: Purchase Stock

Entity: purchase.order

Compute Method: _compute_date_promised

Inputs Method Outputs
  • state
  • order_line
for order in self:
            if order.state not in ('purchase', 'cancel'):
                order.date_promised = False
                continue
            dates_list = order.order_line.filtered(lambda line: not line.display_type and line.date_promised).mapped('date_promised')
            order.date_promised = min(dates_list) if dates_list else False

Back to entity