[tryton-debian-vcs] tryton-modules-account-invoice branch upstream updated. upstream/3.8.0-1-g5dcbb60

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 upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-account-invoice.git;a=commitdiff;h=upstream/3.8.0-1-g5dcbb60

commit 5dcbb60d3511ac78494e5733f051c1d6e0347989
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Feb 10 18:40:14 2016 +0100

    Adding upstream version 3.8.1.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/CHANGELOG b/CHANGELOG
index 5147e51..d701442 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.8.1 - 2016-02-06
+* Bug fixes (see mercurial logs for details)
+
 Version 3.8.0 - 2015-11-02
 * Bug fixes (see mercurial logs for details)
 * Don't set default unit price on invoice line
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 0a568ed..dd7c347 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond_account_invoice
-Version: 3.8.0
+Version: 3.8.1
 Summary: Tryton module for invoicing
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/invoice.py b/invoice.py
index 811bb88..b77135d 100644
--- a/invoice.py
+++ b/invoice.py
@@ -452,13 +452,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):
@@ -733,8 +726,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):
@@ -2091,7 +2098,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 7f11b80..0d3ddd2 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.8.0
+version=3.8.1
 depends:
     account
     account_product
diff --git a/trytond_account_invoice.egg-info/PKG-INFO b/trytond_account_invoice.egg-info/PKG-INFO
index 50ad2bb..ea6b7a3 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.8.0
+Version: 3.8.1
 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