コンテンツへスキップ
メニュー
この質問にフラグが付けられました

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
79909
1
9月 16
10571
1
3月 25
878
1
11月 20
4460
1
6月 17
5274