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): 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