跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

  1. 主页
  2. 版块
  3. Odoo 开发与实施交流
  4. 试图中添加一个按钮

试图中添加一个按钮

已定时 已固定 已锁定 已移动 Odoo 开发与实施交流
13 帖子 4 发布者 10.1k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • K 离线
    K 离线
    K_Go
    写于 最后由 编辑
    #4

    变成这样了。。不是很明白为什么。。

    1 条回复 最后回复
    0
    • K 离线
      K 离线
      K_Go
      写于 最后由 编辑
      #5

      我是对照form中的代码来改的,因为这个页面中的按钮就是我想要添加的,就像下面这个图一样。

      &lt;group col=&quot;17&quot; colspan=&quot;4&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;state&quot; widget=&quot;statusbar&quot; statusbar_visible=&quot;draft,progress,done&quot; statusbar_colors=&#039;{&quot;shipping_except&quot;:&quot;red&quot;,&quot;invoice_except&quot;:&quot;red&quot;,&quot;waiting_date&quot;:&quot;blue&quot;}&#039;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button name=&quot;invoice_recreate&quot; states=&quot;invoice_except&quot; string=&quot;Recreate Invoice&quot; icon=&quot;gtk-go-forward&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button name=&quot;invoice_corrected&quot; states=&quot;invoice_except&quot; string=&quot;Ignore Exception&quot; icon=&quot;gtk-apply&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button name=&quot;ship_recreate&quot; states=&quot;shipping_except&quot; string=&quot;Recreate Packing&quot; icon=&quot;gtk-ok&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button name=&quot;ship_corrected&quot; states=&quot;shipping_except&quot; string=&quot;Ignore Exception&quot; icon=&quot;gtk-apply&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button name=&quot;action_cancel&quot; states=&quot;manual,progress&quot; string=&quot;Cancel Order&quot; type=&quot;object&quot; icon=&quot;gtk-cancel&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button name=&quot;%(report_sale_order)d&quot; string=&quot;Print Order&quot; type=&quot;action&quot; icon=&quot;gtk-print&quot; states=&quot;waiting_date,manual,progress,done,shipping_except,invoice_except&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button name=&quot;manual_invoice&quot; states=&quot;manual&quot; string=&quot;Create Final Invoice&quot; icon=&quot;gtk-go-forward&quot; type=&quot;object&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button name=&quot;ship_cancel&quot; states=&quot;shipping_except&quot; string=&quot;Cancel Order&quot; icon=&quot;gtk-cancel&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button name=&quot;action_cancel_draft&quot; states=&quot;cancel&quot; string=&quot;Set to Draft&quot; type=&quot;object&quot; icon=&quot;gtk-convert&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button name=&quot;cancel&quot; states=&quot;draft&quot; string=&quot;Cancel Order&quot; icon=&quot;gtk-cancel&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button name=&quot;invoice_cancel&quot; states=&quot;invoice_except&quot; string=&quot;Cancel Order&quot; icon=&quot;gtk-cancel&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button name=&quot;%(report_sale_order)d&quot; string=&quot;Print Quotation&quot; type=&quot;action&quot; icon=&quot;gtk-print&quot; states=&quot;draft&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;button name=&quot;order_confirm&quot; states=&quot;draft&quot; string=&quot;Confirm Order&quot; icon=&quot;gtk-apply&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/group&gt;
      


      我照着改,加了一个group后还是一样。。。

      1 条回复 最后回复
      0
      • K 离线
        K 离线
        K_Go
        写于 最后由 编辑
        #6

        经过几天的实验,发现直接在上面加一个按钮很难实现,于是在v7里面的 ”更多“ 添加了一个确认订单的触发。
        代码如下:

        &lt;record id=&quot;action_sale_order_confirm_sales&quot; model=&quot;ir.actions.server&quot;&gt;<br />&nbsp; &nbsp; &lt;field name=&quot;name&quot;&gt;Confirm sale1&lt;/field&gt;<br />&nbsp; &nbsp; &lt;field name=&quot;type&quot;&gt;ir.actions.server&lt;/field&gt;<br />&nbsp; &nbsp; &lt;field name=&quot;model_id&quot; ref=&quot;model_sale_order&quot;/&gt;<br />&nbsp; &nbsp; &lt;field name=&quot;state&quot;&gt;code&lt;/field&gt;<br />&nbsp; &nbsp; &lt;field name=&quot;code&quot;&gt;obj.action_button_confirm(context=context)&lt;/field&gt;<br />&lt;/record&gt;<br />&lt;record id=&quot;id_of_the_action_value&quot; model=&quot;ir.values&quot;&gt;<br />&nbsp; &nbsp; &lt;field name=&quot;name&quot;&gt;Confirm sale1&lt;/field&gt;<br />&nbsp; &nbsp; &lt;field name=&quot;action_id&quot; ref=&quot;action_sale_order_confirm_sales&quot;/&gt;<br />&nbsp; &nbsp; &lt;field name=&quot;value&quot; eval=&quot;&#039;ir.actions.server,&#039; + str(ref(&#039;action_sale_order_confirm_sales&#039;))&quot;/&gt;<br />&nbsp; &nbsp; &lt;field name=&quot;key&quot;&gt;action&lt;/field&gt;<br />&nbsp; &nbsp; &lt;field name=&quot;model_id&quot; ref=&quot;model_sale_order&quot;/&gt;<br />&nbsp; &nbsp; &lt;field name=&quot;model&quot;&gt;sale.order&lt;/field&gt;<br />&nbsp; &nbsp; &lt;field name=&quot;key2&quot;&gt;client_action_multi&lt;/field&gt;<br />&lt;/record&gt;
        



        其中action_button_confirm就是确认订单的代码,它在saly.py,类sale_order里面...其实还有一些不是很明白,比如

        &lt;field name=&quot;model_id&quot; ref=&quot;model_sale_order&quot;/&gt;
        

        这一个,为什么它会知道是在saly.py里面?还有就是

        &lt;field name=&quot;model&quot;&gt;sale.order&lt;/field&gt;
        

        这一行和上一行有什么区别。。至于

        &nbsp;  &lt;field name=&quot;key2&quot;&gt;client_action_multi&lt;/field&gt;
        

        我猜应该就是添加到更多里面。。。总之还有一些不明白的地方,不过我想再经过一些摸索应该会慢慢明白。

        PS:大家有问题可以到http://help.openerp.com/questions/这里提问。。。。我就是在这里问的。。

        1 条回复 最后回复
        0
        • mrshellyM 离线
          mrshellyM 离线
          mrshelly
          写于 最后由 编辑
          #7

          7.0的更多, 就相当于 6.1-版本的"右侧菜单栏"...

          如果 help.openerp.com 可以用中文提问的话,估计去的人会很多.

          1 条回复 最后回复
          0
          • wjfonhandW 离线
            wjfonhandW 离线
            wjfonhand
            写于 最后由 编辑
            #8

            楼上的,help.openerp.com 并未指定不能用中文提问,何不试试?

            GoodERP -- Odoo China fork

            1 条回复 最后回复
            0
            • mrshellyM 离线
              mrshellyM 离线
              mrshelly
              写于 最后由 编辑
              #9

              嗯. 问了一个问题
              <br / http://help.openerp.com/question/8084/ta-men-shuo-zhe-li-wen-wen-ti-neng-gou-de-dao-hen-kuai-su-di-jie-jue-shi-zhe-yang-de-ma/ br />

              1 条回复 最后回复
              0
              • JoshuaJ 离线
                JoshuaJ 离线
                Joshua 管理员
                写于 最后由 编辑
                #10

                [quote author=mrshelly link=topic=5843.msg14627#msg14627 date=1364278207]
                嗯. 问了一个问题
                <br / http://help.openerp.com/question/8084/ta-men-shuo-zhe-li-wen-wen-ti-neng-gou-de-dao-hen-kuai-su-di-jie-jue-shi-zhe-yang-de-ma/ br />
                [/quote]

                The question has been closed for the following reason "too localized" by Fabien Pinckaers
                close date 2013-03-26 07:58:43.401743

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

                1 条回复 最后回复
                0
                • K 离线
                  K 离线
                  K_Go
                  写于 最后由 编辑
                  #11

                  😮 😮 😮 😮 😮 😮 😮 😮 :-[ :-[ :-[ :-[[quote author=mrshelly link=topic=5843.msg14627#msg14627 date=1364278207]
                  嗯. 问了一个问题
                  <br / http://help.openerp.com/question/8084/ta-men-shuo-zhe-li-wen-wen-ti-neng-gou-de-dao-hen-kuai-su-di-jie-jue-shi-zhe-yang-de-ma/ br />[/quote]

                  1 条回复 最后回复
                  0
                  • K 离线
                    K 离线
                    K_Go
                    写于 最后由 编辑
                    #12

                    [quote author=Jeff link=topic=5843.msg14626#msg14626 date=1364273186]
                    楼上的,help.openerp.com 并未指定不能用中文提问,何不试试?
                    [/quote]

                    好奇的问问里面的karma是什么意思。。。

                    1 条回复 最后回复
                    0
                    • mrshellyM 离线
                      mrshellyM 离线
                      mrshelly
                      写于 最后由 编辑
                      #13

                      [quote author=K_Go link=topic=5843.msg14633#msg14633 date=1364347379]
                      [quote author=Jeff link=topic=5843.msg14626#msg14626 date=1364273186]
                      楼上的,help.openerp.com 并未指定不能用中文提问,何不试试?
                      [/quote]

                      好奇的问问里面的karma是什么意思。。。
                      [/quote]

                      应该是贡献值的意思...

                      1 条回复 最后回复
                      0

                      • 登录

                      • 没有帐号? 注册

                      • 登录或注册以进行搜索。
                      • 第一个帖子
                        最后一个帖子
                      0
                      • 版块
                      • 标签
                      • 热门
                      • 用户
                      • 群组