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.

51 lines
1.5 KiB

  1. # Copyright 2018 Forest and Biomass Romania
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  3. from odoo import _, models
  4. class VATReportXslx(models.AbstractModel):
  5. _name = 'report.a_f_r.report_vat_report_xlsx'
  6. _inherit = 'report.account_financial_report.abstract_report_xlsx'
  7. def _get_report_name(self):
  8. return _('VAT Report')
  9. def _get_report_columns(self, report):
  10. return {
  11. 0: {'header': _('Code'), 'field': 'code', 'width': 5},
  12. 1: {'header': _('Name'), 'field': 'name', 'width': 100},
  13. 2: {'header': _('Net'),
  14. 'field': 'net',
  15. 'type': 'amount',
  16. 'width': 14},
  17. 3: {'header': _('Tax'),
  18. 'field': 'tax',
  19. 'type': 'amount',
  20. 'width': 14},
  21. }
  22. def _get_report_filters(self, report):
  23. return [
  24. [_('Date from'), report.date_from],
  25. [_('Date to'), report.date_to],
  26. [_('Based on'), report.based_on],
  27. ]
  28. def _get_col_count_filter_name(self):
  29. return 0
  30. def _get_col_count_filter_value(self):
  31. return 2
  32. def _generate_report_content(self, workbook, report):
  33. # For each taxtag
  34. self.write_array_header()
  35. for taxtag in report.taxtags_ids:
  36. # Write taxtag line
  37. self.write_line(taxtag)
  38. # For each tax if detail taxes
  39. if report.tax_detail:
  40. for tax in taxtag.tax_ids:
  41. self.write_line(tax)