Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客戶關係
- e-Commerce
- 會計
- 庫存
- PoS
- 專案管理
- MRP
此問題已被標幟
Hello,
Please try this code,
@api.depends('product_uom_qty', 'discount', 'price_unit', 'tax_id','receive_in_advance')
def _compute_amount(self):
"""Compute the amounts of the SO line."""
for line in self:
price = line.price_unit * (1 - (line.discount or 0.0) / 100.0)
if line.product_uom_qty and line.receive_in_advance:
price = price - (line.receive_in_advance/line.product_uom_qty)
taxes = line.tax_id.compute_all(price, line.order_id.currency_id, line.product_uom_qty, product=line.product_id, partner=line.order_id.partner_shipping_id)
line.update({
'price_tax': sum(t.get('amount', 0.0) for t in taxes.get('taxes', [])),
'price_total': taxes['total_included'],
'price_subtotal': taxes['total_excluded'],
})
If you use UOM, then please change the code accordingly.
Hope this will help you,
Thanks
| 相關帖文 | 回覆 | 瀏覽次數 | 活動 | |
|---|---|---|---|---|
|
|
2
12月 24
|
22330 | ||
|
|
0
9月 24
|
1561 | ||
|
|
3
8月 24
|
3079 | ||
|
|
0
2月 24
|
2251 | ||
|
|
0
2月 24
|
1632 |
how you calculate tax amount?is it tax of subtotal-received in advance?