mrp-report "product cost structure" XML conversion

Bug #1073455 reported by Rudolf Schnapka
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Medium
OpenERP R&D Addons Team 2

Bug Description

in module mrp -> product -> report (branch 6.1)
when creating "Product cost structure" report, in a few situations the created XML causes the report-generation to cause traceback. The problem arised specifically when i. e. the company name contains special characters like the ampersand "&".
Method create_rml() expects correct XML and in this case the ampersand in the company name will make the rml-creation fail.
Solution is:
add method to_xml() to the company.name line (near code-line 116)
... this also would apply to all other textual "names" like product name and if someone would really use special chars like the ampersand in UOM the "uom.name" should also be wrapped "to_xml".

In addition the language-translation-method _() should be applied for all instances of names (company, product, uom...)
I have applied these changes to my local branch file "mrp/report/price.py" (working tree) but I am not sure about the process of committing this file... assistance on how to commit properly would be needed for me to share this code.

thank you! ...and hope it helps.

P. S. In summary this issue should then be solved when applied. The attached file also includes changes I made to the format of the generated XML. The file should be generally acceptable and as such can be exchanged for the currently used one in the 6.1-branch (possibly also in trunk).

Tags: mrp report xml

Related branches

Revision history for this message
Rudolf Schnapka (rs-t3) wrote :
description: updated
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Rudolf Schnapka (rs-t3) wrote :

would like to add a patch to resolve this issue. Basically it's just the catch of non-XML-compliant parts generated. Product names as well as the company name should be parsed to xml (method to_xml()) before furthe processing... and additionally a few items like uom and product.name should be translated (and to_xml'ed).
I hope the attached patch is correctly usable. It works for me... :-)
Greetings from Germany
Rudi

Changed in openobject-addons:
status: Confirmed → In Progress
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.