[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 <amoyaux@users.noreply.github.com>
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<field name="product_min_qty" optional="show"/>
|
||||
<field name="product_max_qty" optional="show"/>
|
||||
<field name="qty_multiple" optional="show"/>
|
||||
<field name="json_lead_days_popover" optional="show" string=" " widget="popover_widget" attrs="{'invisible': [('id', '=', False)]}"/>
|
||||
<field name="json_lead_days_popover" optional="show" nolabel="1" string="Forecast Description" width="10px" widget="popover_widget" attrs="{'invisible': [('id', '=', False)]}"/>
|
||||
<field name="product_uom_name" string="UoM" groups="uom.group_uom"/>
|
||||
<field name="company_id" optional="hide" readonly="1" groups="base.group_multi_company"/>
|
||||
</tree>
|
||||
|
||||
Reference in New Issue
Block a user