コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
7436 ビュー

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

アバター
破棄
関連投稿 返信 ビュー 活動
1
1月 20
4946
0
3月 20
4272
2
10月 22
9927
0
6月 18
2692
3
4月 18
6266