Odoo 中文社区

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

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

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

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

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

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

    OE defalut_get 能判读是哪一个action传过来的呢

    Odoo 新手求助
    2
    8
    2946
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      hugecrab last edited by

      OE defalut_get 能判读是哪一个action传过来的呢

      1 Reply Last reply Reply Quote 0
      • Joshua
        Joshua 管理员 last edited by

        楼主是想根据action来设定默认值?

        【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

        1 Reply Last reply Reply Quote 0
        • H
          hugecrab last edited by

          是通过不同action传到同一个页面。如何判断是否可以得到哪个actionID传过来的

          1 Reply Last reply Reply Quote 0
          • Joshua
            Joshua 管理员 last edited by

            你可以在action的context里面赋值,然后通过其来判断是哪个action,如果是针对默认值,还可以直接在context里面写

            {'default_xxxfields': 'value'}
            

            【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

            1 Reply Last reply Reply Quote 0
            • H
              hugecrab last edited by

              你好,你说的是从后台传的这个我能理解,但是我是从xml文件这里传的
                <act_window id="get_testnum_action"
                      name="Get_testlNum"
                      src_model="test.testhead"
                      res_model="test.wizard.testnum"
                      view_type="form" view_mode="form" target="new"
                      key2="client_action_multi"/>
              这里也可以 defalut_xxx_id吗,请教,谢谢!

              1 Reply Last reply Reply Quote 0
              • Joshua
                Joshua 管理员 last edited by

                是的

                <br />&lt;act_window id=&quot;get_testnum_action&quot; <br />&nbsp; &nbsp; &nbsp; &nbsp; name=&quot;Get_testlNum&quot; <br />&nbsp; &nbsp; &nbsp; &nbsp; context=&quot;{&#039;default_xxxx&#039;: yyyy}&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; src_model=&quot;test.testhead&quot; <br />&nbsp; &nbsp; &nbsp; &nbsp; res_model=&quot;test.wizard.testnum&quot; <br />&nbsp; &nbsp; &nbsp; &nbsp; view_type=&quot;form&quot; view_mode=&quot;form&quot; target=&quot;new&quot; <br />&nbsp; &nbsp; &nbsp; &nbsp; key2=&quot;client_action_multi&quot;/&gt;<br />
                



                【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

                1 Reply Last reply Reply Quote 0
                • H
                  hugecrab last edited by

                  谢谢

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post