Commit Graph
267 Commits
Author SHA1 Message Date
Rob Coekaerts e4ac144ace [IMP] hr_holidays: 'My Department' filter now includes child departments.
The "My department" filter in the "Time Off" overview menu is changed to also include the leaves of employees from child departments (all the way to the bottom of the hierarchy).

task-2699541

closes odoo/odoo#81597

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-01-07 07:26:53 +00:00
Philippe Wauthy c0515b4585 [FIX] hr_holidays: fix being able to select invalid time off type
Prior to this commit, the _search_valid method returns all the time off types.

With this commit, only the time off types that have a valid allocation are returned

task-2711388

closes odoo/odoo#81724

X-original-commit: 20a2b29ee273c505f0279f128e8ac6c13c5be043
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-21 12:05:57 +00:00
Philippe Wauthy 3ae12a6f25 [IMP] hr_holidays: add default filters to smart buttons
Add default filters to the Allocations and Time Off smartbuttons on the time off type form.
This is done to avoid having numerous records with time and only show the relevant to approved and approved allocations as well as the time off for the current year.

task-2688122

closes odoo/odoo#79699

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-30 13:41:31 +00:00
Krina Oza b1b6ccc85d [FIX] hr_holidays: add default filter
Currently, in the overview page of timeoff, in gantt view all
records of the company are displayed. The purpose of this commit
is to improve the loading time by displaying less information
also remove "by employee and time off type" from reporting.

So in this commit, added a default filter "My Department" on
overview page and removed "by employee and time off type" from
the menu "reporting".

closes odoo/odoo#80542

Task-id: 2695774
X-original-commit: ede8331294ebd163af93c8c02eacfbffccfa97c6
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-29 16:28:10 +00:00
sofiagvaladze 704ad908a1 [FIX] hr_holidays: restrict creation of allocations
Purpose: It does not make much sense to create allocations of such an
Time Off Types that don't require allocation.

task - 2658250

closes odoo/odoo#80541

X-original-commit: 69cee9c13b1d5267b74a9f107bae85ea1c42aa38
Related: odoo/enterprise#22589
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-29 16:28:05 +00:00
Philippe Wauthy b6ef46f71c [IMP] hr_holidays: show conflicting time off in validation error message
Description of the issue/feature this PR addresses:
In hr_holidays, there is no information about the conflicting time off when a second time off is scheduled at the same time.
There is a validation error saying "You can not set 2 time off that overlaps on the same day for the same employee".
The validation error should display the conflicting time off

Current behavior before PR:
The validation error displays the following:
"You can not set 2 time off that overlaps on the same day for the same employee"

Desired behavior after PR is merged:
The validation error will display the following:
"You can not set 2 time off that overlaps on the same day for the same employee.
Existing time off: Mitchell Admin / Trip with Family : 24.00 hours / from 06/09/2021 to 08/09/2021 / To Approve"

task-2641682

closes odoo/odoo#76452

Related: odoo/enterprise#22490
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-25 08:29:21 +00:00
Michael (mcm) 3ce226dd85 [FIX] hr_holidays: fix date range picker
Before this commit, picking a range of dates by clicking on
the end date field set the wrong date on the start date field.
This was because the option "related_end_date" was used
on the end date field instead of "related_start_date"

Replacing the "related_end_date" by "related_start_date"
on the end date field fixes the issue.

closes odoo/odoo#79997

X-original-commit: 8402e55e0db474ee64e641866d8c76302fb1ef4e
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-11-23 06:46:46 +00:00
Kevin Baptiste e20739312a [FIX] hr_holidays: allow Officers to create allocation again
The domain on the allocation leave type was too restrictive for Time Off
Officer and they couldn't create allocations when the "Employee
Requests" of the Time Off Type was set to "no".

This commit allows the Time Off Officer to request those allocations
again.

closes odoo/odoo#80041

Taskid: 2694163
X-original-commit: d79af924a59f32a0b2dee9b10bb7c8cf388892df
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-18 18:45:30 +00:00
Florian Damhaut 41f7426595 [FIX] hr_holidays : Only show allocable leaves in allocation requests form
Current Behaviour :
Employee can request any type of leave.

Behaviour after the PR:
Employee are only shown leave that they can request.

opw-2684670

closes odoo/odoo#79502

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-12 10:30:57 +00:00
Kevin Baptiste ba619ce027 [IMP] hr_holidays: allow users to cancel Time Off
A user without Time Off rights is now allowed to cancel their own
validated time off when:
    - It's not yet started;
    - No work-entries has been generated for it yet.

The time off is archived and the days taken reallocated.

closes odoo/odoo#76722

Taskid: 2643713
Related: odoo/upgrade#2843
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-10-28 11:34:57 +00:00
William Braeckman 4a29ba94ad [IMP] hr_holidays_attendance: improve leave_type name_get
The name_get for leaves types would previously not show the number of
hours available to the user for the extra hours time off type.
This commit adds that special case of time off type.

This commit also improves the leave_type name_get overall, by allowing
the hours to be display upon initial loading when requesting new
leaves/allocations properly.
Thanks to this change we do not need to display the number of extra
hours available at all time in the form views.

TaskId-2655689

Part-of: odoo/odoo#77841
2021-10-26 14:10:56 +00:00
Kevin Baptiste 1e99b471f7 [IMP] hr_holidays: show all employees in list view
A time off for multiple employees was not showing who the employees were
in the list view.

Now it shows the avatar of all employees in the list view.

closes odoo/odoo#78758

Taskid: 2674062
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-26 11:04:49 +00:00
Kevin Baptiste 60d62a1d9d [REF] hr*: misc cleanup
*: hr_expense, hr_holidays, hr_work_entry_holidays

- Remove unused template;
- Remove unused fields (hr_expense);
- Rename group_days_allocation to convey proper meaning;
- Remove deprecated method.

closes odoo/odoo#78128

Related: odoo/upgrade#2907
Taskid: 2665866
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-20 15:15:03 +00:00
Mathieu Duckerts-Antoine 85b8a95116 [REF] *: clean some useless %% in xml files
The commit https://github.com/odoo/odoo/commit/1b40e9265f88f57aaaf311bb8fae3d1fd1966d7d
allows to get rid of most escapings %% in xmls but there were still occurences
of useless %% in some of them. We remove them.

closes odoo/odoo#78069

Related: odoo/enterprise#21553
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-10-11 12:34:47 +00:00
Philippe Wauthy 6367ff2b33 [FIX] hr_holidays: Improve general UX (Back2basics)
General fixes for usability

- Time off type configuration visual : https://tinyurl.com/yj2z6okp
- When you create an allocation, the end date should have a place holder "no limit". If there is no end date recorded, that value should be displayed on loading.
- In Overview, remove filter "people i manage"
- In Approvals / time off : change filters : https://i.imgur.com/uDNjZv8.png
- In Approvals / approvals : change filters like in point 5 (remove people I manage replace with my team)
- In Reporting / By Employee : filters : https://tinyurl.com/yg3u3rkf
- In Reporting / By Type : filters : https://tinyurl.com/yhbpgz5m
- Remove Allocations smartbutton from Employee App
- When you click on TimeOff Smartbutton from Employee App, you should be redirect to this screen : https://tinyurl.com/ygwxzx5b
- When an allocation is created, the validity is added to the name of the allocation like "Allocation X (validity Date --> Date) and hide the validity field in "My allocations".
- Users will have the information of the validity from the name of the allocation

task-2643692

closes odoo/odoo#77376

X-original-commit: 7f92c830d3607167bd76bc43d992fbf720a3ef29
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-09-29 08:33:26 +00:00
William Braeckman bd13371781 [FW][FIX] hr_holidays: Make accrual plan prorated
closes odoo/odoo#77342

Forward-port-of: #77311
Related: odoo/enterprise#21229
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-09-29 08:33:03 +00:00
sofiagvaladze 415ab27126 [IMP] hr_holidays: Time Off smartbutton
task - 2634892

closes odoo/odoo#75941

Related: odoo/upgrade#2852
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-29 08:32:44 +00:00
William Braeckman 8f89c30998 [FIX] hr_holidays: fix wrong context for absent action
Since odoo/odoo#35700 department_id is not a searchable field in the
employee search view as it has been added in the searchpanel. Since
then, the view from department > absence has been broken since it was
not filtering on the department anymore.
This commit fixes that behaviour by defaulting to the department in the
searchpanel instead.

TaskId-2648380

closes odoo/odoo#77157

X-original-commit: 9200742a1bde75ec2de02b9d11f67dc77538d79d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-24 12:35:43 +00:00
Kevin Baptiste 4cc00d44d6 [FIX] hr_holidays: correctly compute Time Off type statbuttons
The stat buttons were showing incorrect values, the accrual action was
not returning, archiving an employee was no longer possible because an
incorrect state was used.

closes odoo/odoo#76468

Taskid: 2641596
X-original-commit: cc75a1233ed40cb1a4812a5f4a377b8859795b26
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-14 08:22:05 +00:00
Kevin Baptiste 8c969fb980 [IMP] hr_holidays: improve views
- Hide transition mode if there is 0 or 1 level on accrual plan;
- Fix kanban card
- Reduce bottom padding on calendar view
- Log a message when an allocation linked to accrual runs for the first
time

closes odoo/odoo#75940

Taskid: 2636417
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-09-08 12:44:49 +00:00
Mathieu Duckerts-Antoine 7545913020 [REF] *: graph archs cleaning
We clean various graph archs taking into consideration that:
 - the default type of a graph is "bar".
 - a bar chart is by default stacked.
 - the field attributes type="row" and type="col" does not make sense for
   a graph view (since its implementation was separated from the pivot
   implementation a long time ago))
 - the boolean attributes should now take 1 or 0 as value (but the other
   values are accepted for retrocompatibility).

Part-of: odoo/odoo#76065
2021-09-07 15:50:14 +00:00
William Braeckman 0a3bd7f414 [FIX] hr_holidays: fix action_with_unused_accruals visual
Fixes the above mentioned field in the hierarchical kanban view in the
accrual plan form view.

TaskId-2637152

closes odoo/odoo#75923

Related: odoo/upgrade#2802
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-09-03 14:30:43 +00:00
254d6a71e8 [IMP] hr_holidays: Improve Accruals, dashboards and general UX (Back2basics)
Purpose
=======

Time Off : New Dashboard, Accruals feature, Public holidays, New time off type configuration view.

- Review of Dashboard
- Accrual feature : Currently, when you create an allocation, it's possible to create an
  Accrual, but there is no appraisal Plan. An Appraisal plan is use to define steps of accruals
  for each employee.
  In Belgium, we use accrual Allocation for European Leaves, or compensatory hours, it's a
  simple use case.  But in USA, it's possible to change the calculation mode each year.
  Also, in USA, it's possible to deal your accrual plan when you arrive on the company. It's a
  HR Officer task to create the right Accrual allocation for each new employee.
- Public Holidays :
  Improvement of global time off feature located on Working hours calendar. Now, Time off
  application have to manage Public Holidays.
- Review of Time Off type configuration

COM PR: https://github.com/odoo/odoo/pull/72511
ENT PR: https://github.com/odoo/enterprise/pull/19157
UPG PR: https://github.com/odoo/upgrade/pull/2791
TaskID:2475413

closes odoo/odoo#72511

Related: odoo/enterprise#19157
Related: odoo/upgrade#2791
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: William Braeckman <wbr@odoo.com>
Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2021-09-02 12:57:03 +00:00
Martin Trigaux d9e3aab69b [FIX] mail: convert res_model_id to selection
Following the removal of read access on ir.model (odoo/odoo#69120),
the mail.activity.type model was not accessible to non-admin users due
to the res_model_id many2one field.

Before this commit, a project user could not access the Activity Type
menu.

Convert it to a selection field with the selection values being
computed in sudo.

closes odoo/odoo#74981

Related: odoo/enterprise#20214
Related: odoo/upgrade#2734
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-08-23 06:56:00 +00:00
Touati Djamel (otd) 4c0787b60b [FIX] hr_holidays: Prevent allocation date_to from switching to another day
Steps to reproduce the bug:

Go to your computer's date settings
Change region, e.g: (US or choose a region with a negative UTC)
Go to the preferences settings in odoo > Change the timezone to US too
Go to Time Off app > Manager > Allocations > Create a new one
Allocation type : "Accrual Allocation"
Set the end date to, e.g: "04/07/2021"
save

Problem:
The end date moves back by one day.
The field " date_to " is of ”datetime” type, so we use in the view "widget="date"
Therefore, the user can only choose the date. We save the time in the database at" 00: 00:00 ".
But as we use in the view "widget="date", after saving the record,
the datetime will be converted to a date, based on the user's UTC.

For example, in our case:
in database, date_to = "2021-07-04 00:00:00"
user UTC = "UTC-6"
result = "2021-07-04 00:00:00" - 06:00:00 → "2021-07-03 00:18:00"

Solution:
Remove the widget date to allow a user entering the full date (eg: 2021-07-04 23:00:00), that
will be stored correctly in UTC afterwards, instead of having the widget making the date switch to
another day.

opw-2607082

closes odoo/odoo#75218

X-original-commit: 2ddabf087004e14ac77aa397eb345d750026dd20
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-08-17 17:33:23 +00:00
Kevin Baptiste 86aa7b78aa [IMP] *: introduce data-hotkey on form and modal views
Define `data-hotkey` on most used action buttons.

For the modals, the following keys are dedicated for "special"
actions:
 - Alt+G: add
 - Alt+V: save
 - Alt+Z: cancel

closes odoo/odoo#73275

Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-15 08:39:49 +00:00
William Braeckman e9281fc1c5 [FIX] hr_holidays: fix being able to select an invalid leave
Previously the domain in the view for the leave request didn't check for
the time off type validity, this fix aims to remove that possibility.
Also prevents from selecting expired time off types in allocation
requests.

Task ID: 2578150

closes odoo/odoo#72653

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-07-08 07:44:37 +00:00
Kevin Baptiste 2961513141 [ADD] hr_holidays_attendance: convert overtime to holidays
This module allows an employee to create leave requests or allocation
requests from their overtime.

Depending on the configuration of the leave type, the request can be
made from:

    - "My Profile" for allocation which allows employee requests;
    - Time Off dashboard for leave type with no allocations;
    - The employee profile for the time off manager.

TaskID: 1904850

[IMP] hr_holidays{,_attendance}: leave allocation multi create

Change leave allocation create function to a multi create one.

Task ID: 1904850
2021-07-06 11:35:01 +02:00
bit-odoo 800f9c499a [FW][FIX] mail, various: show only my activities shown through systray
Before this commit, suppose we have a scenario like below

  Task-A:
    Activity-1:
      name: Email ( Today )
      Assigned to: User-1
  Task-B:
    Activity-1:
      name: Email ( Today )
      assigned to: User-2
    Activity-2:
      name: Call ( Due in 3 Days )
      assigned to: User-1

When User-1 goes through the systray 'Today' filter shortcut he gets both
Task-A and Task-B in the list instead of only Task-A. Indeed currently
activities are not filtered based on current user with its deadlines.

However purpose of systray is to indicate activities current user has to
perform instead of global activities.

After this commit activities will be filtered based on deadlines as well as the
current user. In order to achieve this behavior we needed to pass a domain like
[
   ('activity_ids.date_deadline','=', fields.Date.today()),
   ('activity_ids.user_id','=', 1)
]

And for that purpose we introduced a non-stored compute field with a search
method.

Task ID-2438822
COM PR odoo/odoo#72219

X-original-commit: f4eaf4d8fb2f97240201104dcd4fc7e2674bce02
2021-06-21 07:51:00 +00:00
sofiagvaladze 8804690e7a [IMP] hr_holidays: Improve archived employees management
Add filter on everyone menu
Add archived filters

task - 2416659

closes odoo/odoo#64806

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-15 04:07:52 +00:00
Barad Mahendra 51399445a3 [IMP] hr_holidays: support document on Time Off based on Time Off type
Currently, it's possible to add supporting documents on the chatter of
the time off. But it's not easy to use and doesn't make really sense.
So we will add the possibility to add it more easily.

So in this commit,
 - Added 'Supporting Document' on Time Off type to support the
attachment based on types.
 - On new Time Off, if the Time Off type has a support document then allow
uploading the supporting document in form view.
 - The File is recorded on the chatter of the Time Off request.
 - There will be synchronization between chatter and form attahcments.

PS: added non-stored m2m field to display the attachment view(m2m_binary)
in the form view as o2m does not support it.

TaskID: 2431478
2021-04-13 13:38:31 +00:00
Munaf Khan 20955462f0 [IMP] various: beautify list-views using decoration
Currently, to identify records based on state, in most of the list views we
use 'badge' widget on 'state' fields which can be decorated as needed.

However, for the list views, best approach would be to also add list
decoration along with 'badge' widget so that the whole line is colored
and it's easy for user to 'scan' the information

This commit improves the behavior adding decorations to several list-views.
To check the list of changes, kindly see the task specification

Apart from that, this commit also improves label of the module state from
'Not Installed' to 'Uninstalled'.

TaskID-2527119

closes odoo/odoo#71367

Related: odoo/enterprise#18587
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-03 09:24:13 +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
dht-odoo 12469ef4d3 [IMP] various: improve the sequence of menu items
- Currently all menus are out of order in app switcher.
- For example, Sales app is 16 menu away from Accounting,
  Social Marketing app is 25 menu away from Email Marketing, etc.
  So, all menus should be reordered.

- This commit will reorder the menus of the app switcher in order to reduce
  the distance between correlated applications,
  and bring the most common apps upward.
- And in this commit we have left gap of 5 subsequent sequence for further new menus.

PR: #69984
TASK ID: 2513082

Related: odoo/enterprise#17989
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-07 05:54:18 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
Kevin Baptiste 819221086c [MOV] hr_holidays: move field to hr.employee
Move the field current_leave_id to hr.employee.

closes odoo/odoo#67332

Taskid: 2476677
Related: odoo/upgrade#2239
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-05 14:00:35 +00:00
Aurélien (avd) 2b73e09ba8 [IMP] hr_holidays: add various cosmetic changes
Remove 'refuse' leaves from the Calendar View.
Improve leave/leave.allocation popup form views.
Add Sequence handle to leave type list view.

Change the sorted key func. in _search override to
first order by sequence asc then sort ties by
remaining,taken desc.

closes odoo/odoo#62162

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-09 08:52:43 +00:00
Prakash Prajapati 4eb549cc78 [FIX] web: Fix scroll issue in full calendar
Currently, When we load the Year view of the calendar then
the view is not properly scrolled top due to padding at the
top.
Calendar is scrolled to the current month but due to top
padding in year view it was not scrolled top when initially it
was loaded.

So in this commit, remove the top padding and use padding on month
so it will not have initial scroll when scroll to the particular month.

Set default calendar view to 'month'.

closes odoo/odoo#66811

Taskid: 2428655
X-original-commit: adbade3c1a000c476644e616d66af5cb982249cf
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-25 10:54:56 +00:00
Mithilesh Rao 6cd42e016d [IMP] hr_holidays,web: Improve the mobile view for calendar and times off
Purpose of the task is to improve mobile interface of the Time Off
and calendar view.

So in this commit, we have improved UI as below:
hr_holidays:
 - Move the leave summary topbar from top to sidebar filter of
calendar for small screen
 - Improve the kanban view of leave for mobile and added the
badge for state.

web:
 - Improve the calendar year mobile view by spliting the month view
in 2 column.

TaskID: 2333778
Related PR: https://github.com/odoo/enterprise/pull/13454

closes odoo/odoo#61474

Related: odoo/enterprise#13454
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-02-08 08:35:05 +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
Xavier Dubuc 12004c5665 [FIX] hr_holidays: show plane icon according to user status
task-2377882

closes odoo/odoo#64614

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-01-22 10:20:31 +00:00
Adrien Dieudonne c868f26b70 [FIX] hr_holidays: .o_hr_holidays_dates not useful anymore
We can safely remove 'o_hr_holidays_dates' class since 'o_row'
is applied on mobile too.

Related task ID: 1929043
2021-01-20 12:54:30 +00:00
Nidhi Patel f3725a3dde [FIX] hr_holidays: Fix display of a wrong warning message
Currently, when we create time off and does not add 'Start Date' or
'End Date', it displays a wrong warning.
Issue is occur because date_from is required field at db level and it's
value computed based on visible field request_date_from which is
non-required field and when you keep that empty it will raisse the
contraint instead of required error.

So in this commit, we make request_date_field field required from view
and also make request_date_to visible based on condition so it should
fill the proper value inside the date_from and date_to.

closes odoo/odoo#63222

Taskid: 2352360
X-original-commit: c54f445ceae72518f787f43213ec78a9a7e1b1eb
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-11 11:00:42 +00:00
Giacomello Nathan ec25487cfb [IMP] Time Off: Year Calendar ajustments
A new calendar view has been added, the "year" view.
Some modifications should be done on this view, more specialy in "Time Off" application.
Problems were the fact that it was hard to see if a time off has been approved or not.
Another was the fact that week-ends & public holidays were not grey.

This commit change year calendar in Time Off module.
More specially, this commit:
- Change default calendar in personal dashboard to "year"
- Gray week-ends & public holiday (based on the worker's calendar)
- Hatch non-approved time off
- Removed a calendar view from My Time Off Requests
- Fix a "cancel" button that doesn't work
- Add a new view that is displayed when there is no filter to show on the filter view for calendars

Task id #2318645
Task id #2317525
2020-12-09 16:06:30 +01:00
Xavier Dubuc 26a768379d [IMP] hr_holidays: use tests_assets for common tests assets
task-2411138

closes odoo/odoo#62802

Related: odoo/enterprise#15129
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-12-04 09:04:02 +00:00
Xavier Dubuc de638c3f18 [FIX] hr_holidays: bring back the out of office panel in threads
task-2277511

closes odoo/odoo#62638

X-original-commit: d9aa362914945e6cb095b04fa94cfb3469abd907
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-12-02 11:03:39 +00:00
Thibault Francois bb42687206 [FIX] hr_holidays: Cannot save regular allocation
Problem
-------
For regular allocation that have an empty date_from
(Allocation existing before 14.0),
it's not possible to save any change since an invisible field is required
and cannot be set.

Solution
--------
The field date from should be only required for type accrual

closes odoo/odoo#61892

X-original-commit: 700e584dd22fb7bc845675b4a49a3e5a85a7253a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-11-17 18:00:22 +00:00
IEL 33b35286cb [FIX] hr_holidays: hide Duration for half day leaves
STEPS:
* install hr_leaves
* allocate half days leaves
* start creating new time off, set [x] Half day checkbox

BEFORE: there is label "Duration", but no any fields for it

AFTER: hide Duration label

WHY:

* this bug came after improvements in https://github.com/odoo/odoo/commit/d2238de57630d58c4913ab44746476b83492c72f

---

opw-2370907

closes odoo/odoo#61181

X-original-commit: 47213962c8884125e8f68c7bd39e499a585d1345
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2020-11-02 14:57:24 +00:00
IEL f7c5fb244f [REF] hr_holidays: remove readonly in labels
WHY: it's a copy-paste mistake and doesn't have any meaning, while makes code
less readable

closes odoo/odoo#61091

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-30 18:05:14 +00:00
Achraf (abz) 69e3f42bbc [FIX] hr_holidays: Refuse approved time off
Issue

    - Install "Time Off"
    - Create new time off and approve it

    We can no longer refuse it

Cause

    The refuse button is invisible if the status is not equal to 'validate', in this case it is equal to 'validate1'

Solution

    Change the attrs to display the refuse button when the status is 'validate1'

opw-2361929

closes odoo/odoo#61079

X-original-commit: 80926f582d88aae359a6b35ea521026a3804ce00
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-10-30 16:40:25 +00:00