Skip to content
Snippets Groups Projects
Commit fd491de6 authored by Arnold Moyaux's avatar Arnold Moyaux
Browse files

[FIX] stock: inventory adjustement one product


Usecase to reproduce:
- Create a product tracked by serial number
- Do an inventory adjustement for it with the selected option 'one
product only'
- Add a new line with a serial number
- Save

Error due to missing product_id field at the inventory.line creation.
It's due to readonly set on the view. It will select by default the
inventory product but it will not send it to the server.

Add force_save in order to send the field even if it's readonly

Fix #39902

closes odoo/odoo#39935

Signed-off-by: default avatarArnold Moyaux <amoyaux@users.noreply.github.com>
parent 74f0787b
Branches
Tags
No related merge requests found
......@@ -158,7 +158,7 @@
<button name="action_reset_product_qty" states="confirm" string="⇒ Set quantities to 0" type="object" class="oe_link oe_right" groups="stock.group_stock_user"/>
<field name="line_ids" string="Inventory Details" context="{'default_location_id': location_id, 'default_product_id': product_id, 'default_prod_lot_id': lot_id, 'default_package_id': package_id, 'default_partner_id': partner_id}" mode="tree,kanban">
<tree string="Inventory Details" editable="bottom" decoration-info="product_qty != theoretical_qty" decoration-danger="theoretical_qty &lt; 0">
<field name="product_id" domain="[('type','=','product')]" attrs="{'readonly': [('parent.filter', '=', 'product')]}"/>
<field name="product_id" domain="[('type','=','product')]" attrs="{'readonly': [('parent.filter', '=', 'product')]}" force_save="1"/>
<field name="product_uom_id" string="UoM" groups="product.group_uom"/>
<field name="location_id" domain="[('id', 'child_of', parent.location_id)]" groups="stock.group_stock_multi_locations"/>
<field name="prod_lot_id" domain="[('product_id', '=', product_id)]" context="{'default_product_id': product_id}" groups="stock.group_production_lot"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment