Skip to content

Instantly share code, notes, and snippets.

@ianjosephwilson
Created January 19, 2013 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianjosephwilson/4575364 to your computer and use it in GitHub Desktop.
Save ianjosephwilson/4575364 to your computer and use it in GitHub Desktop.
diff -r 91e0c59c47aa tryton/common/domain_parser.py
--- a/tryton/common/domain_parser.py Thu Jan 03 16:29:35 2013 +0100
+++ b/tryton/common/domain_parser.py Sat Jan 19 13:33:42 2013 -0800
@@ -749,9 +749,9 @@
def string_(clause):
if not clause:
return ''
- if (isinstance(clause[0], basestring)
- and (clause[0] in self.fields
- or clause[0] == 'rec_name')):
+ if isinstance(clause[0], basestring) and clause[0] not in ('AND', 'OR'):
+ assert clause[0] in self.fields or clause[0] == 'rec_name',
+ "Field in clause is not available to parser."
name, operator, value = clause
if name not in self.fields:
escaped = value.replace('%%', '__')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment