Add context when searching ids for report

This commit is contained in:
Cédric Krier committed 2008-11-12 18:41:55 +01:00
1 parent 11a8f2942e
commit 5ad66b5dc5
1 file changed
+4 -3
+4 -3
View File
@@ -23,8 +23,11 @@ class Action(object):
datas = data.copy()
ids = datas['ids']
del datas['ids']
ctx = rpc.CONTEXT.copy()
ctx.update(context)
if not ids:
args = ('object', 'execute', datas['model'], 'search', [])
args = ('object', 'execute', datas['model'], 'search', [],
0, None, None, ctx)
try:
ids = rpc.execute(*args)
except Exception, exception:
@@ -35,8 +38,6 @@ class Action(object):
message(_('Nothing to print!'), window)
return False
datas['id'] = ids[0]
ctx = rpc.CONTEXT.copy()
ctx.update(context)
args = ('report', 'execute', name, ids, datas, ctx)
try:
res = rpc.execute(*args)