Odoo Help


field.related for country

Shokri Alnajjar
on 8/19/14, 8:39 AM 1,385 views

I'm trying to add a many2one coulumn in stock.picking that refers to res.country

class stock_picking(osv.Model):

    _inherit = 'stock.picking'

    _columns = {

                       'x_country':fields.many2one('res.country','Country of Origin'),


and display the user's selection in stock.move with related field 

'x_country':fields.related('picking_id', 'x_country', type='char' ,relation='stock.picking', store=True, string='Country of Origin'),

but the system is displaying this  browse_record(res.country,12) instead of the country name 

any solutions ??




| 5 5 7
Bikaner, India

OpenERP Developer at SunARC Technology

On 8/19/14, 8:45 AM

Change your code type char into many2one

'x_country':fields.related('picking_id', 'x_country', type='many2one' ,relation='stock.picking', store=True, string='Country of Origin')

thanks man , i had to change the type and relation and it worked

Shokri Alnajjar
on 8/19/14, 9:05 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 8/19/14, 8:39 AM
Seen: 1385 times
Last updated: 3/16/15, 8:10 AM