Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
3637 Weergaven

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.

Avatar
Annuleer
Beste antwoord

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
Avatar
Annuleer
Auteur

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

Auteur

For you , What is the best solution?

Auteur

Could you give me an example to create it?

i update in answer

Auteur

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

Gerelateerde posts Antwoorden Weergaven Activiteit
0
aug. 25
198
0
jun. 25
749
3
mei 25
1864
0
apr. 25
3
0
apr. 25
842