Onboarding Panel for Tree View in Odoo 17
The open-source ERP program Odoo has Innovative features to help businesses run more smoothly and flexible. The tree view in onboarding panel is one such feature. This tutorial will walk you through the process of adding an Odoo 17 Onboarding panel for tree view.
On-Boarding Panel In Odoo17
Odoo 17 has the useful feature called onboarding panels that helps the new users become acquainted with the different features. They may set to display under particular circumstances and are frequently seen in modules like Sales and Invoicing.
Enhance the Employee Department Model with the help of Odoo Onboarding Panel
Let’s look at an example where we need to modify the Employee department model (hr.department) tree view in order to include an Odoo onboarding panel.
First step: Make a New Module
First things first, let’s make a new module called banner_route. There will be subfolders for data, models, views, and other things in this module.
We’re going to create a new file to inherit the onboarding in the models folder.both during and after onboarding.onboarding.step models as well as some function introductions. don’t forget to include the file in the models’ folder’s init file.
Step 2: Add the Features
Add these features to bring out the operations from the panel .
from odoo import api, models
class Onboarding(models.Model):
_inherit = 'onboarding.onboarding'
@api.model
def action_close_panel_account_invoice(self):
self.action_close_panel(banner_route.action_close_panel_department')
and specific department-related onboarding panel can cancel function of the Onboarding model using the action_close_panel_account_invoice. It calls the action_close_panel function with the argument “banner_route.action_close_panel_department,” which indicates the panel to be closed. This function ensures that the department onboarding panel is closed appropriately when this action is initiated.
from odoo import api, models
class OnboardingStep(models.Model):
_inherit = 'onboarding.onboarding.step'
@api.model
def action_open_department_onboarding_sample_department(self):
action = self.env['ir.actions.actions']._for_xml_id(
'hr.hr_department_tree_action')
action.update({
'views': [[self.env.ref('hr.view_department_form').id, 'form']],
'view_mode': 'form',
'target': 'main',
})
return action
The action_open_department_onboarding_sample_department method in the OnboardingStep model may be used to open an Odoo department onboarding view. This method retrieves an action for the department tree view, adjusts the action to show the department form view, and switches the view mode to form, and targets the main window to display the form. During the department onboarding process, the technique ensures that the user is traveling to the right form view for additional interaction.
Step 3: Describe the Onboarding Panel for Tree View
Define the panel’s viewpoints and Make a file in the data folder and insert the below code
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<!--ONBOARDING STEPS -->
<record id="banner_route_onboarding_sample_department_step"
model="onboarding.onboarding.step">
<field name="title">Sample Department</field>
<field name="description">Create a sample department</field>
<field name="button_text">Create</field>
<field name="panel_step_open_action_name">
action_open_department_onboarding_sample_department
</field>
<field name="step_image" type="base64"
file="base/static/img/onboarding_sample.png"></field>
</record>
<record id="onboarding_onboarding_department" model="onboarding.onboarding">
<field name="name">Department Onboarding</field>
<field name="step_ids" eval="[
Command.link(ref('banner_route.banner_route_onboarding_sample_department_step')),
]"/>
<field name="route_name">department</field>
<field name="panel_close_action_name">action_close_panel_department
</field>
</record>
</odoo>
Step 4: Integration of the Onboarding Panel for Tree View
update the Department’s tree view in the onboarding panel. We’ll add the panel and inherit the Department’s current tree view.
<record id="hr_department_view_tree_inherit_banner_route" model="ir.ui.view">
<field name="name">hr.department.view.tree.inherit.banner.route</field>
<field name="model">hr.department</field>
<field name="inherit_id" ref="hr.view_department_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="banner_route">/onboarding/department</attribute>
</xpath>
</field>
</record>
We can create a new onboarding panel with our own processes for our views using all of these stages.
With this simple process can significantly improve the user happiness to integrate the onboarding panel into the Odoo 17 tree view. Whether you’re a developer or tweaking Odoo ERP for your UAE business or looking to boost team productivity, we hope this blog has all the steps and code you need to get going on it, if you have any doubts about it, feel free to contact us.
"Unlock the Full Potential of Your Business with Odoo ERP!"
"Get a Cost Estimate for Your ERP Project, Absolutely FREE!"
Get a Free Quote