% can't appear on view from xml.

I want a string like "%a - Abbreviated Week name" to be put onto form view.

but when I enter that,

<label string="%a - Abbreviated Week name" />

It raises an error like...

Traceback (most recent call last):
  File "./openerp-server.py", line 104, in <module>
    pooler.get_db_and_pool(tools.config['db_name'], update_module=True)
  File "/home/jvo/ws_bzr/server/bin/pooler.py", line 38, in get_db_and_pool
    addons.load_modules(db, force_demo, status, update_module)
  File "/home/jvo/ws_bzr/server/bin/addons/__init__.py", line 535, in load_modules
    load_module_graph(cr, basegraph, status, check_access_rules=False, report=report)
  File "/home/jvo/ws_bzr/server/bin/addons/__init__.py", line 478, in load_module_graph
    tools.convert_xml_import(cr, m, fp, idref, mode=mode, **kwargs)
  File "/home/jvo/ws_bzr/server/bin/tools/convert.py", line 854, in convert_xml_import
    obj.parse(xmlstr)
  File "/home/jvo/ws_bzr/server/bin/tools/convert.py", line 748, in parse
    self._tags[rec.nodeName](self.cr, rec, n)
  File "/home/jvo/ws_bzr/server/bin/tools/convert.py", line 711, in _tag_record
    f_val = _eval_xml(self,field, self.pool, cr, self.uid, self.idref)
  File "/home/jvo/ws_bzr/server/bin/tools/convert.py", line 116, in _eval_xml
    txt = '<?xml version="1.0"?>\n'+_process("".join([i.toxml().encode("utf8") for i in node.childNodes]), idref)
  File "/home/jvo/ws_bzr/server/bin/tools/convert.py", line 115, in _process
    return s % idref
ValueError: unsupported format character 'a' (0x29) at index 728

I fear that its the problem of regular expression.

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Jay Vora (Serpent Consulting Services)
Solved:
Last query:
Last reply:

This question was originally filed as bug #307070.

Revision history for this message
Husen Daudi (husendaudi) said :
#1

For xml you should use %% for %

<label string="%%a - Abbreviated Week name" />

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#2

Thanks Mr Husen.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) said :
#3

Thanks Mr husen.
<label string="%%a - Abbreviated Week name" />