Odoo Help


Server Action Based on M2O Field Selection

Edward Nash
on 5/4/16, 3:58 PM 645 views

I'm working with the CRM module. I have a form view with two fields. A "x_link_call_to" field (M2O) and an "email_from" field (char). The "x_link_call_to" field is related to model "x_link_call_to". This model has "x_name" and "x_email" as fields. "x_name" contains the names shown in the "link call" field. 

I need to write a server action that will take the email from the "x_link_call_to" model and put it in the "email_from" field, based on what name is selected on the "link call" field. 

I created a server action to execute what I believe is the right python code, but it does not work: object.x_link_call_to and object.x_link_call_to.x_name and object.x_link_call_to.x_name.x_email and object.write ({ 'email_from': object.x_link_call_to.x_name.x_email})

Can someone please advise on a solution?

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: 5/4/16, 3:58 PM
Seen: 645 times
Last updated: 5/5/16, 1:16 AM