Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Projekt
- MRP
To pytanie dostało ostrzeżenie
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
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj się| Powiązane posty | Odpowiedzi | Widoki | Czynność | |
|---|---|---|---|---|
|
How to add a sequence a field?
Rozwiązane
|
|
2
gru 24
|
22343 | |
|
|
0
wrz 24
|
1566 | ||
|
|
3
sie 24
|
3100 | ||
|
|
0
lut 24
|
2263 | ||
|
|
0
lut 24
|
1634 |
how you calculate tax amount?is it tax of subtotal-received in advance?