Cannot open duplicated special reports (e.g. "Order with Layout" from sale_layout)

Asked by gde (OpenERP)

With OpenERP 6.0.3 (on SaaS platform).

I tried to duplicate the report "Order with layout" but I get an error when I tried to open the duplicated one.

Here is the error I get:
(<type 'exceptions.NameError'>, NameError("name 'sale_order_lines' is not defined",), <traceback object at 0x7fcf38768908>)

Step to reproduce the bug:
- Install the module sale_order_layout and base_report_designer
- Open OpenOffice writer and select "Modify an existing report"
- Copy the content of the Sale Order report and paste it in a new document
- Select the option "Open new report" and choose "Sale Order" in the list
- Save your report and send it to the server
- Open the report in OpenERP
==> Bug!

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jagdish Panchal (Open ERP) (jap-openerp) said :
#1

Hello Amit,

I have checked the bug and it seems to be a problem from report designer module or framework,
So I request community team to check it once again and transfer it to respected team for further progress.

Thanks,
jap

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) said :
#2

Hello,

The "Order with Layout" report is a special kind of report that cannot be duplicated, because it depends on a special preprocessor system that makes a virtual "sale_order_lines" value available during report generation. This list contains the sale order lines in a special format, allowing the rendering the various layout options chosen on the sale order.

Of course the "Order with Layout" report uses this virtual "sale_order_lines", so if you duplicate it and create a normal report it will not have the special preprocessor (it is based on the normal "sale order" document), so you will get an error when it tries to access the missing virtual value. Duplicating special reports with preprocessors is not possible, but you have other options:
- modify the original report directly
- or after duplicating the report, remove the references to virtual fields that do not exist in the base document

For example for the Order with Layout report you could change the "loop" on the order lines using the Report Designer, to make it loop on the normal "Order Lines" field (order_line), instead of the virtual sale_order_lines (called here sale_order_lines(o)).

Thanks for your understanding!

PS: we could improve the system to warn about duplicating special reports with preprocessors, but there is no way currently to know for sure if a report cannot be duplicated, so that would be a new development (wishlist). At the same time we could also improve the error message, but at least it shows the correct issue: the report refers to a 'sale_order_lines' name that cannot be found.

Can you help with this problem?

Provide an answer of your own, or ask gde (OpenERP) for more information if necessary.

To post a message you must log in.