Pas moyen de générer le rapport 'cash'
J'utilise un fichier de config hreports tout basique pour le rapport de trésorerie :
'cash': {
'title' : 'Trésorerie',
'output': os.path.join(OUTPUT_DIR, "{year}", "{type}.html"),
'parts' : [
{ 'account': 'Finances', 'depth':1, 'title': "Aperçu"},
],
},
mais lorsque je lance le binaire, je me retrouve avec une erreur jinja2.exceptions.UndefinedError: 'unicode object' has no attribute 'month_name'
et je ne comprends pas du tout d'où ça sort / qu'est-ce que je peux y faire (oui, les dates sont vieilles ;) ) :
INFO:hreport:loading year 2017 with hledger
INFO:hreport:loading closed year 2017 with hledger
INFO:hreport:loading year 2018 with hledger
INFO:hreport:loading closed year 2018 with hledger
INFO:hreport:loading year 2019 with hledger
INFO:hreport:loading closed year 2019 with hledger
INFO:hreport:write report balance_sheet to file bilans/bilans/2017/balance_sheet.html
INFO:hreport:write report incomes_statement to file bilans/bilans/2017/incomes_statement.html
Traceback (most recent call last):
File "/home/x/y/z/ledger/hreports/bin/hreport", line 203, in <module>
main(sys.argv[1:])
File "/home/x/y/z/ledger/hreports/bin/hreport", line 197, in main
doreports(options)
File "/home/x/y/z/ledger/hreports/bin/hreport", line 158, in doreports
doreport(accounting_years, accounting_years_closed, report)
File "/home/x/y/z/ledger/hreports/bin/hreport", line 139, in doreport
output = cash(accounting_years, report, context)
File "/home/x/y/z/ledger/hreports/bin/hreport", line 73, in cash
return template.render(**context).encode('utf-8')
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/x/y/z/ledger/hreports/hreports/../templates/cash.html", line 1, in top-level template code
{% extends "base.html" %}
File "/home/x/y/z/ledger/hreports/hreports/../templates/base.html", line 11, in top-level template code
{% block content %}contenu à définir{% endblock %}
File "/home/x/y/z/ledger/hreports/hreports/../templates/cash.html", line 28, in block "content"
<th colspan="2" class="period">{{ period.month_name() }}</th>
jinja2.exceptions.UndefinedError: 'unicode object' has no attribute 'month_name'
Si quelqu'un a une piste, merci !