[tryton-debian-vcs] tryton-modules-product branch upstream-3.0 updated. upstream/3.0.1-1-g5e1a477

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Wed Jul 15 14:21:23 UTC 2015


The following commit has been merged in the upstream-3.0 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-product.git;a=commitdiff;h=upstream/3.0.1-1-g5e1a477

commit 5e1a4773e0a2363d995e4525e4273e8237456752
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Jul 15 12:54:06 2015 +0200

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

diff --git a/CHANGELOG b/CHANGELOG
index 93781a5..5df3b36 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.0.2 - 2015-07-13
+* Bug fixes (see mercurial logs for details)
+
 Version 3.0.1 - 2015-02-22
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index 5371712..537c1f2 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond_product
-Version: 3.0.1
+Version: 3.0.2
 Summary: Tryton module with products
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/tryton.cfg b/tryton.cfg
index fc473a9..c8571e6 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=3.0.1
+version=3.0.2
 depends:
     ir
     res
diff --git a/trytond_product.egg-info/PKG-INFO b/trytond_product.egg-info/PKG-INFO
index 31e7a32..606a69d 100644
--- a/trytond_product.egg-info/PKG-INFO
+++ b/trytond_product.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond-product
-Version: 3.0.1
+Version: 3.0.2
 Summary: Tryton module with products
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/uom.py b/uom.py
index 987a3f0..21928b5 100644
--- a/uom.py
+++ b/uom.py
@@ -1,5 +1,6 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
+from __future__ import division
 from decimal import Decimal
 from sql import Table
 
@@ -133,7 +134,11 @@ class Uom(ModelSQL, ModelView):
 
     @staticmethod
     def round(number, precision=1.0):
-        return round(number / precision) * precision
+        i, d = divmod(precision, 1)
+        base = round(number / precision)
+        # Instead of multiply by the decimal part, we must divide by the
+        # integer to avoid precision lost due to float
+        return (base * i) + ((base / (1 / d)) if d != 0 else 0)
 
     @classmethod
     def validate(cls, uoms):
-- 
tryton-modules-product



More information about the tryton-debian-vcs mailing list