[FIX] purchase_stock: no overwrite of orderpoint.route_id
action_set_supplier doesn't have to overwrite the orderpoint.route_id if it already has one that fit the requirements (action = 'buy'). OPW-3746624 closes odoo/odoo#154495 X-original-commit: f52a17082a5507b283a0107118ef411d3be0b192 Signed-off-by: William Henrotin (whe) <whe@odoo.com>
This commit is contained in:
@@ -126,7 +126,8 @@ class SupplierInfo(models.Model):
|
||||
orderpoint = self.env['stock.warehouse.orderpoint'].browse(orderpoint_id)
|
||||
if not orderpoint:
|
||||
return
|
||||
orderpoint.route_id = self.env['stock.rule'].search([('action', '=', 'buy')], limit=1).route_id.id
|
||||
if 'buy' not in orderpoint.route_id.rule_ids.mapped('action'):
|
||||
orderpoint.route_id = self.env['stock.rule'].search([('action', '=', 'buy')], limit=1).route_id.id
|
||||
orderpoint.supplier_id = self
|
||||
supplier_min_qty = self.product_uom._compute_quantity(self.min_qty, orderpoint.product_id.uom_id)
|
||||
if orderpoint.qty_to_order < supplier_min_qty:
|
||||
|
||||
Reference in New Issue
Block a user