Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
6439 Widoki

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.   

Awatar
Odrzuć
Najlepsza odpowiedź

Hello Jose,

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

Module 


Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

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

Powiązane posty Odpowiedzi Widoki Czynność
7
maj 20
6440
3
lis 19
10912
1
lip 18
4968
0
kwi 16
3096
2
kwi 15
5983