Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
4758 Vizualizări

I need to print tax amount in every line based on tax percentage given in each line in invoice.

Kindly help me here!

Imagine profil
Abandonează

Please mention the version.

Autor

Version 14

Cel mai bun răspuns

Hello Sakthi Priya,

Hope you are doing well.

To print tax amount in every line based on tax percentage given in each line in invoice, you have to add new Monetary field into account.move.line model and display into invoice line tree view and also you have to write one onchange method based on tax_ids like below.

class AccountMoveLine(models.Model):
_inherit = 'account.move.line'

tax_amount_line = fields.Monetary(string='Total Amount', store=True, readonly=True,
currency_field='currency_id')

@api.onchange('tax_ids')
def check_tax_amount(self):
for rec in self:
if rec.tax_ids:
for tax in rec.tax_ids:
rec.tax_amount_line += (rec.price_unit * tax.amount) / 100
else:
rec.tax_amount_line = 0

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwar

Imagine profil
Abandonează

thanks a lot, you are the man!

but a little correction, you need to multiply again by rec.quantity

Related Posts Răspunsuri Vizualizări Activitate
2
aug. 25
2536
1
iul. 25
951
1
aug. 25
1151
0
mai 25
1397
2
apr. 25
3591