MRP report product.price requires currency symbol

Bug #898478 reported by Xavier Fernandez http://www.smile.fr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 2

Bug Description

In MRP module report report.product.price:

there are extensive use of lines of type :
<col t='yes'>""" + rml_obj.formatLang(total_strd, digits=purchase_price_digits) + ' ' + company_currency.symbol + """</col>

which naturally crash the report if the company's currency has no symbol specified (it is not mandatory):

[2011-11-30 19:30:54,904][JFM_local] ERROR:web-services:[07]: File "/home/xafer/openerp/tahiti/server/bin/addons/mrp/report/price.py", line 153, in create_xml
[2011-11-30 19:30:54,904][JFM_local] ERROR:web-services:[08]: <col t='yes'>""" + rml_obj.formatLang(total_strd, digits=purchase_price_digits) + ' ' + company_currency.symbol or company_currency.name + """</col>
[2011-11-30 19:30:54,904][JFM_local] ERROR:web-services:[09]: TypeError: coercing to Unicode: need string or buffer, bool found

Replacing all 'company_currency.symbol' by '(company_currency.symbol or company_currency.name)' does the trick

Related branches

Revision history for this message
Xavier Fernandez http://www.smile.fr (xav-fernandez) wrote :
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Xavier,

I have faced the same problem, If I removed the currency symbol from Currency view.
By d why nice catch..;-).

Thanks for providing a patch.

Changed in openobject-addons:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Kirti Savalia(OpenERP) (ksa-openerp) wrote :

Hello,

Thank For Reporting and Contribution.
It has been Fixed in http://bazaar.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-898478-ksa
revision-id: <email address hidden>
revno: 5865
It will be available in trunk soon.

Thanks.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
Xavier Fernandez http://www.smile.fr (xav-fernandez) wrote :

The issue is the same on 6.0 and should also be merged, just like in trunk: http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/revision/6081

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Correcting status, the fix has actually landed a while ago in the trunk/6.1 branch at revision 6081
revision-id: <email address hidden>

Changed in openobject-addons:
milestone: none → 6.1
status: Fix Committed → Fix Released
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.