[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#687626: pre-approve unblock: tryton-server/2.2.4-1



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Dear release managers,

please approve the upload of tryton-server_2.2.4-1.

The new version contains the upstream bug fix release [1].

The fixes are for

 * NULL value for boolean fields should be considered like False
 * Don't fail on unknown database for WebDAV
 * Fix reading from cache in field one2many
 * Fix comparison of BrowseRecord when other is not a BrowseRecord
 * Skip empty arch when searching other strings of same model
 * Fix MySQLdb to use time for TIME instead of timedelta
 * Add missing empty selection for action in menu
 * Add missing quote on order field
 * Fix nested order_calc tables_args manipulation

Mathias

[1] http://news.tryton.org/2012/09/maintenance-releases-for-supported.html


debdiff attached

unblock: tryton-server/2.2.4-1
diff -Nru tryton-server-2.2.3/CHANGELOG tryton-server-2.2.4/CHANGELOG
--- tryton-server-2.2.3/CHANGELOG	2012-05-07 11:11:01.000000000 +0200
+++ tryton-server-2.2.4/CHANGELOG	2012-09-10 18:06:36.000000000 +0200
@@ -1,3 +1,6 @@
+Version 2.2.4 - 2012-09-10
+* Bug fixes (see mercurial logs for details)
+
 Version 2.2.3 - 2012-05-07
 * Bug fixes (see mercurial logs for details)
 
diff -Nru tryton-server-2.2.3/debian/changelog tryton-server-2.2.4/debian/changelog
--- tryton-server-2.2.3/debian/changelog	2012-06-30 17:37:43.000000000 +0200
+++ tryton-server-2.2.4/debian/changelog	2012-09-12 16:52:22.000000000 +0200
@@ -1,3 +1,10 @@
+tryton-server (2.2.4-1) unstable; urgency=low
+
+  * Merging upstream version 2.2.4.
+  * Refreshing patch 02-support-pywebdav-0.9.8.
+
+ -- Mathias Behrle <mathiasb@m9s.biz>  Wed, 12 Sep 2012 16:52:02 +0200
+
 tryton-server (2.2.3-2) unstable; urgency=low
 
   * Updating maintainers field.
diff -Nru tryton-server-2.2.3/debian/patches/02-support-pywebdav-0.9.8 tryton-server-2.2.4/debian/patches/02-support-pywebdav-0.9.8
--- tryton-server-2.2.3/debian/patches/02-support-pywebdav-0.9.8	2012-06-30 16:46:37.000000000 +0200
+++ tryton-server-2.2.4/debian/patches/02-support-pywebdav-0.9.8	2012-09-12 16:44:38.000000000 +0200
@@ -1,7 +1,7 @@
 Author: Mathias Behrle <mathiasb@m9s.biz>
 Description: Support new structure of pywebdav > 0.9.4.1.
---- tryton-server.orig/trytond/protocols/webdav.py	2012-05-09 11:42:39.277620212 +0200
-+++ tryton-server/trytond/protocols/webdav.py	2012-05-09 11:42:59.112947846 +0200
+--- tryton-server.orig/trytond/protocols/webdav.py	2012-09-11 19:41:40.000000000 +0200
++++ tryton-server/trytond/protocols/webdav.py	2012-09-12 16:44:26.630387413 +0200
 @@ -12,11 +12,15 @@
  import logging
  from threading import local
@@ -127,7 +127,7 @@
          global CACHE
          CACHE = LocalDict()
          if not Transaction().cursor:
-@@ -527,22 +538,57 @@
+@@ -527,25 +538,57 @@
          if dbname:
              Cache.resets(dbname)
  
@@ -154,12 +154,16 @@
 +
      def get_userinfo(self, user, password, command=''):
 -        dbname = urllib.unquote_plus(self.path.split('/', 2)[1])
-+        path = urlparse.urlparse(self.path).path
-+        dbname = urllib.unquote_plus(path.split('/', 2)[1])
-         if not dbname:
--            database = Database().connect()
+-        database = Database().connect()
+-        cursor = database.cursor()
+-        databases = database.list(cursor)
+-        cursor.close()
+-        if not dbname or dbname not in databases:
 -            return 1
 -        user = int(login(dbname, user, password, cache=False))
++        path = urlparse.urlparse(self.path).path
++        dbname = urllib.unquote_plus(path.split('/', 2)[1])
++        if not dbname:
 +            Database().connect()
 +            return True
 +        if user:
@@ -196,8 +200,8 @@
  
  class SecureWebDAVAuthRequestHandler(WebDAVAuthRequestHandler):
  
---- tryton-server.orig/trytond/webdav/webdav.py	2012-05-09 11:42:39.277620212 +0200
-+++ tryton-server/trytond/webdav/webdav.py	2012-05-09 11:42:59.112947846 +0200
+--- tryton-server.orig/trytond/webdav/webdav.py	2011-10-24 15:57:46.000000000 +0200
++++ tryton-server/trytond/webdav/webdav.py	2012-09-12 16:07:24.620219292 +0200
 @@ -2,11 +2,33 @@
  #this repository contains the full copyright notices and license terms.
  import os
@@ -497,9 +501,9 @@
 +                raise Exception('Bad arguments')
 +
  Attachment()
---- tryton-server.orig/CHANGELOG	2012-05-09 11:42:39.277620212 +0200
-+++ tryton-server/CHANGELOG	2012-05-09 11:42:59.112947846 +0200
-@@ -4,6 +4,7 @@
+--- tryton-server.orig/CHANGELOG	2012-09-11 19:41:40.000000000 +0200
++++ tryton-server/CHANGELOG	2012-09-12 16:07:24.620219292 +0200
+@@ -7,6 +7,7 @@
  Version 2.2.2 - 2012-03-28
  * Bug fixes (see mercurial logs for details)
  * Don't allow rpc call on ModelStorage without ModelView (CVE-2012-0215)
@@ -507,8 +511,8 @@
  
  Version 2.2.1 - 2011-12-26
  * Bug fixes (see mercurial logs for details)
---- tryton-server.orig/doc/topics/install.rst	2012-05-09 11:42:39.277620212 +0200
-+++ tryton-server/doc/topics/install.rst	2012-05-09 11:42:59.112947846 +0200
+--- tryton-server.orig/doc/topics/install.rst	2011-10-24 15:57:45.000000000 +0200
++++ tryton-server/doc/topics/install.rst	2012-09-12 16:07:24.620219292 +0200
 @@ -15,7 +15,7 @@
      * polib (https://bitbucket.org/izi/polib/wiki/Home)
      * Optional: psycopg 2 or later (http://www.initd.org/)
@@ -518,8 +522,8 @@
      * Optional: pydot (http://code.google.com/p/pydot/)
      * Optional: pytz (http://pytz.sourceforge.net/)
      * Optional: unoconv http://dag.wieers.com/home-made/unoconv/)
---- tryton-server.orig/etc/trytond.conf	2012-05-09 11:42:56.205046418 +0200
-+++ tryton-server/etc/trytond.conf	2012-05-09 11:42:59.112947846 +0200
+--- tryton-server.orig/etc/trytond.conf	2012-09-12 16:04:53.000000000 +0200
++++ tryton-server/etc/trytond.conf	2012-09-12 16:07:24.620219292 +0200
 @@ -2,13 +2,13 @@
  #this repository contains the full copyright notices and license terms.
  [options]
@@ -547,8 +551,8 @@
  # Configure the database type
  # allowed values are postgresql, sqlite, mysql
  #db_type = postgresql
---- tryton-server.orig/setup.py	2012-05-09 11:42:39.277620212 +0200
-+++ tryton-server/setup.py	2012-05-09 11:42:59.112947846 +0200
+--- tryton-server.orig/setup.py	2011-10-24 15:57:45.000000000 +0200
++++ tryton-server/setup.py	2012-09-12 16:07:24.620219292 +0200
 @@ -65,7 +65,7 @@
      extras_require={
          'PostgreSQL': ['psycopg2 >= 2.0'],
@@ -558,8 +562,8 @@
          'unoconv': ['unoconv'],
          'SSL': ['pyOpenSSL'],
          'graphviz': ['pydot'],
---- tryton-server.orig/trytond/config.py	2012-05-09 11:42:39.277620212 +0200
-+++ tryton-server/trytond/config.py	2012-05-09 11:42:59.112947846 +0200
+--- tryton-server.orig/trytond/config.py	2012-03-17 11:25:18.000000000 +0100
++++ tryton-server/trytond/config.py	2012-09-12 16:07:24.620219292 +0200
 @@ -24,14 +24,15 @@
  class ConfigManager(object):
      def __init__(self, fname=None):
@@ -577,8 +581,8 @@
              'db_type': 'postgresql',
              'db_host': False,
              'db_port': False,
---- tryton-server.orig/trytond/tests/test_mixins.py	2012-05-09 11:42:39.277620212 +0200
-+++ tryton-server/trytond/tests/test_mixins.py	2012-05-09 11:42:59.116947710 +0200
+--- tryton-server.orig/trytond/tests/test_mixins.py	2011-12-06 11:28:56.000000000 +0100
++++ tryton-server/trytond/tests/test_mixins.py	2012-09-12 16:07:24.624219161 +0200
 @@ -30,7 +30,7 @@
                      urllib.quote(DB_NAME)))
  
@@ -604,8 +608,8 @@
              self.assertEqual(self.urlwizard.get_url(),
                  'tryton://%s/%s/wizard/test.test_wizard' % (server_name,
                      urllib.quote(DB_NAME)))
---- tryton-server.orig/trytond/url.py	2012-05-09 11:42:39.277620212 +0200
-+++ tryton-server/trytond/url.py	2012-05-09 11:42:59.116947710 +0200
+--- tryton-server.orig/trytond/url.py	2011-10-24 15:57:46.000000000 +0200
++++ tryton-server/trytond/url.py	2012-09-12 16:07:24.624219161 +0200
 @@ -16,7 +16,8 @@
          from trytond.wizard import Wizard
          from trytond.report import Report
@@ -616,8 +620,8 @@
          hostname = '.'.join(encodings.idna.ToASCII(part) for part in
              hostname.split('.'))
  
---- tryton-server.orig/trytond/webdav/webdav.xml	2012-05-09 11:42:39.277620212 +0200
-+++ tryton-server/trytond/webdav/webdav.xml	2012-05-09 11:42:59.116947710 +0200
+--- tryton-server.orig/trytond/webdav/webdav.xml	2011-10-24 15:57:46.000000000 +0200
++++ tryton-server/trytond/webdav/webdav.xml	2012-09-12 16:07:24.624219161 +0200
 @@ -105,5 +105,122 @@
              <field name="menu" ref="menu_collection_list"/>
              <field name="group" ref="res.group_admin"/>
diff -Nru tryton-server-2.2.3/PKG-INFO tryton-server-2.2.4/PKG-INFO
--- tryton-server-2.2.3/PKG-INFO	2012-05-07 11:11:04.000000000 +0200
+++ tryton-server-2.2.4/PKG-INFO	2012-09-10 18:06:44.000000000 +0200
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.0
 Name: trytond
-Version: 2.2.3
+Version: 2.2.4
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: B2CK
diff -Nru tryton-server-2.2.3/trytond/backend/mysql/database.py tryton-server-2.2.4/trytond/backend/mysql/database.py
--- tryton-server-2.2.3/trytond/backend/mysql/database.py	2012-05-05 12:29:28.000000000 +0200
+++ tryton-server-2.2.4/trytond/backend/mysql/database.py	2012-06-12 14:33:13.000000000 +0200
@@ -40,6 +40,7 @@
     def cursor(self, autocommit=False, readonly=False):
         conv = MySQLdb.converters.conversions.copy()
         conv[float] = lambda value, _: repr(value)
+        conv[MySQLdb.constants.FIELD_TYPE.TIME] = MySQLdb.times.Time_or_None
         args = {
             'db': self.database_name,
             'sql_mode': 'traditional,postgresql',
diff -Nru tryton-server-2.2.3/trytond/ir/ui/menu.py tryton-server-2.2.4/trytond/ir/ui/menu.py
--- tryton-server-2.2.3/trytond/ir/ui/menu.py	2011-11-22 13:27:29.000000000 +0100
+++ tryton-server-2.2.4/trytond/ir/ui/menu.py	2012-05-22 14:44:37.000000000 +0200
@@ -76,12 +76,13 @@
         order_field='name'), 'get_rec_name', searcher='search_rec_name')
     icon = fields.Selection('list_icons', 'Icon', translate=False)
     action = fields.Function(fields.Reference('Action',
-        selection=[
-            ('ir.action.report', 'ir.action.report'),
-            ('ir.action.act_window', 'ir.action.act_window'),
-            ('ir.action.wizard', 'ir.action.wizard'),
-            ('ir.action.url', 'ir.action.url'),
-        ]), 'get_action', setter='set_action')
+            selection=[
+                ('', ''),
+                ('ir.action.report', 'ir.action.report'),
+                ('ir.action.act_window', 'ir.action.act_window'),
+                ('ir.action.wizard', 'ir.action.wizard'),
+                ('ir.action.url', 'ir.action.url'),
+                ]), 'get_action', setter='set_action')
     active = fields.Boolean('Active')
 
     def __init__(self):
diff -Nru tryton-server-2.2.3/trytond/ir/ui/view.py tryton-server-2.2.4/trytond/ir/ui/view.py
--- tryton-server-2.2.3/trytond/ir/ui/view.py	2011-11-22 13:27:29.000000000 +0100
+++ tryton-server-2.2.4/trytond/ir/ui/view.py	2012-06-28 15:39:34.000000000 +0200
@@ -138,7 +138,10 @@
                     ('module', '=', view.module),
                     ])
                 for view2 in self.browse(view_ids):
-                    tree2 = etree.fromstring(view2.arch)
+                    xml2 = view2.arch.strip()
+                    if not xml2:
+                        continue
+                    tree2 = etree.fromstring(xml2)
                     root2_element = tree2.getroottree().getroot()
                     strings += self._translate_view(root2_element)
             if not strings:
diff -Nru tryton-server-2.2.3/trytond/model/browse.py tryton-server-2.2.4/trytond/model/browse.py
--- tryton-server-2.2.3/trytond/model/browse.py	2011-12-25 14:51:10.000000000 +0100
+++ tryton-server-2.2.4/trytond/model/browse.py	2012-07-10 16:03:10.000000000 +0200
@@ -242,9 +242,13 @@
         return "BrowseRecord(%s, %d)" % (self._model_name, self.id)
 
     def __eq__(self, other):
+        if not isinstance(other, BrowseRecord):
+            return False
         return (self._model_name, self.id) == (other._model_name, other.id)
 
     def __ne__(self, other):
+        if not isinstance(other, BrowseRecord):
+            return True
         return (self._model_name, self.id) != (other._model_name, other.id)
 
     # we need to define __unicode__ even though we've already defined __str__
diff -Nru tryton-server-2.2.3/trytond/model/fields/one2many.py tryton-server-2.2.4/trytond/model/fields/one2many.py
--- tryton-server-2.2.3/trytond/model/fields/one2many.py	2011-11-22 13:27:29.000000000 +0100
+++ tryton-server-2.2.4/trytond/model/fields/one2many.py	2012-07-30 11:16:46.000000000 +0200
@@ -88,7 +88,7 @@
         for i in chain(*ids2):
             if i in cache[self.model_name] \
                     and self.field in cache[self.model_name][i]:
-                res[cache[self.model_name][i][self.field].id].append(i)
+                res[cache[self.model_name][i][self.field]].append(i)
             else:
                 ids3.append(i)
 
diff -Nru tryton-server-2.2.3/trytond/model/modelsql.py tryton-server-2.2.4/trytond/model/modelsql.py
--- tryton-server-2.2.3/trytond/model/modelsql.py	2012-05-05 12:29:28.000000000 +0200
+++ tryton-server-2.2.4/trytond/model/modelsql.py	2012-08-30 11:39:21.000000000 +0200
@@ -1800,15 +1800,21 @@
             else:
                 if (arg[2] is False) and (arg[1] == '='):
                     if table._columns[arg[0]]._type == 'boolean':
-                        qu1.append('("%s"."%s" = %%s)' % \
-                                (table._table, arg[0]))
+                        qu1.append('(("%s"."%s" = %%s) OR ("%s"."%s" IS NULL))'
+                            % (table._table, arg[0], table._table, arg[0]))
                         qu2.append(False)
                     else:
                         qu1.append('("%s"."%s" IS NULL)' % \
                                 (table._table, arg[0]))
                 elif (arg[2] is False) and (arg[1] == '!='):
-                    qu1.append('("%s"."%s" IS NOT NULL)' % \
-                            (table._table, arg[0]))
+                    if table._columns[arg[0]]._type == 'boolean':
+                        qu1.append('(("%s"."%s" != %%s) '
+                            'AND ("%s"."%s" IS NOT NULL))'
+                            % (table._table, arg[0], table._table, arg[0]))
+                        qu2.append(False)
+                    else:
+                        qu1.append('("%s"."%s" IS NOT NULL)' % \
+                                 (table._table, arg[0]))
                 else:
                     if arg[0] == 'id':
                         qu1.append('("%s"."%s" %s %%s)' % \
@@ -1890,8 +1896,7 @@
                                     table_name + '.' + link_field)
                     for i in range(len(tables)):
                         if table_name in tables[i]:
-                            args = tables_args[tables[i]]
-                            del tables_args[tables[i]]
+                            args = tables_args.pop(tables[i], [])
                             tables[i] = tables[i].replace(table_name,
                                     table_name + '.' + link_field)
                             tables_args[tables[i]] = args
@@ -1926,8 +1931,7 @@
                                     table_name + '.' + link_field)
                     for i in range(len(tables)):
                         if table_name in tables[i]:
-                            args = tables_args[tables[i]]
-                            del tables_args[tables[i]]
+                            args = tables_args.pop(tables[i], [])
                             tables[i] = tables[i].replace(table_name,
                                     table_name + '.' + link_field)
                             tables_args[tables[i]] = args
@@ -1946,8 +1950,7 @@
                                     table_name2 + '.' + link_field2)
                     for i in range(1, len(tables)):
                         if table_name2 in tables[i]:
-                            args = tables_args[tables[i]]
-                            del tables_args[tables[i]]
+                            args = tables_args.pop(tables[i], [])
                             tables[i] = tables[i].replace(table_name2,
                                     table_name2 + '.' + link_field2)
                             tables_args[tables[i]] = args
@@ -2035,8 +2038,8 @@
                         'order': otype,
                         })
                 else:
-                    order_by.append('"' + table_name + '".' + field_name + \
-                            ' ' + otype)
+                    order_by.append('"%s"."%s" %s'
+                        % (table_name, field_name, otype))
                 return order_by, tables, tables_args
 
         if field in self._inherit_fields.keys():
diff -Nru tryton-server-2.2.3/trytond/protocols/webdav.py tryton-server-2.2.4/trytond/protocols/webdav.py
--- tryton-server-2.2.3/trytond/protocols/webdav.py	2012-03-26 12:33:54.000000000 +0200
+++ tryton-server-2.2.4/trytond/protocols/webdav.py	2012-08-07 12:31:14.000000000 +0200
@@ -529,8 +529,11 @@
 
     def get_userinfo(self, user, password, command=''):
         dbname = urllib.unquote_plus(self.path.split('/', 2)[1])
-        if not dbname:
-            database = Database().connect()
+        database = Database().connect()
+        cursor = database.cursor()
+        databases = database.list(cursor)
+        cursor.close()
+        if not dbname or dbname not in databases:
             return 1
         user = int(login(dbname, user, password, cache=False))
 
diff -Nru tryton-server-2.2.3/trytond/tests/test_fields.py tryton-server-2.2.4/trytond/tests/test_fields.py
--- tryton-server-2.2.3/trytond/tests/test_fields.py	2012-03-26 12:33:54.000000000 +0200
+++ tryton-server-2.2.4/trytond/tests/test_fields.py	2012-08-30 11:37:46.000000000 +0200
@@ -135,6 +135,23 @@
             boolean3_id = self.boolean.create({})
             self.assert_(boolean3_id)
 
+            # Test search with NULL value
+            boolean4_id = self.boolean.create({
+                    'boolean': None,
+                    })
+            self.assert_(boolean4_id)
+
+            boolean_ids = self.boolean.search([
+                    ('boolean', '=', False),
+                    ])
+            self.assertEqual(boolean_ids,
+                [boolean2_id, boolean3_id, boolean4_id])
+
+            boolean_ids = self.boolean.search([
+                    ('boolean', '!=', False),
+                    ])
+            self.assertEqual(boolean_ids, [boolean1_id])
+
             boolean3 = self.boolean.read(boolean3_id, ['boolean'])
             self.assert_(boolean3['boolean'] == False)
 
diff -Nru tryton-server-2.2.3/trytond/version.py tryton-server-2.2.4/trytond/version.py
--- tryton-server-2.2.3/trytond/version.py	2012-04-24 14:18:22.000000000 +0200
+++ tryton-server-2.2.4/trytond/version.py	2012-05-07 14:54:04.000000000 +0200
@@ -1,7 +1,7 @@
 #This file is part of Tryton.  The COPYRIGHT file at the top level of
 #this repository contains the full copyright notices and license terms.
 PACKAGE = "trytond"
-VERSION = "2.2.3"
+VERSION = "2.2.4"
 LICENSE = "GPL-3"
 WEBSITE = "http://www.tryton.org/";
 
diff -Nru tryton-server-2.2.3/trytond.egg-info/PKG-INFO tryton-server-2.2.4/trytond.egg-info/PKG-INFO
--- tryton-server-2.2.3/trytond.egg-info/PKG-INFO	2012-05-07 11:11:02.000000000 +0200
+++ tryton-server-2.2.4/trytond.egg-info/PKG-INFO	2012-09-10 18:06:42.000000000 +0200
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.0
 Name: trytond
-Version: 2.2.3
+Version: 2.2.4
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: B2CK

Attachment: signature.asc
Description: PGP signature


Reply to: