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

Module: Inventory

Entity: stock.warehouse.orderpoint

Compute Method: _compute_unwanted_replenish

View 19.0 View 20.0
Inputs Method Outputs
  • product_id
  • product_uom
  • qty_to_order
  • product_max_qty
  • company_id
  • company_id.id
  • location_id
  • location_id.id
  • uom_id
for orderpoint in self:
-             if not orderpoint.product_id or orderpoint.product_uom.is_zero(orderpoint.qty_to_order) or orderpoint.product_uom.compare(orderpoint.product_max_qty, 0) == -1:
+             if not orderpoint.product_id or orderpoint.uom_id.is_zero(orderpoint.qty_to_order) or orderpoint.uom_id.compare(orderpoint.product_max_qty, 0) == -1:
                orderpoint.unwanted_replenish = False
            else:
                after_replenish_qty = orderpoint.product_id.with_context(company_id=orderpoint.company_id.id, location=orderpoint.location_id.id).virtual_available + orderpoint.qty_to_order
-                 orderpoint.unwanted_replenish = orderpoint.product_uom.compare(after_replenish_qty, orderpoint.product_max_qty) > 0
+                 orderpoint.unwanted_replenish = orderpoint.uom_id.compare(after_replenish_qty, orderpoint.product_max_qty) > 0
  • unwanted_replenish

Back to entity