Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Odoo 10 adding sub-menu to another module

Subscribe

Get notified when there's activity on this post

This question has been flagged
newmodulepayrollodoo10SUBMENU
11 Replies
9359 Views
Avatar
Serdar Eren

Hi everyone,

I am trying to create a sub-menu to Payroll Modules. Tried so many way but i cant make it.

I found this code in forum but it is not working.

<menuitem id="menu_test" parent="hr_payroll.menu_hr_payroll_root" name="Test Module Parent"/>
<menuitem id="menu_test_child" parent="menu_test" name="My Menu" action="action_view_hr_module_reports_form"/>
Employee Payslips
Payslips Batches
Configuration
    • Salary Structures
    • Salary Structures Hierarchy
    • Salary Rules
    • Contribution Registers 

    These are default sub-menus in payroll and i want to add a new Reports menu. How can i do that?

  • Someone can help me please? Thank you.

0
Avatar
Discard
Avatar
Divya Vyas
Best Answer

Hello

The issue is you didn't define any action in menuitem..iN ODOO10 you have to assign action in menuitem.


Thanks

1
Avatar
Discard
Niyas Raphy (Walnut Software Solutions)

he already given the action for the menu

Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,

The code you have given to create the menu is correct. I think you may didn't have defined the action for the menu as well as corresponding views on clicking the menu. If you not defined the action "action_view_hr_module_reports_form" and the view, please do it , then you can see the menu.

Thanks

1
Avatar
Discard
Avatar
Serdar Eren
Author Best Answer

Defined like that, but still gives me an error "External ID not found..."


<record id="view_hr_module_reports_tree" model="ir.ui.view">

            <field name="name">hr_module.reports.tree</field>

            <field name="model">hr_module.reports</field>

            <field name="arch" type="xml">

                <tree string="Payslips Batches">

                    <field name="name"/>

                    <field name="date_start"/>

                    <field name="credit_note"/>

                    <field name="state"/>

                </tree>

            </field>

        </record>

        

        <record id="action_view_hr_module_reports_form" model="ir.actions.act_window">

            <field name="name">Employee Payslips</field>

            <field name="res_model">hr_module.reports</field>

            <field name="view_type">form</field>

            <field name="view_id" ref="view_hr_module_reports_tree"/>

        </record>

0
Avatar
Discard
Avinash Nk

Check that you mention the inherited module name in your manifest file.

Serdar Eren
Author

'depends': [

'base',

'hr',

'hr_contract',

'hr_payroll',

],

here is my _manifest_.py

Niyas Raphy (Walnut Software Solutions)

any error in error log ?

Serdar Eren
Author

ParseError: "External ID not found in the system: hr_module.action_view_hr_module_reports_form" while parsing /home/dev1/odoo-10.0/custom_addons/hr_module/views/payroll_payslips_view.xml:5, near

<menuitem id="menu_test_child" parent="menu_test" name="My Menu" action="action_view_hr_module_reports_form"/> gives me this error

Niyas Raphy (Walnut Software Solutions)

try to change to tree instead of form,

<field name="view_type">tree</field>

Niyas Raphy (Walnut Software Solutions)

and did you have defined the model , hr_module.reports ?

Serdar Eren
Author

yes in my module.py defined like

class hr_payroll_reports(models.Model):

name = 'hr_module.reports'

_description = 'Reports'

Serdar Eren
Author

here is my full code,

<data>

<menuitem id="menu_test" parent="hr_payroll.menu_hr_payroll_root" name="Test Module Parent"/>

<record id="view_hr_module_reports_tree" model="ir.ui.view">

<field name="name">hr_module.reports.tree</field>

<field name="model">hr_module.reports</field>

<field name="arch" type="xml">

<tree string="Payslips Batches">

<field name="name"/>

<field name="date_start"/>

<field name="credit_note"/>

</tree>

</field>

</record>

<record id="action_view_hr_module_reports_form" model="ir.actions.act_window">

<field name="name">Employee Payslips</field>

<field name="res_model">hr_module.reports</field>

<field name="view_type">tree</field>

<field name="view_id" ref="view_hr_module_reports_tree"/>

</record>

<menuitem id="menu_test_child" parent="menu_test" name="My Menu" action="action_view_hr_module_reports_form"/>

</data>

models.py

class hr_payroll_reports(models.Model):

name = 'hr_module.reports'

_description = 'Reports'

name = fields.Char(required=True, readonly=True, states={'draft': [('readonly', False)]})

date_start = fields.Date(string='Date From', required=True, readonly=True)

credit_note = fields.Boolean(string='Credit Note', readonly=True,

states={'draft': [('readonly', False)]},

help="If its checked, indicates that all payslips generated from here are refund payslips.")

and gives me this error

Model not found: hr_module.reports

Error context:

View `hr_module.reports.tree`

[view_id: 1114, xml_id: n/a, model: hr_module.reports, parent_id: n/a]

None" while parsing /home/dev1/odoo-10.0/custom_addons/hr_module/views/payroll_payslips_view.xml:6, near

<record id="view_hr_module_reports_tree" model="ir.ui.view">

<field name="name">hr_module.reports.tree</field>

<field name="model">hr_module.reports</field>

<field name="arch" type="xml">

<tree string="Payslips Batches">

<field name="name"/>

<field name="date_start"/>

<field name="credit_note"/>

</tree>

</field>

</record>

Niyas Raphy (Walnut Software Solutions)

py file mentioned in init ?

Serdar Eren
Author

yes of course

Serdar Eren
Author

I found the solution, my mistake is class name hr_payroll_reports should be like HrModuleReports, i think in odoo has some method for class name and it is seperating capital letters than put dot between letters. So odoo find and use methods something like that.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Sign up
Related Posts Replies Views Activity
how we add dynamic value (input value) in salary rule
payroll salary_rules input odoo10
Avatar
0
Jan 17
4542
Transfering One2Many Field inputs into Popup Model v10
one2many payroll popup check_writing odoo10
Avatar
0
Mar 20
3262
Biometric module for odoo 10 cummunity edition Solved
payroll attendance biometric timesheets odoo10
Avatar
Avatar
Avatar
Avatar
Avatar
4
Nov 19
6196
Is there any module is (free) available for healthcare management in Odoo10?
newmodule medical functional pharmaceuticals odoo10
Avatar
Avatar
1
Aug 19
5392
Batches of pay slips Solved
payroll
Avatar
Avatar
1
Sep 25
1058
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now