Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
411 Представления

In Odoo I have inherited many addons module in the custom_addons module, but in Event module I am facing issues, as to show the module we have to set the action in the <menuitem/>, and the action for the event views is not there in the addons modules(event.event).

A correct way to inherit and include the event.event views in the custom module, such that it is visible in the menu bar of my custom module.

As I was checking the <menuitem> of the original module in :

odoo-16.0/addons/event/views/event_menu_views.xml

<menuitem name="Events" id="menu_event_event" sequence="1" parent="event.event_main_menu" groups="event.group_event_registration_desk"/>

there is no action in the above line. As I have inherited many modules earlier there use to be action given in the <menuitem> which makes the button/link working in the menu bar, and by copying the same action to my custom module's <menuitem> makes the same thing visible to my custom module. like in the given line:

<menuitem id="menu_hr_employee_user" name="Employees" action="open_view_employee_list_my" parent="menu_hr_employee_payroll" sequence="1"/>

In the HR module I have to include(copy) the employee form in my custom module, so I inherited and just copied the action to my custom module's <menuitem>, which made the form visible to it.

Аватар
Отменить
Лучший ответ

Hi,

Action for event views are declared in xml like below:

<record id="event.menu_event_event" model="ir.ui.menu">

        <field name="action" ref="event.action_event_view"/>

    </record>

    <menuitem name="Events"

        id="menu_event_event"

        sequence="1"

        parent="event.event_main_menu"

        groups="event.group_event_registration_desk"/>

So you can use this action in your custom module.


Hope it helps

Аватар
Отменить