Initial commit: OCA Technical packages (595 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:03 +02:00
commit 2cc02aac6e
24950 changed files with 2318079 additions and 0 deletions

View file

@ -0,0 +1,44 @@
# HR Org Chart Overview
Odoo addon: hr_org_chart_overview
## Installation
```bash
pip install odoo-bringout-oca-hr-hr_org_chart_overview
```
## Dependencies
This addon depends on:
- hr
## Manifest Information
- **Name**: HR Org Chart Overview
- **Version**: 16.0.1.0.0
- **Category**: Human Resources
- **License**: AGPL-3
- **Installable**: True
## Source
Based on [OCA/hr](https://github.com/OCA/hr) branch 16.0, addon `hr_org_chart_overview`.
## License
This package maintains the original AGPL-3 license from the upstream Odoo project.
## Documentation
- Overview: doc/OVERVIEW.md
- Architecture: doc/ARCHITECTURE.md
- Models: doc/MODELS.md
- Controllers: doc/CONTROLLERS.md
- Wizards: doc/WIZARDS.md
- Install: doc/INSTALL.md
- Usage: doc/USAGE.md
- Configuration: doc/CONFIGURATION.md
- Dependencies: doc/DEPENDENCIES.md
- Troubleshooting: doc/TROUBLESHOOTING.md
- FAQ: doc/FAQ.md

View file

@ -0,0 +1,32 @@
# Architecture
```mermaid
flowchart TD
U[Users] -->|HTTP| V[Views and QWeb Templates]
V --> C[Controllers]
V --> W[Wizards Transient Models]
C --> M[Models and ORM]
W --> M
M --> R[Reports]
DX[Data XML] --> M
S[Security ACLs and Groups] -. enforces .-> M
subgraph Hr_org_chart_overview Module - hr_org_chart_overview
direction LR
M:::layer
W:::layer
C:::layer
V:::layer
R:::layer
S:::layer
DX:::layer
end
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
```
Notes
- Views include tree/form/kanban templates and report templates.
- Controllers provide website/portal routes when present.
- Wizards are UI flows implemented with `models.TransientModel`.
- Data XML loads data/demo records; Security defines groups and access.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for hr_org_chart_overview. Configure related models, access rights, and options as needed.

View file

@ -0,0 +1,3 @@
# Controllers
This module does not define custom HTTP controllers.

View file

@ -0,0 +1,5 @@
# Dependencies
This addon depends on:
- [hr](../../odoo-bringout-oca-ocb-hr)

View file

@ -0,0 +1,4 @@
# FAQ
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
- Q: How to enable? A: Start server with --addon hr_org_chart_overview or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-hr-hr_org_chart_overview"
# or
uv pip install odoo-bringout-oca-hr-hr_org_chart_overview"
```

View file

@ -0,0 +1,12 @@
# Models
Detected core models and extensions in hr_org_chart_overview.
```mermaid
classDiagram
class hr_employee
```
Notes
- Classes show model technical names; fields omitted for brevity.
- Items listed under _inherit are extensions of existing models.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: hr_org_chart_overview. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon hr_org_chart_overview
- License: LGPL-3

View file

@ -0,0 +1,3 @@
# Reports
This module does not define custom reports.

View file

@ -0,0 +1,8 @@
# Security
This module does not define custom security rules or access controls beyond Odoo defaults.
Default Odoo security applies:
- Base user access through standard groups
- Model access inherited from dependencies
- No custom row-level security rules

View file

@ -0,0 +1,5 @@
# Troubleshooting
- Ensure Python and Odoo environment matches repo guidance.
- Check database connectivity and logs if startup fails.
- Validate that dependent addons listed in DEPENDENCIES.md are installed.

View file

@ -0,0 +1,7 @@
# Usage
Start Odoo including this addon (from repo root):
```bash
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon hr_org_chart_overview
```

View file

@ -0,0 +1,3 @@
# Wizards
This module does not include UI wizards.

View file

@ -0,0 +1,91 @@
=====================
HR Org Chart Overview
=====================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4cc882929b27dcf21a07d9f818d18f9675c48274c713e642c9d5b1bd9f55a872
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github
:target: https://github.com/OCA/hr/tree/16.0/hr_org_chart_overview
:alt: OCA/hr
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/hr-16-0/hr-16-0-hr_org_chart_overview
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/hr&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This module adds an extended Organization Chart Overview using
`OrgChart library <https://github.com/dabeng/OrgChart>`_ library.
**Table of contents**
.. contents::
:local:
Usage
=====
To use the module go to Employees > Reporting > Organizational Chart.
The chart can be expanded or collapsed by clicking on the arrows that appear
when the mouse is over a node (employee). Furthermore, clicking on an employee
will redirect the user to the form view of that employee.
Using the search bar, the user can filter the chart by entering the employee
name or department. To clear the filter, delete all introduced characters.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/hr/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/hr/issues/new?body=module:%20hr_org_chart_overview%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* ForgeFlow S.L.
Contributors
~~~~~~~~~~~~
* Adria Gil Sorribes <adria.gil@forgeflow.com>
* Lois Rilo Antelo <lois.rilo@forgeflow.com>
* Irfani <irfani@irfani.web.id>
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
This module is part of the `OCA/hr <https://github.com/OCA/hr/tree/16.0/hr_org_chart_overview>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View file

@ -0,0 +1 @@
from . import models

View file

@ -0,0 +1,27 @@
# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "HR Org Chart Overview",
"version": "16.0.1.0.0",
"category": "Human Resources",
"website": "https://github.com/OCA/hr",
"author": "ForgeFlow S.L., Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"application": False,
"summary": "Organizational Chart Overview",
"depends": ["hr"],
"data": ["views/hr_views.xml"],
"assets": {
"web.assets_backend": [
"hr_org_chart_overview/static/src/js/hr_org_chart_overview.js",
"hr_org_chart_overview/static/src/lib/orgchart/html2canvas.min.js",
"hr_org_chart_overview/static/src/lib/orgchart/jspdf.min.js",
"hr_org_chart_overview/static/src/lib/orgchart/jquery.orgchart.js",
"hr_org_chart_overview/static/src/lib/orgchart/jquery.orgchart.css",
"hr_org_chart_overview/static/src/scss/hr_org_chart_style.scss",
"hr_org_chart_overview/static/src/xml/**/*",
],
},
}

View file

@ -0,0 +1,39 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_org_chart_overview
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: hr_org_chart_overview
#. odoo-javascript
#: code:addons/hr_org_chart_overview/static/src/xml/hr_org_chart_overview.xml:0
#, python-format
msgid "Control panel toolbar"
msgstr "Traka alata kontrolne ploče"
#. module: hr_org_chart_overview
#: model:ir.model,name:hr_org_chart_overview.model_hr_employee
msgid "Employee"
msgstr "Zaposleni"
#. module: hr_org_chart_overview
#: model:ir.actions.client,name:hr_org_chart_overview.action_org_chart_overview
#: model:ir.ui.menu,name:hr_org_chart_overview.menu_org_chart_overview_report
msgid "Organizational Chart"
msgstr "Organizacioni dijagram"
#. module: hr_org_chart_overview
#. odoo-python
#: code:addons/hr_org_chart_overview/models/hr_employee.py:0
#, python-format
msgid "You cannot assign manager recursively."
msgstr "Broj indirektnih podređenih"

View file

@ -0,0 +1,39 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_org_chart_overview
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: hr_org_chart_overview
#. odoo-javascript
#: code:addons/hr_org_chart_overview/static/src/xml/hr_org_chart_overview.xml:0
#, python-format
msgid "Control panel toolbar"
msgstr ""
#. module: hr_org_chart_overview
#: model:ir.model,name:hr_org_chart_overview.model_hr_employee
msgid "Employee"
msgstr ""
#. module: hr_org_chart_overview
#: model:ir.actions.client,name:hr_org_chart_overview.action_org_chart_overview
#: model:ir.ui.menu,name:hr_org_chart_overview.menu_org_chart_overview_report
msgid "Organizational Chart"
msgstr ""
#. module: hr_org_chart_overview
#. odoo-python
#: code:addons/hr_org_chart_overview/models/hr_employee.py:0
#, python-format
msgid "You cannot assign manager recursively."
msgstr ""

View file

@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_org_chart_overview
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-05-24 11:10+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.17\n"
#. module: hr_org_chart_overview
#. openerp-web
#: code:addons/hr_org_chart_overview/static/src/xml/hr_org_chart_overview.xml:0
#, python-format
msgid "Control panel toolbar"
msgstr "Barra strumenti del pannello di controllo"
#. module: hr_org_chart_overview
#: model:ir.model,name:hr_org_chart_overview.model_hr_employee
msgid "Employee"
msgstr "Dipendente"
#. module: hr_org_chart_overview
#: model:ir.actions.client,name:hr_org_chart_overview.action_org_chart_overview
#: model:ir.ui.menu,name:hr_org_chart_overview.menu_org_chart_overview_report
msgid "Organizational Chart"
msgstr "Organigramma"
#. module: hr_org_chart_overview
#: code:addons/hr_org_chart_overview/models/hr_employee.py:0
#, python-format
msgid "You cannot assign manager recursively."
msgstr "Non si può assegnare un responsabile ricorsivamente."

View file

@ -0,0 +1,50 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_org_chart_overview
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-03-13 03:46+0000\n"
"Last-Translator: Eder Brito <britoederr@gmail.com>\n"
"Language-Team: none\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.3.2\n"
#. module: hr_org_chart_overview
#. openerp-web
#: code:addons/hr_org_chart_overview/static/src/xml/hr_org_chart_overview.xml:0
#, python-format
msgid "Control panel toolbar"
msgstr "Barra de ferramentas do painel de controle"
#. module: hr_org_chart_overview
#: model:ir.model.fields,field_description:hr_org_chart_overview.field_hr_employee__display_name
msgid "Display Name"
msgstr "Nome de Exibição"
#. module: hr_org_chart_overview
#: model:ir.model,name:hr_org_chart_overview.model_hr_employee
msgid "Employee"
msgstr "Funcionário"
#. module: hr_org_chart_overview
#: model:ir.model.fields,field_description:hr_org_chart_overview.field_hr_employee__id
msgid "ID"
msgstr "ID"
#. module: hr_org_chart_overview
#: model:ir.model.fields,field_description:hr_org_chart_overview.field_hr_employee____last_update
msgid "Last Modified on"
msgstr "Última Modificação em"
#. module: hr_org_chart_overview
#: model:ir.actions.client,name:hr_org_chart_overview.action_org_chart_overview
#: model:ir.ui.menu,name:hr_org_chart_overview.menu_org_chart_overview_report
msgid "Organizational Chart"
msgstr "Organograma"

View file

@ -0,0 +1,50 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * hr_org_chart_overview
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-11-16 11:36+0000\n"
"Last-Translator: Simon S <simon.stromberg@vertel.se>\n"
"Language-Team: none\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"
#. module: hr_org_chart_overview
#. openerp-web
#: code:addons/hr_org_chart_overview/static/src/xml/hr_org_chart_overview.xml:0
#, python-format
msgid "Control panel toolbar"
msgstr "Kontrollpanelens verktygsfält"
#. module: hr_org_chart_overview
#: model:ir.model.fields,field_description:hr_org_chart_overview.field_hr_employee__display_name
msgid "Display Name"
msgstr "Visningsnamn"
#. module: hr_org_chart_overview
#: model:ir.model,name:hr_org_chart_overview.model_hr_employee
msgid "Employee"
msgstr "Anställd"
#. module: hr_org_chart_overview
#: model:ir.model.fields,field_description:hr_org_chart_overview.field_hr_employee__id
msgid "ID"
msgstr "ID"
#. module: hr_org_chart_overview
#: model:ir.model.fields,field_description:hr_org_chart_overview.field_hr_employee____last_update
msgid "Last Modified on"
msgstr "Senast ändrad den"
#. module: hr_org_chart_overview
#: model:ir.actions.client,name:hr_org_chart_overview.action_org_chart_overview
#: model:ir.ui.menu,name:hr_org_chart_overview.menu_org_chart_overview_report
msgid "Organizational Chart"
msgstr "Organisationsschema"

View file

@ -0,0 +1 @@
from . import hr_employee

View file

@ -0,0 +1,85 @@
# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import _, api, models
from odoo.exceptions import ValidationError
org_chart_classes = {
0: "level-0",
1: "level-1",
2: "level-2",
3: "level-3",
4: "level-4",
}
class HrEmployee(models.Model):
_inherit = "hr.employee"
@api.constrains("parent_id")
def _check_parent_id(self):
if not self._check_recursion():
raise ValidationError(_("You cannot assign manager recursively."))
def _get_employee_domain(self, parent_id):
company = self.env.company
domain = ["|", ("company_id", "=", False), ("company_id", "=", company.id)]
if not parent_id:
domain.extend([("parent_id", "=", False), ("child_ids", "!=", False)])
else:
domain.append(("parent_id", "=", parent_id))
return domain
def _get_employee_data(self, level=0):
return {
"id": self.id,
"name": self.name,
"title": self.job_id.name,
"className": org_chart_classes[level],
"image": self.env["ir.attachment"]
.sudo()
.search(
[
("res_model", "=", "hr.employee"),
("res_id", "=", self.id),
("res_field", "=", "image_512"),
],
limit=1,
)
.datas,
}
@api.model
def _get_children_data(self, child_ids, level):
children = []
for employee in child_ids:
data = employee._get_employee_data(level)
employee_child_ids = self.search(self._get_employee_domain(employee.id))
if employee_child_ids:
data.update(
{
"children": self._get_children_data(
employee_child_ids, (level + 1) % 5
)
}
)
children.append(data)
return children
@api.model
def get_organization_data(self):
# First get employee with no manager
domain = self._get_employee_domain(False)
data = {"id": None, "name": "", "title": "", "children": []}
top_employees = self.search(domain)
for top_employee in top_employees:
child_data = top_employee._get_employee_data()
# If any child we fetch data recursively for childs of top employee
top_employee_child_ids = self.search(
self._get_employee_domain(top_employee.id)
)
if top_employee_child_ids:
child_data.update(
{"children": self._get_children_data(top_employee_child_ids, 1)}
)
data.get("children").append(child_data)
return data

View file

@ -0,0 +1,3 @@
* Adria Gil Sorribes <adria.gil@forgeflow.com>
* Lois Rilo Antelo <lois.rilo@forgeflow.com>
* Irfani <irfani@irfani.web.id>

View file

@ -0,0 +1,2 @@
This module adds an extended Organization Chart Overview using
`OrgChart library <https://github.com/dabeng/OrgChart>`_ library.

View file

@ -0,0 +1,8 @@
To use the module go to Employees > Reporting > Organizational Chart.
The chart can be expanded or collapsed by clicking on the arrows that appear
when the mouse is over a node (employee). Furthermore, clicking on an employee
will redirect the user to the form view of that employee.
Using the search bar, the user can filter the chart by entering the employee
name or department. To clear the filter, delete all introduced characters.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

@ -0,0 +1,436 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>HR Org Chart Overview</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: gray; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic, pre.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="hr-org-chart-overview">
<h1 class="title">HR Org Chart Overview</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:4cc882929b27dcf21a07d9f818d18f9675c48274c713e642c9d5b1bd9f55a872
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/hr/tree/16.0/hr_org_chart_overview"><img alt="OCA/hr" src="https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/hr-16-0/hr-16-0-hr_org_chart_overview"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/hr&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds an extended Organization Chart Overview using
<a class="reference external" href="https://github.com/dabeng/OrgChart">OrgChart library</a> library.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<p>To use the module go to Employees &gt; Reporting &gt; Organizational Chart.</p>
<p>The chart can be expanded or collapsed by clicking on the arrows that appear
when the mouse is over a node (employee). Furthermore, clicking on an employee
will redirect the user to the form view of that employee.</p>
<p>Using the search bar, the user can filter the chart by entering the employee
name or department. To clear the filter, delete all introduced characters.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/hr/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/hr/issues/new?body=module:%20hr_org_chart_overview%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>ForgeFlow S.L.</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Adria Gil Sorribes &lt;<a class="reference external" href="mailto:adria.gil&#64;forgeflow.com">adria.gil&#64;forgeflow.com</a>&gt;</li>
<li>Lois Rilo Antelo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
<li>Irfani &lt;<a class="reference external" href="mailto:irfani&#64;irfani.web.id">irfani&#64;irfani.web.id</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
</a>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/hr/tree/16.0/hr_org_chart_overview">OCA/hr</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,239 @@
odoo.define("hr_org_chart_overview", function (require) {
"use strict";
var core = require("web.core");
var AbstractAction = require("web.AbstractAction");
var HrOrgChartOverview = AbstractAction.extend({
contentTemplate: "HrOrgChartOverview",
events: {
"click .node": "_onClickNode",
"click #print-pdf": "_onPrintPDF",
"keyup #key-word": "_onKeyUpSearch",
"click #zoom-in": "_onClickZoomIn",
"click #zoom-out": "_onClickZoomOut",
"click #toggle-pan": "_onClickTogglePan",
},
init: function (parent) {
this.orgChartData = {};
this.actionManager = parent;
console.log(this.actionManager);
this._super.apply(this, arguments);
},
/**
* @override
*/
willStart: function () {
var self = this;
var def = this._rpc({
model: "hr.employee",
method: "get_organization_data",
}).then(function (res) {
self.orgChartData = res;
return;
});
return Promise.all([def, this._super.apply(this, arguments)]);
},
_getNodeTemplate: function (data) {
return `
<span class="image"><img src="data:image/png;base64,${data.image}"/></span>
<div class="title">${data.name}</div>
<div class="content">${data.title}</div>
`;
},
_renderButtons: function () {
this.$buttons = this.$(".o_cp_buttons");
this.$buttons.prepend(`
<button type="button" id="print-pdf" class="btn btn-primary o-kanban-button-new" accesskey="p">
Print PDF
</button>
<button type="button" id="zoom-in" class="btn btn-primary o-kanban-button-new" accesskey="+">
<i class="fa fa-plus" title="Zoom In"></i>
</button>
<button type="button" id="toggle-pan" class="btn o-kanban-button-new" accesskey="m">
<i class="fa fa-arrows" title="Toggle Pan"></i>
</button>
<button type="button" id="zoom-out" class="btn btn-primary o-kanban-button-new" accesskey="-">
<i class="fa fa-minus" title="Zoom Out"></i>
</button>
`);
},
_renderSearchView: function () {
this.$searchView = this.$(".o_cp_searchview");
this.$searchView.prepend(`
<div class="o_searchview" role="search" aria-autocomplete="list">
<div class="o_searchview_input_container">
<input type="text" class="o_searchview_input" id="key-word" accesskey="Q" placeholder="Search...">
</div>
</div>
`);
},
_renderBreadcrumb: function () {
this.$breadcrumb = this.$(".breadcrumb");
this.$breadcrumb.prepend(`
<li class="breadcrumb-item active">Organizational Chart</li>
`);
},
_updateControlPanel: function () {
this._renderButtons();
this._renderSearchView();
this._renderBreadcrumb();
},
start: function () {
this.oc = this.$("#chart-container").orgchart({
data: this.orgChartData,
nodeContent: "title",
nodeTemplate: this._getNodeTemplate,
exportFilename: "MyOrgChart",
});
this._updateControlPanel();
return this._super.apply(this, arguments);
},
_filterNodes: function (keyWord) {
var show = false;
var $chart = this.$(".orgchart");
// Disalbe the expand/collapse feture
$chart.addClass("noncollapsable");
// Distinguish the matched nodes and the unmatched nodes according to the given key word
$chart
.find(".node")
.filter(function (index, node) {
$(node).removeClass("matched");
$(node).removeClass("retained");
if ($(node).text().toLowerCase().indexOf(keyWord) > -1) {
show = true;
}
return $(node).text().toLowerCase().indexOf(keyWord) > -1;
})
.addClass("matched")
.closest("table")
.parents("table")
.find("tr:first")
.find(".node")
.addClass("retained");
// Hide the unmatched nodes
$chart.find(".matched,.retained").each(function (index, node) {
$(node)
.removeClass("slide-up")
.closest(".nodes")
.removeClass("hidden")
.siblings(".lines")
.removeClass("hidden");
var $unmatched = $(node)
.closest("table")
.parent()
.siblings()
.find(".node:first:not(.matched,.retained)")
.closest("table")
.parent()
.addClass("hidden");
$unmatched
.parent()
.prev()
.children()
.slice(1, $unmatched.length * 2 + 1)
.addClass("hidden");
});
// Hide the redundant descendant nodes of the matched nodes
$chart.find(".matched").each(function (index, node) {
if (!$(node).closest("tr").siblings(":last").find(".matched").length) {
$(node).closest("tr").siblings().addClass("hidden");
}
});
if (show) {
this.$("#chart-container").removeClass("hidden");
} else {
this.$("#chart-container").addClass("hidden");
}
},
_clearFilterResults: function () {
this.$(".orgchart")
.removeClass("noncollapsable")
.find(".node")
.removeClass("matched retained")
.end()
.find(".hidden")
.removeClass("hidden")
.end()
.find(".slide-up, .slide-left, .slide-right")
.removeClass("slide-up slide-right slide-left");
},
_openEmployeeFormView: function (id) {
var self = this;
// Go to the employee form view
self._rpc({
model: "hr.employee",
method: "get_formview_action",
args: [[id]],
}).then(function (action) {
self.trigger_up("do_action", {action: action});
});
},
_onClickNode: function (ev) {
ev.preventDefault();
this._openEmployeeFormView(parseInt(ev.currentTarget.id));
},
_onPrintPDF: function (ev) {
ev.preventDefault();
this.oc.export(this.oc.exportFilename, "pdf");
},
_onClickZoomIn: function (ev) {
ev.preventDefault();
this.oc.setChartScale(this.oc.$chart, 1.1);
},
_onClickZoomOut: function (ev) {
ev.preventDefault();
this.oc.setChartScale(this.oc.$chart, 0.9);
},
_onClickTogglePan: function (ev) {
ev.preventDefault();
var update_pan_to = !this.oc.options.pan;
this.oc.options.pan = update_pan_to;
this.oc.setOptions("pan", update_pan_to);
if (update_pan_to === true) {
$("#toggle-pan").addClass("btn-primary");
} else {
$("#toggle-pan").removeClass("btn-primary");
}
},
_onPrintPNG: function (ev) {
ev.preventDefault();
this.oc.export(this.oc.exportFilename);
},
_onKeyUpSearch: function (ev) {
var value = ev.target.value.toLowerCase();
if (value.length === 0) {
this._clearFilterResults();
} else {
this._filterNodes(value);
}
},
});
core.action_registry.add("hr_org_chart_overview", HrOrgChartOverview);
return HrOrgChartOverview;
});

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,693 @@
/*
* jQuery OrgChart Plugin
* https://github.com/dabeng/OrgChart
*
* Copyright 2016, dabeng
* https://github.com/dabeng
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.orgchart {
box-sizing: border-box;
display: inline-block;
min-height: 202px;
min-width: 202px;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-image: linear-gradient(90deg, rgba(200, 0, 0, 0.15) 10%, rgba(0, 0, 0, 0) 10%), linear-gradient(rgba(200, 0, 0, 0.15) 10%, rgba(0, 0, 0, 0) 10%);
background-size: 10px 10px;
border: 1px dashed rgba(0,0,0,0);
padding: 20px;
}
.orgchart .hidden, .orgchart~.hidden {
display: none;
}
.orgchart.b2t {
transform: rotate(180deg);
}
.orgchart.l2r {
position: absolute;
transform: rotate(-90deg) rotateY(180deg);
transform-origin: left top;
}
.orgchart .verticalNodes ul {
list-style: none;
margin: 0;
padding-left: 18px;
text-align: left;
}
.orgchart .verticalNodes ul:first-child {
margin-top: 2px;
}
.orgchart .verticalNodes>td::before {
content: '';
border: 1px solid rgba(217, 83, 79, 0.8);
}
.orgchart .verticalNodes>td>ul>li:first-child::before {
box-sizing: border-box;
top: -4px;
height: 30px;
width: calc(50% - 2px);
border-width: 2px 0 0 2px;
}
.orgchart .verticalNodes ul>li {
position: relative;
}
.orgchart .verticalNodes ul>li::before,
.orgchart .verticalNodes ul>li::after {
box-sizing: border-box;
content: '';
position: absolute;
left: -6px;
border-color: rgba(217, 83, 79, 0.8);
border-style: solid;
border-width: 0 0 2px 2px;
}
.orgchart .verticalNodes ul>li::before {
top: -4px;
height: 30px;
width: 11px;
}
.orgchart .verticalNodes ul>li::after {
top: 1px;
height: 100%;
}
.orgchart .verticalNodes ul>li:first-child::after {
box-sizing: border-box;
top: 24px;
width: 11px;
border-width: 2px 0 0 2px;
}
.orgchart .verticalNodes ul>li:last-child::after {
box-sizing: border-box;
border-width: 2px 0 0;
}
.orgchart.r2l {
position: absolute;
transform: rotate(90deg);
transform-origin: left top;
}
.orgchart>.spinner::before {
width: 100px;
height: 100px;
border-width: 10px;
border-radius: 50px;
margin-top: 30px;
border-top-color: rgba(68, 157, 68, 0.8);
border-bottom-color: rgba(68, 157, 68, 0.8);
border-left-color: rgba(68, 157, 68, 0.8);
}
.orgchart table {
border-spacing: 0;
border-collapse: separate;
}
.orgchart>table:first-child{
margin: 20px auto;
}
.orgchart td {
text-align: center;
vertical-align: top;
padding: 0;
}
.orgchart .lines:nth-child(3) td {
box-sizing: border-box;
height: 20px;
}
.orgchart .lines .topLine {
border-top: 2px solid rgba(217, 83, 79, 0.8);
}
.orgchart .lines .rightLine {
border-right: 1px solid rgba(217, 83, 79, 0.8);
float: none;
border-radius: 0;
}
.orgchart .lines .leftLine {
border-left: 1px solid rgba(217, 83, 79, 0.8);
float: none;
border-radius: 0;
}
.orgchart .lines .downLine {
background-color: rgba(217, 83, 79, 0.8);
margin: 0 auto;
height: 20px;
width: 2px;
float: none;
}
/* node styling */
.orgchart .node {
box-sizing: border-box;
display: inline-block;
position: relative;
margin: 0;
padding: 3px;
border: 2px dashed transparent;
text-align: center;
}
.orgchart.l2r .node, .orgchart.r2l .node {
width: 50px;
height: 140px;
}
.orgchart .node>.spinner {
position: absolute;
top: calc(50% - 1rem);
left: calc(50% - 1rem);
}
.orgchart .node>.spinner::before {
width: 2rem;
height: 2rem;
border-width: 0.2rem;
border-radius: 1rem;
border-top-color: rgba(68, 157, 68, 0.8);
border-bottom-color: rgba(68, 157, 68, 0.8);
border-left-color: rgba(68, 157, 68, 0.8);
}
.orgchart .node:hover {
background-color: rgba(238, 217, 54, 0.5);
transition: .5s;
cursor: default;
z-index: 20;
}
.orgchart .node.focused {
background-color: rgba(238, 217, 54, 0.5);
}
.orgchart .ghost-node {
position: fixed;
left: -10000px;
top: -10000px;
}
.orgchart .ghost-node rect {
fill: #ffffff;
stroke: #bf0000;
}
.orgchart .node.allowedDrop {
border-color: rgba(68, 157, 68, 0.9);
}
.orgchart .node .title {
box-sizing: border-box;
padding: 2px;
width: 130px;
text-align: center;
font-size: 0.75rem;
font-weight: bold;
height: 20px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background-color: rgba(217, 83, 79, 0.8);
color: #fff;
border-radius: 4px 4px 0 0;
}
.orgchart.b2t .node .title {
transform: rotate(-180deg);
transform-origin: center bottom;
}
.orgchart.l2r .node .title {
transform: rotate(-90deg) translate(-45px, -45px) rotateY(180deg);
transform-origin: bottom center;
}
.orgchart.r2l .node .title {
transform: rotate(-90deg) translate(-45px, -45px);
transform-origin: bottom center;
}
.orgchart .node .title .symbol {
float: left;
margin-top: 12px;
margin-left: 2px;
}
.orgchart .node .title .symbol::before {
background-color: #fff;
border-color: rgba(217, 83, 79, 0.8);
}
.orgchart .node .title .symbol::after {
background-color: #fff;
}
.orgchart .node .content {
box-sizing: border-box;
padding: 2px;
height: 20px;
font-size: 0.625rem;
border: 1px solid rgba(217, 83, 79, 0.8);
border-radius: 0 0 4px 4px;
text-align: center;
background-color: #fff;
color: #333;
text-overflow: ellipsis;
white-space: nowrap;
}
.orgchart.b2t .node .content {
transform: rotate(180deg);
transform-origin: center top;
}
.orgchart.l2r .node .content {
transform: rotate(-90deg) translate(-45px, -45px) rotateY(180deg);
transform-origin: top center;
width: 130px;
}
.orgchart.r2l .node .content {
transform: rotate(-90deg) translate(-45px, -45px);
transform-origin: top center;
width: 130px;
}
.orgchart .node .edge {
position: absolute;
cursor: default;
transition: .2s;
}
.orgchart .node .edge::before {
border-color: rgba(68, 157, 68, 0.5);
}
.orgchart.noncollapsable .node .edge {
display: none;
}
.orgchart .node .edge:hover {
cursor: pointer;
}
.orgchart .edge:hover::before {
border-color: #449d44;
}
.orgchart .node .verticalEdge {
width: calc(100% - 6px);
width: -webkit-calc(100% - 6px);
width: -moz-calc(100% - 6px);
height: 10px;
left: 3px;
}
.orgchart .node .verticalEdge::before {
position: absolute;
left: calc(50% - 0.3125rem);
}
.orgchart .node .topEdge {
top: -2px;
}
.orgchart .node .topEdge.oci-chevron-up::before {
top: 2px;
}
.orgchart .node .topEdge.oci-chevron-down::before {
bottom: 3px;
}
.orgchart .node .bottomEdge {
bottom: -2px;
}
.orgchart .node .bottomEdge.oci-chevron-up::before {
bottom: -3px;
}
.orgchart .node .bottomEdge.oci-chevron-down::before {
bottom: 1px;
}
.orgchart .node .horizontalEdge {
width: 10px;
height: calc(100% - 6px);
height: -webkit-calc(100% - 6px);
height: -moz-calc(100% - 6px);
top: 3px;
}
.orgchart .node .rightEdge {
right: -2px;
}
.orgchart .node .leftEdge {
left: -2px;
}
.orgchart .node .horizontalEdge::before {
position: absolute;
top: calc(50% - 0.3125rem);
}
.orgchart .node .rightEdge.oci-chevron-left::before {
right: -3px;
}
.orgchart .node .rightEdge.oci-chevron-right::before {
right: 1px;
}
.orgchart .node .leftEdge.oci-chevron-right::before {
left: -3px;
}
.orgchart .node .leftEdge.oci-chevron-left::before {
left: 1px;
}
.orgchart .node .toggleBtn {
position: absolute;
left: 5px;
bottom: -2px;
}
.orgchart .node .toggleBtn::before {
background-color: rgba(68, 157, 68, 0.6);
}
.orgchart .node .toggleBtn:hover::before {
background-color: #449d44;
}
.oc-export-btn {
display: inline-block;
position: absolute;
right: 5px;
top: 5px;
padding: 6px 12px;
margin-bottom: 0;
font-size: 14px;
font-weight: 400;
line-height: 1.42857143;
text-align: center;
white-space: nowrap;
vertical-align: middle;
touch-action: manipulation;
cursor: pointer;
user-select: none;
color: #fff;
background-color: #5cb85c;
border: 1px solid transparent;
border-color: #4cae4c;
border-radius: 4px;
}
.oc-export-btn[disabled] {
cursor: not-allowed;
box-shadow: none;
opacity: 0.3;
}
.oc-export-btn:hover,.oc-export-btn:focus,.oc-export-btn:active {
background-color: #449d44;
border-color: #347a34;
}
.orgchart~.mask {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 999;
text-align: center;
background-color: rgba(0,0,0,0.3);
}
.orgchart~.mask .spinner {
position: absolute;
top: calc(50% - 50px);
left: calc(50% - 50px);
}
.orgchart~.mask .spinner::before {
width: 100px;
height: 100px;
border-width: 10px;
border-radius: 50px;
border-top-color: rgba(68, 157, 68, 0.8);
border-bottom-color: rgba(68, 157, 68, 0.8);
border-left-color: rgba(68, 157, 68, 0.8);
}
.orgchart .node {
transition: transform 0.3s, opacity 0.3s;
}
.orgchart .slide-down {
opacity: 0;
transform: translateY(40px);
}
.orgchart.l2r .node.slide-down, .orgchart.r2l .node.slide-down {
transform: translateY(130px);
}
.orgchart .slide-up {
opacity: 0;
transform: translateY(-40px);
}
.orgchart.l2r .node.slide-up, .orgchart.r2l .node.slide-up {
transform: translateY(-130px);
}
.orgchart .slide-right {
opacity: 0;
transform: translateX(130px);
}
.orgchart.l2r .node.slide-right, .orgchart.r2l .node.slide-right {
transform: translateX(40px);
}
.orgchart .slide-left {
opacity: 0;
transform: translateX(-130px);
}
.orgchart.l2r .node.slide-left, .orgchart.r2l .node.slide-left {
transform: translateX(-40px);
}
/* oci means organization chart icons */
.oci {
display: inline-block;
position: relative;
font-style: normal;
font-family: Arial;
}
.oci-chevron-up::before {
content: "";
display: inline-block;
box-sizing: border-box;
vertical-align: text-bottom;
width: 0.625rem;
height: 0.625rem;
border-width: 0 0.2rem 0.2rem 0;
border-style: solid;
border-color: #000;
background: transparent;
transform: rotate(-135deg);
}
.oci-chevron-right::before {
content: "";
display: inline-block;
box-sizing: border-box;
width: 0.625rem;
height: 0.625rem;
border-width: 0 0.2rem 0.2rem 0;
border-style: solid;
border-color: #000;
background: transparent;
transform: rotate(-45deg);
}
.oci-chevron-down::before {
content: "";
display: inline-block;
box-sizing: border-box;
width: 0.625rem;
height: 0.625rem;
border-width: 0 0.2rem 0.2rem 0;
border-style: solid;
border-color: #000;
background: transparent;
transform: rotate(45deg);
}
.oci-chevron-left::before {
content: "";
display: inline-block;
box-sizing: border-box;
width: 0.625rem;
height: 0.625rem;
border-width: 0 0.2rem 0.2rem 0;
border-style: solid;
border-color: #000;
background: transparent;
transform: rotate(135deg);
}
.oci-leader::before {
position: absolute;
content: "";
display: inline-block;
width: 0.4rem;
height: 0.4rem;
border-radius: 0.2rem;
background: #000;
top: -0.75rem;
left: 0.1rem;
}
.oci-leader::after {
position: absolute;
content: "";
display: inline-block;
width: 0.875rem;
height: 0.375rem;
border-radius: 0.25rem 0.25rem 0 0;
background: #000;
top: -0.3rem;
left: -0.125rem;
}
.oci-plus-square::before {
content: "+";
display: inline-block;
vertical-align: text-bottom;
text-align: center;
width: 1rem;
height: 1rem;
background-color: #000;
color: #fff;
}
.oci-plus-circle::before {
content: "+";
display: inline-block;
vertical-align: text-bottom;
text-align: center;
width: 1rem;
height: 1rem;
border-radius: 0.5rem;
background-color: #000;
color: #fff;
}
.oci-minus-square::before {
content: "";
display: inline-block;
vertical-align: text-bottom;
text-align: center;
width: 1rem;
height: 1rem;
background-color: #000;
color: #fff;
}
.oci-minus-circle::before {
content: "";
display: inline-block;
vertical-align: text-bottom;
text-align: center;
width: 1rem;
height: 1rem;
border-radius: 0.5rem;
background-color: #000;
color: #fff;
}
.oci-arrow-circle-up::before {
content: "▲";
display: inline-block;
text-align: center;
vertical-align: text-bottom;
width: 1rem;
height: 1rem;
border-radius: 0.5rem;
background-color: #000;
color: #fff;
font-size: 0.875rem;
}
.oci-arrow-circle-down::before {
content: "▼";
text-align: center;
display: inline-block;
vertical-align: text-bottom;
width: 1rem;
height: 1rem;
border-radius: 0.5rem;
background-color: #000;
color: #fff;
font-size: 0.875rem;
}
.oci-info-circle::before {
content: "i";
display: inline-block;
vertical-align: text-bottom;
width: 1rem;
height: 1rem;
border-radius: 0.5rem;
background-color: #000;
color: #fff;
text-align: center;
font-weight: bold;
}
.oci-spinner::before {
content: "";
vertical-align: text-bottom;
display: inline-block;
box-sizing: border-box;
width: 1rem;
height: 1rem;
border: 0.1rem solid #000;
border-right-color: transparent;
border-radius: 0.625rem;
animation: oci-infinite-spinning .75s linear infinite;
}
@keyframes oci-infinite-spinning {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,109 @@
.custom_control_panel .o_control_panel {
position: fixed;
width: 100%;
z-index: 1;
}
.image img {
max-height: 120px;
max-width: 120px;
border-radius: 50%;
}
.orgchart {
margin-top: 50px;
background: #f9f9f9 !important;
.node .title {
font-size: 1rem;
min-width: 200px;
}
.node .content {
font-size: 1rem;
}
}
.o-filter-button {
margin-right: 10px;
}
.orgchart td.left,
.orgchart td.right,
.orgchart td.top {
border-color: #aaa !important;
}
.orgchart td > .down {
background-color: #aaa !important;
}
.orgchart .level-0 .title {
background-color: #006699 !important;
}
.orgchart .level-0 .content {
border-color: #006699 !important;
}
.orgchart .level-0 .image img {
border: solid 1px #006699;
}
.orgchart .level-1 .title {
background-color: #009933 !important;
}
.orgchart .level-1 .content {
border-color: #009933 !important;
}
.orgchart .level-1 .image img {
border: solid 1px #009933;
}
.orgchart .level-2 .title {
background-color: #993366 !important;
}
.orgchart .level-2 .content {
border-color: #993366 !important;
}
.orgchart .level-2 .image img {
border: solid 1px #993366;
}
.orgchart .level-3 .title {
background-color: #996633 !important;
}
.orgchart .level-3 .content {
border-color: #996633 !important;
}
.orgchart .level-3 .image img {
border: solid 1px #996633;
}
.orgchart .level-4 .title {
background-color: #cc0066 !important;
}
.orgchart .level-4 .content {
border-color: #cc0066 !important;
}
.orgchart .level-4 .image img {
border: solid 1px #cc0066;
}
/* Hide the very first 3 rows (that represent the pseudo root element) */
.orgchart > table > tr:nth-child(-n + 3) {
display: none;
}
/* in the .node class of the root, search for the first children of root and
hide their topEdge arrow which is associated to the pseudo root elemen */
.orgchart > table > tr.nodes > td > table > tbody > tr > td > div.node > i.topEdge {
display: none;
}

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates>
<t t-name="ControlPanel">
<div class="o_control_panel">
<div>
<div class="o_cp_top_left">
<ol class="breadcrumb" role="navigation" />
</div>
<div class="o_cp_top_right">
<div class="o_cp_searchview" role="search">
<t t-if="widget.withSearchBar" t-call="SearchView" />
</div>
</div>
</div>
<div>
<div class="o_cp_left">
<div
class="o_cp_buttons"
role="toolbar"
aria-label="Control panel toolbar"
/>
<aside class="o_cp_sidebar" />
</div>
</div>
</div>
</t>
<t t-name="HrOrgChartOverview">
<div class="custom_control_panel">
<t t-call="ControlPanel" />
</div>
<div id="chart-container" />
</t>
</templates>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="action_org_chart_overview" model="ir.actions.client">
<field name="name">Organizational Chart</field>
<field name="tag">hr_org_chart_overview</field>
<field name="target">main</field>
</record>
<menuitem
parent="hr.hr_menu_hr_reports"
id="menu_org_chart_overview_report"
action="action_org_chart_overview"
sequence="1"
/>
</odoo>

View file

@ -0,0 +1,42 @@
[project]
name = "odoo-bringout-oca-hr-hr_org_chart_overview"
version = "16.0.0"
description = "HR Org Chart Overview - Organizational Chart Overview"
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-hr>=16.0.0",
"requests>=2.25.1"
]
readme = "README.md"
requires-python = ">= 3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
]
[project.urls]
homepage = "https://github.com/bringout/0"
repository = "https://github.com/bringout/0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["hr_org_chart_overview"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]