Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
8413 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore Risposta migliore

Hi Ahmed,

I tried your line but it did not work

Thnaks

Avatar
Abbandona

can you post your code ?

Risposta migliore

Hello,

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

Regards,

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
mar 15
3342
3
lug 25
3863
1
mag 25
788
0
mag 25
731
2
nov 24
1991