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

Module: Products Expiration Date

Entity: stock.lot

Compute Method: _compute_product_expiry_alert

Inputs Method Outputs
current_date = fields.Datetime.now()
for lot in self:
            if lot.expiration_date:
                lot.product_expiry_alert = lot.expiration_date <= current_date
            else:
                lot.product_expiry_alert = False

Back to entity