CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I have a many2one field in my shipping_line class that refers to res_partner_id. In my view, I want to show only the companies, not all the partners. I know that it's related to the boolean field names 'is_company'.
I tried this by creating a fields.related field in shipping_line, like this :
'partner_is_company': fields.related('partner_id', 'res_partner_is_company', type='boolean', store=True)
In my view, I've added a domain :
<field name="partner_id" domain="[('partner_is_company', '==', True)]" />
I don't know what's wrong, I'm kind of new (you can see that in my others Q...)
So I have this error for now :
(...) ValueError: Invalid leaf ['partner_is_company', '==', True]
If someone can help me with this, I'll be very gratefull !
in the domain function not is valid the equal double sign
<field name="partner_id" domain="[('partner_is_company', '=', True)]" />
although not is necessary the "related" field
> 'partner_is_company': fields.many2one('res.partner', 'Partner Company', domain=[('is_company', '=', True)])
About This Community
Odoo Training Center
|Asked: 12/3/13, 12:52 PM|
|Seen: 2345 times|
|Last updated: 3/16/15, 8:10 AM|