跳至内容
菜单
此问题已终结
3 回复
8421 查看

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,

形象
丢弃
相关帖文 回复 查看 活动
1
3月 15
3344
3
7月 25
3879
1
5月 25
798
0
5月 25
737
2
11月 24
2001