Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
149 Visualizações

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
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
2
out. 25
2240
0
nov. 24
3040
1
nov. 24
3305
1
nov. 24
2979
2
jun. 25
4888