Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
7432 Visualizzazioni

Hi, 

I want to show price_subtotal without any discount. Price subtotal is automatically calculated as discount in Odoo. How can I change that? I  want to sum discount for order line at the bottom.

Avatar
Abbandona
Risposta migliore

You will need to override account invoice class method that is responsible for sub price computation, the method name is  _compute_price(self):

Avatar
Abbandona
Autore

Will this affect tax total when I do this. Because there are many operations in this method.

It depends on the way the database was configured. But mostly discount are not taxable

Risposta migliore

you can d o this in by inheriting the sale.order.line

@api.depends('product_uom_qty', 'discount', 'price_unit', 'tax_id')
def _compute_amount(self):
res = super(InheritSaleOrderLine, self)._compute_amount()
"""
Compute the amounts of the SO line.
"""
for line in self:
line.price_subtotal = (Here you can give your own value)

return res

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
gen 20
4945
0
mar 20
4270
2
ott 22
9918
0
giu 18
2691
3
apr 18
6266