To create writer function in openerp you have to override the create and write methods, as show in example below.
Example:- use this code to write and override function in openerp
def write(self, cr, uid, ids, values, context = None):
res = super(MyChildClass, self).write(cr, uid, ids, values, context = context)
if 'child_field' in values:
for child_item in self.browse(cr, uid, ids, context = context):
self.pool.get('my.parent.model').write(cr, uid, [child_item.parent_id.id], {'parent_field': values['child_field'],}, context = context)
return res
0 Comment(s)