Menu Item Rename
Rename menu items using module xml.
Conditions générales
Garantie satisfait ou remboursé de 30 jours
Expédition : 2-3 jours ouvrables
Base XML Rename
This module allows to rename UI elements using XML data files in modules.
Table of Contents
Context
Renaming a menu in Odoo directly through the web interface is not a good idea.
- We rapidly loose track of what was modified.
- The menu names are not changed in test environments (except with replication of the prod).
- The changes are lost if someone forces the override of translations.
The same applies for renaming other objects such as user groups.
Module Design
A mixin xml.rename.mixin is added.
This mixin has a method rename which takes 3 mandatory parameters:
- ref: the xml reference of the record.
- lang: the language of the term.
- value: the new term.
Optionaly, a field parameter can be supplied, in case the field is not name.
The mixin can be added to any model.
For now, the module adds the mixin to ir.ui.menu and res.groups.
Usage
Here are 2 examples for renaming menu items and user groups.
Renaming a User Group
Here is an example of renaming a user group. This works the same way as renaming a menu item.
<function name="rename" model="res.groups"> <value type="char">account.group_account_user</value> <value type="char">fr_FR</value> <value type="char">Comptable</value> </function>
Before loading the XML, the group is named Montrer les fonctions de comptabilité complète in french.
After loading the XML, the group is named Comptable.
Known Issues
If you reload translations with Overwrite Existing Terms checked, the terms loaded with XML will not be reloaded automatically. You will need to update the modules containing these XML files).
Contributors
- Numigi (tm) and all its contributors (https://bit.ly/numigiens)