changeset ebac96a343ee in modules/purchase_requisition:default
details:
https://hg.tryton.org/modules/purchase_requisition?cmd=changeset;node=ebac96a343ee
description:
Allow setting unit on requisition line without product
issue9106
review297121043
diffstat:
CHANGELOG | 1 +
purchase.py | 4 +++-
2 files changed, 4 insertions(+), 1 deletions(-)
diffs (22 lines):
diff -r 61eadeb66426 -r ebac96a343ee CHANGELOG
--- a/CHANGELOG Thu Mar 19 19:08:52 2020 +0100
+++ b/CHANGELOG Fri Mar 20 19:07:14 2020 +0100
@@ -1,3 +1,4 @@
+* Allow setting unit on line without product
* Add button to process requisition
Version 5.4.0 - 2019-11-04
diff -r 61eadeb66426 -r ebac96a343ee purchase.py
--- a/purchase.py Thu Mar 19 19:08:52 2020 +0100
+++ b/purchase.py Fri Mar 20 19:07:14 2020 +0100
@@ -468,7 +468,9 @@
super().__setup__()
unit_categories = cls._unit_categories()
cls.unit.domain = [
- ('category', 'in', [Eval(c) for c in unit_categories]),
+ If(Bool(Eval('product_uom_category')),
+ ('category', 'in', [Eval(c) for c in unit_categories]),
+ ('category', '!=', -1)),
]
cls.unit.depends.extend(unit_categories)