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.

98 lines
5.8 KiB

  1. -
  2. I first fix the demo periods (7.0 only)
  3. see https://code.launchpad.net/~acsone-openerp/openobject-addons/7.0-bug-1281579-sbi/+merge/207311
  4. which was merged in 8.0
  5. -
  6. !python {model: account.period}: |
  7. import time
  8. if not self.search(cr, uid, [('special', '=', False),
  9. ('fiscalyear_id', '=', ref('account.data_fiscalyear')),
  10. ('company_id', '=', ref('base.main_company'))]):
  11. cur_year = time.strftime('%Y')
  12. self.create(cr, uid, {
  13. 'code': '00/' + cur_year,
  14. 'name': 'X 00/' + cur_year,
  15. 'special': True,
  16. 'fiscalyear_id': ref('account.data_fiscalyear'),
  17. 'date_start': cur_year + '-01-01',
  18. 'date_stop': cur_year + '-01-01',
  19. 'company_id': ref('base.main_company'),
  20. })
  21. self.write(cr, uid, ref('account.period_1'), {'special': False})
  22. self.write(cr, uid, ref('account.period_2'), {'special': False})
  23. self.write(cr, uid, ref('account.period_3'), {'special': False})
  24. self.write(cr, uid, ref('account.period_4'), {'special': False})
  25. self.write(cr, uid, ref('account.period_5'), {'special': False})
  26. self.write(cr, uid, ref('account.period_6'), {'special': False})
  27. self.write(cr, uid, ref('account.period_7'), {'special': False})
  28. self.write(cr, uid, ref('account.period_8'), {'special': False})
  29. self.write(cr, uid, ref('account.period_9'), {'special': False})
  30. self.write(cr, uid, ref('account.period_10'), {'special': False})
  31. self.write(cr, uid, ref('account.period_11'), {'special': False})
  32. self.write(cr, uid, ref('account.period_12'), {'special': False})
  33. -
  34. In order to test the PDF General Ledger webkit wizard I will print report with default setting
  35. -
  36. !python {model: account.account}: |
  37. ctx={}
  38. data_dict = {'chart_account_id':ref('account.chart0')}
  39. ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
  40. from tools import test_reports
  41. test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit')
  42. -
  43. In order to test the PDF General Ledger webkit wizard I will print report with posted move
  44. -
  45. !python {model: account.account}: |
  46. ctx={}
  47. data_dict = {'chart_account_id':ref('account.chart0'), 'target_move': 'posted'}
  48. ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
  49. from tools import test_reports
  50. test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit')
  51. -
  52. In order to test the PDF General Ledger webkit wizard I will print report with transactions or non zero balance
  53. -
  54. !python {model: account.account}: |
  55. ctx={}
  56. data_dict = {'chart_account_id':ref('account.chart0'), 'display_account': 'bal_mix'}
  57. ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
  58. from tools import test_reports
  59. test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit')
  60. -
  61. In order to test the PDF General Ledger webkit wizard I will print report with inital balance and currency ammount
  62. -
  63. !python {model: account.account}: |
  64. ctx={}
  65. data_dict = {'chart_account_id':ref('account.chart0'), 'amount_currency': 1}
  66. ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
  67. from tools import test_reports
  68. test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit')
  69. #Filter by date
  70. -
  71. In order to test the PDF General Ledger webkit wizard I will print report with inital balance and currency ammount and I filter by date of the first tree month
  72. -
  73. !python {model: account.account}: |
  74. from datetime import datetime
  75. ctx={}
  76. data_dict = {'chart_account_id':ref('account.chart0'),'amount_currency': 1, 'chart_account_id': 1, 'date_from': '%s-01-01' %(datetime.now().year),
  77. 'date_to':'%s-04-01' %(datetime.now().year), 'display_account': 'bal_all', 'filter': 'filter_date',}
  78. ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
  79. from tools import test_reports
  80. test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit')
  81. -
  82. In order to test the PDF General Ledger webkit wizard I will print report with inital balance and currency ammount and I filter by date of the first tree month
  83. -
  84. !python {model: account.account}: |
  85. from datetime import datetime
  86. ctx={}
  87. data_dict = {'chart_account_id':ref('account.chart0'),'amount_currency': 1, 'chart_account_id': 1, 'date_from': '%s-01-01' %(datetime.now().year),
  88. 'date_to':'%s-04-01' %(datetime.now().year), 'display_account': 'bal_all', 'filter': 'filter_date',}
  89. ctx.update({'model': 'account.account','active_ids':[ref('account.chart0')],'active_id':ref('account.chart0')})
  90. from tools import test_reports
  91. test_reports.try_report_action(cr, uid, 'action_account_general_ledger_menu_webkit',wiz_data=data_dict, context=ctx, our_module='account_financial_report_webkit')
  92. # I still have to parse report content but for this I need accounting data on multiple exercises and faor all fiscal year