-
- Downloads
[IMP] stock: editable quants
Made some changes in stock.quant model to allow user to modify product
quantity easier.
To allow the edition of quant without opening more permissions on the
model, we switch to sudo in create mode and write if the conditions are
met (special key in context + access rights on the current user + write
on a specific field).
Also, we have two list views for the quant:
- The old list view who still readonly.
- A new list view where user can create new quant or edit quantity
of existing ones
We display the second one if user is a stock manager.
For existing quants, user can modify counted quantity (which will modify
product quantity). User can also create new quant, in this case:
- The quant is really a new one (ex.: new product/location
association) so will simply create a new quant.
- A corresponding quant already exist, so will modify the existing
quant instead of create a new one.
When an user creates a new quant, the model will check each time a
non-quantity field (product, location, SN/LN, package or owner) is
modified to see if corresponding quant exists. In this case, it'll get
the quant ID and will update reserved and on hand quantities.
If user didn't change the inventory quantity, it'll be updated too.
On product form view, the 'Update quantity' button was removed as user
can now simply modify quant with 'On Hand' stat button.
Task #1935921
Co-authored-by:
sle-odoo <sle@odoo.com>
Showing
- addons/mrp/tests/test_order.py 6 additions, 6 deletionsaddons/mrp/tests/test_order.py
- addons/mrp/tests/test_procurement.py 6 additions, 6 deletionsaddons/mrp/tests/test_procurement.py
- addons/mrp/tests/test_workorder_operation.py 3 additions, 3 deletionsaddons/mrp/tests/test_workorder_operation.py
- addons/stock/__manifest__.py 0 additions, 1 deletionaddons/stock/__manifest__.py
- addons/stock/models/product.py 24 additions, 38 deletionsaddons/stock/models/product.py
- addons/stock/models/stock_production_lot.py 4 additions, 4 deletionsaddons/stock/models/stock_production_lot.py
- addons/stock/models/stock_quant.py 216 additions, 2 deletionsaddons/stock/models/stock_quant.py
- addons/stock/tests/__init__.py 1 addition, 0 deletionsaddons/stock/tests/__init__.py
- addons/stock/tests/test_quant_inventory_mode.py 215 additions, 0 deletionsaddons/stock/tests/test_quant_inventory_mode.py
- addons/stock/tests/test_warehouse.py 2 additions, 29 deletionsaddons/stock/tests/test_warehouse.py
- addons/stock/views/product_views.xml 0 additions, 6 deletionsaddons/stock/views/product_views.xml
- addons/stock/views/stock_production_lot_views.xml 0 additions, 6 deletionsaddons/stock/views/stock_production_lot_views.xml
- addons/stock/views/stock_quant_views.xml 42 additions, 9 deletionsaddons/stock/views/stock_quant_views.xml
- addons/stock/wizard/__init__.py 0 additions, 1 deletionaddons/stock/wizard/__init__.py
- addons/stock/wizard/stock_change_product_qty.py 0 additions, 95 deletionsaddons/stock/wizard/stock_change_product_qty.py
- addons/stock/wizard/stock_change_product_qty_views.xml 0 additions, 28 deletionsaddons/stock/wizard/stock_change_product_qty_views.xml
- addons/stock/wizard/stock_quantity_history.py 22 additions, 3 deletionsaddons/stock/wizard/stock_quantity_history.py
- addons/website_sale_stock/tests/test_website_sale_stock_product_warehouse.py 4 additions, 6 deletions..._stock/tests/test_website_sale_stock_product_warehouse.py
Loading
Please register or sign in to comment