Skip to Content
Menu
This question has been flagged
1 Reply
3162 Views

I want to change contact's owner(res.partner's user_id field) along with its parent customer when changing this customer's salesperson. 

I tried onchange function and compute field, but no luck.

Any help or suggestion?

I am using odoo v8.

Avatar
Discard
Author Best Answer

The solution is easier than i thought from the beginning 

I just overrided write() method, just as below:

@api.multi
def write(self, vals):
    super(res_partner, self).write(vals)
    if 'user_id' in vals.keys():
        for contact in self.child_ids:
            contact.write(vals)
    return True



Avatar
Discard