Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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?


Awatar
Odrzuć

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

Autor

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

Powiązane posty Odpowiedzi Widoki Czynność
4
paź 21
80097
1
wrz 16
10734
1
mar 25
1019
1
lis 20
4562
1
cze 17
5427