Odoo Help

Welcome!

This community 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.

0

AttributeError: 'browse_record_list' object has no attribute 'country_code' [Closed]

By
Odoo
on 11/6/14, 5:28 AM 649 views

The Question has been closed for reason: duplicate question

by
Odoo
on 11/06/2014 09:15:44

 

class mother_tongue(osv.osv):
    _name = 'test.test'

    _columns = {'address_type':fields.selection([('physical', 'Physical Address'), ('mailing', 'Mailing Address')], 'Address Type'),

'account_name':fields.char('Account Name'),
                'contact_name':fields.char('Contact Name',readonly=True),

     
            
    }

 

def onchange_partner(self, cr, uid, ids,address_type, context=None):
        res = {}
        obj = self.pool.get('res.partner').browse(cr,uid,ids,address_type)
        if address_type=='physical':
            res['account_name'] = obj.name
            res['contact_name'] = obj.country_code
        return {'value':res}

can you please explain your use???? so that viewers can understand use...

Baiju
on 11/6/14, 8:26 AM
0
Anand
On 11/6/14, 6:50 AM

Country_code is not available in res.partner..

so use obj.country_id.id

ping me if u get prob solved,,,

no same issue .country_id does not exist

Odoo
on 11/6/14, 7:05 AM

have you used .country_id.id

Anand
on 11/6/14, 7:10 AM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 11/6/14, 5:28 AM
Seen: 649 times
Last updated: 3/16/15, 8:10 AM