From 250e37f88c86d5b9a94e4747d7f8dc96369d0e68 Mon Sep 17 00:00:00 2001 From: Max Holtzberg Date: Wed, 28 Dec 2011 16:03:31 +0100 Subject: [PATCH 1/2] Passing false to SQL query on property field search as parameter issue2351 review206002 --- trytond/model/fields/property.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trytond/model/fields/property.py b/trytond/model/fields/property.py index cb493c3e08..87033c5183 100644 --- a/trytond/model/fields/property.py +++ b/trytond/model/fields/property.py @@ -101,10 +101,10 @@ class Property(Function): ' THEN ' + \ self.get_condition(sql_type, clause) + \ ' ELSE '\ - 'FALSE '\ + '%s '\ 'END', [model._name, name] + property_val + \ - self.get_condition_args(clause)) + self.get_condition_args(clause) + [False]) props = cursor.fetchall() default = None From acffdd82460c665810ecce2fdd722a9e6916171f Mon Sep 17 00:00:00 2001 From: Max Holtzberg Date: Thu, 29 Dec 2011 11:57:44 +0100 Subject: [PATCH 2/2] Correct handling of NULL values in user defined split_part function on SQLite issue2370 review214001 --- trytond/backend/sqlite/database.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trytond/backend/sqlite/database.py b/trytond/backend/sqlite/database.py index 1e78b75e2d..32eb4638b2 100644 --- a/trytond/backend/sqlite/database.py +++ b/trytond/backend/sqlite/database.py @@ -81,6 +81,8 @@ def date_trunc(_type, date): tm_tuple.tm_mday) def split_part(text, delimiter, count): + if text is None: + return None return (text.split(delimiter) + [''] * (count - 1))[count - 1] def replace(text, pattern, replacement):