콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
8649 화면

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
3481
naked domain set up 해결 완료
3
7월 25
4371
1
5월 25
995
0
5월 25
903
2
11월 24
2205