Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


How to solve encoding problems when using base_rml_edit?

Torvald B. Bringsvor
on 11/29/13, 4:42 PM 2,684 views

I'm using the module base_rml_edit from CubicERP to edit reports in RML format in the GUI. And this works pretty well.

But I have a problem when I want to use national characters in the reports. I get the usual encoding error:

  File "/srv/openerp7/openerp-7.0-20131105-002511/openerp/osv/orm.py", line 4186, in write
    result += self._columns[field].set(cr, self, id, field, vals[field], user, context=rel_context) or []   File "/srv/openerp7/openerp-7.0-20131105-002511/openerp/osv/fields.py", line 1153, in set
    self._fnct_inv(obj, cr, user, id, name, value, self._fnct_inv_arg, context)   File "/srv/openerp7/openerp7/openerp/addons/base_rml_edit/ir_actions.py", line 38, in _report_content_txt_inv
    self.write(cr,uid,id,{'report_rml_content':str(value)},context=context) UnicodeEncodeError: 'ascii' codec can't encode character u'\xf8' in position 12603: ordinal not in range(128)

I have added the usual encoding header to the report:

<?xml version="1.0" encoding="utf-8" standalone="no" ?>

But I think this is not a problem with the report, but with the RML editor.

The letter I'm trying to use is the Norwegian ø. Since salary in Norwegian is Lønn this is pretty nice to have for a payslip...

Have any of you used non-ascii characters in RML reports?

Mariusz Mizgier
On 11/29/13, 4:59 PM

If you use the ascii code for that letter (ø), would it work? Usually using ASCII code for the special sign does the trick in python, I've used it myself with Polish letters.

Thanks! Wish I had thought of that. For your info, here's a great page for finding the codes: http://www.utf8-chartable.de/unicode-utf8-table.pl?utf8=oct&unicodeinhtml=dec&htmlent=1

Torvald Baade Bringsvor, Torvald B. Bringsvor
on 11/29/13, 7:10 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


Asked: 11/29/13, 4:42 PM
Seen: 2684 times
Last updated: 9/21/15, 4:24 AM