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.

54 lines
1.7 KiB

  1. # -*- coding: utf-8 -*-
  2. # Author: Julien Coux
  3. # Copyright 2016 Camptocamp SA
  4. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  5. import time
  6. from . import abstract_test
  7. class TestTrialBalance(abstract_test.AbstractTest):
  8. """
  9. Technical tests for Trial Balance Report.
  10. """
  11. def _getReportModel(self):
  12. return self.env['report_trial_balance_qweb']
  13. def _getQwebReportName(self):
  14. return 'account_financial_report_qweb.report_trial_balance_qweb'
  15. def _getXlsxReportName(self):
  16. return 'account_financial_report_qweb.report_trial_balance_xlsx'
  17. def _getXlsxReportActionName(self):
  18. return 'account_financial_report_qweb.action_report_trial_balance_xlsx'
  19. def _getReportTitle(self):
  20. return 'Trial Balance'
  21. def _getBaseFilters(self):
  22. return {
  23. 'date_from': time.strftime('%Y-01-01'),
  24. 'date_to': time.strftime('%Y-12-31'),
  25. 'company_id': self.env.ref('base.main_company').id,
  26. 'fy_start_date': time.strftime('%Y-01-01'),
  27. }
  28. def _getAdditionalFiltersToBeTested(self):
  29. return [
  30. {'only_posted_moves': True},
  31. {'hide_account_balance_at_0': True},
  32. {'show_partner_details': True},
  33. {'only_posted_moves': True, 'hide_account_balance_at_0': True},
  34. {'only_posted_moves': True, 'show_partner_details': True},
  35. {'hide_account_balance_at_0': True, 'show_partner_details': True},
  36. {
  37. 'only_posted_moves': True,
  38. 'hide_account_balance_at_0': True,
  39. 'show_partner_details': True
  40. },
  41. ]
  42. def _partner_test_is_possible(self, filters):
  43. return 'show_partner_details' in filters