Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
8608 Переглядів

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 

Аватар
Відмінити
Найкраща відповідь

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


Аватар
Відмінити
Автор Найкраща відповідь

Hi Ahmed,

I tried your line but it did not work

Thnaks

Аватар
Відмінити

can you post your code ?

Найкраща відповідь

Hello,

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

Regards,

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
бер. 15
3458
naked domain set up Вирішено
3
лип. 25
4315
1
трав. 25
987
0
трав. 25
883
2
лист. 24
2190