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

I'm testing how to make the create "add a product" element of the sale.order.form view invisible in case the status of the sales order is draft or sent. I'm not getting the following rule to be met inside the element:

<create string = "Add a product" attrs = "{'invisible': [('state', 'not in', ['draft', 'sent'])]}" />

But I can't make it happen.

아바타
취소
베스트 답변

Hi,
Try this.

<field name="order_line" 
attrs="{'readonly':[('state', 'not in', ['draft','sent'])]}">

Thank you

아바타
취소
작성자

hello Kripal

This attrs is correct for the "field" tag but not for the "create" tag, I suppose it must be another syntax so that these types of rules or attributes can be applied.

베스트 답변

Hello Franklin

If you want to invisible "Add a Product" then use like this
I think it's helpful for you.

Ex.
<xpath expr="//field[@name='order_line']/tree/control/create[1]" position="attributes">
                <attribute name="invisible">1</attribute>
            </xpath>

아바타
취소
작성자

Hello Nikul Chaudhary

I don't want "Add a product" to be permanently invisible, but to be invisible when state is draft or sent. Also I think xpath is used only when inheriting a model. In this case I am directly editing the source model. If you could help me with those parameters I will be very grateful.

관련 게시물 답글 화면 활동
4
9월 20
3777
2
9월 21
5670
1
7월 19
3047
1
5월 16
6133
2
3월 15
8888