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

I need hidden a button in a odoo 8 view if a contact belong to a company.

my_model.py
'conctact_id': fields.many2one('res.partner', 'Contact'),
'company_id': fields.many2one('res.partner', 'Company'),

I need something like this.

myview.xml
<button name="assignate_company_to_contact" type="object" string="Set Company" attrs="{'invisible': [('conctact_id.parent_id.id','!=','company_id.id')]}" />
<field name="conctact_id"/> 
<field name="company_id"/>

But this don't work, and made more complicate logic with on_change and related fields its my last option.

Any good idea?


아바타
취소

Try creating a related field for parent and compare it with company_id

작성자

I created but even I can not say

<button name="assignate_company_to_contact" type="object" string="Set Company" attrs="{'invisible': [('parent_name','=','company_name')]}" />

관련 게시물 답글 화면 활동
4
10월 21
80116
1
9월 16
10747
1
3월 25
1028
1
11월 20
4566
1
6월 17
5439