Odoo Help

0

Update field from another table

By
Jihen BEN ALI
on 3/15/16, 1:10 PM 549 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

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.

Register

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)

Stats

Asked: 3/15/16, 1:10 PM
Seen: 549 times
Last updated: 3/15/16, 1:57 PM