This question has been flagged
1 Reply
3699 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 ??

Avatar
Discard
Best Answer

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')

Avatar
Discard
Author

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