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

I have a selection field that have 4 value:

'request_state': fields.selection([('buy','buy'),('available_in_stock','available in stock'),('lack_of_liquidity','lack of liquidity') ,('cancel','cancel') ,('disagreement_with_organization','disagreement with organization')], 'request state' )

I want show another field based on  'request_state'  if it is buy OR available_in_stock

 My xml code is

<field name="evaluation" attrs="{'invisible': ['&amp;',('request_state','not in','buy'),('request_state','not in','available_in_stock')}"  />

That work correct but if I use

<field name="evaluation" attrs="{'invisible': ['|',('request_state','not in','buy'),('request_state','not in','available_in_stock')}"  />

That work  and logic (buy and available_in_stock)

my problem is if I use OR  it’s apply and logic and if I use AND it’s apply or logic

* I use openerp v6

아바타
취소

Hope this one helps you: https://goo.gl/BCxCpk

베스트 답변

hello,

1. if you use OR it means either conditionA or conditionB is satisfying

2. if you use AND it means ConiditionA and ConditionB both are must be satisfying so request_state not in buy state and request_state not in available_in_stock. 
Thank you

아바타
취소
베스트 답변

Hi,

How invisible field work is

"{'invisible': conditions_to_be_invisible}"
Here I think you are confused with logical operators.

What you need is make a field visible based on ConditionA OR ConditionB.

but what you have written is make invisible based on ConditionA AND Condition.

both are the same.

Thank You

아바타
취소
관련 게시물 답글 화면 활동
1
3월 15
10581
1
10월 23
96
2
2월 25
1328
0
9월 23
4
0
11월 22
20