Skip to Content
Menu
This question has been flagged
2587 Views

Hello,

I'm trying to save a field in 2 tables so I had used the function def create but it didn't work could you help please to figure out what's the problem in my code:

class school_parent(osv.osv):

_name='school.parent'

 def create(self, cr, uid, vals, context=None):

result = super(school_parent, self).create(cr, uid, vals, context=context)

parent_obj = self.browse(cr, uid, result, context=context)

parent_type = parent_obj.type 

for parent in parent_obj:

self.pool.get('school.users').write(cr, uid, parent.id, {'type':parent_type})

return result

Thanks

Avatar
Discard