Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3620 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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
Ảnh đại diện
Huỷ bỏ
Tác giả

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

Tác giả

For you , What is the best solution?

Tác giả

Could you give me an example to create it?

i update in answer

Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 8 25
191
0
thg 6 25
746
3
thg 5 25
1858
0
thg 4 25
3
0
thg 4 25
838