Odoo Help

0

How to change contact's owner(user_id) along with his parent customer?

By
jianxin
on 11/10/15, 8:40 PM 537 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.

0
jianxin
On 11/11/15, 1:32 AM

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



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: 11/10/15, 8:40 PM
Seen: 537 times
Last updated: 11/11/15, 2:11 AM