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

Module: Lunch

Entity: lunch.supplier

Compute Method: _compute_order_deadline_passed

Inputs Method Outputs
now = fields.Datetime.now().replace(tzinfo=UTC)
for supplier in self:
            if supplier.send_by == 'mail':
                now = now.astimezone(ZoneInfo(supplier.tz))
                email_time = datetime.combine(fields.Date.context_today(supplier), float_to_time(supplier.automatic_email_time), tzinfo=ZoneInfo(supplier.tz))
                supplier.order_deadline_passed = supplier.available_today and now > email_time
            else:
                supplier.order_deadline_passed = not supplier.available_today

Back to entity