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