[FIX] stock: remove dynamic domain on stock_move_line
This commit is contained in:
committed by
Arnold Moyaux
parent
6c4447ef59
commit
945730ca35
@@ -188,6 +188,7 @@
|
||||
<field name="lots_visible" invisible="1"/>
|
||||
<field name="done_move" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="product_uom_category_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
<p attrs="{'invisible': [('finished_move_line_ids', '!=', [])]}">
|
||||
|
||||
@@ -62,6 +62,7 @@
|
||||
<field name="location_dest_id" invisible="1"/>
|
||||
<field name="production_id" invisible="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="product_uom_category_id" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</form>
|
||||
@@ -110,6 +111,7 @@
|
||||
<group>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="product_id" readonly="1"/>
|
||||
<field name="product_uom_category_id" readonly="1"/>
|
||||
<label for="qty_done" string ="Quantity"/>
|
||||
<div class="o_row">
|
||||
<span><field name="qty_done" readonly="1" nolabel="1"/></span>
|
||||
|
||||
@@ -24,7 +24,8 @@ class StockMoveLine(models.Model):
|
||||
help="Change to a better name", index=True)
|
||||
company_id = fields.Many2one('res.company', string='Company', readonly=True, required=True, index=True)
|
||||
product_id = fields.Many2one('product.product', 'Product', ondelete="cascade", check_company=True, domain="[('type', '!=', 'service'), '|', ('company_id', '=', False), ('company_id', '=', company_id)]")
|
||||
product_uom_id = fields.Many2one('uom.uom', 'Unit of Measure', required=True)
|
||||
product_uom_id = 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')
|
||||
product_qty = fields.Float(
|
||||
'Real Reserved Quantity', digits=0,
|
||||
compute='_compute_product_qty', inverse='_set_product_qty', store=True)
|
||||
@@ -112,10 +113,6 @@ class StockMoveLine(models.Model):
|
||||
self.product_uom_id = self.move_id.product_uom.id
|
||||
else:
|
||||
self.product_uom_id = self.product_id.uom_id.id
|
||||
res = {'domain': {'product_uom_id': [('category_id', '=', self.product_uom_id.category_id.id)]}}
|
||||
else:
|
||||
res = {'domain': {'product_uom_id': []}}
|
||||
return res
|
||||
|
||||
@api.onchange('lot_name', 'lot_id')
|
||||
def onchange_serial_number(self):
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<sheet>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="product_uom_category_id" invisible="1"/>
|
||||
<group>
|
||||
<group>
|
||||
<field name="date"/>
|
||||
|
||||
@@ -243,6 +243,7 @@
|
||||
<field name="picking_id" invisible="1" force_save="1"/>
|
||||
<field name="move_id" invisible="1" force_save="1" />
|
||||
<field name="picking_code" invisible="1"/>
|
||||
<field name="product_uom_category_id" invisible="1"/>
|
||||
<field name="product_id" invisible="1"/>
|
||||
<field name="package_level_id" invisible="1"/>
|
||||
<field name="location_id" options="{'no_create': True}" attrs="{'readonly': ['&', ('package_level_id', '!=', False), ('parent.picking_type_entire_packs', '=', True)]}" invisible="not context.get('show_source_location')" domain="[('id', 'child_of', parent.location_id), '|', ('company_id', '=', False), ('company_id', '=', company_id)]" groups="stock.group_stock_multi_locations"/>
|
||||
@@ -285,6 +286,7 @@
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="move_id" invisible="1"/>
|
||||
<field name="picking_id" invisible="1"/>
|
||||
<field name="product_uom_category_id" invisible="1"/>
|
||||
<field name="location_id" options="{'no_create': True}" attrs="{'column_invisible': [('parent.picking_type_code', '=', 'incoming')]}" groups="stock.group_stock_multi_locations" domain="[('id', 'child_of', parent.location_id), '|', ('company_id', '=', False), ('company_id', '=', company_id)]"/>
|
||||
<field name="location_dest_id" options="{'no_create': True}" attrs="{'column_invisible': [('parent.picking_type_code', '=', 'outgoing')]}" groups="stock.group_stock_multi_locations" domain="[('id', 'child_of', parent.location_dest_id), '|', ('company_id', '=', False), ('company_id', '=', company_id)]"/>
|
||||
<field name="package_id" groups="stock.group_tracking_lot"/>
|
||||
|
||||
Reference in New Issue
Block a user