Skip to content

Commit 4061a97

Browse files
committed
[FIX] stock_secondary_unit: Error when user try to select a secondary uom without product in sale order line
TT51683
1 parent b94a8a1 commit 4061a97

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

stock_secondary_unit/views/stock_move_views.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
/>
1818
<field
1919
name="secondary_uom_id"
20-
domain="['|', ('product_id', '=', product_id),
20+
domain="product_id and ['|', ('product_id', '=', product_id),
2121
'&amp;', ('product_tmpl_id.product_variant_ids', 'in', [product_id]),
22-
('product_id', '=', False)]"
22+
('product_id', '=', False)] or [(0, '=', 1)]"
2323
attrs="{'readonly': [('state', '!=', 'draft'), ('id', '!=', False)]}"
2424
options="{'no_create': True}"
2525
groups="uom.group_uom"
@@ -46,9 +46,9 @@
4646
/>
4747
<field
4848
name="secondary_uom_id"
49-
domain="['|', ('product_id', '=', product_id),
49+
domain="product_id and ['|', ('product_id', '=', product_id),
5050
'&amp;', ('product_tmpl_id.product_variant_ids', 'in', [product_id]),
51-
('product_id', '=', False)]"
51+
('product_id', '=', False)] or [(0, '=', 1)]"
5252
attrs="{'readonly': [('state', '!=', 'draft'), ('id', '!=', False)]}"
5353
options="{'no_create': True}"
5454
groups="uom.group_uom"

stock_secondary_unit/views/stock_picking_views.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
/>
2020
<field
2121
name="secondary_uom_id"
22-
domain="['|', ('product_id', '=', product_id),
22+
domain="product_id and ['|', ('product_id', '=', product_id),
2323
'&amp;', ('product_tmpl_id.product_variant_ids', 'in', [product_id]),
24-
('product_id', '=', False)]"
24+
('product_id', '=', False)] or [(0, '=', 1)]"
2525
options="{'no_create': True}"
2626
attrs="{'column_invisible': [('parent.immediate_transfer', '=', True)], 'readonly': ['|', ('is_initial_demand_editable', '=', False), '&amp;', '&amp;', ('show_operations', '=', True), ('is_locked', '=', True), ('is_initial_demand_editable', '=', False)]}"
2727
groups="uom.group_uom"
@@ -39,9 +39,9 @@
3939
/>
4040
<field
4141
name="secondary_uom_id"
42-
domain="['|', ('product_id', '=', product_id),
42+
domain="product_id and ['|', ('product_id', '=', product_id),
4343
'&amp;', ('product_tmpl_id.product_variant_ids', 'in', [product_id]),
44-
('product_id', '=', False)]"
44+
('product_id', '=', False)] or [(0, '=', 1)]"
4545
options="{'no_create': True}"
4646
attrs="{'invisible': [('parent.immediate_transfer', '=', True)], 'readonly': [('is_initial_demand_editable', '=', False)]}"
4747
groups="uom.group_uom"

0 commit comments

Comments
 (0)