Commit Graph
233 Commits
Author SHA1 Message Date
Xavier Bol (xbo) f009f19fc5 [FIX] web_hierarchy,hr_org_chart: remove highlight on focus record
Before this commit, the highlight added on a focus record, that styling
added was useful when we displayed only the first result in the search
to be able to build a tree but since now all the records found with
the search made by the user are shown without building a tree if it
is not possible then it is no longer needed to highlight the records
found.

This commit removes the highlight added on the focused record, the one
found by the search since it is not really needed.

task-3556262

closes odoo/odoo#138803

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-10-18 15:26:33 +00:00
Xavier Bol (xbo) e7360074e9 [FIX] hr_org_chart: add icon in stat button to go to org chart view
task-3556262

Part-of: odoo/odoo#138803
2023-10-18 15:26:33 +00:00
Xavier Bol (xbo) a055b9c20e [MOV] hr_org_chart,web_hierarchy: move hierarchy view in its own module
This commit moves the generic code of hierarchy view into new module
called `web_hierarchy` to be able to use it outside the hr scope.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) 55571bc1ac [IMP] hr_org_chart: add test for hierarchy view
This commit adds some tests for the hierarchy view to test most of
features implemented on that view.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) 77afd2833f [IMP] hr_org_chart: add stat button in hr.employee form view
This commit adds a stat button in the form view `hr.employee` model
to be able to go to the org chart and visualize the hierarchy of
the current record displayed in the form view.
The action used inside that stat button cannot have a domain to filter
the result to just have the current record since the user will not
be able to search into the search view. The alternative is to use
a context used inside the hierarchy view to add the domain only when
we load the view (as it is a default domain).

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) 6df589a73b [IMP] hr_org_chart: add hierarchy view for hr.employee.public model
This commit defines a hierarchy view for `hr.employee.public` model.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) 879e4e3412 [IMP] hr_org_chart: add opacity when one of siblings is unfolded
Before this commit, when the user unfolds a node to display its child
nodes, if that node unfolded has some child nodes then it could be
difficult for the user to clearly see the hierarchy.

This commit adds an opacity to 50% for the sibling nodes when the user
unfold a node in the same row.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) 3489a0d28f [IMP] hr_org_chart: auto scroll in hierarchy view
Before this commit, when the user unfold a node in hierarchy view,
he has to scroll to be able to see the child nodes added.

This commit adds an auto-scroll when a new row is added to directly
show the child nodes added on the view when the user unfolds a node
in the hirarchy view.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) 3e5e6fd3e3 [IMP] hr_org_chart: add new menu Org Chart in Employee menu
This commit adds a new menu called `Org Chart` in Emnployee menu
to directly have the Org chart view as first view when the user
clicks on that button.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) 2f463b564b [IMP] hr_org_chart: add drag&drop in hierarchy view
This commit allows the user to drag and drop a record (hierarchy
node) into another one to set the one hovered as the manager of the
one dragged. It also allows to drag a record into a row to define
the manager of the row as the manager of the record dragged.
This commit also adds an new attribute on `hierarchy` tag to use
when we define that view for a certain model to enable the drag and
drop feature.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) 5ade959732 [IMP] hr_org_chart: allow to define custom icon in hierarchy card
Before this commit, the icon displayed inside the Unfold button with
the number of child nodes is the default one. In the employee hierarchy
view, since the child nodes are obviously employees, the icon could
be the one displayed users (`fa-users`).

This commit adds a new attribute called `icon` on `hierarchy` tag
to be able to define another icon displayed on that button. By
doing that, the icon displayed inside employee hierarchy view can
changed to have the one expected and more relevant.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) 7223f1ae8b [IMP] hr_org_chart: define hierarchy view for hr.department
This commit defines a hierarchy view for `hr.department` model.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) 95e0149659 [IMP] hr_org_chart: define hierarchy view for hr.employee model
This commit defines a hierarchy view for `hr.employee` model.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) 03ce25127d [IMP] hr_org_chart: add child_count in unfold button of hierarchy card
Before this commit, the user can unfold a node in hierarchy view but
before clicking on it he cannot know how many child nodes there are.

This commit adds the number of child nodes in the Unfold button with
the default icon.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) 1048111a18 [IMP] hr_org_chart,web: define icon class on i tag for view button icon
Before this commit, the icon of the hierarchy view should be rotate
of 90 deg to have an appropriate icon for the view. The problem is
since the icon class is added on button classes, the button will
also be rotated with the icon instead of just the icon.

This commit defines a `i` tag inside the `button` element to select
the view to be able to apply css rotation only on the icon instead
of the whole button.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) e28e1e5b25 [IMP] hr_org_chart,web: extend kanban compiler for hierarchy view
This commit extends the kanban compiler for the hirarchy view. Some
changes has been done in the kanban compiler to be able to reuse the
existing code.

task-3376776
2023-10-16 08:17:31 +02:00
Xavier Bol (xbo) 16c4a54d42 [ADD] hr_org_chart: add hierarchy view
This commit adds a new view called hierarchy view, that view allows
the user to visualize a hierarchy in a model. For instance, that view
could be used for `hr.employee` to easily visualize the hierarchy
inside the company (the manager and his employees) as an Organization
Chart.
That commit introduces a new method for the hierarchy view, called
`hierarchy_read`, that method will be when the view will be loaded
to get the initial data to display.

Some details for the definition of that new view:
------------------------------------------------

Some attributes can be defined on the `hierarchy` tag:
- `parent_field` (default='parent_id') contains the parent field name
  to use to find the parent record of the current to build the hierarchy.
- `child_field` (optional attribute) contains the child field name
  to use to find the child records (it is in fact the one2many field).
  If that field is defined then some queries can be avoided since we
  directly fetch the children when a read/search_read is done.

Inside the `hierarchy` tag, the fields to read can be added and then
a template as to be defined as we do when we define the kanban view.
The template to create is called `hierarchy-box` and that template
will be used to display the card inside a node in the hierarchy view.

task-3376776
2023-10-16 08:17:31 +02:00
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Michael (mcm) 1f5e8f0fd4 [IMP] web,*: remove web.session
This commit removes the legacy session and adapts the modules where it
was used.

task 3439226

closes odoo/odoo#133153

Related: odoo/enterprise#46290
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-08-29 11:10:47 +00:00
Pierre Pulinckx (pipu) c07181b20b [REF] *: Replace env._t() by _t()
In this commit, all usages of env._t() are replaced by _t().
In templates files, env._t() didn't work because terms used
in attributes where not extracted into the translation files.
Only string are exported from .xml files to translation files.
So, to make it works, we set a variable that is then used
in attributes.
For example :

<t t-set="string_to_translate">String to translate</t>
<Dialog title="string_to_translate>...</Dialog>

task-3292454

closes odoo/odoo#131390

Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-18 19:17:16 +02:00
Jorge Pinna Puissant e338487028 [REF] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
218ad8456a [REF] *: adapt codebase to new RelationalModel
This commit adapts the code in addons w.r.t. the introduction of
the RelationalModel.

Main changes that were requested are:
 - record datapoints no longer always have an "id" key in their
 data (they still do if the id field is in the view), so we use
 record.resId instead
 - the new model is based on fined-grained reactivity, so several
 components that previously relied on onWillUpdateProps to update
 their internal state no longer worked. Typically, using the hook
 "observeRecord" is the way to go now.
 - specialdata are no longer handled in the model, so the components
 needing specialData can use the hook "useSpecialData"
 - more generally, all overrides of models (RelationalModel or
 KanbanModel) needed to be reworked.

Part of task~3179751

Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
2023-07-24 20:17:50 +02:00
Thomas Lefebvre (thle) 352345a1af [FIX] hr_org_chart: use context in kwargs
Steps to reproduce:
-------------------
- being in a multi-company context;
- select a company that is not the user's default company;
- add a manager to an employee;

Issue:
------
We don't see the organization chart.

Cause:
------
There is no "allowed_company_ids" key
in the context of the rpc call.

Solution:
---------
If a context is passed explicitly
in the call rpc kwargs, it must be used.
Otherwise, use the default context of call rpc.

opw-3422642

closes odoo/odoo#129233

X-original-commit: 32353bcf94fa4f7378f61c22664267e1e8a34a1f
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-07-24 08:58:19 +02:00
Kevin Baptiste 7c7b31cc8b [FIX] hr_org_chart: refresh OrgChart on manager change
Setting or changing the manager of an employee would not refresh the
OrgChart.

task-3381781

closes odoo/odoo#126617

X-original-commit: cbd5feed298efece8809d13434409e50326bd79b
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-28 09:59:59 +02:00
Elisabeth Dickinson c84d388fac [FIX] *: switch image's .rounded-circle to `.rounded
*: gamification, hr, hr_contract, hr_expense, hr_holidays, hr_org_chart,
lunch, mail, web

Since the Milk refactoring, the backend uses only `.rounded` avatar
images. The `.rounded-circle` classes on images have been replaced by
`.rounded`.

task-3336569
part of task-3326263

closes odoo/odoo#123286

X-original-commit: b492049788353274fb32bb6fbe4d40e97a184a87
Related: odoo/enterprise#41798
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-01 17:55:25 +02:00
Martin Trigaux 2afdda2576 [I18N] *: export saas-16.3 source terms
closes odoo/odoo#123046

X-original-commit: 137f5ca0cb703ee953cb01db525362f7a778e6bd
Related: odoo/enterprise#41703
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-01 11:43:51 +02:00
Louis Wicket (wil) 04189318cc [I18N] *: update master translations
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.

This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).

closes odoo/odoo#121629

Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-22 17:52:07 +02:00
Xavier-Do 608c1ea100 [FIX] tests: check test tags *_install
Making a test post_install using @tagged should always remove the
at_install tag.

The main reason for that is that runbot split config select if an
at_install or post_install tests should be executed is using negation:
`--test-tags -post_install`. The reason for that is that giving a positive tag will
replace the "standard" tag and non standard tag could be executed if
giving `--test-tags at_install` (without negation)

Since runbot tests in parallel builds, one of them using
`--test-tags -post_install` and the other `--test-tags -at_install`,
a test that is both post install and at install wont be executed at all.

Also, a tests with both tags will be executed twice
in a normal flow, usually not intended.

The correct way to make a test post_install is to use

@tagged('post_install', '-at_install')

closes odoo/odoo#118969

X-original-commit: d1db306b212d4abb5b2faab9e56c8e83b85c53b9
Related: odoo/enterprise#39966
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-04-19 11:01:13 +02:00
Bruno Boi b4b834c0a9 [REF] web: simplify popover hook usage
**Before this commit**
Almost all of the use cases of the `usePopover` hook are dealing
with an abnormal amount of complexity:
- they have to store the closing function of the popover, and sometimes
  keep track to its opening state,
- you can find a duplication of a useUniquePopover hook, which is
  anyway the behavior that is always wanted for popover users.

This is due to the fact that usePopover is just some kind of wrapper
to the lower level popover service.

**After the commit**
- The usePopover now has a new API, which simplifies its usage.
- The useUniquePopover hook implementations have been removed and
  this "unique" behavior is now merged into usePopover
  and has become the standard one (not configurable).
- All of the use cases have been adapted, even the cases where
  components used directly the popover service (through `useService()`).

See the adapted jsDoc around the hook in popover_hook.js

closes odoo/odoo#118066

Related: odoo/enterprise#39654
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-04-13 16:40:19 +02:00
Martin Trigaux 1be5eae8ef [I18N] *: remove nl_BE files
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.

closes odoo/odoo#115845

X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-03-20 16:51:30 +01:00
Jurgen (jugj) a0b256e41f [IMP] hr_employee : make UX improvements
task - 3203838

closes odoo/odoo#114677

X-original-commit: dbb6ad44d2bf027f1fae34f616fa39e614ac8e8e
Related: odoo/enterprise#37908
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-20 16:51:06 +01:00
Kevin Baptiste 8c1ab1f47c [IMP] data_recycle,hr_*: JS improvements
*: hr_attendance, hr_org_chart

Apply recommendations from odoo/odoo#104975 to HR apps.

task-3069138

closes odoo/odoo#114208

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-02 18:18:56 +01:00
Michael (mcm) 9f4622492c [REF] *: register field descriptors instead of components
Before this commit, the field's description was stored on the
component and this component was then registered.

Now, an object describing the field is used on registration the same way
as it is done for views since https://github.com/odoo/odoo/commit/b828cfc72c587d0b73fcc5459695705640437671.
This split the component's description (props, template, ...) of
the field's description (displayName, supportedTypes, ...) and makes
it clearer.

closes odoo/odoo#112498

Task: 3171520
Related: odoo/enterprise#37105
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-16 14:13:32 +01:00
Jurgen (jugj) 790ad0e961 [FIX] hr_org_chart: Count indirect subordinates correctly
task - 3142380

closes odoo/odoo#111398

X-original-commit: 23e729e5a4086cd106f3a5e825d141232c81b750
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-31 12:56:14 +01:00
Martin Trigaux 776689b0f4 [I18N] *: export saas-16.1 source terms
closes odoo/odoo#110752

X-original-commit: 56b2b52287a8f2192d80ea417c7efac80a87c0a9
Related: odoo/enterprise#36173
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-24 10:20:30 +01:00
Adesh Jolhe eee988bc89 [IMP] hr_org_chart: fix the traceback when we click on See All of the Organization Chart
Steps to reproduce:
- Go to Employee
- Open the Employee profile and click on Work information.
- In the Organization Chart Below the hierarchy See All button is visible.
- Click on the 'See All' button.

Currently, when we click on the ``see all'' button of the organization chart, the traceback
comes. Fixed it in this commit.

task-3133047

closes odoo/odoo#110476

X-original-commit: 9f4e1fa80dc75900fb8a2c979568c3ab8f65a635
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-20 09:40:49 +01:00
Xavier BOL (xbo) 1695850504 [IMP] hr_org_chart: know if employee is subordinate of current one
Before this commit, in the search view, it is not possible to filter the
employees to only have those ones who is a subordinate of the current
user. That is, if Pierre is the current employee/user and he is the
manager of Paul and Paul is the manager of Jacques. Pierre could want to
see his subordinates in his view of so Paul and Jacques instead of just
Paul.

This commit adds a new boolean field called `is_subordinate` in
`hr.employee` and `hr.employee.public` models. This field will be True
if the employee is a subordinate of the current user.

task-3061362

closes odoo/odoo#108060

Related: odoo/enterprise#34181
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-04 17:50:45 +01:00
Kevin Baptiste 270b9aa7c3 [FIX] hr_org_chart: don't loop when own manager
When an employee was their own manager, the org chart would be filled
with their own name.

task-3093917

closes odoo/odoo#107546

X-original-commit: 53f9359d84a6bb500db693298a12608964a0a118
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-08 18:00:29 +01:00
Malay Khamar 5333fe2acc [FIX] hr_org_chart: fix the hr ORG chart parent employee redirection issue
closes odoo/odoo#103726

X-original-commit: 1fb8fa16ab7dc298d54f089d7163fb556dbc5fcc
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-21 11:09:22 +02:00
Kevin Baptiste 9b7d968557 [FIX] hr_org_chart,hr_expense: fix form UI
This PR adapts the form views since the merge of #100570.

task-3002465

closes odoo/odoo#102750

X-original-commit: 03b7ed51d9bb1e0717d21cd6516f98e477a2c926
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-10 09:48:23 +02:00
William Braeckman 24fbcf2266 [FIX] hr_org_chart: fix label in res_users form view
The colspan attribute was missing for the form view making it look like
there was a label for the org chart widget, which should not be there.

closes odoo/odoo#100469

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-09-19 11:29:11 +02:00
Gorash 39ea7a1fab [IMP] web/all: XML templates are now declared into the python manifest.
Adapt all manifest, split some XML file and update JavaScript files.

Part-of: odoo/odoo#95500
2022-09-14 20:25:01 +02:00
William Braeckman 90c035b70e [FIX] hr_org_chart: fix data not being reloaded
This commit fixes an issue with the org chart since it was converted to
owl, the data would not be reloaded when changing from record to record.
Instead it would always show the data from the first record it ever
loaded.

closes odoo/odoo#99618

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-07 11:25:48 +02:00
Yannick Tivisse 4400bd15ba [IMP] hr_org_chart: Migrate widget to owl 2022-08-24 09:23:01 +02:00
Romeo Fragomeli cf4f23d484 [FIX] web,*: adapt old BS4 classes
*: hr_org_chart,l10n_gcc_invoice_stock_account,mail,point_of_sale,
   purchase,website,website_sale,website_sale_autocomplete,
   website_slides_survey

Some commit have added old Bootstrap 4 classes after the merge of
Bootstrap 5.

Note that it's not possible anymore as the merge bot is now able to
detect it.

closes odoo/odoo#98349

Related: odoo/enterprise#30551
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-08-18 16:47:30 +02:00
stefanorigano (SRI) a75530c323 [IMP] hr: review and optimize SCSS
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2865713

closes odoo/odoo#93049

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-08-08 10:50:48 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli 9b5c9484fe [REF] *: BS5: adapt changes in media query mixin
> Media query mixins parameters have changed for a more logical approach

> media-breakpoint-down() uses the breakpoint itself instead of the next
> breakpoint (e.g., media-breakpoint-down(lg) instead of
> media-breakpoint-down(md) targets viewports smaller than lg).
> Similarly, the second parameter in media-breakpoint-between() also
> uses the breakpoint itself instead of the next breakpoint (e.g.,
> media-between(sm, lg) instead of media-breakpoint-between(sm, md)
> targets viewports between sm and lg).

https://getbootstrap.com/docs/5.1/migration/#sass

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli 23c3a31a0d [REF] *: BS5: removal of .media class
https://getbootstrap.com/docs/5.1/migration/#grid-updates
https://getbootstrap.com/docs/5.1/utilities/flex/#media-object
https://github.com/twbs/bootstrap/pull/28265

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:19 +02:00
Kevin Baptiste 93ed43bcb3 [IMP] hr_org_chart: use flexbox
Use flex on the popover header to better handle long names.

closes odoo/odoo#94236

Taskid: 2888199
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-23 09:00:31 +02:00