【问题标题】:Perform "actions" in status bar widget在状态栏小部件中执行“操作”
【发布时间】:2016-04-28 15:42:38
【问题描述】:

我有一个带有状态栏小部件的字段,如果我按下状态栏中的一个按钮,我希望启动一个功能,(类似于 onchange),一些帮助??

【问题讨论】:

    标签: openerp action statusbar odoo-8


    【解决方案1】:

    您可以直接使用 onchange 或扩展状态栏小部件。

    【讨论】:

      【解决方案2】:

      试试这个:

      xml文件

      <button name="action_draft" type="object"
                                  string="Reset to draft"
                                  states="confirm"/>
      <button name="action_confirm" type="object"
                                          string="Confirm" states="draft"
                                          class="oe_highlight"/>
      <field name="state" widget="statusbar"/>
      

      .py 文件

      def action_draft(self):
          self.state = 'draft'
      
      def action_confirm(self):
          self.state = 'confirm'
      

      【讨论】:

        猜你喜欢
        • 2018-08-04
        • 1970-01-01
        • 1970-01-01
        • 2012-07-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-10-05
        相关资源
        最近更新 更多