Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

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]
    懇請賜教指導是哪邊出了問題


  • 管理员

    Hi kk071700

    <br />return {<br />...<br />&#039;context&#039;:{&#039;default_x_job_no&#039;:&#039;98585&#039;},&nbsp; #问题1<br />&#039;target&#039;: &#039;new&#039;, #问题2<br />...<br />}<br />
    


    Joshua



  • [quote author=Joshua link=topic=4388.msg12006#msg12006 date=1349936958]
    Hi kk071700

    <br />return {<br />...<br />&#039;context&#039;:{&#039;default_x_job_no&#039;:&#039;98585&#039;},&nbsp; #问题1<br />&#039;target&#039;: &#039;new&#039;, #问题2<br />...<br />}<br />
    


    Joshua
    [/quote]

    感恩 Joshua大指點迷津



  • try

    'target': 'iframe'


Log in to reply