[tryton-debian-vcs] tryton-modules-project-invoice branch debian-jessie-2.8 updated. debian/2.8.4-1-2-gf3988c7

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Wed Dec 23 16:53:30 UTC 2015


The following commit has been merged in the debian-jessie-2.8 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-project-invoice.git;a=commitdiff;h=debian/2.8.4-1-2-gf3988c7

commit f3988c7ec19d41c1f25200cddb3bb5fa9899607f
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Dec 23 15:13:30 2015 +0100

    Releasing debian version 2.8.5-1.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/debian/changelog b/debian/changelog
index 9f6789a..3449e7e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+tryton-modules-project-invoice (2.8.5-1) unstable; urgency=medium
+
+  * Merging upstream version 2.8.5.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Wed, 23 Dec 2015 15:13:30 +0100
+
 tryton-modules-project-invoice (2.8.4-1) unstable; urgency=medium
 
   * Merging upstream version 2.8.4.
commit f16d26b44058e0fd905a243a4c412c3ac7e29cb4
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Dec 23 15:13:30 2015 +0100

    Merging upstream version 2.8.5.

diff --git a/CHANGELOG b/CHANGELOG
index f9513a4..5eb4588 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 2.8.5 - 2015-12-22
+* Bug fixes (see mercurial logs for details)
+
 Version 2.8.4 - 2015-02-22
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index 5c1af31..6efed1e 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond_project_invoice
-Version: 2.8.4
+Version: 2.8.5
 Summary: Tryton module to invoice projects
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/tryton.cfg b/tryton.cfg
index a85c147..cef8be8 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=2.8.4
+version=2.8.5
 depends:
     ir
     project
diff --git a/trytond_project_invoice.egg-info/PKG-INFO b/trytond_project_invoice.egg-info/PKG-INFO
index c2216ee..df4d911 100644
--- a/trytond_project_invoice.egg-info/PKG-INFO
+++ b/trytond_project_invoice.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond-project-invoice
-Version: 2.8.4
+Version: 2.8.5
 Summary: Tryton module to invoice projects
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/work.py b/work.py
index b237dde..1f71ae2 100644
--- a/work.py
+++ b/work.py
@@ -139,6 +139,7 @@ class Work:
     def _get_invoiced_amount_effort(works):
         pool = Pool()
         InvoiceLine = pool.get('account.invoice.line')
+        Currency = pool.get('currency.currency')
 
         with Transaction().set_user(0, set_context=True):
             invoice_lines = InvoiceLine.browse([
@@ -148,9 +149,14 @@ class Work:
         id2invoice_lines = dict((l.id, l) for l in invoice_lines)
         amounts = {}
         for work in works:
+            currency = work.company.currency
             if work.invoice_line:
                 invoice_line = id2invoice_lines[work.invoice_line.id]
-                amounts[work.id] = invoice_line.amount
+                invoice_currency = (invoice_line.invoice.currency
+                    if invoice_line.invoice else invoice_line.currency)
+                amounts[work.id] = Currency.compute(invoice_currency,
+                    Decimal(str(work.effort)) * invoice_line.unit_price,
+                    currency)
             else:
                 amounts[work.id] = Decimal(0)
         return amounts
@@ -159,6 +165,7 @@ class Work:
     def _get_invoiced_amount_timesheet(works):
         pool = Pool()
         InvoiceLine = pool.get('account.invoice.line')
+        Currency = pool.get('currency.currency')
 
         with Transaction().set_user(0, set_context=True):
             invoice_lines = InvoiceLine.browse([
@@ -169,13 +176,18 @@ class Work:
         id2invoice_lines = dict((l.id, l) for l in invoice_lines)
         amounts = {}
         for work in works:
+            currency = work.company.currency
             amounts[work.id] = Decimal(0)
             for timesheet_line in work.work.timesheet_lines:
                 if not timesheet_line.invoice_line:
                     continue
                 invoice_line = id2invoice_lines[timesheet_line.invoice_line.id]
-                amounts[work.id] += (invoice_line.unit_price
-                    * Decimal(str(timesheet_line.hours)))
+                invoice_currency = (invoice_line.invoice.currency
+                    if invoice_line.invoice else invoice_line.currency)
+                amounts[work.id] += Currency.compute(invoice_currency,
+                    (Decimal(str(timesheet_line.hours))
+                        * invoice_line.unit_price),
+                    currency)
         return amounts
 
     @staticmethod
-- 
tryton-modules-project-invoice



More information about the tryton-debian-vcs mailing list