[FIX] stock: use the same editable view for inventories and products

This commit makes sure the same view is used between the "inventory
adjustments" menu and the " update quantity" button in the product form.
The two views should always keep the same fields and buttons.

Task : 2555118

Part-of: odoo/odoo#74715
This commit is contained in:
William Henrotin
2021-09-02 12:57:32 +00:00
parent 72f5b23063
commit 79ee1ae3d2
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -539,7 +539,8 @@ class Product(models.Model):
)
else:
self = self.with_context(product_tmpl_ids=self.product_tmpl_id.ids)
action = self.env['stock.quant']._get_quants_action(domain)
action = self.env['stock.quant'].action_view_inventory()
action['domain'] = domain
action["name"] = _('Update Quantity')
return action
+1 -1
View File
@@ -353,7 +353,7 @@
<field name="inventory_quantity_set" invisible="1"/>
<field name="location_id" domain="[('usage', 'in', ['internal', 'transit'])]" attrs="{'readonly': [('id', '!=', False)]}" invisible="context.get('hide_location', False)" options="{'no_create': True}"/>
<field name="product_id" attrs="{'readonly': [('id', '!=', False)]}" readonly="context.get('single_product', False)" force_save="1" options="{'no_create': True}"/>
<field name="product_categ_id" optional="show"/>
<field name="product_categ_id" optional="hide"/>
<field name="lot_id" groups="stock.group_production_lot"
attrs="{'readonly': ['|', ('id', '!=', False), ('tracking', 'not in', ['serial', 'lot'])]}"
invisible="context.get('hide_lot', False)"