Records in domains cause a "maximum recursion depth exceeded" error when
converted to SQL. Simply add a test to show a better error message.
lead = self.browse(cr, uid, id, context=context)
local_context = dict(context)
local_context.setdefault('default_type', lead.type)
- local_context.setdefault('default_section_id', lead.section_id)
+ local_context.setdefault('default_section_id', lead.section_id.id)
if lead.type == 'opportunity':
default['date_open'] = fields.datetime.now()
else:
"Invalid operator %r in domain term %r" % (operator, leaf)
assert leaf in (TRUE_LEAF, FALSE_LEAF) or left in model._all_columns \
or left in MAGIC_COLUMNS, "Invalid field %r in domain term %r" % (left, leaf)
+ assert not isinstance(right, BaseModel), \
+ "Invalid value %r in domain term %r" % (right, leaf)
table_alias = '"%s"' % (eleaf.generate_alias())