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

Module: DDMRP

Entity: stock.buffer

Compute Method: _compute_dlt

View 18.0 View 19.0
Inputs Method Outputs
  • buffer_profile_id
  • buffer_profile_id.item_type
  • location_id
  • location_id.id
  • lead_days
for rec in self:
            if rec.buffer_profile_id.item_type == "manufactured":
                bom = rec._get_manufactured_bom()
                dlt = bom.with_context(location_id=rec.location_id.id).dlt
            elif rec.buffer_profile_id.item_type == "distributed":
                dlt = rec.lead_days
            else:
                sellers = rec._get_product_sellers()
-                 dlt = sellers and fields.first(sellers).delay or rec.lead_days
+                 dlt = sellers[0].delay if sellers else rec.lead_days
            rec.dlt = dlt
  • dlt

Back to entity