Broken yml test in account_payment account_financial_report_webkit

Bug #1281579 reported by Laurent Mignon (Acsone) on 2014-02-18
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Account - Financial Report
Undecided
Unassigned
Odoo Addons (MOVED TO GITHUB)
New
Undecided
Unassigned
OpenERP Community Backports (Addons)
Undecided
Unassigned

Bug Description

When tests are launched with the openerp-command with './bin/openerp_command initialize --no-create --tests --database openerp_test --module account_financial_report_webkit', the test 'tests/general_ledger.yml' fails with the following stacktrace:
2014-02-18 12:47:11,674 12627 ERROR openerp_test openerp.tools.yaml_import: (u'No period found', '')
Traceback (most recent call last):
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/tools/yaml_import.py", line 874, in process
    self._process_node(node)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/tools/yaml_import.py", line 887, in _process_node
    self.process_python(node)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/tools/yaml_import.py", line 560, in process_python
    unsafe_eval(code_obj, {'ref': self.get_id}, code_context)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/addons-account-financial-report/account_financial_report_webkit/tests/general_ledger.yml", line 5, in <module>
    ctx={}
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/tools/test_reports.py", line 294, in try_report_action
    result = _exec_action(action, datas, context)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/tools/test_reports.py", line 278, in _exec_action
    res = try_report(cr, uid, 'report.'+action['report_name'], ids, datas, context, our_module=our_module)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/tools/test_reports.py", line 53, in try_report
    res = netsvc.LocalService(rname).create(cr, uid, ids, data, context)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/addons/report_webkit/webkit_report.py", line 340, in create
    result = self.create_source_pdf(cursor, uid, ids, data, report_xml, context)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/report/report_sxw.py", line 511, in create_source_pdf
    return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/addons/report_webkit/webkit_report.py", line 222, in create_single_pdf
    self.parser_instance.set_context(objs, data, ids, report_xml.report_type)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/addons-account-financial-report/account_financial_report_webkit/report/general_ledger.py", line 90, in set_context
    start_period = self.get_first_fiscalyear_period(fiscalyear)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/addons-account-financial-report/account_financial_report_webkit/report/common_reports.py", line 301, in get_first_fiscalyear_period
    return self._get_st_fiscalyear_period(fiscalyear)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/addons-account-financial-report/account_financial_report_webkit/report/common_reports.py", line 315, in _get_st_fiscalyear_period
    raise osv.except_osv(_('No period found'), '')
except_osv: (u'No period found', '')
2014-02-18 12:47:11,677 12627 ERROR openerp_test openerp.modules.loading: module account_financial_report_webkit: an exception occurred in a test
Traceback (most recent call last):
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/modules/loading.py", line 83, in load_test
    _load_data(cr, module_name, idref, mode, 'test')
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/modules/loading.py", line 122, in _load_data
    tools.convert_yaml_import(cr, module_name, fp, kind, idref, mode, noupdate, report)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/tools/yaml_import.py", line 938, in yaml_import
    yaml_interpreter.process(yaml_string)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/tools/yaml_import.py", line 874, in process
    self._process_node(node)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/tools/yaml_import.py", line 887, in _process_node
    self.process_python(node)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/tools/yaml_import.py", line 560, in process_python
    unsafe_eval(code_obj, {'ref': self.get_id}, code_context)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/addons-account-financial-report/account_financial_report_webkit/tests/general_ledger.yml", line 5, in <module>
    ctx={}
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/tools/test_reports.py", line 294, in try_report_action
    result = _exec_action(action, datas, context)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/tools/test_reports.py", line 278, in _exec_action
    res = try_report(cr, uid, 'report.'+action['report_name'], ids, datas, context, our_module=our_module)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/tools/test_reports.py", line 53, in try_report
    res = netsvc.LocalService(rname).create(cr, uid, ids, data, context)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/addons/report_webkit/webkit_report.py", line 340, in create
    result = self.create_source_pdf(cursor, uid, ids, data, report_xml, context)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/parts/openerp/openerp/report/report_sxw.py", line 511, in create_source_pdf
    return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/addons/report_webkit/webkit_report.py", line 222, in create_single_pdf
    self.parser_instance.set_context(objs, data, ids, report_xml.report_type)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/addons-account-financial-report/account_financial_report_webkit/report/general_ledger.py", line 90, in set_context
    start_period = self.get_first_fiscalyear_period(fiscalyear)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/addons-account-financial-report/account_financial_report_webkit/report/common_reports.py", line 301, in get_first_fiscalyear_period
    return self._get_st_fiscalyear_period(fiscalyear)
  File "/home/lmi/projects/openerp/openerp-deldrive-buildout/addons-account-financial-report/account_financial_report_webkit/report/common_reports.py", line 315, in _get_st_fiscalyear_period
    raise osv.except_osv(_('No period found'), '')
except_osv: (u'No period found', '')

Related branches

Stéphane Bidoul (Acsone) (sbi) wrote :

The problems come from offical account/demo/account_demo.xml which has special=True for all demo periods.

Anyone know why it is so?

Changed in account-financial-report:
status: New → Confirmed
Stéphane Bidoul (Acsone) (sbi) wrote :

The fix linked in associated merge propsals consists in two parts:
1. improving the demo data in openobject-addons/account to have a proper opening period
2. fixing references to partners in base demo data (error which was revealed after fixing 1.)

Changed in ocb-addons:
status: New → Fix Committed
status: Fix Committed → Fix Released
Changed in account-financial-report:
status: Confirmed → Fix Committed
Changed in account-financial-report:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers