İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
7395 Görünümler

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
Vazgeç
En İyi Yanıt

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

Avatar
Vazgeç
Üretici

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

En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Oca 20
4927
0
Mar 20
4245
2
Eki 22
9882
0
Haz 18
2678
3
Nis 18
6253