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

automated server actions to set fields onchange of other fields

By
Alexander Soare
on 6/9/16, 11:57 AM 339 views

to start with I just want to be able to set a char field in a res.partner object given that the 'supplier' boolean is set to true. So far I know that I can use automated actions to call a server action when the supplier field is changed. I don't know how to write the python code for the server action. And I don't know how to only execute it if the boolean is true. Could I please get some pointers on this?

please elaborate your query ," I just want to be able to set a char field in a res.partner object given that the 'supplier' boolean is set to true" and "And I don't know how to only execute it if the boolean is true"

Prakash Sharma
on 6/10/16, 12:57 PM

@Prakash Sharma does my response below make more sense?

Alexander Soare
on 6/14/16, 10:57 AM
0
Alexander Soare
On 6/13/16, 5:36 AM

Let me be more clear. In the res.partner.form view the user can tick or untick the checkbox which says that the contact is a 'Vendor' (by default the model calls this field 'supplier' and it is a boolean). I want to be able to set the value of a custom char field to 'whatever' if the 'supplier' boolean is set to true, otherwise I want that char field empty. This is all just a stepping stone for me to eventually be able to do something more complex but I'll omit that as I don't want to add complexity here.

So far I know that I can use automated actions to call a server action when the 'supplier' field is changed. I don't know how to write the python code for the server action. Could I please get some pointers on this?

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: 6/9/16, 11:57 AM
Seen: 339 times
Last updated: 6/13/16, 5:36 AM