From 795c3cd1d4409d2d9ed72e5d15aad03687eb0b1d Mon Sep 17 00:00:00 2001 From: "Touati Djamel (otd)" Date: Tue, 15 Mar 2022 10:53:29 +0000 Subject: [PATCH] [FIX] stock: make the location current stock view non-editable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce the bug: - Enable “Storage Locations” option in the inventory settings - Go to Inventory > Configuration > Warehouse > locations - Choose any Location > Click on current stock > Select any product - Try to add two line Problem: Traceback is triggered, Because the line should not be added twice(like in “Inventory Adjustments” view) and as in the `_onchange_location_or_product_id` we access the quantity, it should be only one quant: https://github.com/odoo/odoo/blob/15.0/addons/stock/models/stock_quant.py#L517 In v14, this list view is not editable, but since the refactor in v15 added the new view `stock.quant.inventory.tree.editable`, it is being called by this action Solution: set the `view_id` to `stock.quant.tree`, which is the view it was previously using opw-2779795 closes odoo/odoo#86766 X-original-commit: 68657a85eb09dd306feab91d805b8c21eb75010f Signed-off-by: Tiffany Chang Signed-off-by: Djamel Touati (otd) --- addons/stock/views/stock_quant_views.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/views/stock_quant_views.xml b/addons/stock/views/stock_quant_views.xml index 2ef66d9e41f..a3920d230ac 100644 --- a/addons/stock/views/stock_quant_views.xml +++ b/addons/stock/views/stock_quant_views.xml @@ -183,11 +183,13 @@ {'search_default_internal_loc': 1, 'search_default_productgroup':1, 'search_default_locationgroup':1} stock.quant + {'search_default_productgroup': 1} [('location_id', 'child_of', active_ids)] Current Stock stock.quant +