Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kirjanpito
- Varastointi
- PoS
- Projekti
- MRP
Tämä kysymys on merkitty
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
Nautitko keskustelusta? Älä vain lue, vaan osallistu!
Luo tili jo tänään nauttiaksesi yksinoikeusominaisuuksista ja osallistuaksesi mahtavaan yhteisöömme!
Rekisteröidy| Aiheeseen liittyviä artikkeleita | Vastaukset | Näkymät | Toimenpide | |
|---|---|---|---|---|
|
How to add a sequence a field?
Ratkaistu
|
|
2
jouluk. 24
|
22334 | |
|
|
0
syysk. 24
|
1564 | ||
|
|
3
elok. 24
|
3082 | ||
|
|
0
helmik. 24
|
2254 | ||
|
|
0
helmik. 24
|
1634 |
how you calculate tax amount?is it tax of subtotal-received in advance?