summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDjamel (otd) <otd@odoo.com>2021-05-19 12:11:10 +0000
committerDjamel (otd) <otd@odoo.com>2021-05-19 12:20:01 +0000
commitcfd2a39bece6a6fba379897183a767900c06d746 (patch)
tree62fd2c12974cb3fab33514f688bcd58ff1f6c6dc
parent5fc2f6943bbeb3e12740681ba9aaa22d2bd8abf3 (diff)
[FIX] stock: fix the manual reservation option
Steps to reproduce the bug: - Go to inventory settings > select "Reservation: Manually or based on Automatic scheduler" option - Create a storable product - Create a planned delivery order for a created product - Click on “Mark as to do” > the order status becomes "waiting" - Process a receipt for the same product Problem: The status of the delivery order is changed from "waiting” to "ready" and the product is automatically reserved solution: In this commit, we fix this by adding a parameter "stock.picking_no_auto_reserve" to ir.config_parameter when the manual reservation option is enabled opw-2520742 closes odoo/odoo#71033 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
-rw-r--r--addons/stock/models/res_config_settings.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/stock/models/res_config_settings.py b/addons/stock/models/res_config_settings.py
index 6e75526df31..045fcfb01b2 100644
--- a/addons/stock/models/res_config_settings.py
+++ b/addons/stock/models/res_config_settings.py
@@ -59,6 +59,10 @@ class ResConfigSettings(models.TransientModel):
self.group_stock_multi_locations = True
def set_values(self):
+ if self.module_procurement_jit == '0':
+ self.env['ir.config_parameter'].sudo().set_param('stock.picking_no_auto_reserve', True)
+ else:
+ self.env['ir.config_parameter'].sudo().set_param('stock.picking_no_auto_reserve', False)
warehouse_grp = self.env.ref('stock.group_stock_multi_warehouses')
location_grp = self.env.ref('stock.group_stock_multi_locations')
base_user = self.env.ref('base.group_user')