Commit Graph
9 Commits
Author SHA1 Message Date
Yannick Tivisse 9da4639b49 [IMP] hr_org_chart: Improve perf
From 300 to 100ms

Part-of: odoo/odoo#85133
2022-02-28 17:27:08 +00:00
Raphael Collet 34d6f87d54 [REF] core: put field.depends on registry and make field.recursive explicit
The attributes field.depends and field.depends_context are problematic
for sharing fields across registries, because they depend on the model's
registry class, which may vary from one registry to another.  In order
to make computed fields shareable, we have to move those values away
from fields.

For the same reason, field.recursive should not be inferred, because its
value may depend on the registry, although it is generally not the case.
Moreover, the flag recursive=True is set on a field when field triggers
are determined (on the registry).  A compute method may be called before
the flag is set (if no update has been done yet), and that can lead to
incorrect computations.

This happened in test TestUsers2.test_reified_groups in module 'base'.
The user groups view was apparently determined without the flag being
set, and the view depends on the recursive field 'trans_implied_ids',
which was not correctly computed.

We thus force developers to be explicit about recursive computed fields.
The code now logs a warning when the flag is not set up properly.
2021-05-03 12:33:29 +00:00
Swapnesh Shah 641bd9d8ef [FIX] hr_org_chart: Typo in field's label
closes odoo/odoo#47115

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-06 16:07:21 +00:00
jbm-odoo 3b40a324d6 [FIX] hr_org_chart: Avoid write on employee just by loading the view
Before this commit:
When loading a employee form, a write is done due to hr_org_chart

After this commit:
No write should be performed

closes odoo/odoo#42214

Taskid: 2150314
X-original-commit: 6e150ee19bb1f42c14d13218114ae9afbb84ebf4
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-19 17:24:31 +00:00
Swapnesh Shah 5fef9d27d0 [FIX] hr_org_chart: Compute non-stored fields in superuser mode
closes odoo/odoo#39428

X-original-commit: 1f2ff1e93b6fcbf2d6a2153465aa81852cc65816
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-28 11:10:47 +00:00
RomainLibert d09d5c2e8a [IMP] hr_org_chart: Adapt module with new hr.employee.public model 2019-05-31 10:21:20 +02:00
lul-odoo 48254cc8a1 [IMP] hr_org_chart: Allow recursion in hierarchy
Employees can appear multiple times in the org chart

Purpose
=======

Allow recursive hierarchy (an employee can be its own manager; e.g. the CEO is manager of everyone
but is also member of a department managed by the CTO who is himself managed by the CEO).
This means an employee might appear in multiple place in the organisational chart.

The button to see more of the hierarchy in the organisation chart opens all employees under the N+2 of the
current employee being displayed but does not open the view of the N+2.

Specification
=============

Add 'subordinates_ids' computed field on 'hr.employee' to get all subordinates (direct and indirect).

closes odoo/odoo#27900
2018-12-06 13:56:45 +00:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Fabien Pinckaers e25dd35a25 [ADD] hr_org_chart: organizational chart on employee forms
This commit introduces a new widget specific to employees. It is used
to display an org chart centered on the current displayed employee.
Two levels of managers as well as subordinates are displayed.

It is contained in its own module and its installation is available from
hr settings.

Thanks to Stefano Rigano <sri@odoo.com> (@stefanorigano) for design and UX
implementation.
2017-04-03 10:38:03 +02:00