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

Hello, I want to automatically calculate the subtotal with taxes in each line of sale.order. 

I added a column "subtotal_with_taxes" and then I define this method (the two things in sale.order.line model):

@api.onchange('WHAT?') 
def change_subtotal_with_taxes(self):
I want to execute this method every time when user presses "update" in the sale.order but I didn't see the way. How can I do this? I try with api.onchange('id') but not works, also I try api.onchange('price_subtotal') but not works because 'price_subtotal' is function field.   

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

Hello Jose,

Try below link module it will help you to solve your problem,

Module 


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

In this case, that is easier, you inherit method button_dummy(), this will work the same way.

Ảnh đại diện
Huỷ bỏ
Tác giả

Yes, it works. But if the user presses "Save" without pressing "(update)" the method is not called. How can I solve this?

Bài viết liên quan Trả lời Lượt xem Hoạt động
7
thg 5 20
6228
3
thg 11 19
10740
1
thg 7 18
4861
0
thg 4 16
2942
2
thg 4 15
5785