Here is my error
File "/usr/share/pyshared/simplejson/encoder.py", line 202, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: browse_record(bpl.division.n.registration, 1) is not JSON serializable
Here is my relation mapping table
class company_estate_division(osv.osv):
_name = 'bpl.company.estate.division'
_description = 'bpl company estate division mapping'
_columns = {
'bpl_estate_id': fields.many2one('bpl.estate.n.registration', 'Estate', select=True),
'bpl_division': fields.related('bpl_estate_id', 'divisions', type='char', string='Estate & Division'),
}
And here shows my division and estate model classes.
class estate_new_registration(osv.osv):
_name = "bpl.estate.n.registration"
_description = "Estates"
_columns = {
'name': fields.char('Estate Name', size=128, required=True),
'company_id': fields.many2one('res.company', 'Company Name', select=True),
'divisions': fields.one2many('bpl.division.n.registration', 'estate_id', 'Division')
}
class division_new_registration(osv.osv):
_name = "bpl.division.n.registration"
_description = "Divisions"
_columns = {
'name': fields.char('Division Name', size=128, required=True),
'estate_id': fields.many2one('bpl.estate.n.registration', 'Estate Name', select=True),
}
I need to map company
to estates
. (company one-to-many estates)
I think using related fields is easier than others for this mapping. Please help.