[tryton-debian-vcs] tryton-server branch upstream updated. upstream/4.0.2-1-g73d6b1e

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Mon Aug 8 09:26:02 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-server.git;a=commitdiff;h=upstream/4.0.2-1-g73d6b1e

commit 73d6b1e76b33841c72e96f515cc98915f0ea439b
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Fri Aug 5 11:16:36 2016 +0200

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

diff --git a/CHANGELOG b/CHANGELOG
index 73608b1..92ccb2c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 4.0.3 - 2016-08-02
+* Bug fixes (see mercurial logs for details)
+
 Version 4.0.2 - 2016-07-04
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index 46d3e59..a71edb7 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond
-Version: 4.0.2
+Version: 4.0.3
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/trytond.egg-info/PKG-INFO b/trytond.egg-info/PKG-INFO
index 46d3e59..a71edb7 100644
--- a/trytond.egg-info/PKG-INFO
+++ b/trytond.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond
-Version: 4.0.2
+Version: 4.0.3
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/trytond/__init__.py b/trytond/__init__.py
index bee2fc6..d39c887 100644
--- a/trytond/__init__.py
+++ b/trytond/__init__.py
@@ -5,7 +5,7 @@ import time
 import logging
 from email import charset
 
-__version__ = "4.0.2"
+__version__ = "4.0.3"
 logger = logging.getLogger(__name__)
 
 os.environ['TZ'] = 'UTC'
diff --git a/trytond/backend/mysql/table.py b/trytond/backend/mysql/table.py
index a7bd9d2..bfe6031 100644
--- a/trytond/backend/mysql/table.py
+++ b/trytond/backend/mysql/table.py
@@ -209,8 +209,9 @@ class TableHandler(TableHandlerInterface):
             if (base_type == 'varchar'
                     and self._columns[column_name]['typname'] == 'varchar'):
                 # Migrate size
+                from_size = self._columns[column_name]['size']
                 if field_size is None:
-                    if self._columns[column_name]['size'] != 255:
+                    if from_size != 255:
                         self.alter_size(column_name, base_type)
                 elif self._columns[column_name]['size'] == field_size:
                     pass
@@ -219,8 +220,7 @@ class TableHandler(TableHandlerInterface):
                         'Unable to migrate column %s on table %s '
                         'from varchar(%s) to varchar(%s).',
                         column_name, self.table_name,
-                        self._columns[column_name]['size'] > 0
-                        and self._columns[column_name]['size'] or 255,
+                        from_size if from_size and from_size > 0 else 255,
                         field_size)
             return
 
diff --git a/trytond/backend/postgresql/table.py b/trytond/backend/postgresql/table.py
index f5c70ad..a332304 100644
--- a/trytond/backend/postgresql/table.py
+++ b/trytond/backend/postgresql/table.py
@@ -270,21 +270,20 @@ class TableHandler(TableHandlerInterface):
             if (base_type == 'varchar'
                     and self._columns[column_name]['typname'] == 'varchar'):
                 # Migrate size
+                from_size = self._columns[column_name]['size']
                 if field_size is None:
-                    if self._columns[column_name]['size']:
+                    if from_size:
                         self.alter_size(column_name, base_type)
-                elif self._columns[column_name]['size'] == field_size:
+                elif from_size == field_size:
                     pass
-                elif (self._columns[column_name]['size']
-                        and self._columns[column_name]['size'] < field_size):
+                elif from_size and from_size < field_size:
                     self.alter_size(column_name, column_type[1])
                 else:
                     logger.warning(
                         'Unable to migrate column %s on table %s '
                         'from varchar(%s) to varchar(%s).',
                         column_name, self.table_name,
-                        self._columns[column_name]['size'] > 0 and
-                        self._columns[column_name]['size'] or "",
+                        from_size if from_size and from_size > 0 else "",
                         field_size)
             return
 
diff --git a/trytond/backend/sqlite/table.py b/trytond/backend/sqlite/table.py
index 1609ede..cb64b5b 100644
--- a/trytond/backend/sqlite/table.py
+++ b/trytond/backend/sqlite/table.py
@@ -200,21 +200,20 @@ class TableHandler(TableHandlerInterface):
             if (base_type == 'VARCHAR'
                     and self._columns[column_name]['typname'] == 'VARCHAR'):
                 # Migrate size
+                from_size = self._columns[column_name]['size']
                 if field_size is None:
-                    if self._columns[column_name]['size'] > 0:
+                    if from_size > 0:
                         self.alter_size(column_name, base_type)
-                elif self._columns[column_name]['size'] == field_size:
+                elif from_size == field_size:
                     pass
-                elif (self._columns[column_name]['size'] > 0
-                        and self._columns[column_name]['size'] < field_size):
+                elif from_size and from_size < field_size:
                     self.alter_size(column_name, column_type[1])
                 else:
                     logger.warning(
                         'Unable to migrate column %s on table %s '
                         'from varchar(%s) to varchar(%s).',
                         column_name, self.table_name,
-                        self._columns[column_name]['size'] > 0
-                        and self._columns[column_name]['size'] or "",
+                        from_size if from_size and from_size > 0 else "",
                         field_size)
             return
 
diff --git a/trytond/ir/translation.py b/trytond/ir/translation.py
index e57e20f..a62018f 100644
--- a/trytond/ir/translation.py
+++ b/trytond/ir/translation.py
@@ -1665,7 +1665,8 @@ class TranslationExport(Wizard):
 
     def default_result(self, fields):
         file_ = self.result.file
+        cast = self.result.__class__.file.cast
         self.result.file = False  # No need to store it in session
         return {
-            'file': file_,
+            'file': cast(file_) if file_ else None,
             }
diff --git a/trytond/ir/ui/icon.py b/trytond/ir/ui/icon.py
index 14877d8..31f1484 100644
--- a/trytond/ir/ui/icon.py
+++ b/trytond/ir/ui/icon.py
@@ -50,5 +50,6 @@ class Icon(ModelSQL, ModelView):
 
     def get_icon(self, name):
         path = os.path.join(self.module, self.path.replace('/', os.sep))
-        with file_open(path, subdir='modules', mode='r') as fp:
+        with file_open(path,
+                subdir='modules', mode='r', encoding='utf-8') as fp:
             return fp.read()
diff --git a/trytond/ir/ui/view.py b/trytond/ir/ui/view.py
index d03dc6a..33a4b70 100644
--- a/trytond/ir/ui/view.py
+++ b/trytond/ir/ui/view.py
@@ -193,7 +193,8 @@ class View(ModelSQL, ModelView):
         if self.name and self.module:
             path = os.path.join(self.module, 'view', self.name + '.xml')
             try:
-                with file_open(path, subdir='modules', mode='r') as fp:
+                with file_open(path,
+                        subdir='modules', mode='r', encoding='utf-8') as fp:
                     value = fp.read()
             except IOError:
                 pass
-- 
tryton-server



More information about the tryton-debian-vcs mailing list