Function return值的問題
-
小弟用按鈕呼叫自身wizard內的Function, 然後Function內再指定去外部該wizard的view
[color=blue]<button name="create_claim" string="Claim" icon="gtk-go-forward" type="object"/>
def create_claim(self, cr, uid, ids, context=None):
return {
'name': 'Claim',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'create.claim.order',#該wizard
'type': 'ir.actions.act_window',
'x_job_no':'98585',#欲傳的參數
}[/color]
但是出現了2個問題
1. [b]x_job_no參數無法傳到新的view中[/b]
2.[b]希望原視窗轉換但是按下按鈕後是開一新視窗顯示而非原視窗轉換,同時原視窗出現Error訊息[/b]
如下
[color=red]Traceback (most recent call last): File "C:\MODERNSPECS\modernspecserp_server\bin\netsvc.py", line 489, in dispatch result = ExportService.getService(service_name).dispatch(method, auth, params) File "C:\MODERNSPECS\modernspecserp_server\bin\service\web_services.py", line 599, in dispatch res = fn(db, uid, *params) File "C:\MODERNSPECS\modernspecserp_server\bin\osv\osv.py", line 122, in wrapper return f(self, dbname, *args, **kwargs) File "C:\MODERNSPECS\modernspecserp_server\bin\osv\osv.py", line 176, in execute res = self.execute_cr(cr, uid, obj, method, *args, **kw) File "C:\MODERNSPECS\modernspecserp_server\bin\osv\osv.py", line 167, in execute_cr return getattr(object, method)(cr, uid, *args, **kw) File "C:\MODERNSPECS\modernspecserp_server\bin\osv\orm.py", line 1963, in read res2 = self._columns[f].get_memory(cr, self, ids, f, user, context=context, values=result) File "C:\MODERNSPECS\modernspecserp_server\bin\osv\fields.py", line 348, in get_memory result[id] = obj.datas[id].get(name, False) KeyError: 816
[/color]
懇請賜教指導是哪邊出了問題 -
[quote author=Joshua link=topic=4388.msg12006#msg12006 date=1349936958]
Hi kk071700<br />return {<br />...<br />'context':{'default_x_job_no':'98585'}, #问题1<br />'target': 'new', #问题2<br />...<br />}<br />
Joshua
[/quote]
感恩 Joshua大指點迷津