[tryton-debian-vcs] tryton-server branch debian-wheezy created. debian/2.2.4-1-2-gbc3f722

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Tue Sep 30 10:56:57 UTC 2014


The following commit has been merged in the debian-wheezy branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-server.git;a=commitdiff;h=debian/2.2.4-1-2-gbc3f722
commit bc3f722b6c55bc2a4fde3d062ff3b5a741562c74
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Sep 23 13:15:07 2014 +0200

    Releasing debian version 2.2.4-1+deb7u1.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/debian/changelog b/debian/changelog
index 5db976e..a9341ee 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+tryton-server (2.2.4-1+deb7u1) stable-security; urgency=high
+
+  * Adding patch 03-fix-safe_eval for CVE-2014-6633.
+    This patch introduces a fix to not allow double underscores in 
+    safe_eval and uses literal_eval whereever possible.
+    S.a https://bugs.tryton.org/issue4155
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Tue, 23 Sep 2014 12:28:55 +0200
+
 tryton-server (2.2.4-1) unstable; urgency=low
 
   * Merging upstream version 2.2.4.
commit 5ebca249a56572da7c31209c8de385c1f1e344b1
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Sep 23 12:23:55 2014 +0200

    Adding patch 03-fix-safe_eval for CVE-2014-6633.
    
    This patch is a backport from trunk. It fixes safe_eval to not allow any
    double underscores and uses literal_eval whereever possible.

diff --git a/debian/patches/03-fix-safe_eval b/debian/patches/03-fix-safe_eval
new file mode 100644
index 0000000..4b0dfa7
--- /dev/null
+++ b/debian/patches/03-fix-safe_eval
@@ -0,0 +1,144 @@
+Author: Mathias Behrle <mathiasb at m9s.biz>
+Description: Fix for CVE-2014-6633.
+ Fix safe_eval to not allow any double underscore and use
+ literal_eval where ever possible.
+ 
+ This patch is a backport of the original patch from trunk.
+Bug: https://bugs.tryton.org/issue4155
+--- tryton-server.orig/trytond/ir/cron.py	2014-09-23 11:21:46.194519576 +0200
++++ tryton-server/trytond/ir/cron.py	2014-09-23 11:09:37.000000000 +0200
+@@ -6,9 +6,9 @@
+ import traceback
+ import sys
+ import logging
++from ast import literal_eval
+ from trytond.backend import Database
+ from trytond.model import ModelView, ModelSQL, fields
+-from trytond.tools import safe_eval
+ from trytond.transaction import Transaction
+ from trytond.pool import Pool
+ from trytond.backend import TableHandler
+@@ -133,7 +133,7 @@
+     def _callback(self, cron):
+         pool = Pool()
+         try:
+-            args = (cron.args or []) and safe_eval(cron.args)
++            args = (cron.args or []) and literal_eval(cron.args)
+             model_obj = pool.get(cron.model)
+             with Transaction().set_user(cron.user.id):
+                 getattr(model_obj, cron.function)(*args)
+--- tryton-server.orig/trytond/ir/lang.py	2014-09-23 11:22:56.172114900 +0200
++++ tryton-server/trytond/ir/lang.py	2014-09-23 11:10:55.000000000 +0200
+@@ -3,10 +3,11 @@
+ import time
+ import datetime
+ import warnings
++from ast import literal_eval
+ 
+ from trytond.model import ModelView, ModelSQL, fields
+ from trytond.model.cacheable import Cacheable
+-from trytond.tools import safe_eval, datetime_strftime
++from trytond.tools import datetime_strftime
+ from trytond.transaction import Transaction
+ from trytond.pool import Pool
+ from time_locale import TIME_LOCALE
+@@ -111,7 +112,7 @@
+         '''
+         for lang in self.browse(ids):
+             try:
+-                grouping = safe_eval(lang.grouping)
++                grouping = literal_eval(lang.grouping)
+                 for i in grouping:
+                     if not isinstance(i, int):
+                         return False
+@@ -197,10 +198,10 @@
+ 
+         if monetary:
+             thousands_sep = monetary['mon_thousands_sep']
+-            grouping = safe_eval(monetary['mon_grouping'])
++            grouping = literal_eval(monetary['mon_grouping'])
+         else:
+             thousands_sep = lang['thousands_sep']
+-            grouping = safe_eval(lang['grouping'])
++            grouping = literal_eval(lang['grouping'])
+         if not grouping:
+             return (s, 0)
+         result = ""
+--- tryton-server.orig/trytond/res/user.py	2014-09-23 11:22:56.192114212 +0200
++++ tryton-server/trytond/res/user.py	2014-09-23 11:13:22.000000000 +0200
+@@ -9,9 +9,9 @@
+ except ImportError:
+     hashlib = None
+     import sha
++from ast import literal_eval
+ from trytond.model import ModelView, ModelSQL, fields
+ from trytond.wizard import Wizard
+-from trytond.tools import safe_eval
+ from trytond.backend import TableHandler
+ from trytond.security import get_connections
+ from trytond.transaction import Transaction
+@@ -274,7 +274,7 @@
+                 date = date.replace(i, j)
+             res['locale'] = {
+                 'date': date,
+-                'grouping': safe_eval(user.language.grouping),
++                'grouping': literal_eval(user.language.grouping),
+                 'decimal_point': user.language.decimal_point,
+                 'thousands_sep': user.language.thousands_sep,
+             }
+--- tryton-server.orig/trytond/tests/test_tools.py	2014-09-23 11:21:46.370513528 +0200
++++ tryton-server/trytond/tests/test_tools.py	2014-09-23 11:35:45.000000000 +0200
+@@ -87,7 +87,7 @@
+         '''
+         Attempt to get arround direct attr access.
+         '''
+-        self.assertRaises(Exception, safe_eval, "getattr(int, '__abs__')")
++        self.assertRaises(Exception, safe_eval, "getattr(int, 'real')")
+ 
+     def test0062safe_eval_func_globals(self):
+         '''
+--- tryton-server.orig/trytond/tools/misc.py	2014-09-23 11:21:46.370513528 +0200
++++ tryton-server/trytond/tools/misc.py	2014-09-23 11:31:50.000000000 +0200
+@@ -407,8 +407,8 @@
+     return comp
+ 
+ def safe_eval(source, data=None):
+-    if '__subclasses__' in source:
+-        raise ValueError('__subclasses__ not allowed')
++    if '__' in source:
++        raise ValueError('Double underscores not allowed')
+ 
+     comp = _compile_source(source)
+     return eval(comp, {'__builtins__': {
+--- tryton-server.orig/trytond/webdav/webdav.py	2014-09-23 11:25:02.543785066 +0200
++++ tryton-server/trytond/webdav/webdav.py	2014-09-23 11:17:09.000000000 +0200
+@@ -9,9 +9,10 @@
+ import uuid
+ import datetime
+ from dateutil.relativedelta import relativedelta
++from ast import literal_eval
+ from trytond.model import ModelView, ModelSQL, fields
+ from trytond.version import PACKAGE, VERSION, WEBSITE
+-from trytond.tools import reduce_ids, safe_eval
++from trytond.tools import reduce_ids
+ from trytond.transaction import Transaction
+ from trytond.pool import Pool
+ from trytond.config import CONFIG
+@@ -299,7 +300,7 @@
+                 if not model_obj:
+                     return res
+                 model_ids = model_obj.search(
+-                        safe_eval(collection.domain or "[]"))
++                    literal_eval(collection.domain))
+                 for child in model_obj.browse(model_ids):
+                     if '/' in child.rec_name:
+                         continue
+@@ -733,7 +734,7 @@
+             model_name = collection.model.model
+             model_obj = pool.get(model_name)
+             ids = list(resources[model_name])
+-            domain = safe_eval(collection.domain or '[]')
++            domain = literal_eval(collection.domain)
+             domain = [domain, ('id', 'in', ids)]
+             record_ids = model_obj.search(domain)
+             for record in model_obj.browse(record_ids):
diff --git a/debian/patches/series b/debian/patches/series
index dd12fb4..d291d55 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 01-debian-data-dir
 02-support-pywebdav-0.9.8
+03-fix-safe_eval
commit a95e1304dc9243f2988abdfb6a4d09c851196b79
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Oct 3 23:00:00 2012 +0200

    Releasing debian version 2.2.4-1.

diff --git a/debian/changelog b/debian/changelog
index 58354ba..5db976e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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 at m9s.biz>  Wed, 03 Oct 2012 21:52:54 +0200
+
 tryton-server (2.2.3-2) unstable; urgency=low
 
   * Updating maintainers field.
commit 1689e5430028386f835514346574d9c72f1766ca
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed Sep 12 16:50:55 2012 +0200

    Refreshing patch 02-support-pywebdav-0.9.8.

diff --git a/debian/patches/02-support-pywebdav-0.9.8 b/debian/patches/02-support-pywebdav-0.9.8
index 79ab594..8e4e852 100644
--- a/debian/patches/02-support-pywebdav-0.9.8
+++ b/debian/patches/02-support-pywebdav-0.9.8
@@ -1,7 +1,7 @@
 Author: Mathias Behrle <mathiasb at 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 @@ Description: Support new structure of pywebdav > 0.9.4.1.
          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 @@ Description: Support new structure of pywebdav > 0.9.4.1.
 +
      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 @@ Description: Support new structure of pywebdav > 0.9.4.1.
  
  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 @@ Description: Support new structure of pywebdav > 0.9.4.1.
 +                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 @@ Description: Support new structure of pywebdav > 0.9.4.1.
  
  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 @@ Description: Support new structure of pywebdav > 0.9.4.1.
      * 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 @@ Description: Support new structure of pywebdav > 0.9.4.1.
  # 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 @@ Description: Support new structure of pywebdav > 0.9.4.1.
          '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 @@ Description: Support new structure of pywebdav > 0.9.4.1.
              '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 @@ Description: Support new structure of pywebdav > 0.9.4.1.
              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 @@ Description: Support new structure of pywebdav > 0.9.4.1.
          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"/>
commit 89b56cc3212917f1421d715d7cf0560f66aa34f9
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Tue Sep 11 19:41:40 2012 +0200

    Merging upstream version 2.2.4.

diff --git a/CHANGELOG b/CHANGELOG
index 78bb31c..c00b801 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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 --git a/PKG-INFO b/PKG-INFO
index 1feace8..2faa0f5 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -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 --git a/trytond.egg-info/PKG-INFO b/trytond.egg-info/PKG-INFO
index 1feace8..2faa0f5 100644
--- a/trytond.egg-info/PKG-INFO
+++ b/trytond.egg-info/PKG-INFO
@@ -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 --git a/trytond/backend/mysql/database.py b/trytond/backend/mysql/database.py
index b702521..8b76b60 100644
--- a/trytond/backend/mysql/database.py
+++ b/trytond/backend/mysql/database.py
@@ -40,6 +40,7 @@ class Database(DatabaseInterface):
     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 --git a/trytond/ir/ui/menu.py b/trytond/ir/ui/menu.py
index ec98fd1..fa6e977 100644
--- a/trytond/ir/ui/menu.py
+++ b/trytond/ir/ui/menu.py
@@ -76,12 +76,13 @@ class UIMenu(ModelSQL, ModelView):
         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 --git a/trytond/ir/ui/view.py b/trytond/ir/ui/view.py
index 72a7422..c3a134e 100644
--- a/trytond/ir/ui/view.py
+++ b/trytond/ir/ui/view.py
@@ -138,7 +138,10 @@ class View(ModelSQL, ModelView):
                     ('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 --git a/trytond/model/browse.py b/trytond/model/browse.py
index 2f8c1af..d50d063 100644
--- a/trytond/model/browse.py
+++ b/trytond/model/browse.py
@@ -242,9 +242,13 @@ class BrowseRecord(object):
         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 --git a/trytond/model/fields/one2many.py b/trytond/model/fields/one2many.py
index 5ae64c6..0c0c766 100644
--- a/trytond/model/fields/one2many.py
+++ b/trytond/model/fields/one2many.py
@@ -88,7 +88,7 @@ class One2Many(Field):
         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 --git a/trytond/model/modelsql.py b/trytond/model/modelsql.py
index c75eefb..73f3f0b 100644
--- a/trytond/model/modelsql.py
+++ b/trytond/model/modelsql.py
@@ -1800,15 +1800,21 @@ class ModelSQL(ModelStorage):
             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 @@ class ModelSQL(ModelStorage):
                                     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 @@ class ModelSQL(ModelStorage):
                                     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 @@ class ModelSQL(ModelStorage):
                                     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 @@ class ModelSQL(ModelStorage):
                         '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 --git a/trytond/protocols/webdav.py b/trytond/protocols/webdav.py
index 735de79..273fd36 100644
--- a/trytond/protocols/webdav.py
+++ b/trytond/protocols/webdav.py
@@ -529,8 +529,11 @@ class WebDAVAuthRequestHandler(AuthServer.BufferedAuthRequestHandler,
 
     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 --git a/trytond/tests/test_fields.py b/trytond/tests/test_fields.py
index 69861ed..51d0e27 100644
--- a/trytond/tests/test_fields.py
+++ b/trytond/tests/test_fields.py
@@ -135,6 +135,23 @@ class FieldsTestCase(unittest.TestCase):
             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 --git a/trytond/version.py b/trytond/version.py
index 9ffcf38..93ae01b 100644
--- a/trytond/version.py
+++ b/trytond/version.py
@@ -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/"
 
commit d24d57b6a9fc51f40ecaea84d8d72c6bab29b20d
Author: Daniel Baumann <daniel at debian.org>
Date:   Sat Jun 30 17:37:46 2012 +0200

    Releasing debian version 2.2.3-2.

diff --git a/debian/changelog b/debian/changelog
index c9619aa..58354ba 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+tryton-server (2.2.3-2) unstable; urgency=low
+
+  * Updating maintainers field.
+  * Updating vcs fields.
+  * Switching to xz compression.
+  * Updating to debhelper version 9.
+  * Correcting copyright file to match format version 1.0.
+  * Sorting overrides alphabetically in rules.
+
+ -- Daniel Baumann <daniel at debian.org>  Sat, 30 Jun 2012 17:37:41 +0200
+
 tryton-server (2.2.3-1) unstable; urgency=low
 
   * Merging upstream version 2.2.3.
commit da5cd86e580f767a08a26af62a33523e4808c097
Author: Daniel Baumann <daniel at 127011.net>
Date:   Sat Jun 30 17:11:32 2012 +0200

    Sorting overrides alphabetically in rules.

diff --git a/debian/rules b/debian/rules
index 1b0b646..d956c32 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,9 +3,6 @@
 %:
 	dh ${@} --with python2
 
-override_dh_installinit:
-	dh_installinit --update-rcd-params='defaults 21'
-
 override_dh_auto_clean:
 	dh_auto_clean
 
@@ -13,3 +10,6 @@ override_dh_auto_clean:
 
 override_dh_builddeb:
 	dh_builddeb -- -Zxz -z9
+
+override_dh_installinit:
+	dh_installinit --update-rcd-params='defaults 21'
commit ee71ba586bb9304165455a4ec11fb0cd4ab216e2
Author: Daniel Baumann <daniel at 127011.net>
Date:   Sat Jun 30 17:11:13 2012 +0200

    Correcting copyright file to match format version 1.0.

diff --git a/debian/copyright b/debian/copyright
index 42de24d..f5e10ab 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,20 +1,18 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 
 Files: *
-Copyright:
- (C) 2004-2008 Tiny SPRL
- (C) 2007-2012 Cedric Krier
- (C) 2007-2011 Bertrand Chenal
- (C) 2008-2012 B2CK SPRL
- (C) 2011 Openlabs Technologies & Consulting (P) Ltd.
+Copyright: 2004-2008 Tiny SPRL
+           2007-2012 Cedric Krier
+           2007-2011 Bertrand Chenal
+           2008-2012 B2CK SPRL
+           2011 Openlabs Technologies & Consulting (P) Ltd.
 License: GPL-3+
 
 Files: doc/*
-Copyright:
- (C) 2008-2011 Bertrand Chenal
- (C) 2008-2011 Cedric Krier
- (C) 2008-2011 Ian Wilson
- (C) 2008-2011 Udo Spallek
+Copyright: 2008-2011 Bertrand Chenal
+           2008-2011 Cedric Krier
+           2008-2011 Ian Wilson
+           2008-2011 Udo Spallek
 License: GPL-3+
 
 Files: */icons/*
@@ -22,9 +20,8 @@ Copyright: not applicable
 License: public-domain
 
 Files: debian/*
-Copyright:
- (C) 2009-2012 Daniel Baumann <daniel at debian.org>
- (C) 2010-2012 Mathias Behrle <mathiasb at m9s.biz>
+Copyright: 2009-2012 Daniel Baumann <daniel at debian.org>
+           2010-2012 Mathias Behrle <mathiasb at m9s.biz>
 License: GPL-3+
 
 License: GPL-3+
commit e32ba2da4c55d63fff4a5522d3e40dd3bd65ff71
Author: Daniel Baumann <daniel at 127011.net>
Date:   Sat Jun 30 17:11:13 2012 +0200

    Updating to debhelper version 9.

diff --git a/debian/compat b/debian/compat
index 45a4fb7..ec63514 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-8
+9
diff --git a/debian/control b/debian/control
index 83f842a..51f48da 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
 Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at m9s.biz>
 Dm-Upload-Allowed: yes
-Build-Depends: debhelper (>= 8), python (>= 2.6.6-3~), python-setuptools
+Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools
 Standards-Version: 3.9.3
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-server.git
commit 4fd62f143e1f930978aa64ff29b0208bea905253
Author: Daniel Baumann <daniel at 127011.net>
Date:   Sat Jun 30 17:11:13 2012 +0200

    Switching to xz compression.

diff --git a/debian/rules b/debian/rules
index 4afa7bb..1b0b646 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,3 +10,6 @@ override_dh_auto_clean:
 	dh_auto_clean
 
 	rm -rf *.egg-info
+
+override_dh_builddeb:
+	dh_builddeb -- -Zxz -z9
diff --git a/debian/source/options b/debian/source/options
index d053b65..22a4de9 100644
--- a/debian/source/options
+++ b/debian/source/options
@@ -1,2 +1,2 @@
-compression = gzip
+compression = xz
 compression-level = 9
commit b720e8ea4e9f91929cd31e7c39146667ee3a9c19
Author: Daniel Baumann <daniel at 127011.net>
Date:   Sat Jun 30 16:55:07 2012 +0200

    Updating vcs fields.

diff --git a/debian/control b/debian/control
index c4adb4e..83f842a 100644
--- a/debian/control
+++ b/debian/control
@@ -7,8 +7,8 @@ Dm-Upload-Allowed: yes
 Build-Depends: debhelper (>= 8), python (>= 2.6.6-3~), python-setuptools
 Standards-Version: 3.9.3
 Homepage: http://www.tryton.org/
-Vcs-Browser: http://git.debian-maintainers.org/?p=tryton/tryton-server.git
-Vcs-Git: git://git.debian-maintainers.org/git/tryton/tryton-server.git
+Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-server.git
+Vcs-Git: git://debian.tryton.org/git/packages/tryton-server.git
 X-Python-Version: >= 2.6
 
 Package: tryton-server
commit 9125ca7fae836c768652f06376e3d854da303e9b
Author: Daniel Baumann <daniel at 127011.net>
Date:   Sat Jun 30 16:47:48 2012 +0200

    Updating maintainers field.

diff --git a/debian/control b/debian/control
index 59afa73..c4adb4e 100644
--- a/debian/control
+++ b/debian/control
@@ -1,7 +1,7 @@
 Source: tryton-server
 Section: python
 Priority: optional
-Maintainer: Debian Tryton Maintainers <tryton at lists.debian-maintainers.org>
+Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
 Uploaders: Daniel Baumann <daniel at debian.org>, Mathias Behrle <mathiasb at m9s.biz>
 Dm-Upload-Allowed: yes
 Build-Depends: debhelper (>= 8), python (>= 2.6.6-3~), python-setuptools
commit 9c839fe952f562137d0edd783786bfefffdf6213
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed May 9 13:14:36 2012 +0200

    Releasing debian version 2.2.3-1.

diff --git a/debian/changelog b/debian/changelog
index 18ae927..c9619aa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+tryton-server (2.2.3-1) unstable; urgency=low
+
+  * Merging upstream version 2.2.3.
+  * Refreshing patch 02-support-pywebdav-0.9.8.
+  * Updating years in copyright.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Wed, 09 May 2012 11:59:55 +0200
+
 tryton-server (2.2.2-1) unstable; urgency=high
 
   * Merging upstream version 2.2.2.
commit b2fa1799b3a988b68245b13ab03b93d6a7cfb490
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed May 9 11:59:50 2012 +0200

    Updating years in copyright.

diff --git a/debian/copyright b/debian/copyright
index 3bf80a0..42de24d 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -3,9 +3,9 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Files: *
 Copyright:
  (C) 2004-2008 Tiny SPRL
- (C) 2007-2011 Cedric Krier
+ (C) 2007-2012 Cedric Krier
  (C) 2007-2011 Bertrand Chenal
- (C) 2008-2011 B2CK SPRL
+ (C) 2008-2012 B2CK SPRL
  (C) 2011 Openlabs Technologies & Consulting (P) Ltd.
 License: GPL-3+
 
commit f31d66d5d9f323d70c337799be34f502d34fed8a
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed May 9 11:44:37 2012 +0200

    Refreshing patch 02-support-pywebdav-0.9.8.

diff --git a/debian/patches/02-support-pywebdav-0.9.8 b/debian/patches/02-support-pywebdav-0.9.8
index db55045..79ab594 100644
--- a/debian/patches/02-support-pywebdav-0.9.8
+++ b/debian/patches/02-support-pywebdav-0.9.8
@@ -1,7 +1,7 @@
 Author: Mathias Behrle <mathiasb at m9s.biz>
 Description: Support new structure of pywebdav > 0.9.4.1.
---- tryton-server.orig/trytond/protocols/webdav.py	2012-03-28 23:01:53.000000000 +0200
-+++ tryton-server/trytond/protocols/webdav.py	2012-03-28 23:11:24.303392800 +0200
+--- 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
 @@ -12,11 +12,15 @@
  import logging
  from threading import local
@@ -196,8 +196,8 @@ Description: Support new structure of pywebdav > 0.9.4.1.
  
  class SecureWebDAVAuthRequestHandler(WebDAVAuthRequestHandler):
  
---- tryton-server.orig/trytond/webdav/webdav.py	2011-10-24 15:57:46.000000000 +0200
-+++ tryton-server/trytond/webdav/webdav.py	2012-03-28 23:04:37.829024886 +0200
+--- 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
 @@ -2,11 +2,33 @@
  #this repository contains the full copyright notices and license terms.
  import os
@@ -497,9 +497,9 @@ Description: Support new structure of pywebdav > 0.9.4.1.
 +                raise Exception('Bad arguments')
 +
  Attachment()
---- tryton-server.orig/CHANGELOG	2012-03-28 23:01:53.000000000 +0200
-+++ tryton-server/CHANGELOG	2012-03-28 23:06:23.945466018 +0200
-@@ -1,6 +1,7 @@
+--- 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 @@
  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 +507,8 @@ Description: Support new structure of pywebdav > 0.9.4.1.
  
  Version 2.2.1 - 2011-12-26
  * Bug fixes (see mercurial logs for details)
---- tryton-server.orig/doc/topics/install.rst	2011-10-24 15:57:45.000000000 +0200
-+++ tryton-server/doc/topics/install.rst	2012-03-28 23:04:37.829024886 +0200
+--- 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
 @@ -15,7 +15,7 @@
      * polib (https://bitbucket.org/izi/polib/wiki/Home)
      * Optional: psycopg 2 or later (http://www.initd.org/)
@@ -518,8 +518,8 @@ Description: Support new structure of pywebdav > 0.9.4.1.
      * 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-03-28 23:03:51.000000000 +0200
-+++ tryton-server/etc/trytond.conf	2012-03-28 23:04:37.829024886 +0200
+--- 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
 @@ -2,13 +2,13 @@
  #this repository contains the full copyright notices and license terms.
  [options]
@@ -547,8 +547,8 @@ Description: Support new structure of pywebdav > 0.9.4.1.
  # Configure the database type
  # allowed values are postgresql, sqlite, mysql
  #db_type = postgresql
---- tryton-server.orig/setup.py	2011-10-24 15:57:45.000000000 +0200
-+++ tryton-server/setup.py	2012-03-28 23:04:37.829024886 +0200
+--- 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
 @@ -65,7 +65,7 @@
      extras_require={
          'PostgreSQL': ['psycopg2 >= 2.0'],
@@ -558,8 +558,8 @@ Description: Support new structure of pywebdav > 0.9.4.1.
          'unoconv': ['unoconv'],
          'SSL': ['pyOpenSSL'],
          'graphviz': ['pydot'],
---- tryton-server.orig/trytond/config.py	2012-03-28 23:01:53.000000000 +0200
-+++ tryton-server/trytond/config.py	2012-03-28 23:04:37.829024886 +0200
+--- 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
 @@ -24,14 +24,15 @@
  class ConfigManager(object):
      def __init__(self, fname=None):
@@ -577,8 +577,8 @@ Description: Support new structure of pywebdav > 0.9.4.1.
              'db_type': 'postgresql',
              'db_host': False,
              'db_port': False,
---- tryton-server.orig/trytond/tests/test_mixins.py	2011-12-06 11:28:56.000000000 +0100
-+++ tryton-server/trytond/tests/test_mixins.py	2012-03-28 23:04:37.829024886 +0200
+--- 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
 @@ -30,7 +30,7 @@
                      urllib.quote(DB_NAME)))
  
@@ -604,8 +604,8 @@ Description: Support new structure of pywebdav > 0.9.4.1.
              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	2011-10-24 15:57:46.000000000 +0200
-+++ tryton-server/trytond/url.py	2012-03-28 23:04:37.833024752 +0200
+--- 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
 @@ -16,7 +16,8 @@
          from trytond.wizard import Wizard
          from trytond.report import Report
@@ -616,8 +616,8 @@ Description: Support new structure of pywebdav > 0.9.4.1.
          hostname = '.'.join(encodings.idna.ToASCII(part) for part in
              hostname.split('.'))
  
---- tryton-server.orig/trytond/webdav/webdav.xml	2011-10-24 15:57:46.000000000 +0200
-+++ tryton-server/trytond/webdav/webdav.xml	2012-03-28 23:04:37.833024752 +0200
+--- 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
 @@ -105,5 +105,122 @@
              <field name="menu" ref="menu_collection_list"/>
              <field name="group" ref="res.group_admin"/>
commit edb8de0fa0968aa41ac1874182f0b1a014b7c73a
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Wed May 9 11:28:38 2012 +0200

    Merging upstream version 2.2.3.

diff --git a/CHANGELOG b/CHANGELOG
index f074bf1..78bb31c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 2.2.3 - 2012-05-07
+* Bug fixes (see mercurial logs for details)
+
 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)
diff --git a/COPYRIGHT b/COPYRIGHT
index 231a7a9..baf02b6 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -1,7 +1,7 @@
 Copyright (C) 2004-2008 Tiny SPRL.
-Copyright (C) 2007-2011 Cédric Krier.
+Copyright (C) 2007-2012 Cédric Krier.
 Copyright (C) 2007-2011 Bertrand Chenal.
-Copyright (C) 2008-2011 B2CK SPRL.
+Copyright (C) 2008-2012 B2CK SPRL.
 Copyright (C) 2011 Openlabs Technologies & Consulting (P) Ltd.
 
 This program is free software: you can redistribute it and/or modify
diff --git a/PKG-INFO b/PKG-INFO
index 30e8fe4..1feace8 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
 Name: trytond
-Version: 2.2.2
+Version: 2.2.3
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: B2CK
diff --git a/trytond.egg-info/PKG-INFO b/trytond.egg-info/PKG-INFO
index 30e8fe4..1feace8 100644
--- a/trytond.egg-info/PKG-INFO
+++ b/trytond.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
 Name: trytond
-Version: 2.2.2
+Version: 2.2.3
 Summary: Tryton server
 Home-page: http://www.tryton.org/
 Author: B2CK
diff --git a/trytond/backend/database.py b/trytond/backend/database.py
index 808c0d1..3ca6b18 100644
--- a/trytond/backend/database.py
+++ b/trytond/backend/database.py
@@ -104,8 +104,7 @@ class CursorInterface(object):
     IN_MAX = 1000
 
     def __init__(self):
-        from trytond.cache import LRUDict
-        self.cache = LRUDict(CONTEXT_CACHE_SIZE)
+        self.cache = {}
 
     def get_cache(self, context=None):
         '''
diff --git a/trytond/backend/mysql/database.py b/trytond/backend/mysql/database.py
index 1d2b778..b702521 100644
--- a/trytond/backend/mysql/database.py
+++ b/trytond/backend/mysql/database.py
@@ -27,8 +27,6 @@ def _replace_split_part_right(mobj):
     if pos == 2:
         return ', -1'
     return ', 1'
-DatabaseIntegrityError = None
-DatabaseOperationalError = None
 
 
 class Database(DatabaseInterface):
diff --git a/trytond/convert.py b/trytond/convert.py
index 62452ca..7c0bdf5 100644
--- a/trytond/convert.py
+++ b/trytond/convert.py
@@ -354,8 +354,12 @@ class Fs2bdAccessor:
             record_ids.setdefault(rec.model, [])
             record_ids[rec.model].append(rec.db_id)
 
+        object_name_list = set(self.pool.object_name_list())
+
         self.browserecord[module] = {}
         for model_name in record_ids.keys():
+            if model_name not in object_name_list:
+                continue
             model_obj = self.pool.get(model_name)
             self.browserecord[module][model_name] = {}
             for i in range(0, len(record_ids[model_name]), cursor.IN_MAX):
@@ -928,6 +932,7 @@ def post_import(pool, module, to_delete):
             ('module', '=', module),
             ], order=[('id', 'DESC')])
 
+    object_name_list = set(pool.object_name_list())
     for mrec in modeldata_obj.browse(mdata_ids):
         mdata_id, model, db_id = mrec.id, mrec.model, mrec.db_id
 
@@ -977,9 +982,14 @@ def post_import(pool, module, to_delete):
                 'Deleting %s@%s' % (db_id, model))
         try:
             # Deletion of the record
-            model_obj = pool.get(model)
-            model_obj.delete(db_id)
-            mdata_delete.append(mdata_id)
+            if model in object_name_list:
+                model_obj = pool.get(model)
+                model_obj.delete(db_id)
+                mdata_delete.append(mdata_id)
+            else:
+                logging.getLogger("convert").warning(
+                        'Could not delete id %d of model %s because model no '
+                        'longer exists.' % (db_id, model))
             cursor.commit()
         except Exception:
             cursor.rollback()
diff --git a/trytond/ir/cron.py b/trytond/ir/cron.py
index 99ed8d3..0d8de4f 100644
--- a/trytond/ir/cron.py
+++ b/trytond/ir/cron.py
@@ -68,6 +68,7 @@ class Cron(ModelSQL, ModelView):
         table.column_rename('numbercall', 'number_calls')
         table.column_rename('doall', 'repeat_missed')
         table.column_rename('nextcall', 'next_call')
+        table.drop_column('running')
 
         super(Cron, self).init(module_name)
 
diff --git a/trytond/ir/ui/form.rnc b/trytond/ir/ui/form.rnc
index b20dd5c..015f36e 100644
--- a/trytond/ir/ui/form.rnc
+++ b/trytond/ir/ui/form.rnc
@@ -20,7 +20,7 @@ attlist.form &= attribute on_write { text }?
 attlist.form &= [ a:defaultValue = "4" ] attribute col { text }?
 attlist.form &= attribute cursor { text }?
 
-tree = element tree { attlist.tree, field+ }
+tree = element tree { attlist.tree, field* }
 attlist.tree &=
   [ a:defaultValue = "Unknown" ] attribute string { text }?
 attlist.tree &= attribute on_write { text }?
diff --git a/trytond/ir/ui/form.rng b/trytond/ir/ui/form.rng
index 1bb7c62..2832183 100644
--- a/trytond/ir/ui/form.rng
+++ b/trytond/ir/ui/form.rng
@@ -42,9 +42,9 @@
   <define name="tree">
     <element name="tree">
       <ref name="attlist.tree"/>
-      <oneOrMore>
+      <zeroOrMore>
         <ref name="field"/>
-      </oneOrMore>
+      </zeroOrMore>
     </element>
   </define>
   <define name="attlist.tree" combine="interleave">
@@ -502,11 +502,6 @@
   </define>
   <define name="attlist.image" combine="interleave">
     <optional>
-      <attribute name="help"/>
-    </optional>
-  </define>
-  <define name="attlist.image" combine="interleave">
-    <optional>
       <attribute name="xexpand" a:defaultValue="0">
         <choice>
           <value>0</value>
@@ -527,6 +522,11 @@
   </define>
   <define name="attlist.image" combine="interleave">
     <optional>
+      <attribute name="help"/>
+    </optional>
+  </define>
+  <define name="attlist.image" combine="interleave">
+    <optional>
       <attribute name="states"/>
     </optional>
   </define>
diff --git a/trytond/model/model.py b/trytond/model/model.py
index b180768..8240bad 100644
--- a/trytond/model/model.py
+++ b/trytond/model/model.py
@@ -27,6 +27,7 @@ class Model(WarningErrorMixin, URLMixin):
 
     def _reset_columns(self):
         self.__columns = None
+        self.__defaults = None
         self._reset_xxx2many_targets()
 
     def _getcolumns(self):
diff --git a/trytond/model/modelsql.py b/trytond/model/modelsql.py
index a578a8e..c75eefb 100644
--- a/trytond/model/modelsql.py
+++ b/trytond/model/modelsql.py
@@ -2031,7 +2031,7 @@ class ModelSQL(ModelStorage):
             if field_name:
                 if '%(table)s' in field_name or '%(order)s' in field_name:
                     order_by.append(field_name % {
-                        'table': table_name,
+                        'table': '"%s"' % table_name,
                         'order': otype,
                         })
                 else:
diff --git a/trytond/res/request.py b/trytond/res/request.py
index 5be47f0..d93bc23 100644
--- a/trytond/res/request.py
+++ b/trytond/res/request.py
@@ -123,7 +123,7 @@ class Request(ModelSQL, ModelView):
             request_history_obj.create(values)
         self.write(ids, {
             'state': 'waiting',
-            'date_send': datetime.datetime.now(),
+            'date_sent': datetime.datetime.now(),
             })
         return True
 
diff --git a/trytond/version.py b/trytond/version.py
index 7650cc7..9ffcf38 100644
--- a/trytond/version.py
+++ b/trytond/version.py
@@ -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.2"
+VERSION = "2.2.3"
 LICENSE = "GPL-3"
 WEBSITE = "http://www.tryton.org/"
 
-- 
tryton-server



More information about the tryton-debian-vcs mailing list