Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
6 Antwoorden
8218 Weergaven

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?

Avatar
Annuleer
Beste antwoord

<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>

Avatar
Annuleer
Beste antwoord

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


Avatar
Annuleer
Beste antwoord

<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>

Avatar
Annuleer
Beste antwoord

<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>

Avatar
Annuleer
Beste antwoord

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"/>

Avatar
Annuleer

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

Gerelateerde posts Antwoorden Weergaven Activiteit
1
mrt. 15
6113
1
mrt. 15
4454
2
mrt. 15
9956
1
mrt. 24
5892
5
feb. 23
29473