Search code examples
javascriptodooodoo-13

How can i create new widget that show departments hierarchy in odoo 13?


I want to create a custom widget to show the departments hierarchy chart, and if there is a way to use the already existed hr_org_chart -which used on employee form show underlying employees- widget that will be fine.


Solution

  • hr.employee is hardcoded in hr_org_chart so you can only show the employee organisation hierarchy.

    You can create a new module based on hr_org_chart.

    You will need to replace hr.employee model with hr.department
    Replace employee_id with department_id
    Remove all fields that do not exist in the department model.
    Rename templates

    I did a quick test and it worked.