Se rendre au contenu
Menu
Cette question a été signalée
3 Réponses
5779 Vues

Hi,


in an invoice, when you change the discount on a line, amount of the line and of the invoice is automatically recalculated.


I would like to do the same by clicking on a button that i've added in the invoice form view. 

Probably by calling the same function than the automatic way.


Is anybody know how to do that?


Vincent

Avatar
Ignorer
Meilleure réponse

I don't know the version, but in your button click you can add some custom code like in V13,

for line in self.move_line_ids:

    line._onchange_price_subtotal()

Avatar
Ignorer
Auteur Meilleure réponse

Hello Abdalmola Mustapha,

Sorry i don't understood your answer.

Could you explain differently or share an example please.

Vincent

Avatar
Ignorer
Meilleure réponse

in line automatic calculate but if only if customize in method calculate  to stop auto discount
after that using your method to calculate discount

Avatar
Ignorer
Publications associées Réponses Vues Activité
2
mai 25
1153
0
mars 15
3390
2
mars 15
6709
1
juil. 25
707
2
juil. 25
810