From fc3b82115cd50c7653981c8756e454686d83201a Mon Sep 17 00:00:00 2001 From: "Tiffany Chang (tic)" Date: Fri, 28 Aug 2020 09:56:44 +0000 Subject: [PATCH] [FIX] stock: make orderpoint qtys depend on move product_uom_qty Orderpoint qtys were not updating when an already saved stock.move has its demand updated. This was leading to new orderpoints being created when there is already an existing one. This commit fixes this bug by adding the missing dependency. Steps to reproduce: - Create a product - Create a delivery with the product > Mark As Todo - Go to replenishment report (product should be added) - Go back to same delivery > unlock > increase the existing move line demand amount - Return to replenishment report. product now has 2 orderpoints instead of just 1. Additionally this commit fixes a column mislabeling in the "Reordering Rules" tree so that it now matches the "Replenishment" tree closes odoo/odoo#57355 Task: 2327726 X-original-commit: 1429a7d3029fff1c6cac8fbe98b00eb931d43604 Signed-off-by: Arnold Moyaux --- addons/stock/models/stock_orderpoint.py | 2 +- addons/stock/views/stock_orderpoint_views.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/models/stock_orderpoint.py b/addons/stock/models/stock_orderpoint.py index f6835d863e7..9a8755f6cf3 100644 --- a/addons/stock/models/stock_orderpoint.py +++ b/addons/stock/models/stock_orderpoint.py @@ -223,7 +223,7 @@ class StockWarehouseOrderpoint(models.Model): self.trigger = 'auto' return self.action_replenish() - @api.depends('product_id', 'location_id', 'product_id.stock_move_ids', 'product_id.stock_move_ids.state') + @api.depends('product_id', 'location_id', 'product_id.stock_move_ids', 'product_id.stock_move_ids.state', 'product_id.stock_move_ids.product_uom_qty') def _compute_qty(self): orderpoints_contexts = defaultdict(lambda: self.env['stock.warehouse.orderpoint']) for orderpoint in self: diff --git a/addons/stock/views/stock_orderpoint_views.xml b/addons/stock/views/stock_orderpoint_views.xml index 4b69fd9990c..3bdc71a7979 100644 --- a/addons/stock/views/stock_orderpoint_views.xml +++ b/addons/stock/views/stock_orderpoint_views.xml @@ -83,7 +83,7 @@ - +