Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
151 Widoki

I am using Odoo 18 (note: Odoo 18 has a different JavaScript structure compared to older versions).

I want to achieve the following:

  1. Create a simple controller that renders a template showing employee data.
  2. The template should contain a simple table displaying about 4 employees.
  3. On the backend (Python side), when I create or update data in the hr.employee model…
  4. The webpage (template from step 2) should display a simple notification without refreshing the page, for example: “Your employee records are updated”.
Awatar
Odrzuć
Najlepsza odpowiedź

Hi,


You want to create a webpage in Odoo 18 that displays a table of employee data and shows a notification whenever employee records are created or updated. The recommended approach is to create a custom module that adds a controller to render the employee table template, extends the hr.employee model to send a notification using bus.bus whenever records are created or updated, and includes JavaScript on the frontend to listen for these notifications and display them dynamically without refreshing the page. This setup leverages Odoo’s real-time messaging system to notify users of changes while keeping the module modular and upgrade-safe.


* https://www.cybrosys.com/blog/how-to-create-and-configure-web-controllers-in-odoo-18

* https://www.cybrosys.com/blog/key-elements-of-controller-request-and-response-in-odoo-18


Hope it helps

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
paź 25
2240
0
lis 24
3040
1
lis 24
3305
1
lis 24
2979
2
cze 25
4888