openerp - How to take out 'contact' values from a 'Many2one' field in Odoo? -
any many2one field either linked hr.employee or res.users shows values home addresses or contacts in many2one drop down tool. has suggestion on how stop ?
you can use domain filter avoid unwanted results.
for eg:- in sale order see customers although related object res.patner, because of domain filter( please see code )
<field name="partner_id" on_change="onchange_partner_id(partner_id, context)" domain="[('customer','=',true)]" context="{'search_default_customer':1, 'show_address': 1}" options='{"always_reload": true}'/>
here domain filter " domain="[('customer','=',true)]" "
ie. records customer field true shown
from comments:- if want see system users user res.users instead of res.partner. like:-
'user_id' : fields.many2one('res.users', 'user')
hope helps.
Comments
Post a Comment