Odoo Help


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.


Update field from another table

on 3/15/16, 1:10 PM 228 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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


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