KeyError: 'date_original'

Bug #1190823 reported by Maxime Chambreuil (http://www.savoirfairelinux.com)
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Medium
OpenERP R&D Addons Team 3
OpenERP Canada
Fix Released
Undecided
David Cormier

Bug Description

On OpenERP 7, install check_writing module
Choose your chart of accounts template
Using the check form and the payment method field, create a new journal with 'Allow check writing' on
Create a supplier invoice, validate it and pay with the payment method created before.
In the list of checks, select your check and print it (any of top, middle or bottom).
PDF file is generated but there is some data missing due to those error messages in the log :

2013-06-14 02:11:50,523 5256 ERROR Check openerp.tools.safe_eval: Cannot eval "formatLang(l['date_original'] ,date=True) or ''"
Traceback (most recent call last):
  File "/home/max/openerp/server/7.0/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
KeyError: 'date_original'
2013-06-14 02:11:50,524 5256 ERROR Check openerp.tools.safe_eval: Cannot eval "formatLang( l['amount_due'])"
Traceback (most recent call last):
  File "/home/max/openerp/server/7.0/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
KeyError: 'amount_due'
2013-06-14 02:11:50,527 5256 WARNING Check openerp.report.render.rml2pdf.trml2pdf: Warning: style not found, P26 - setting default!

2013-06-14 02:11:50,527 5256 ERROR Check openerp.tools.safe_eval: Cannot eval 'str(fill_stars(voucher.amount_in_word))'
Traceback (most recent call last):
  File "/home/max/openerp/server/7.0/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
  File "/home/max/openerp/addons/7.0/account_check_writing/report/check_print.py", line 37, in fill_stars
    amount = amount.replace('Dollars','')
AttributeError: 'bool' object has no attribute 'replace'
2013-06-14 02:11:50,532 5256 ERROR Check openerp.tools.safe_eval: Cannot eval "formatLang(l['date_original'] ,date=True) or ''"
Traceback (most recent call last):
  File "/home/max/openerp/server/7.0/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
KeyError: 'date_original'
2013-06-14 02:11:50,533 5256 ERROR Check openerp.tools.safe_eval: Cannot eval "formatLang (l['amount_due'])"
Traceback (most recent call last):
  File "/home/max/openerp/server/7.0/openerp/tools/safe_eval.py", line 241, in safe_eval
    return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
  File "", line 1, in <module>
KeyError: 'amount_due'

Related branches

Changed in openerp-canada:
assignee: nobody → David Cormier (david-cormier-j)
Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello Maxime,

I have checked your issue with latest trunk as well as with 7.0. But Its working fine at all.

So, would you please check it again with and notify me if you still face any issue.

Thank you.

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote :

Hello Twinkle,

Regarding the field 'amount_due', it is created here:
http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/account_check_writing/report/check_print.py#L44

in just one case of the if statement. In the other case, the field is amount_unreconciled which is not used in the middle and bottom rml report.

Regarding the date_original, it is a field of account.voucher.line, but it is not available to the report:
http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/account_check_writing/report/check_print.py#L44
and it is used in the middle and bottom report.

Regarding the missing style, can you tell me where it is set in the rml file:
http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/account_check_writing/report/check_print_middle.rml#L200

cause it only appears once.

Maybe you checked with the top report which is fine. Sorry for the wrong description.

Changed in openerp-canada:
status: New → Fix Committed
Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :

Hello Maxime ,

Thanks for reproting,

I am facing same issue with as you have. So, I am confirming this issue.

Regards,

Revision history for this message
Twinkle Christian(OpenERP) (tch-openerp) wrote :
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: Incomplete → Confirmed
summary: - [7.0] KeyError: 'date_original'
+ KeyError: 'date_original'
Changed in openerp-canada:
status: Fix Committed → Fix Released
Amit Parik (amit-parik)
tags: added: invoicing
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Bharat Devnani (Open ERP) (bde-openerp) wrote :

Hello Maxime Chambreuil,

Thanks for reporting and David Cormier for contributing. This bug has been resolved in
branch : https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1190823-bde
with following:
Revision ID : <email address hidden>
Revision Number : 9031

Once reviewed by our experts it will be merged in addons soon.

Thanks & Regards,
Devnani Bharat R.

Changed in openobject-addons:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.