Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
3 Antworten
8610 Ansichten

I would like to hide a the "Create Invoice" button on the sale order form using the invisible attribute.

However, I want to hide the button, when a specific "Char" field is not empty.

I tried the XML below but it did not work!

<button name="302" position="replace">

    <button name="302" string="Create Invoice" type="action" states="manual" class="oe_highlight" groups="base.group_user" attrs="{'invisible': [('x_original_order_name', '!=', '')]}"/>

</button>

How can I hide the Create Invoice button when my custom field is not empty?

Thanks 

Avatar
Verwerfen
Beste Antwort

Hello  Ababneh,


You can not apply "attrs" to button when type is "action"

(you can apply "attrs" when you are opening wizard from button like this)

<button name="%(action_create_payment_order)d" string="Invoices"  type="action" attrs="{'invisible':[('state','=','done')]}" />



Thanks


Avatar
Verwerfen
Autor Beste Antwort

Hi Ahmed,

I tried your line but it did not work

Thnaks

Avatar
Verwerfen

can you post your code ?

Beste Antwort

Hello,

Try to remove the states keyword, and try as e.g: attrs="{'invisible':['|',('x_original_order_name','!=',''),('state','!=', 'manual')]}"

Regards,

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
März 15
3458
3
Juli 25
4315
1
Mai 25
987
0
Mai 25
883
2
Nov. 24
2190