Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
7494 มุมมอง

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.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน

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

คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ม.ค. 20
5043
0
มี.ค. 20
4381
2
ต.ค. 22
10023
0
มิ.ย. 18
2743
3
เม.ย. 18
6314