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.move.line

Compute Method: _compute_removal_date

Inputs Method Outputs
  • lot_id
  • lot_id.removal_date
  • picking_type_use_create_lots
  • product_id
  • product_id.use_expiration_date
  • expiration_date
  • product_id.removal_time
for move_line in self:
            if move_line.lot_id.removal_date:
                move_line.removal_date = move_line.lot_id.removal_date
            elif move_line.picking_type_use_create_lots:
                if move_line.product_id.use_expiration_date and move_line.expiration_date:
                    move_line.removal_date = move_line.expiration_date - datetime.timedelta(days=move_line.product_id.removal_time)
                else:
                    move_line.removal_date = False

Back to entity