技术咨询:如何修改accounting->Reports->PDF Reports中的Partner Ledger菜单项名称?
Hey there! Let's walk through two reliable ways to rename the Partner Ledger menu item located under Accounting > Reports > PDF Reports > Partner Ledger in your Odoo instance. I'll start with the recommended maintainable approach, then cover a quick tweak for testing or temporary changes.
Method 1: Custom Module (Recommended for Production)
This method ensures your changes won't get overwritten when you update Odoo or the Accounting module. Here's how to do it:
- First, either use an existing custom module or create a new basic one (if you don't have one already).
- In your module's
viewsdirectory, create a new XML file (e.g.,custom_menu_renames.xml). - Add the following code, replacing
Your Desired Menu Namewith the new name you want:
Note: If the<odoo> <!-- Inherit and rename the Partner Ledger menu --> <record id="custom_rename_partner_ledger_menu" model="ir.ui.menu"> <field name="name">Your Desired Menu Name</field> <field name="inherit_id" ref="account.menu_action_report_partner_ledger"/> </record> </odoo>refvalue doesn't work, activate Developer Mode, navigate to the Partner Ledger menu, and check its External ID to use here. - Update your module's
__manifest__.pyfile to include this XML in thedatalist:'data': [ # ... other existing files 'views/custom_menu_renames.xml', ], - Upgrade your custom module from the Apps menu, then refresh your browser to see the updated menu name.
Method 2: Quick Developer Mode Tweak (Temporary/Testing)
If you need a fast change and don't mind losing it during module updates, use this:
- Activate Developer Mode: Go to
Settings > Developer Tools > Activate Developer Mode. - Navigate to
Settings > Technical > User Interface > Menus. - Use the search bar to find the "Partner Ledger" menu record.
- Click the Edit button, modify the
Namefield to your preferred text, then save. - Refresh your page—your new menu name will be visible immediately.
Important Note
Always prefer the custom module method for production environments. Direct database changes (like the second method) are overwritten when you update Odoo or the Accounting app.
内容的提问来源于stack exchange,提问作者Mohammad AL-Hamalawy

