Permalink
Browse files

[FIX]stock: added domain from py side

  • Loading branch information...
pka-odoo committed Sep 20, 2018
1 parent d6692a7 commit b79f64c824ae4e8dd3b5c667961ff92f207b4bc5
@@ -61,7 +61,7 @@ def _default_group_id(self):
"be moved. Lowering this quantity does not generate a "
"backorder. Changing this quantity on assigned moves affects "
"the product reservation, and should be done with care.")
product_uom = fields.Many2one('uom.uom', 'Unit of Measure', required=True)
product_uom = fields.Many2one('uom.uom', 'Unit of Measure', required=True, domain="[('category_id', '=', product_uom_category_id)]")
product_uom_category_id = fields.Many2one(related='product_id.uom_id.category_id', store=False)
# TDE FIXME: make it stored, otherwise group will not work
product_tmpl_id = fields.Many2one(
@@ -113,6 +113,7 @@
<tree decoration-muted="scrapped == True" string="Stock Moves" editable="bottom">
<field name="product_id"/>
<field name="name" invisible="1"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="product_uom_qty"/>
<field name="product_uom" options="{'no_open': True, 'no_create': True}" string="Unit of Measure" groups="uom.group_uom"/>
<field name="location_id" invisible="1"/>
@@ -228,6 +229,7 @@
<group name="main_grp_col2">
<field name="product_id"/>
<label for="product_uom_qty"/>
<field name="product_uom_category_id" invisible="1"/>
<div class="o_row">
<field name="product_uom_qty"/>
<field name="product_uom" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom"/>
@@ -283,6 +285,7 @@
<field name="product_id"/>
<field name="picking_type_id" invisible="1"/>
<field name="group_id" invisible="1"/>
<field name="product_uom_category_id" invisible="1"/>
<label for="product_uom_qty"/>
<div>
<field name="product_uom_qty"/>
@@ -310,7 +310,7 @@
<field name="product_uom_qty" string="Initial Demand" attrs="{'column_invisible': ['&amp;',('parent.immediate_transfer', '=', True), ('parent.is_locked', '=', True)], 'readonly': [('is_initial_demand_editable', '=', False)]}"/>
<field name="reserved_availability" string="Reserved" attrs="{'column_invisible': (['|','&amp;', ('parent.state','=', 'done'), ('parent.picking_type_code', '=', 'incoming'),'&amp;',('parent.immediate_transfer', '=', True), ('parent.is_locked', '=', True)])}"/>
<field name="quantity_done" string="Done" attrs="{'readonly': [('is_quantity_done_editable', '=', False)]}"/>
<field name="product_uom" domain="[('category_id', '=', product_uom_category_id)]" attrs="{'readonly': [('state', '!=', 'draft'), ('additional', '=', False)]}" options="{'no_open': True, 'no_create': True}" string="Unit of Measure" groups="uom.group_uom"/>
<field name="product_uom" attrs="{'readonly': [('state', '!=', 'draft'), ('additional', '=', False)]}" options="{'no_open': True, 'no_create': True}" string="Unit of Measure" groups="uom.group_uom"/>
<button name="action_show_details" string="Register lots, packs, location" type="object" icon="fa-list" attrs="{'invisible': [('show_details_visible', '=', False)]}" options='{"warn": true}'/>
</tree>
</field>

0 comments on commit b79f64c

Please sign in to comment.