docuement: armor the ir.action.report.xml code
It was a little careless, better have an assertion there, at least, for the cases we don't cover. Historically, it has been here since commit: efeed12bea5c008ed6 ;) bzr revid: p_christ@hol.gr-20110118164956-vboodk5j4g9eofix
This commit is contained in:
parent
29721236fc
commit
e9b56eafe2
|
@ -42,8 +42,12 @@ class ir_action_report_xml(osv.osv):
|
|||
def _model_search(self, cr, uid, obj, name, args, context=None):
|
||||
if not len(args):
|
||||
return []
|
||||
assert len(args) == 1 and args[0][1] == '=', 'expression is not what we expect: %r' % args
|
||||
model_id= args[0][2]
|
||||
if not model_id:
|
||||
# a deviation from standard behavior: when searching model_id = False
|
||||
# we return *all* reports, not just ones with empty model.
|
||||
# One reason is that 'model' is a required field so far
|
||||
return []
|
||||
model = self.pool.get('ir.model').read(cr, uid, [model_id])[0]['model']
|
||||
report_id = self.search(cr, uid, [('model','=',model)])
|
||||
|
|
Loading…
Reference in New Issue