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

Additionnal several fields in opportunity menu

By
anthony
on 5/7/13, 9:00 AM 747 views

Hi,

In opportunity menu : I created three new fields : licence, support and development I would like to know the total and transfer the values to expected revenue

For example : Licence = 500 Support = 200 Development = 400 Expected revenue = Licence + support + development Expected revenue = 1 100

Do you have an idea? Thanks in advance.

1
jamesbale
On 5/7/13, 9:07 AM

You can make Expected revenue a functional field which contain total of all there fields or you can make onchange method on all there fields on change transfer total value to the Expected revenue field

def expexted_revenue(self, cr, uid, ids, field_name, arg, context=None):
            res = {'planned_revenue': 0.0}
            for line in self.browse(cr, uid, ids, context=context):
                res[line.id]['planned_revenue'] = line.license + line.support + line.development
            return res

Ok, Thanks jamesbale. I received your mail the last time. Thanks

anthony
on 5/7/13, 9:09 AM

For you , What is the best solution?

anthony
on 5/8/13, 1:03 PM

Could you give me an example to create it?

anthony
on 5/8/13, 2:20 PM

i update in answer

jamesbale
on 5/9/13, 8:36 AM

Thanks Jamesbale, it working! I used onchange solution. Thanks a million for you help :)

anthony
on 5/10/13, 6:31 AM

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

0 follower(s)

Stats

Asked: 5/7/13, 9:00 AM
Seen: 747 times
Last updated: 3/16/15, 8:10 AM