changeset 4dbf2180797d in modules/account_invoice:default
details:
https://hg.tryton.org/modules/account_invoice?cmd=changeset;node=4dbf2180797d
description:
Enforce the same category of UoM between invoice lines and origin
The origin lines compute the remaining quantity by converting the move
quantity
to the origin unit. So they must have the same category of UoM.
issue9142
review285011002
diffstat:
invoice.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diffs (21 lines):
diff -r 0405b129e759 -r 4dbf2180797d invoice.py
--- a/invoice.py Fri Mar 06 23:50:37 2020 +0100
+++ b/invoice.py Tue Mar 17 23:26:58 2020 +0100
@@ -1659,11 +1659,16 @@
'on_change_with_unit_digits')
product = fields.Many2One('product.product', 'Product',
ondelete='RESTRICT',
+ domain=[
+ If(Bool(Eval('product_uom_category')),
+ ('default_uom_category', '=', Eval('product_uom_category')),
+ ()),
+ ],
states={
'invisible': Eval('type') != 'line',
'readonly': _states['readonly'],
},
- depends=['type'] + _depends)
+ depends=['type', 'product_uom_category'] + _depends)
product_uom_category = fields.Function(
fields.Many2One('product.uom.category', 'Product Uom Category'),
'on_change_with_product_uom_category')