4

Question :

In a menuitem such as :

<menuitem id="menu_id"
          name="menu name 3e"
          parent="parent_path"
          action="action_path"
          sequence="10"/>

How can I get the name to be equivalent to "menu item 3<sup>e</sup>" so it will be displayed like "menu item 3e"?

Attempts :

Code 1:

<menuitem id="menu_id"
          name="menu name 3<sup>e</sup>"
          parent="parent_path"
          action="action_path"
          sequence="10"/>

Error: XMLSyntaxError: Unescaped '<' not allowed in attributes values, line 2, column 24 (line as been replaced in the error to be accurate in the snippet)

Code 2:

<menuitem id="menu_id"
          name="menu name 3&lt;sup>e&lt;/sup>"
          parent="parent_path"
          action="action_path"
          sequence="10"/>

Error: No problem to upgrade module, but the name displayed is menu name 3<sup>e</sup>

I also tried to escape using \< and << instead of < but it is just desperate non-sense for xml

NB :

I have a similar question (not in-depth detailled here not to overload the question) about adding html in the value of a record's fields, or in a button text, for example <field name="name">3<sup>e</sup></field>

But it throws the error : AssertionError: Element field has extra content: sup, line 5

No matter how I try to escape it, except for the replacement of < by &lt; but the result is the same as the 2sd attempts on the menuitem.

T.Nel
  • 1,540
  • 2
  • 18
  • 34

1 Answers1

0

Why code 2 work for me: Odoo11

name="Projects 3&lt;sup> e&lt;/sup>"

Let see

Anh Hoang
  • 1
  • 1
  • Your image show the unexpected behavior. It should be displayed as Projects 3e. I edited my question because the "error" I'm getting was not displayed as expected – T.Nel Jul 20 '18 at 11:18