stock_usability: usability improvements on inventory and picking form view
This commit is contained in:
@@ -146,3 +146,16 @@ class StockQuant(models.Model):
|
|||||||
action = self.action_view_stock_moves()
|
action = self.action_view_stock_moves()
|
||||||
action['context'] = {'search_default_todo': True}
|
action['context'] = {'search_default_todo': True}
|
||||||
return action
|
return action
|
||||||
|
|
||||||
|
|
||||||
|
class StockInventoryLine(models.Model):
|
||||||
|
_inherit = 'stock.inventory.line'
|
||||||
|
|
||||||
|
state = fields.Selection(store=True)
|
||||||
|
partner_id = fields.Many2one(states={'done': [('readonly', True)]})
|
||||||
|
product_id = fields.Many2one(states={'done': [('readonly', True)]})
|
||||||
|
product_uom_id = fields.Many2one(states={'done': [('readonly', True)]})
|
||||||
|
product_qty = fields.Float(states={'done': [('readonly', True)]})
|
||||||
|
location_id = fields.Many2one(states={'done': [('readonly', True)]})
|
||||||
|
package_id = fields.Many2one(states={'done': [('readonly', True)]})
|
||||||
|
prod_lot_id = fields.Many2one(states={'done': [('readonly', True)]})
|
||||||
|
|||||||
@@ -23,6 +23,11 @@
|
|||||||
<button name="action_cancel" type="object" position="attributes">
|
<button name="action_cancel" type="object" position="attributes">
|
||||||
<attribute name="confirm">Are you sure you want to cancel this picking?</attribute>
|
<attribute name="confirm">Are you sure you want to cancel this picking?</attribute>
|
||||||
</button>
|
</button>
|
||||||
|
<!-- picking_type_id updates location_id and location_dest_id, we it's
|
||||||
|
better to put it BEFORE in the view, not AFTER ! -->
|
||||||
|
<field name="location_id" position="before">
|
||||||
|
<field name="picking_type_id" position="move"/>
|
||||||
|
</field>
|
||||||
<!-- STOCK MOVE -->
|
<!-- STOCK MOVE -->
|
||||||
<!-- This sum is useful to check the 'number of items' to transfer... -->
|
<!-- This sum is useful to check the 'number of items' to transfer... -->
|
||||||
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='product_uom_qty']" position="attributes">
|
<xpath expr="//field[@name='move_ids_without_package']/tree/field[@name='product_uom_qty']" position="attributes">
|
||||||
@@ -350,7 +355,9 @@ should be able to access it. So I add a menu entry under Inventory Control. -->
|
|||||||
<button name="action_reset_product_qty" type="object" position="attributes">
|
<button name="action_reset_product_qty" type="object" position="attributes">
|
||||||
<attribute name="confirm">Are you sure you want to reset all quantities to 0 ?</attribute>
|
<attribute name="confirm">Are you sure you want to reset all quantities to 0 ?</attribute>
|
||||||
</button>
|
</button>
|
||||||
|
<button name="action_inventory_line_tree" position="attributes">
|
||||||
|
<attribute name="states">confirm,done</attribute>
|
||||||
|
</button>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
@@ -370,6 +377,16 @@ should be able to access it. So I add a menu entry under Inventory Control. -->
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="stock_inventory_line_tree2" model="ir.ui.view">
|
||||||
|
<field name="model">stock.inventory.line</field>
|
||||||
|
<field name="inherit_id" ref="stock.stock_inventory_line_tree2"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="prod_lot_id" position="attributes">
|
||||||
|
<attribute name="attrs">{'readonly': ['|', ('product_tracking', '=', 'none'), ('state', '=', 'done')]}</attribute>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<record id="view_stock_quant_tree" model="ir.ui.view">
|
<record id="view_stock_quant_tree" model="ir.ui.view">
|
||||||
<field name="name">stock.usability.quant.tree</field>
|
<field name="name">stock.usability.quant.tree</field>
|
||||||
<field name="model">stock.quant</field>
|
<field name="model">stock.quant</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user