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.

107 lines
4.7 KiB

  1. -
  2. In order to test the Excel General Ledger webkit wizard I will print report on all the journals
  3. -
  4. !python {model: account.account}: |
  5. ctx = {}
  6. fiscalyear_id = self.pool['account.fiscalyear'].search(cr, uid, [])[0]
  7. wizard = self.pool['account.print.journal.xls']
  8. period_ids = wizard.fy_period_ids(cr, uid, fiscalyear_id)
  9. data_dict = {'chart_account_id': ref('account.chart0'),
  10. 'journal_ids': self.pool['account.journal'].search(cr, uid, []),
  11. 'fiscalyear_id': fiscalyear_id,
  12. 'period_from': period_ids[0],
  13. 'period_to': period_ids[-1],
  14. }
  15. ctx.update({'model': 'account.account',
  16. 'active_ids': [ref('account.chart0')],
  17. 'active_id': ref('account.chart0')})
  18. from openerp.tools import test_reports
  19. test_reports.try_report_action(
  20. cr, uid,
  21. 'account_journal_report_xls.action_print_journal_by_period_xls',
  22. wiz_data=data_dict,
  23. context=ctx,
  24. wiz_buttons='print_report',
  25. our_module='account_journal_report_xls')
  26. -
  27. In order to test the Excel General Ledger webkit wizard I will print report with entries sorted by date
  28. -
  29. !python {model: account.account}: |
  30. ctx = {}
  31. fiscalyear_id = self.pool['account.fiscalyear'].search(cr, uid, [])[0]
  32. wizard = self.pool['account.print.journal.xls']
  33. period_ids = wizard.fy_period_ids(cr, uid, fiscalyear_id)
  34. data_dict = {'chart_account_id': ref('account.chart0'),
  35. 'journal_ids': self.pool['account.journal'].search(cr, uid, []),
  36. 'sort_selection': 'l.date',
  37. 'fiscalyear_id': fiscalyear_id,
  38. 'period_from': period_ids[0],
  39. 'period_to': period_ids[-1],
  40. }
  41. ctx.update({'model': 'account.account',
  42. 'active_ids': [ref('account.chart0')],
  43. 'active_id': ref('account.chart0')})
  44. from openerp.tools import test_reports
  45. test_reports.try_report_action(
  46. cr, uid,
  47. 'account_journal_report_xls.action_print_journal_by_period_xls',
  48. wiz_data=data_dict,
  49. context=ctx,
  50. wiz_buttons='print_report',
  51. our_module='account_journal_report_xls')
  52. -
  53. In order to test the Excel General Ledger webkit wizard I will print report without grouped entries
  54. -
  55. !python {model: account.account}: |
  56. ctx = {}
  57. fiscalyear_id = self.pool['account.fiscalyear'].search(cr, uid, [])[0]
  58. wizard = self.pool['account.print.journal.xls']
  59. period_ids = wizard.fy_period_ids(cr, uid, fiscalyear_id)
  60. data_dict = {'chart_account_id': ref('account.chart0'),
  61. 'journal_ids': self.pool['account.journal'].search(cr, uid, []),
  62. 'group_entries': False,
  63. 'fiscalyear_id': fiscalyear_id,
  64. 'period_from': period_ids[0],
  65. 'period_to': period_ids[-1],
  66. }
  67. ctx.update({'model': 'account.account',
  68. 'active_ids': [ref('account.chart0')],
  69. 'active_id': ref('account.chart0')})
  70. from openerp.tools import test_reports
  71. test_reports.try_report_action(
  72. cr, uid,
  73. 'account_journal_report_xls.action_print_journal_by_period_xls',
  74. wiz_data=data_dict,
  75. context=ctx,
  76. wiz_buttons='print_report',
  77. our_module='account_journal_report_xls')
  78. -
  79. In order to test the Excel General Ledger webkit wizard I will print report with currency
  80. -
  81. !python {model: account.account}: |
  82. ctx = {}
  83. fiscalyear_id = self.pool['account.fiscalyear'].search(cr, uid, [])[0]
  84. wizard = self.pool['account.print.journal.xls']
  85. period_ids = wizard.fy_period_ids(cr, uid, fiscalyear_id)
  86. data_dict = {'chart_account_id': ref('account.chart0'),
  87. 'journal_ids': self.pool['account.journal'].search(cr, uid, []),
  88. 'amount_currency': False,
  89. 'fiscalyear_id': fiscalyear_id,
  90. 'period_from': period_ids[0],
  91. 'period_to': period_ids[-1],
  92. }
  93. ctx.update({'model': 'account.account',
  94. 'active_ids': [ref('account.chart0')],
  95. 'active_id': ref('account.chart0')})
  96. from openerp.tools import test_reports
  97. test_reports.try_report_action(
  98. cr, uid,
  99. 'account_journal_report_xls.action_print_journal_by_period_xls',
  100. wiz_data=data_dict,
  101. context=ctx,
  102. wiz_buttons='print_report',
  103. our_module='account_journal_report_xls')