[tryton-debian-vcs] tryton-modules-account-invoice branch debian-stretch-3.6 updated. debian/3.6.2-1-3-gb9c6e01

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Wed Feb 10 19:53:20 UTC 2016


The following commit has been merged in the debian-stretch-3.6 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-account-invoice.git;a=commitdiff;h=debian/3.6.2-1-3-gb9c6e01

commit b9c6e015b8f7ebfd3b920b3ce552cf6f757144ce
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Feb 10 18:41:56 2016 +0100

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

diff --git a/debian/changelog b/debian/changelog
index 2c7121c..fa4e367 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tryton-modules-account-invoice (3.6.3-1) unstable; urgency=medium
+
+  * Merging upstream version 3.6.3.
+  * Updating copyright file.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Wed, 10 Feb 2016 18:41:56 +0100
+
 tryton-modules-account-invoice (3.6.2-1) unstable; urgency=medium
 
   * Adapting section naming in gbp.conf to current git-buildpackage.
commit 1b2e8325a321551c130df353f0aaf00e79974fdd
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Feb 10 18:41:55 2016 +0100

    Updating copyright file.

diff --git a/debian/copyright b/debian/copyright
index f8372ae..0cb70c3 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,9 +1,9 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 
 Files: *
-Copyright: 2008-2015 Cédric Krier
+Copyright: 2008-2016 Cédric Krier
            2008-2013 Bertrand Chenal
-           2008-2015 B2CK SPRL
+           2008-2016 B2CK SPRL
            2004-2008 Tiny SPRL
 License: GPL-3+
 
commit 94d3e96f17610d1f1ad0bcfc87ecf16bb11bc3cf
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Feb 10 18:41:55 2016 +0100

    Merging upstream version 3.6.3.

diff --git a/CHANGELOG b/CHANGELOG
index 042a2d3..0036060 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.6.3 - 2016-02-06
+* Bug fixes (see mercurial logs for details)
+
 Version 3.6.2 - 2015-12-22
 * Bug fixes (see mercurial logs for details)
 
diff --git a/COPYRIGHT b/COPYRIGHT
index 3a28212..48f96af 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,6 +1,6 @@
-Copyright (C) 2008-2015 Cédric Krier.
+Copyright (C) 2008-2016 Cédric Krier.
 Copyright (C) 2008-2013 Bertrand Chenal.
-Copyright (C) 2008-2015 B2CK SPRL.
+Copyright (C) 2008-2016 B2CK SPRL.
 Copyright (C) 2004-2008 Tiny SPRL.
 
 This program is free software: you can redistribute it and/or modify
diff --git a/PKG-INFO b/PKG-INFO
index d96689a..42dc640 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond_account_invoice
-Version: 3.6.2
+Version: 3.6.3
 Summary: Tryton module for invoicing
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/invoice.py b/invoice.py
index 739ef00..c981a53 100644
--- a/invoice.py
+++ b/invoice.py
@@ -440,13 +440,6 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
         if self.lines:
             for line in self.lines:
                 self.untaxed_amount += getattr(line, 'amount', None) or 0
-                for attribute, default_value in (
-                        ('taxes', []),
-                        ('unit_price', Decimal(0)),
-                        ('quantity', 0.),
-                        ):
-                    if not getattr(line, attribute, None):
-                        setattr(line, attribute, default_value)
             computed_taxes = self._get_taxes()
 
         def is_zero(amount):
@@ -721,8 +714,22 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
 
     @property
     def taxable_lines(self):
-        return [(l.taxes, l.unit_price, l.quantity) for l in self.lines
-            if l.type == 'line']
+        taxable_lines = []
+        # In case we're called from an on_change we have to use some sensible
+        # defaults
+        for line in self.lines:
+            if getattr(line, 'type', None) != 'line':
+                continue
+            taxable_lines.append(tuple())
+            for attribute, default_value in [
+                    ('taxes', []),
+                    ('unit_price', Decimal(0)),
+                    ('quantity', 0.),
+                    ]:
+                value = getattr(line, attribute, None)
+                taxable_lines[-1] += (
+                    value if value is not None else default_value,)
+        return taxable_lines
 
     @property
     def tax_type(self):
@@ -2108,7 +2115,7 @@ class InvoiceTax(ModelSQL, ModelView):
         if not self.tax:
             return
         if self.invoice:
-            context = self.invoice.get_tax_context()
+            context = self.invoice._get_tax_context()
         else:
             context = {}
         with Transaction().set_context(**context):
diff --git a/tryton.cfg b/tryton.cfg
index c6d9da1..05a2f31 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.6.2
+version=3.6.3
 depends:
     account
     account_product
diff --git a/trytond_account_invoice.egg-info/PKG-INFO b/trytond_account_invoice.egg-info/PKG-INFO
index 5e42c1a..64e4648 100644
--- a/trytond_account_invoice.egg-info/PKG-INFO
+++ b/trytond_account_invoice.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond-account-invoice
-Version: 3.6.2
+Version: 3.6.3
 Summary: Tryton module for invoicing
 Home-page: http://www.tryton.org/
 Author: Tryton
-- 
tryton-modules-account-invoice



More information about the tryton-debian-vcs mailing list