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

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -