跳至内容
菜单
此问题已终结

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
79891
1
9月 16
10558
1
3月 25
865
1
11月 20
4447
1
6月 17
5253