Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ

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?


Ảnh đại diện
Huỷ bỏ

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

Tác giả

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')]}" />

Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 10 21
79959
1
thg 9 16
10640
1
thg 3 25
935
1
thg 11 20
4490
1
thg 6 17
5298