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

Hello All,

I have two module which override _amount_all method of sale.order.

Here is the code of default method .

@api.depends('order_line.price_total')
def _amount_all(self):
    """
    Compute the total amounts of the SO.
    """
    for order in self:
        amount_untaxed = amount_tax = 0.0
        for line in order.order_line:
            amount_untaxed += line.price_subtotal
            amount_tax += line.price_tax
        order.update({
            'amount_untaxed': amount_untaxed,
            'amount_tax': amount_tax,
            'amount_total': amount_untaxed + amount_tax,
        })


How can i override this method to successfully archived updation of value without replace whole method.

both method do some operation on amount_untaxed, taxed and amount tax and update amount_untaxed,amount_tax and amount_total based on calculation.







Awatar
Odrzuć
Najlepsza odpowiedź

same problem !!!!!!!!!!!!!!!

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
lis 23
17515
3
lis 24
25152
1
kwi 23
6200
2
gru 22
6956
1
lis 22
4090