Commit Graph
43 Commits
Author SHA1 Message Date
Miquel Raïch 70ae1cf628 [FIX] hr: avoid <footer> not found error in view
closes odoo/odoo#80554

X-original-commit: fc5ae487fc178d43c487271d174e27d060b56d1d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-12-08 11:17:15 +00:00
Krina Oza 962f13a2e0 [IMP] base,hr: imporve the language settings and access to it
Currently, in My Profile all the users have access to language settings
even when the user does not have the rights to activate/deactivate
languages. Also, the language setting list is not user friendly which
needs to be imporved.

so in this commit hide "More Languages" button in My Profile for users
that does not have the rights and the language settings list is
improved by adding seperate buttons to "activate", "disable" and "update" a
language.

PS: groups does not work on My profile so added the compute field based
on group.

closes odoo/odoo#69292

Taskid: 2466771
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-07 09:50:58 +00:00
Leonardo Pavan Rocha c53724ebc3 [IMP] *: adds generic user avatar
Description of the issue/feature this PR addresses:
It is currently quite difficult to differentiate users. Most of the time, people
don't take the time to upload an actual avatar so everybody looks the same. This
PR generates a custom avatar with the users initials and random color to
differentiate them. For res.users, res.partner and hr.employee, image fields now
hold the binary image and avatar are used to show the image or svg.

Current behavior before PR:
Avatar had only random colors and was being saved in database, being inefficient

Desired behavior after PR is merged:
A new mixin defines image fields and in case no image is set, it generates an
SVG image with the user's initials and random color.

closes odoo/odoo#69819

Task: 2404630
Related: odoo/enterprise#18199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-01 14:36:23 +00:00
sofiagvaladze 95daf9d28c [IMP] hr: Create activity a month before Work Permit Expiration Date
Add boolean field to upload work permit

Task - 2442648

closes odoo/odoo#65899

Related: odoo/upgrade#2173
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-24 21:40:32 +00:00
Kevin Baptiste 3d5e912da7 [IMP] hr: add a model for work locations
The work location of an employee was previously a fields.Char. That was
changed to a Many2one field to a the new model called work.location.
That had some consequences in other modules that had to be slightly
adjusted.  The modules impacted were hr, hr_appraisal, hr_payroll.

Task id: 2335646

closes odoo/odoo#63192

Related: odoo/enterprise#15235
Related: odoo/upgrade#2020
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-05 13:00:09 +00:00
Laurent Stukkens (LTU) 7a516973d3 [IMP] hr_contract: add employee type
Prior to this commit:

* All employees were treated the same way regarding the contractual point of vue.

From this commit on:

* Three employee types will be created:
 - Employee, which is supposed to be under contract
 - Student & Contractor which are both not supposed to have an employee contract (but are still use the employee as working for the company)

* Employee view and Contract History will take this consideration into account.

closes odoo/odoo#64931

Taskid: 2446000
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-01-28 12:20:16 +00:00
Yannick Tivisse 5703ec3cd8 [IMP] hr: Make employee lang editable on employee + my profile
The field is defined on the private address (address_home_id) of the
employee.

It would be more convenient to allow the configuration directly on the
employee view and to allow the employee to change it by himself.

closes odoo/odoo#64949

Taskid: 2410407
Related: odoo/enterprise#15918
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-01-22 16:05:20 +00:00
Yannick Tivisse 5b886a747a [FIX] hr: Edit private address fields directly instead of M2O
Purpose
=======

The goal of this commit if double:
- Prevent employees to change the m2o address_home_id, that could lead
  to future inconsistencies on future HR processes
- Allow the employee to modify it own private address, even if the
  access is restricted to administrators for private addresses

closes odoo/odoo#62891

Taskid: 2412387
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-04 13:38:51 +00:00
Yannick Tivisse 2511f5a889 [FIX] hr: Allow editing some missing fields on My Profile
Purpose
=======

Some fields weren't editable, even when the option is enabled on
the settings.

closes odoo/odoo#57842

X-original-commit: 57d595e87642fa6f7bec62cbb88a39c35cc72589
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-09-16 14:06:59 +00:00
Olivier Dony 63e38dad8d [FIX] base,hr*: adapt profile view to security fields 2020-08-14 23:06:24 +00:00
Simon Genin (ges) 8a6a4766d9 [IMP] hr_employee: improve form usability
Improve slightly the layout of some forms related to employee and contracts.

Modified modules:
hr
hr_expense
hr_holidays
timesheet_grid
hr_contract_salary
hr_payroll_account

Task ID 2277298

closes odoo/odoo#52981

Related: odoo/enterprise#11156
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-04 09:21:00 +00:00
Swapnesh Shah fab315489c [FIX] hr: show Create employee button based on company employee
Before this commit, the `Create Employee` button was not visible if user is linked to employee in any other company as the domain was based on `employee_count`. (Which represents Employee belongs to all companies)

With this commit, we check for `employee_id` which makes sure if the user has linked Employee for currently activated company.

Followup on 95564bcd2c

X-original-commit: cb9ac24caea53615e2808a36e850939a1ccaa041
2020-05-18 11:58:10 +00:00
dmonzonis 328f6dbc98 [ADD] mail_bot_hr: Bridge module to remove mail_bot dependency from hr
In v12, the hr module did not have a hard dependency on mail_bot, so the
users could uninstall it if they did not want/need its functionality. In
v13, mail_bot was added as a dependency to include the notification
widget and the odoobot state in the user forms modified by the hr
module. However, this also brings potentially unwanted functionality to
anyone who installs an hr related application.

This commit removes the dependency on mail_bot by adding the mail_bot_hr
bridge module, which provides integration between mail_bot and hr if
both modules are installed.
2020-04-10 11:15:19 +00:00
Nicolas Lempereur b53cf339e4 [FIX] web,*: phone number ltr even in rtl language
Currently there is two ways in view to have a phone number displayed in
LTR in a RTL language:

- have `widget="phone"` on a field
- have a class o_force_ltr on the field

But this is currently done very rarely and fail in list view because the
direction of data cells is used, eg.:

```
<div style="direction:rtl">
  <table><tr><td style="direction:ltr">
      <span>+1 2 3</span>
  </td></tr><tr><td>
      <span style="direction:ltr">+4 5 6</span>
  </td>/tr></table>
</div>
```

will be displayed as:

+1 2 3
6 5 4+

In this commit, we use unicode-bidi* to optionally add an additional
level of embedding so direction is taken into account by the
bidirectional algorithm.

This commit also adds o_force_ltr class or phone widget on phone fields
where it is not already defined.

*: https://drafts.csswg.org/css-writing-modes-3/#propdef-unicode-bidi

opw-2224828
closes #48425

closes odoo/odoo#48588

X-original-commit: ab067218e069f0a92610c3f0d4137e563e47755c
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-03-30 13:50:04 +00:00
Xavier Morel e95ccf0908 [FIX] *: domains should not have as many binary operator as there are terms
* modify client-side domain normalisation to error if the domain is
  invalid (not enough terms / segments for the number of operators)
* add better error reporting to attrs / modifiers parsing
* add a few layered error augmentation to provide clearer context
  e.g. "error: invalid domain <thing>" is helpful but "error while
  parsing modifiers for field foo: modifier invisible: invalid domain
  <thing>" is much more helpful
* rework _evalModifiers to deduplicate it in order to more easily
  implement this contextual augmentation
* test that improper domains are properly found improper
* fix a bunch of incorrect attrs domains
* also removed an apparently undefined (& unused) "options" argument
  to a _applyModifiers call

closes odoo/odoo#44642

Related: odoo/enterprise#8175
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-02-12 09:32:17 +00:00
jdoutreloux b30e280b2d [IMP] sale_stock : add warehouse_id field on user form
We had a default warehouse_id on the users to allow
a better stock managment based on the sale person.

The warehouse_id on a sales order is now computed from
the property_warehouse_id field on a user.
If the user doesn't have a property_warehouse_id set
the warehouse_id on the sales order is the one with the
smallest sequence number in the company of the SO.

Task-2166382
2020-02-05 10:59:38 +01:00
Lucas Perais (lpe) 9538245267 [IMP] *: adapt views for phone widget sms enabled default
Task 2123526

This commit adapts the views to take into account
that the phone widget enables sending an sms by default

*: crm, hr, sms, base
2020-01-27 09:31:53 +00:00
Kevin Baptiste 6cbe824871 [REV] web: reverts update to fontawesome 5.11.2
This reverts commit ff1c35513a.

closes odoo/odoo#41480

X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc
Related: odoo/enterprise#7110
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-09 10:33:36 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes

This commit replaces the old names to the new ones.

closes odoo/odoo#35826

Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:05:12 +00:00
Swapnesh Shah 6f128fa959 [FIX] hr: Display archived employee on user form
closes odoo/odoo#38143

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-10-07 19:53:55 +00:00
RomainLibert 44a500c8d0 [FIX] hr: make the email field visible again
You DO want to be able to change your user's email address from the
employee profile

closes odoo/odoo#37674

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-10-01 10:16:05 +00:00
jbm-odoo 73498572c3 [IMP] hr: Employee Profile set readonly attribute on readonly field
closes odoo/odoo#36698

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-11 14:00:39 +00:00
Kevin Baptiste 3ad8820276 [IMP] hr_holidays: reintroduce out of office (back2basics)
TaskID: 2057430

closes odoo/odoo#35952

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-22 07:33:20 +00:00
Yannick Tivisse e631dbc182 [IMP] hr: Improve general employee form UX (back2basics)
TaskID: 2054559

closes odoo/odoo#35802

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-19 11:10:03 +00:00
Yannick Tivisse abd73d61a2 [IMP] hr_holidays: Improve general UX (back2basics)
TaskID: 2053585

closes odoo/odoo#35737

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-16 11:24:04 +00:00
Kevin Baptiste f9fafcdcfb [IMP] hr: improve employee profile usability (back2basics)
Improve the usability of the employees profile / "My Profile"

TaskID: 2048672

closes odoo/odoo#35587

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-13 13:00:40 +00:00
Sébastien Theys 1e9772889b [IMP] *: use image.mixin when appropriate
The following models are already using big images, or they might need big images
in the future:

- partner
- hr employee
- shop category
- lunch product
- gamification badge and karma rank

PR: #34925
2019-08-02 16:47:58 +00:00
Sébastien Theys 58a2ffa26f [IMP] *: rename image fields
image_original => image_1920 (now resized to 1920)
image_big => image_1024
image_large => image_256
image_medium => image_128
image_small  => image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
	what was previously the big size)

+ add new intermediate format:
image_512

PR: #34925
2019-08-02 16:47:58 +00:00
jbm-odoo 252609d375 [IMP] employee profile: Reload the view if language changed
When a user change his langage in employee profile, he doesn't see
the result before reloading manually the page.

With this commit, when a user change his language, the page is
reloaded on saving. And remove Create button on My Profile

closes odoo/odoo#34906

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-02 11:44:45 +00:00
Kevin Baptiste e9d9898276 [IMP] hr: Review the UX for 'My Profile' view
1/ web: adapt formatDate to handle NaN values
DashboardRenderer might return NaN for `Date` or `DateTime` fields if
their original value is null or incorrect.

2/ hr: add job_title in demo data

3/ hr_recruitment: link employee in the chatter for new recruits

4/ hr: remove employee documents in the model

5/ hr_attendance: improve resiliency of relative_time

6/ hr: display manager on res_users

7/ hr: change Address Book to Employee Directory

TaskID: 2009111

closes odoo/odoo#34180

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-18 10:27:50 +00:00
Lucas Lefèvre f6fdde96bd [IMP] hr_*: Improve employee presence state
Purpose
=======
There are currently multiple ways to determine if an employee is presence
or absent:
- login state (user status on chat)
- checkin/checkout from the Attendance app
- leave
- hr_presence (email, ip)
Those states are displayed in several different places and can be inconsitent.
e.g. Logged in -> green in the chat
Not checked in -> red on the employee kanban view.

The multiple ways to determine employee presence described above
should be aggregated together to have a better consistency.

Specification
=============
There are 3 presence states (previously defined in module `hr_presence`),
namely `present`, `absent`, `to_define`. They are now defined as soon as
`hr` module is installed.

The state computation can have several behaviors according to which apps
are installed:

1. `hr` is installed
Check employee presence based on login by default (only for employees with
a user).
Kanban state (private and public): should be green when logged in, red when logged out and
orange when the user is away.
Private employee form: Display a stat button "Connected" on the form view
when the user is logged in or "Last Activity xx/xx/xxx" otherwise.

2. `hr_attendance` is installed:
when the user is logged out, the state
is determined from the checked in/out state. But when the user is logged in,
consider the user as present (even if he checked out).
Kanban state: green for checked in, red for checked out
Private form view: attendance stat button.

3. `hr_holidays` is installed:
Has the highest priority if the employee is on leave.
Kanban state: red if employee is on leave.
Private form view: stat button "Absent Until xx/xx/xxxx" if employee
is on leave.

4. `hr_presence` is installed:
Two additionnal presence checking option: emails sent and IP address connected.
Once a user sent an email or the IP address was connected, he is considered
present for the entire day.

There should be at most one stat button on the employee form view, with the
relevent information.

Task id: 2024482

closes odoo/odoo#34933

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-17 09:11:18 +00:00
Kevin Baptiste 83aaea9e5c [IMP] base: Add option on image widget to enable zoom
Purpose
=======

As the employee picture on a form view is often too small,
it should be possible to zoom on it like for products in eCommerce.

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

Added new bool options on FieldBinaryImage: `zoom` and `background`.

`zoom` will call zoomOdoo.js and display a popup with the zoomed out
image.

`background` is used to either display the image as a div element with
a background-url (to be used e.g. in a kanban view) or as a standard
img element.

closes odoo/odoo#33839

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-26 06:56:17 +00:00
Christophe Simonis 9035fb8a2a [MERGE] forward port branch saas-12.4 up to 618ea1ab67 2019-06-18 10:24:25 +02:00
Hiral Bhavsar 3cd7ed07a2 [IMP] *: remove 'view_type' on window actions.
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.

Task 1937686

closes odoo/odoo#31243

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-17 11:34:17 +00:00
Christophe Simonis 25e3f27062 [MERGE] forward port branch saas-12.3 up to 48a9f5a633 2019-06-17 13:20:35 +02:00
Toufik Ben Jaa ca8a510b56 [FIX] hr: field parent_id shadowing same field on res.partner
- On the HR module, the field `parent_id` is added on `res.users`.
The issue here, is that `res.users` inherits the fields from
`res.partner` where `parent_id` is already defined.

This causes issues when trying to read the parent `res.partner`.

Issue found by @rrahir

closes odoo/odoo#34059

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-06-12 10:42:07 +00:00
Christophe Simonis 71a50a2214 [MERGE] forward port branch saas-12.3 up to 409679866b 2019-06-06 11:54:35 +02:00
Lucas Lefèvre 95564bcd2c [IMP] hr: Direclty create user's employee 2019-05-31 12:58:15 +02:00
RomainLibert b2b26f1ff7 [REF] hr: split hr.py and hr_views.xml into model related files
This is much better for code readability, and in our coding guidelines
2019-05-31 10:21:20 +02:00
Toufik Ben Jaa 1569bef308 [FIX] hr: phone field on res.users is shadowed
- The added field `phone` on `res.users` shadow the field `phone`
inherited by `res.partner`.
The issue is that the field `phone` on `hr.employee` can be read only
by the employee or the HR team.

A lot of views tries to display the field `phone` expecting the one
declared in `res.partner` which should be readable by everyone.
But the one declared in `res.users` shadows it.

closes odoo/odoo#33569

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-22 12:31:41 +00:00
Yannick Tivisse d83890dd14 [IMP] hr: Display certificate on employee form
closes odoo/odoo#33496

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-27 14:06:11 +00:00
Lucas Lefèvre d77ce4c2a9 [IMP] hr_*: introduce the employee profile
General Purpose
===============

We want an 'Employee profile' gathering every data about an employee.
The main form view is modified to become this employee profile.
A user can also see his own profile through the Preferences menu.
The new profile replaces the current Preferences view if the hr module is installed
and the current user is linked to an employee.

A user should be able to see and edit his own profile.

*Problem*:
Many fields on hr.employee are protected by groups="hr.group_hr_user".
Therefore, a regular user cannot see or edit those fields.

This protection must be bypassed to allow read/write access
to the regular user's own data.
A similar mechanism already exists for res.users (for Preferences)

The better (least worst) solution found is to reuse this mechanism by adding related fields on res.users.

Pros:
- Don't change security access on hr.employee
- Don't implement yet another custom security layer, risking to add new security breaches
- A lot of fields are added by other modules on hr.employee.
  It would have required to integrate them with the custom security layer.
- Fields added by other modules on the user's preferences view (normal view, not the profile)
  are automatically included in the employee's profile view.
- Allow the hr.employee form view to be different than the user profile accessible
  through the Preferences menu.
  E.g. add custom buttons only relevant to the logged in user such as "Request a leave".
Cons:
- Each field from hr.employee that you want to appear on its profile
  must be added as a related field on res.users
- Those related fields must be added to user's preferences view (duplicate views)
- They also must be added to SELF_[READABLE | WRITABLE]_FIELDS

Note:
When the front-end loads the views it gets the list of available fields
for the user (according to its access rights). Later, when the front-end wants to
populate the view with data, it only asks to read those available fields.
However, in this case, we want the user to be able to read/write its own data,
even if they are protected by groups (groups are kept on the related fields on res.users).
The front-end need to be made  aware of those fields by sending all field definitions.

hr_attendance
=============

This commit integrate attendance in the new employee profile.
It also adds a stat button to this employee profile showing
the number of hours worked last month.

Remove the boolean computed field 'manual_attendance'.
This field is just a shortcut to add/remove the employee's user
in the "Manual Attendance" group.
The checkbox is confusing on the employee's form and this should
be done through the normal group management screens.

hr_presence
===========

Display the presence status on the employee kanban template.
The status is a colored chip which can be green (present),
orange (to define) or red (absent).

Currently, the presence status is only computed when accessing
the report view. As this commits displays it on the employee kanban,
it should be updated more frequently.
The state should not be updated every time the kanban view is loaded
since the computation is a bit heavy. Instead: add a cron to update
status every 15 minutes.
-> The status is accurate on the report view (status is still updated
   when loading the view)
-> The status in accurate at 15 minutes on the kanban view

[ADD] hr_attendance_presence
============================

Bridge module between hr_attendance and hr_presence.

This commit integrates hr_presence module in the employee
profile and adds the presence status on the employee kanban view.
But hr_attendance adds at the same place a similar status icon for
checkin/checkout.
This bridge module makes the status from hr_presence invisible as
hr_attendance should be the main presence control mechanism.

Also, this commit adds the ability (through a new setting option)
for hr_presence to take into account checkin/checkout to determine
the presence status.

l10n_be_hr_payroll
==================
integration with employee profile
2019-02-14 16:28:54 +01:00
Priyanka Kakadiya b82f6fee71 [IMP] hr: display warning when user is not linked to employee
On user form view, when no employee is linked to the user, we want
to display a message to the HR Officer (only) with the possibility
to create the employee profile with prefilled information.

Task-1916925

closes odoo/odoo#29659

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-04-08 07:58:01 +00:00