[tryton-debian-vcs] tryton-server branch upstream-3.6 updated. upstream/3.6.15-1-g8ee3dca

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Sun Jun 11 22:39:17 UTC 2017


The following commit has been merged in the upstream-3.6 branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-server.git;a=commitdiff;h=upstream/3.6.15-1-g8ee3dca

commit 8ee3dca511096d3c74268a1dac7aca875bea516e
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Jun 11 22:19:43 2017 +0200

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

diff --git a/CHANGELOG b/CHANGELOG
index 5f9b19c..901c7ff 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.6.16 - 2017-06-05
+* Bug fixes (see mercurial logs for details)
+
 Version 3.6.15 - 2017-04-03
 * Bug fixes (see mercurial logs for details)
 * Sanitize path in file_open against suffix (CVE-2017-0360)
diff --git a/PKG-INFO b/PKG-INFO
index 4a034db..d0b6a5e 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond
-Version: 3.6.15
+Version: 3.6.16
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/setup.cfg b/setup.cfg
index 861a9f5..8bfd5a1 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,4 @@
 [egg_info]
 tag_build = 
 tag_date = 0
-tag_svn_revision = 0
 
diff --git a/trytond.egg-info/PKG-INFO b/trytond.egg-info/PKG-INFO
index 4a034db..d0b6a5e 100644
--- a/trytond.egg-info/PKG-INFO
+++ b/trytond.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond
-Version: 3.6.15
+Version: 3.6.16
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/trytond/__init__.py b/trytond/__init__.py
index c218858..e96acbe 100644
--- a/trytond/__init__.py
+++ b/trytond/__init__.py
@@ -4,7 +4,7 @@ import os
 import time
 from email import charset
 
-__version__ = "3.6.15"
+__version__ = "3.6.16"
 
 os.environ['TZ'] = 'UTC'
 if hasattr(time, 'tzset'):
diff --git a/trytond/backend/sqlite/database.py b/trytond/backend/sqlite/database.py
index 13bcaf2..b899737 100644
--- a/trytond/backend/sqlite/database.py
+++ b/trytond/backend/sqlite/database.py
@@ -22,7 +22,7 @@ except ImportError:
     from sqlite3 import OperationalError as DatabaseOperationalError
 from sql import Flavor, Table
 from sql.functions import (Function, Extract, Position, Now, Substring,
-    Overlay, CharLength)
+    Overlay, CharLength, Trim)
 
 __all__ = ['Database', 'DatabaseIntegrityError', 'DatabaseOperationalError',
     'Cursor']
@@ -138,6 +138,27 @@ class SQLiteCharLength(Function):
     _function = 'LENGTH'
 
 
+class SQLiteTrim(Trim):
+
+    def __str__(self):
+        flavor = Flavor.get()
+        param = flavor.param
+
+        function = {
+            'BOTH': 'TRIM',
+            'LEADING': 'LTRIM',
+            'TRAILING': 'RTRIM',
+            }[self.position]
+
+        def format(arg):
+            if isinstance(arg, basestring):
+                return param
+            else:
+                return str(arg)
+        return function + '(%s, %s)' % (
+            format(self.string), format(self.characters))
+
+
 def sign(value):
     if value > 0:
         return 1
@@ -153,6 +174,7 @@ MAPPING = {
     Substring: SQLiteSubstring,
     Overlay: SQLiteOverlay,
     CharLength: SQLiteCharLength,
+    Trim: SQLiteTrim,
     }
 
 
diff --git a/trytond/ir/translation.py b/trytond/ir/translation.py
index 5b8fc43..bfacf5d 100644
--- a/trytond/ir/translation.py
+++ b/trytond/ir/translation.py
@@ -422,7 +422,7 @@ class Translation(ModelSQL, ModelView):
         if not Transaction().context.get(
                 'fuzzy_translation', False):
             for obj_id in ids:
-                trans = cls._translation_cache.get((lang, ttype, name, obj_id),
+                trans = cls._translation_cache.get((name, ttype, lang, obj_id),
                     -1)
                 if trans != -1:
                     translations[obj_id] = trans
@@ -459,7 +459,7 @@ class Translation(ModelSQL, ModelView):
                     translations[res_id] = value
         for res_id in ids:
             if res_id not in translations:
-                cls._translation_cache.set((lang, ttype, name, res_id), False)
+                cls._translation_cache.set((name, ttype, lang, res_id), False)
                 translations[res_id] = False
         return translations
 
@@ -653,7 +653,7 @@ class Translation(ModelSQL, ModelView):
             lang = unicode(lang)
             if source is not None:
                 source = unicode(source)
-            trans = cls._translation_cache.get((lang, ttype, name, source), -1)
+            trans = cls._translation_cache.get((name, ttype, lang, source), -1)
             if trans != -1:
                 res[(name, ttype, lang, source)] = trans
             else:
diff --git a/trytond/model/fields/field.py b/trytond/model/fields/field.py
index d09bdb0..f1811af 100644
--- a/trytond/model/fields/field.py
+++ b/trytond/model/fields/field.py
@@ -64,6 +64,21 @@ def size_validate(value):
                 'size must return integer'
 
 
+def _set_value(record, field):
+    try:
+        field, nested = field.split('.', 1)
+    except ValueError:
+        nested = None
+    if field.startswith('_parent_'):
+        field = field[8:]  # Strip '_parent_'
+    if not hasattr(record, field):
+        setattr(record, field, None)
+    elif nested:
+        parent = getattr(record, field)
+        if parent:
+            _set_value(parent, nested)
+
+
 def depends(*fields, **kwargs):
     methods = kwargs.pop('methods', None)
     assert not kwargs
@@ -81,11 +96,7 @@ def depends(*fields, **kwargs):
         @wraps(func)
         def wrapper(self, *args, **kwargs):
             for field in fields:
-                field = field.split('.')[0]
-                if field.startswith('_parent_'):
-                    field = field[8:]  # Strip '_parent_'
-                if not hasattr(self, field):
-                    setattr(self, field, None)
+                _set_value(self, field)
             return func(self, *args, **kwargs)
         return wrapper
     return decorator
-- 
tryton-server



More information about the tryton-debian-vcs mailing list