changeset fce33c665e94 in modules/project_invoice:default
details:
https://hg.tryton.org/modules/project_invoice?cmd=changeset;node=fce33c665e94
description:
Skip works without list_price on effort invoicing
issue9242
review309401002
diffstat:
project.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (22 lines):
diff -r 2b05413c43d8 -r fce33c665e94 project.py
--- a/project.py Mon Apr 20 14:31:03 2020 +0200
+++ b/project.py Mon Apr 20 14:33:38 2020 +0200
@@ -112,7 +112,8 @@
quantities = {}
for sub_works in grouped_slice(works):
sub_works = list(sub_works)
- where = reduce_ids(table.id, [x.id for x in sub_works])
+ where = reduce_ids(
+ table.id, [x.id for x in sub_works if x.list_price])
cursor.execute(*table.join(progress,
condition=progress.work == table.id
).select(table.id, Sum(progress.progress),
@@ -124,7 +125,7 @@
delta = (
(work.progress or 0)
- invoiced_progress.get(work.id, 0.0))
- if delta > 0:
+ if work.list_price and delta > 0:
quantity = delta
if work.price_list_hour:
quantity *= work.effort_hours