Creating a display notification in Odoo 17 is accomplished as follows:

In the ever-evolving realm of business management, user experience is crucial for the optimal functioning of software applications. Odoo 17, an agile and adaptable open-source ERP platform, acknowledges the significance of keeping users informed about vital updates, events, and actions within the system. A key feature enhancing a smooth user experience is the capability to showcase notifications.

Various notifications provided by Odoo include:

1. Persistent Notification

2. Rainbow Animation

3. Warning

4. Exception Trigger or Validation

Display notifications, often referred to as sticky notifications, offer instantaneous feedback by alerting users to critical events, reminders, or actions necessitating attention in real-time. Whether it's a pending approval, an impending deadline, or a system-wide update, notifications ensure users stay informed and engaged, fostering a more responsive and user-centric environment. Sticky notifications can be crafted using both Python and JavaScript.

Through Python scripting:

Below is an example Python code snippet for showcasing sticky notifications.

 return {
                'type': 'ir.actions.client',
                'tag': 'display_notification',
                'params': {
                    'title': _("Warning head"),
                    'type': 'warning',
                    'message': _("This is the detailed warning"),
                    'sticky': True,
                 },
             }


Next, we can examine each parameter of the sticky notification.

* 'title': This key accepts the title of the notification as its value.

* 'type': This attribute determines the color of the notification. Options include: 'danger' for red, 'warning' for orange, 'info' for blue, and 'success' for green.

* 'message': This field contains the content to be shown in the notification.

* 'sticky': An optional parameter that can be set to either True or False (Boolean value). When set to True, the notification remains visible until the user manually closes it. If set to False, it appears for a few seconds before automatically fading away.

* 'next': An optional parameter indicating the subsequent action to be performed.

I'm currently incorporating a button into the contact form and embedding the Python code within the Python method "action_test_sticky," which can be invoked using the button.

Below is the XML code for including a button in the contact form.

<xpath expr="//field[@name='category_id']" position="after">
 <button string="Test" type="object" name="action_test_sticky"class="oe_highlight"/>
</xpath>

This is what happens when you click the test button in the contact form—a sticky notification appears.

With JavaScript:

The parameters for a sticky notification in JavaScript are identical to those for a Python sticky notification.

Initially, we must import useService from "web/core/utils/hooks".

import { useService } from "@web/core/utils/hooks";

Next, define the notification within the setup() method.

setup() {
    this.notification = useService("notification");
}

Now, we can directly invoke the sticky notification from any method as follows.

this.notification.add(_t("Message detail."),
                {
                    title: _t("warning head"),
                    type: "warning",
         sticky: true                }
            );


Display notifications in Odoo serve various purposes, including assigning tasks, requesting approvals, issuing system alerts, and updating collaboration statuses. Users have the flexibility to personalize and prioritize notifications based on their individual roles and responsibilities.

How to Handle Bank Accounts and Transfer Cash Between Accounts in Odoo 17 Accounting