From 56eb3f35992e0b831490070c1baec63033cfb41d Mon Sep 17 00:00:00 2001 From: svs-odoo Date: Fri, 5 Jun 2020 13:30:36 +0000 Subject: [PATCH] [FIX] stock: default warehouse in replenish wizard Before this commit, passing the `default_warehouse_id` in the context has no effect with the product replenish wizard because the warehouse id was overrided in the `default_get`. --- addons/stock/wizard/product_replenish.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/wizard/product_replenish.py b/addons/stock/wizard/product_replenish.py index ee61fa30e6b..ff697299023 100644 --- a/addons/stock/wizard/product_replenish.py +++ b/addons/stock/wizard/product_replenish.py @@ -49,7 +49,7 @@ class ProductReplenish(models.TransientModel): res['product_uom_id'] = product_tmpl_id.uom_id.id if 'company_id' in fields: res['company_id'] = company.id - if 'warehouse_id' in fields: + if 'warehouse_id' in fields and 'warehouse_id' not in res: warehouse = self.env['stock.warehouse'].search([('company_id', '=', company.id)], limit=1) res['warehouse_id'] = warehouse.id if 'date_planned' in fields: