Odoo Help

Welcome!

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.

0

Server Action Based on M2O Field Selection

By
Edward Nash
on 5/4/16, 3:58 PM 293 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?

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)

Stats

Asked: 5/4/16, 3:58 PM
Seen: 293 times
Last updated: 5/5/16, 1:16 AM