Skip to content
Snippets Groups Projects
Commit 768b1755 authored by Abdelouahab (abla)'s avatar Abdelouahab (abla)
Browse files

[FIX] stock: don't require lot_id on reporting/location

To Reproduce
=============
- enable multi step routes
- edit Receipts operation and uncheck the two options under Traceability
- create storable product with Traceability using lot/serial number
- make purchase of this product and receive it in your inventory
- under inventory/reports/Locations click on line of this product
you will be stuck at that page even if you click discard

Problem
=======
There is an inconsistency between the view and backend, as we allow
receiving traceable product without setting `lot_id`, but in view
require `lot_id` if tracking is enabled on product.

Solution
========
following this [comment](https://github.com/odoo/odoo/blob/16.0/addons/stock/models/stock_move_line.py#L558-L560

), `lot_id` shouldn't be required on view.

opw-3422259

closes odoo/odoo#129322

Signed-off-by: default avatarArnold Moyaux (arm) <arm@odoo.com>
parent 9b9f0f2f
No related branches found
No related tags found
No related merge requests found
......@@ -127,8 +127,7 @@
attrs="{'readonly': [('id', '!=', False)]}"/>
<field name="lot_id" groups="stock.group_production_lot"
attrs="{
'readonly': ['|', ('id', '!=', False), ('tracking', 'not in', ['serial', 'lot'])],
'required': [('tracking', '!=', 'none')]
'readonly': ['|', ('id', '!=', False), ('tracking', 'not in', ['serial', 'lot'])]
}"
invisible="context.get('hide_lot', False)"
context="{'default_product_id': product_id, 'default_company_id': company_id}"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment