Odoo Help


Update field from another table

on 3/15/16, 1:10 PM 358 views


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


 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


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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.


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)


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