Commit Graph
20 Commits
Author SHA1 Message Date
arpr-odoo 3f8dacd26c [IMP] hr_homewroking: fine tunning
This commit adds slight improvement to the design of remote work
by adding margin to "Set Location" button.

task-3693392

closes odoo/odoo#157502

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-04-16 14:12:47 +00:00
Levi Siuzdak (sile) e0109a983c [FIX] hr_homeworking: avoid using FullCalendar api for location record
Versions
--------
- 17.0
- saas-17.1

Steps
-----
1. Have `calendar` and `hr_homeworking` installed;
2. go to Calendar;
3. try to set a location by clicking on a date column.

Issue
-----
Odoo Client Error.

Cause
-----
The `onDayRender` function calls `onDateClick` to create a record,
passing an `info` object lacking the `jsEvent` attribute.

Solution
--------
Use `this.props.createRecord` instead.

closes odoo/odoo#159060

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-04-02 15:40:23 +00:00
Elisabeth Dickinson 7f12d24cc1 [IMP] hr_homeworking: replace popover with dialog on mobile
The homeworking popover was not working with the `#scheduling_box` on
mobile, the latter covering the buttons of the popover.
To solve this, we replace the popover by a dialog on mobile.

task-3630139
part of task-3575827

closes odoo/odoo#145446

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-02-19 15:02:18 +00:00
Leonardo Pavan Rocha f8c2efc012 [FIX] hr_homeworking: show correct colors in homeworking icons
Since the early versions of the homeworking modules, we were showing incorrect
colors for the homeworking icons if the partner_id was too large. This comes
from the fact that we were not using the getColor helper from calendar
to decide which color to render. Since we have a limited amount of colors,
we should not use the partner id to define the color, but actually cycle
through all the possible colors, which is done by the getColor method.

Also, when getting the homeworking data, it was possible to get partner_id as
false when the employee had no related user. This commit also changes this to
fallback on the work_contact_id if no user is set.

task-3561678

closes odoo/odoo#139167

Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
2023-12-06 16:12:24 +00:00
Leonardo Pavan Rocha c0dc12f464 [FIX] hr_homeworking: change default WL and allow deleting default WLs
This commit changes the default worklocation set for the employee from "office"
to false. Also, this commit adds the possibility to delete a default
worklocation from the calendar view.

A typo is also fixed from "exception" to "exceptions" which was causing a bug
returning the worklocations.

task-3584193

closes odoo/odoo#141209

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-11-06 15:36:57 +00:00
Leonardo Pavan Rocha ff2e27afde [FIX] hr_homeworking: don't show work location if not location set
In homeworking, we currently show the work location as false if a location is
not set. This commit fixes this issue by checking if the location is set before
rendering.

task-3570053

Part-of: odoo/odoo#139736
2023-11-04 00:38:21 +00:00
Leonardo Pavan Rocha 82c9e8f85c [FIX] hr_homeworking: fix homeworking button not clickable in week scale
https://github.com/odoo/odoo/pull/138670 changed how the set location buttons
look, however this change started causing the button not to be clickable. This
commit fixes this issue. Also we change the button text from "add location" to
"set location". On top of that, the "set location" button takes too much space,
creating a big gap between the date and the events for that day. To make the
gap smaller, we reduced the size of the button.

task-3570053

Part-of: odoo/odoo#139736
2023-11-04 00:38:21 +00:00
MélanieandXavier Bol 4959d47b70 [IMP] * : redesign employee kanban card (master version)
* = hr, hr_holidays, hr_homeworking

Changes the hover on plane icon for leave. In public employee the hover is : "on leave" and in private employee the hover is the name of type's leave

task : 3527398

closes odoo/odoo#137741

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Co-authored-by: Xavier Bol <xbo@odoo.com>
2023-10-26 12:10:14 +00:00
Elisabeth Dickinson c9807a743b [IMP] calendar,hr_homeworking,web: improve popover layout
The attendance dropdown is a switch button and "Needs Action" is no
longer visible on the popover (instead none of the buttons are selected)

The popovers are larger and the icons aligned. Their headers are the
color of their event.

The year view's event links inside the popovers have the same styling
as their event in the calendar.

task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Elisabeth Dickinson bac931f4ed [IMP] hr_homeworking: improve homeworking button
Their now mobile friendly, and the Add Location button is more
aesthetic. 

task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Leonardo Pavan Rocha 2f4a83e5ab [IMP] web,hr_homeworking,calendar: overwrite default fc header to allow customization
In some modules at Odoo we want to have custom headers for calendar. Since
fullcalendar accepts a function callback that should render the header, it was
decided to have this method exist in the calendar_common_renderer. So any
other apps that want to add something to the header, can just extend this
method. This commit also changes how homeworking changes the header so that it
complies with this change.

task-3455051
task-3389317

Part-of: odoo/odoo#138670
2023-10-23 20:07:23 +00:00
Arnaud Joset 68a7ae269d [FIX] hr_homeworking: fix locale of homeworking day
Before this commit, when the locale was not in english, the following
traceback was observed:

 ```
Uncaught (in promise) Error: The following error occurred in onWillStart: "res[employeeId][((intermediate value) + "_location_id")] is undefined"
    OwlError owl.js:87
    wrapError owl.js:2604
    onWillStart owl.js:2647
    useModelWithSampleData model.js:165
    setup calendar_controller.js:48
    setup attendee_calendar_controller.js:10
    setup appointment_calendar_controller.js:15
    setup google_calendar_controller.js:11
    setup hr_homeworking_calendar_controller.js:12
    setup microsoft_calendar_controller.js:11

 ```

closes odoo/odoo#139052

Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-10-18 16:52:05 +00:00
Leonardo Pavan Rocha f13ea80fe4 [FIX] hr_homeworking: fix homeworking using localized week name for technical field
https://github.com/odoo/odoo/pull/137502 changed how we handle homeworking
records. However, it would throw a traceback if luxon was using any non
english localizations to get the week name of a date. This commit fixes this by
setting the us location before getting the weekname as we rely on it to get the
default data for that day.

closes odoo/odoo#138831

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-17 08:53:16 +00:00
Xavier Bol (xbo) 6ff5f9eb16 [REF] hr: create hr_presence_status widget
Before this commit, the hr presence status icon is hardcoded in
each view in which the icon is needed.

This commit creates a widget for that icon to be able to use that
widget in the views in which the icon is needed to avoid duplicating
the code.

task-3376776
2023-10-16 08:17:30 +02:00
Leonardo Pavan Rocha e9331147ff [IMP] hr_homeworking: simplify module to reduce amount of records stored
This commit changes how hr_homeworking deals with hr.employee.homework records.
Before this, an hr.employee.homework record was created for each day of the
week, even if it was the default location of the employee. This commit reworks
how homeworking deals with them to reduce the amount of records generated.

Now default employee locations don't generate records. They are rendered in the
calendar view as ghost events. For exceptions, we allow only creating a single
exception per day. If an employee sets an exception as 'weekly', it sets that
location as the default one for the employee on that day of the week. Not
having to deal with recurrencies makes the homeworking code simpler to manage
as well. Also exceptions are, by definition, not common. So we shouldn't expect
a lot of exception records to be created.

task-3527196

Part-of: odoo/odoo#137502
2023-10-12 16:12:04 +00:00
Pierre Pulinckx (pipu) ce38e06801 [REF] *:replace moment usages with luxon
luxon and moment are both used in the solution, but these two libraries
facilitate the manipulation of dates. It was decided to replace all uses of
moment with luxon so we can then remove moment.js from the code and lighten
the assets.

task-3391739

closes odoo/odoo#133144

Related: odoo/enterprise#46447
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-08-31 14:14:59 +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
Michael (mcm) 9d6b380a24 [REF] *: adapt patches after new patch function
In the commit [1], the patch has been refactored to support the
native keyword `super`. The current commit just adapts the codebase
to that change.

task 3410198

[1]: 19ea1ac08043e22a811630968e44715cc3bfc495

Part-of: odoo/odoo#125716
2023-08-02 17:29:05 +02:00
Melanie Peyrat (MEPE)anddasz b3be3af61c [ADD] hr_homeworking: add homeworking
Users and employees can now define their usual worklocation
for a day of the week aswell as define unusual ones from the
calendar app. The worklocation is then displayed in the calendar
in two different ways: when only one person is selected, there
is a circle with an icon in it, and a ray that extends to the right
if the person is at the same location for multiple days. If there
are multiple persons selected there is no ray, instead the circles
are grouped by location type and colored accordingly to the filters
in the left panel.

closes odoo/odoo#129585

Task: 3060685
X-original-commit: c74ac3f698d4ea4c9b7a5e060fba4cf77cc9a6d7
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Co-authored-by: dasz <dasz@odoo.com>
2023-07-25 21:22:46 +02:00