[7.0] Error trying to print invoice after Report Designer

Bug #1131451 reported by Marko
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Confirmed
Medium
OpenERP Publisher's Warranty Team

Bug Description

I get the following when try to print an invoice:

2013-02-21 22:35:52,404 18487 ERROR ? openerp.tools.safe_eval: Cannot eval "(o.address_invoice_id and o.address_invoice_id.street) or ''"
Traceback (most recent call last):
  File "/opt/openerp-7.0-20130221-002146/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 "/opt/openerp-7.0-20130221-002146/openerp/osv/orm.py", line 486, in __getattr__
    raise AttributeError(e)
AttributeError: "Field 'address_invoice_id' does not exist in object 'browse_record(account.invoice, 9)'"
2013-02-21 22:35:52,404 18487 WARNING ? openerp.osv.orm.browse_record.account.invoice: Field 'address_invoice_id' does not exist in object 'browse_record(account.invoice, 9)'
2013-02-21 22:35:52,405 18487 DEBUG ? openerp.osv.orm.browse_record.account.invoice: File "/opt/openerp-7.0-20130221-002146/openerp/service/web_services.py", line 700, in go
    (result, format) = obj.create(cr, uid, ids, datas, context)
  File "/opt/openerp-7.0-20130221-002146/openerp/report/report_sxw.py", line 444, in create
    fnct_ret = fnct(cr, uid, ids, data, report_xml, context)

Tags: maintenance
Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :

Hello Marko ,

I have checked this issue with latest code but I did not face this error with trunk or 7.0 ,
and more i found o.address_invoice_id and o.address_invoice_id.street or ' ' in stable6 only. So
would you please try with latest code and give information regarding this issue.

Thanks and waiting for reply!

Changed in openobject-server:
status: New → Incomplete
Revision history for this message
Marko (marko-kauzlaric) wrote : Re: [Bug 1131451] Re: Error when try to print invoice

Jignesh,

Thanks for testing.
the code was the one from yesterday which I installed because I had
the problem with the previous version.
I fear now it has to do with custom report generated with openoffice
(report designer). Some time ago we created a custom print report and
yesterday we noticed the problem. A code upgrade didn't help.
We also uploaded the original print report (we made a backup) but the
error persists. At the moment I'm not sure if it's a problem with the
report or with the code.
Is there a way to reset the account.invoice report to original?

Thanks
Marko

On Fri, Feb 22, 2013 at 6:55 AM, Jignesh Rathod(OpenERP)
<email address hidden> wrote:
> Hello Marko ,
>
> I have checked this issue with latest code but I did not face this error with trunk or 7.0 ,
> and more i found o.address_invoice_id and o.address_invoice_id.street or ' ' in stable6 only. So
> would you please try with latest code and give information regarding this issue.
>
> Thanks and waiting for reply!
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1131451
>
> Title:
> Error when try to print invoice
>
> Status in OpenERP Server:
> New
>
> Bug description:
> I get the following when try to print an invoice:
>
> 2013-02-21 22:35:52,404 18487 ERROR ? openerp.tools.safe_eval: Cannot eval "(o.address_invoice_id and o.address_invoice_id.street) or ''"
> Traceback (most recent call last):
> File "/opt/openerp-7.0-20130221-002146/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 "/opt/openerp-7.0-20130221-002146/openerp/osv/orm.py", line 486, in __getattr__
> raise AttributeError(e)
> AttributeError: "Field 'address_invoice_id' does not exist in object 'browse_record(account.invoice, 9)'"
> 2013-02-21 22:35:52,404 18487 WARNING ? openerp.osv.orm.browse_record.account.invoice: Field 'address_invoice_id' does not exist in object 'browse_record(account.invoice, 9)'
> 2013-02-21 22:35:52,405 18487 DEBUG ? openerp.osv.orm.browse_record.account.invoice: File "/opt/openerp-7.0-20130221-002146/openerp/service/web_services.py", line 700, in go
> (result, format) = obj.create(cr, uid, ids, datas, context)
> File "/opt/openerp-7.0-20130221-002146/openerp/report/report_sxw.py", line 444, in create
> fnct_ret = fnct(cr, uid, ids, data, report_xml, context)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-server/+bug/1131451/+subscriptions

Revision history for this message
Marko (marko-kauzlaric) wrote :

I solved the problem for now.
I checked the fields in settings ad there is actually no address_invoice_id
I modify the report to use partner_id instead and now works.
I don't know if address_invoice_id shuld be there or not...

On Fri, Feb 22, 2013 at 7:06 AM, Jignesh Rathod(OpenERP)
<email address hidden> wrote:
> ** Changed in: openobject-server
> Status: New => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1131451
>
> Title:
> Error when try to print invoice
>
> Status in OpenERP Server:
> Incomplete
>
> Bug description:
> I get the following when try to print an invoice:
>
> 2013-02-21 22:35:52,404 18487 ERROR ? openerp.tools.safe_eval: Cannot eval "(o.address_invoice_id and o.address_invoice_id.street) or ''"
> Traceback (most recent call last):
> File "/opt/openerp-7.0-20130221-002146/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 "/opt/openerp-7.0-20130221-002146/openerp/osv/orm.py", line 486, in __getattr__
> raise AttributeError(e)
> AttributeError: "Field 'address_invoice_id' does not exist in object 'browse_record(account.invoice, 9)'"
> 2013-02-21 22:35:52,404 18487 WARNING ? openerp.osv.orm.browse_record.account.invoice: Field 'address_invoice_id' does not exist in object 'browse_record(account.invoice, 9)'
> 2013-02-21 22:35:52,405 18487 DEBUG ? openerp.osv.orm.browse_record.account.invoice: File "/opt/openerp-7.0-20130221-002146/openerp/service/web_services.py", line 700, in go
> (result, format) = obj.create(cr, uid, ids, datas, context)
> File "/opt/openerp-7.0-20130221-002146/openerp/report/report_sxw.py", line 444, in create
> fnct_ret = fnct(cr, uid, ids, data, report_xml, context)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/openobject-server/+bug/1131451/+subscriptions

Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote : Re: Error when try to print invoice

Hello Marko ,

As per your comment no #3, I am closing this issue ....

Thanks for quick reply....

Changed in openobject-server:
status: Incomplete → Invalid
Revision history for this message
Darren Round (darrenjround) wrote :

I have exactly the same problem. A clean install from today, I tried to edit the invoice using the Report Designer for v7.0 and now when I try to print an invoice nothing happens. In the log is the following error:

  File "/usr/lib/pymodules/python2.7/openerp/report/render/rml2pdf/utils.py", line 92, in _child_get
    eval(n.get('rml_except'), {}, self.localcontext)
  File "/usr/lib/pymodules/python2.7/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 "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 486, in __getattr__
    raise AttributeError(e)
AttributeError: "Field 'address_invoice_id' does not exist in object 'browse_record(account.invoice, 4)'"

It may be worth mentioning that I only changed the label "quantity" to "QTY" and sent the report back to the server.

I now can not print invoices.

Changed in openobject-server:
status: Invalid → Confirmed
summary: - Error when try to print invoice
+ [7.0] Error trying to print invoice after Report Designer
Revision history for this message
Jignesh Rathod(OpenERP) (jir-openerp) wrote :

Hello Marko ,

I agree with Darren , sxw file has a field address_invoice_id which is not change and problem
occurs due to sxw. Currently in invoice_print report rml ( Replaced address_invoice_id field with partner_id )
but not in sxw .So If you change in sxw file and send to server then it replace rml.

So problem occurs due to sxw and I am confirming this issue.

Thank you!

Changed in openobject-server:
importance: Undecided → Medium
affects: openobject-server → openobject-addons
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
Changed in openobject-addons:
assignee: OpenERP R&D Addons Team 3 (openerp-dev-addons3) → OpenERP Publisher's Warranty Team (openerp-opw)
tags: added: maintenance
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.