Skip to Content
Menu
This question has been flagged
3 Replies
8463 Rodiniai

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 

Portretas
Atmesti
Best Answer

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


Portretas
Atmesti
Autorius Best Answer

Hi Ahmed,

I tried your line but it did not work

Thnaks

Portretas
Atmesti

can you post your code ?

Best Answer

Hello,

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

Regards,

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
kov. 15
3372
3
liep. 25
3939
1
geg. 25
833
0
geg. 25
761
2
lapkr. 24
2033