Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

When printing Invoices wrong table of taxes is printed.

By
Anabela Damas
on 9/4/13, 3:43 PM 1,948 views

Hi,

I've done one invoice with several products and different taxes. When printing the invoice I was expecting to see a table with all taxes that I used and the value to witch tax, But I've this: image description So, in the table just appear the IVA23 and the other taxes are ignored.

I open the report with OpenOffice and I saw the cicle for the table of taxes but in the pdf just appear one.

In report:

Tax [[ o.tax_line==[] and removeParentNode('blockTable') ]]
Base 
Amount 

[[ repeatIn(o.tax_line,'t') ]]
[[ t.name ]] 
[[ formatLang(t.base, digits=get_digits(dp='Account'))   ]] [[ o.currency_id.symbol ]]
[[  (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount, digits=get_digits(dp='Account'))   ]] [[ o.currency_id.symbol ]]

Thanks

I have the same problem, did you find any solution?

evon_dun
on 3/6/14, 5:14 AM
0
Anabela Damas
On 3/6/14, 5:29 AM

Hi,

I solve this a long time ago, and I forget to put the solution here. I look for the code that fixes the bug and by the comments, I think is this:

class account_invoice(osv.osv):
    _inherit = "account.invoice"    

   def check_tax_lines(self, cr, uid, inv, compute_taxes, ait_obj):
        if not inv.tax_line:
            for tax in compute_taxes.values():
                ait_obj.create(cr, uid, tax)
        else:
            tax_key = []
            for tax in inv.tax_line:
                if tax.manual:
                    continue
                #IDI
                #key = (tax.tax_code_id.id, tax.base_code_id.id, tax.account_id.id, tax.account_analytic_id.id)
                key = (tax.name, tax.vi_tax_id.id, tax.tax_code_id.id, tax.base_code_id.id, tax.account_id.id, tax.account_analytic_id.id)
                tax_key.append(key)
                if not key in compute_taxes:
                    raise osv.except_osv(_('Warning!'), _('Global taxes defined, but they are not in invoice lines !'))
                base = compute_taxes[key]['base']
                if abs(base - tax.base) > inv.company_id.currency_id.rounding:
                    raise osv.except_osv(_('Warning!'), _('Tax base different!\nClick on compute to update the tax base.'))
            for key in compute_taxes:
                if not key in tax_key:
                    raise osv.except_osv(_('Warning!'), _('Taxes are missing!\nClick on compute button.'))
account_invoice()

I think that is just this. Good luck. =)

I've update the code put nothing happend. The RML file need to be modified in someway too? Stop-Start server and compile the file too.

Wuiler
on 10/29/14, 11:28 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 9/4/13, 3:43 PM
Seen: 1948 times
Last updated: 3/16/15, 8:10 AM