[FIX] stock: make the location current stock view non-editable

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 <tic@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
This commit is contained in:
Touati Djamel (otd)
2022-03-21 15:00:08 +01:00
parent 4c28a6fd0a
commit 795c3cd1d4
+2
View File
@@ -183,11 +183,13 @@
<field name="context">{'search_default_internal_loc': 1, 'search_default_productgroup':1, 'search_default_locationgroup':1}</field>
<field name="res_model">stock.quant</field>
</record>
<record model="ir.actions.act_window" id="location_open_quants"> <!-- Used in location -->
<field name="context">{'search_default_productgroup': 1}</field>
<field name="domain">[('location_id', 'child_of', active_ids)]</field>
<field name="name">Current Stock</field>
<field name="res_model">stock.quant</field>
<field name="view_id" ref="view_stock_quant_tree"/>
</record>
<record id="quant_package_search_view" model="ir.ui.view">