You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.1 KiB

  1. # -*- encoding: utf-8 -*-
  2. ##############################################################################
  3. # For copyright and license notices, see __openerp__.py file in root directory
  4. ##############################################################################
  5. from openerp import models
  6. from openerp.addons.account.report.report_vat import tax_report
  7. from functools import partial
  8. class TaxReport(tax_report):
  9. def __init__(self, cr, uid, name, context=None):
  10. super(TaxReport, self).__init__(cr, uid, name, context=context)
  11. self.localcontext.update({
  12. 'get_lines': partial(self._get_lines, context=context),
  13. })
  14. def _get_lines(self, based_on, company_id=False, parent=False, level=0,
  15. context=None):
  16. result = super(TaxReport, self)._get_lines(
  17. based_on, company_id=company_id, parent=parent, level=level,
  18. context=context)
  19. return filter(lambda x: x['tax_amount'], result)
  20. class ReportVat(models.AbstractModel):
  21. _inherit = 'report.account.report_vat'
  22. _wrapped_report_class = TaxReport