changeset aba259465bd6 in modules/project_invoice:6.0
details: 
https://hg.tryton.org/modules/project_invoice?cmd=changeset&node=aba259465bd6
description:
        Use invoice_unit_price to compute quantity to invoice

        issue11833
        review413861003
        (grafted from acddb9a1cee3993970cc4e1d6668d66ca1218186)
diffstat:

 project.py |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 8ce78f488bc3 -r aba259465bd6 project.py
--- a/project.py        Wed Aug 03 23:53:44 2022 +0200
+++ b/project.py        Tue Nov 15 07:57:13 2022 +0100
@@ -38,7 +38,7 @@
         quantities = {}
         for work in works:
             if (work.progress == 1
-                    and work.list_price
+                    and work.invoice_unit_price
                     and not work.invoice_line):
                 if work.price_list_hour:
                     quantity = work.effort_hours
@@ -114,7 +114,7 @@
         for sub_works in grouped_slice(works):
             sub_works = list(sub_works)
             where = reduce_ids(
-                table.id, [x.id for x in sub_works if x.list_price])
+                table.id, [x.id for x in sub_works if x.invoice_unit_price])
             cursor.execute(*table.join(progress,
                     condition=progress.work == table.id
                     ).select(table.id, Sum(progress.progress),
@@ -126,7 +126,7 @@
                 delta = (
                     (work.progress or 0)
                     - invoiced_progress.get(work.id, 0.0))
-                if work.list_price and delta > 0:
+                if work.invoice_unit_price and delta > 0:
                     quantity = delta
                     if work.price_list_hour:
                         quantity *= work.effort_hours
@@ -287,7 +287,7 @@
         quantities = {}
         for work in works:
             duration = durations[work.id]
-            if work.list_price:
+            if work.invoice_unit_price:
                 hours = duration.total_seconds() / 60 / 60
                 if work.unit_to_invoice:
                     hours = work.unit_to_invoice.round(hours)

Reply via email to