forked from odoo/odoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] hr_org_chart: define hierarchy view for
hr.employee
model
This commit defines a hierarchy view for `hr.employee` model. task-3376776
- Loading branch information
Showing
6 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
addons/hr_org_chart/static/src/views/hr_employee_hierarchy/hr_employee_hierarchy_renderer.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** @odoo-module **/ | ||
|
||
import { Avatar } from "@mail/views/web/fields/avatar/avatar"; | ||
|
||
import { HierarchyRenderer } from "../hierarchy/hierarchy_renderer"; | ||
|
||
export class HrEmployeeHierarchyRenderer extends HierarchyRenderer { | ||
static template = "hr_org_chart.HrEmployeeHierarchyRenderer"; | ||
static components = { | ||
...HierarchyRenderer.components, | ||
Avatar, | ||
}; | ||
} |
7 changes: 7 additions & 0 deletions
7
...s/hr_org_chart/static/src/views/hr_employee_hierarchy/hr_employee_hierarchy_renderer.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.o_hierarchy_renderer { | ||
.o_hierarchy_parent_node_container { | ||
.o_avatar > span { | ||
width: 100% !important; | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...ns/hr_org_chart/static/src/views/hr_employee_hierarchy/hr_employee_hierarchy_renderer.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<templates> | ||
|
||
<t t-name="hr_org_chart.HrEmployeeHierarchyRenderer" t-inherit="hr_org_chart.HierarchyRenderer"> | ||
<xpath expr="//div[hasclass('o_hierarchy_parent_node_container')]/span" position="replace"> | ||
<Avatar | ||
resModel="row.parentNode.model.resModel" | ||
resId="row.parentNode.resId" | ||
displayName="row.parentNode.data.name" | ||
/> | ||
</xpath> | ||
</t> | ||
|
||
</templates> |
12 changes: 12 additions & 0 deletions
12
addons/hr_org_chart/static/src/views/hr_employee_hierarchy/hr_employee_hierarchy_view.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** @odoo-module **/ | ||
|
||
import { registry } from "@web/core/registry"; | ||
import { hierarchyView } from "../hierarchy/hierarchy_view"; | ||
import { HrEmployeeHierarchyRenderer } from "./hr_employee_hierarchy_renderer"; | ||
|
||
export const hrEmployeeHierarchyView = { | ||
...hierarchyView, | ||
Renderer: HrEmployeeHierarchyRenderer, | ||
}; | ||
|
||
registry.category("views").add("hr_employee_hierarchy", hrEmployeeHierarchyView); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters