Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
147 Näkymät

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”.
Avatar
Hylkää
Paras vastaus

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

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
lokak. 25
2240
0
marrask. 24
3040
1
marrask. 24
3305
1
marrask. 24
2979
2
kesäk. 25
4888