跳至內容
選單
此問題已被標幟
6 回覆
7929 瀏覽次數

I'm trying to remove the `action_quotation_send` button via a custom module. In my XML I've attempted:

<record id="view_order_form" model="ir.ui.view">

      <field name="name">sale.order.form</field>

      <field name="model">sale.order</field>
      <field name="priority" eval="1"/>
      <field name="inherit_id" ref="sale.view_order_form"/>
      <field name="arch" type="xml">

          <!-- xpath, doesn't work? -->
          <xpath expr="//button[@name='action_quotation_send']" position="attributes">
              <attribute name="attrs">{'invisible': [('func_field', '=', False)]}</attribute>
          </xpath>

          <!-- straight up removal doesn't work? -->

          <button name="action_quotation_send" position="replace"/>

          <!-- Matching the structure of the original XML doesn't work -->

          <form string="Sales Order">
              <header>

                  <button name="action_quotation_send" position="replace"/>
              </header>
          </form>

      </field>
  </record>

What am I missing?

頭像
捨棄
最佳答案

<xpath expr="//button[@name='action_quotation_send']" position="attributes">

              <attribute name="invisible">1</attribute>

</xpath>

OR

<xpath expr="//button[@name='action_quotation_send']" position="replace">

</xpath>

頭像
捨棄
最佳答案

<xpath expr="//button[@name='action_quotation_send']" position="replace">
</xpath>


頭像
捨棄
最佳答案

<xpath expr="//button[@name='action_quotation_send']" position="attributes">
              <attribute name="invisible">1</attribute>
</xpath>

OR

<xpath expr="//button[@name='action_quotation_send']" position="replace">
</xpath>

頭像
捨棄
最佳答案

<xpath expr="//button[@name='action_quotation_send']" position="attributes">
              <attribute name="invisible">1</attribute>
</xpath>

OR

<xpath expr="//button[@name='action_quotation_send']" position="replace">
</xpath>

頭像
捨棄
最佳答案

Have you tried to make the button invisable instead of removing it?  It would accomplish the same thing. 

For example... 

<button name="action_quotation_send" position="replace" invisible="1"/>

頭像
捨棄

Yes, better idea, and that way could make invisible base upon Group permissions

相關帖文 回覆 瀏覽次數 活動
1
3月 15
5920
1
3月 15
4228
2
3月 15
9729
1
3月 24
5161
5
2月 23
29291