120 Commits
Author SHA1 Message Date
Odoo Translation Bot b31ea21cab [I18N] Update translation terms from Transifex 2024-04-28 00:10:20 +02:00
Odoo Translation Bot 459412b860 [I18N] Update translation terms from Transifex 2024-04-21 00:08:43 +02:00
Odoo Translation Bot 3275156773 [I18N] Update translation terms from Transifex 2024-04-14 00:09:33 +02:00
Odoo Translation Bot 684745f5de [I18N] Update translation terms from Transifex 2024-03-31 00:09:16 +01:00
Odoo Translation Bot 395140671f [I18N] Update translation terms from Transifex 2024-03-24 00:12:07 +01:00
Odoo Translation Bot c4bc200b47 [I18N] Update translation terms from Transifex 2024-03-17 00:11:43 +01:00
Yannick Tivisse 094ab73a2a [FIX] hr_work_entry_holidays: Prevent time off duration erasing
Purpose
=======

The time off duration is set to 0 when the related contract is set
as expired, then we remove the end date and set the contract back
to running.

That's because the check was done before calling super, hence the
contract is excluded from the candidates because it is still expired
without end date, which would make no sense when trying to retrieve
the related calendar.

closes odoo/odoo#157681

Taskid: 3806342
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2024-03-15 15:28:03 +00:00
MélanieandYannick Tivisse 941dc4cee0 [FIX] base,hr: Ensure employee/user image at creation
Ensure an avatar is generated based on the employee/user name
if no image is provided at the record creation (for internal users only).

closes odoo/odoo#147446

Taskid: 3637523
Related: odoo/enterprise#58646
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2024-03-15 13:04:43 +00:00
Odoo Translation Bot 1b9fd01d46 [I18N] Update translation terms from Transifex 2024-03-10 00:13:03 +01:00
Odoo Translation Bot cb45934163 [I18N] Update translation terms from Transifex 2024-03-03 00:09:56 +01:00
Odoo Translation Bot 4f4ca50e8d [I18N] Update translation terms from Transifex 2024-02-25 00:13:04 +01:00
Odoo Translation Bot dd40867949 [I18N] Update translation terms from Transifex 2024-02-11 00:14:17 +01:00
Tiffany Chang (tic) 94c58407f6 [I18N] *: add in Russian translations
For a first iteration, Russian translations were done using DeepL using
1 large .pot file of all the standard modules to translate (e.g. no
localizations, no test modules, etc). Unfortunately for some reason
doing a msgmerge with the existing ru.po files didn't seem to work, so
old "Translators" metadata at top of files were lost (maybe they will be
re-added during next Transifex sync?)

Part-of: odoo/odoo#152285
2024-02-06 18:49:02 +00:00
Odoo Translation Bot c95419af44 [I18N] Update translation terms from Transifex 2024-02-04 00:11:05 +01:00
Yannick Tivisse 43285ebc96 [FIX] hr_holidays: Compute resource_calendar_id even without work entries
Part-of: odoo/odoo#152311
2024-02-02 19:49:40 +00:00
Odoo Translation Bot 625dac5a10 [I18N] Update translation terms from Transifex 2024-01-28 00:16:34 +01:00
Odoo Translation Bot 95a4b6dfdc [I18N] Update translation terms from Transifex 2024-01-21 00:17:03 +01:00
Odoo Translation Bot b81790505b [I18N] Update translation terms from Transifex 2024-01-14 00:16:26 +01:00
Odoo Translation Bot 0e23020b84 [I18N] Update translation terms from Transifex 2024-01-07 00:23:19 +01:00
Odoo Translation Bot ad35458e8b [I18N] Update translation terms from Transifex 2023-12-31 00:18:24 +01:00
Odoo Translation Bot 50e8e08183 [I18N] Update translation terms from Transifex 2023-12-24 00:18:24 +01:00
Odoo Translation Bot 304a6caa14 [I18N] Update translation terms from Transifex 2023-12-17 00:08:26 +01:00
Odoo Translation Bot 3ffba892de [I18N] Update translation terms from Transifex 2023-11-26 00:20:02 +01:00
Odoo Translation Bot f6fe982853 [I18N] Update translation terms from Transifex 2023-11-19 00:28:08 +01:00
Louis (wil) 68b4dfc2bb [I18N] *: import translations
closes odoo/odoo#141655

Related: odoo/enterprise#50484
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-11-08 20:48:14 +00:00
Odoo Translation Bot 5d2bc9e9b3 [I18N] Update translation terms from Transifex 2023-11-05 00:21:55 +01:00
Alvaro Fuentes 74c291ef5f [FIX] hr_work_entry_holidays: fix dates computaiton in write
We need to filter out records without `request_date_from` and
`request_date_to` to avoid the error:
```
  File "/tmp/tmpiaelju95/odoo/17.0/addons/hr_work_entry_holidays/models/hr_leave.py", line 180, in write
    stop = datetime.combine(max(stop_dates) + relativedelta(days=1), time.max)
TypeError: '>' not supported between instances of 'datetime.date' and 'bool'
```

Issue observed in test upgrades of `l10n_hk_hr_payroll`

closes odoo/odoo#140286

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-11-02 15:10:58 +00:00
Odoo Translation Bot 6739c317d1 [I18N] Update translation terms from Transifex 2023-10-29 00:07:17 +02:00
Louis (wil) 3f6f949fa5 [I18N] export sources
closes odoo/odoo#140002

Related: odoo/enterprise#49687
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-10-27 08:36:16 +00:00
Thibault Delavallée 162b74e402 [FIX] various: update query counters
Update counters after all changes. Notably storage of environment variables
(company, alias domain) during mail creation and sending process as well as
computing values depending on alias domain (e.g. reply_to, return-path) lead
to some additional queries to read companies and their alias domains.

Task-36879 (Mail: Support Multi Domains Aliases)

Part-of: odoo/odoo#76734
2023-10-24 19:24:50 +00:00
Dossogne Bertrand 8f87e102a9 [IMP] hr_holidays: see future allocations + refactoring
This commit adds the feature to select a date in the future
in order to see future allocations, would it be for accrual plans
granting new allocated days, lost days due to expired allocations
or allocations that are not yet available to the employee.
The date selector only appear when the employee has accrual allocation,
in which case the feature is more relevant.

This feature comes with a major refactoring of hr_holidays
methods to handle some edge cases in the management of leaves.
The refactoring also includes the removal of the 'draft' and 'cancel'
state in allocations.

This commit also removes unused imports and implements some linting fixes.

task-2675380

closes odoo/odoo#108148

Related: odoo/upgrade#4238
Related: odoo/enterprise#35157
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-06 08:25:12 +00:00
Rob Coekaerts 8f4e365ad7 [FIX] hr_holidays: allow maternity leave during credit time
During a credit time period where the employee works zero hours,
the employee should still be able to take maternity leave.

Before this change this was only possible if you manually set the
duration of this leave for it to be non-zero, which was kind of a hack.
Now that durations are computed correctly automatically, maternity (and
paternity) leaves were added to the list of exceptions of leave types
that can be taken even if their duration is zero.

Part-of: odoo/odoo#119317
2023-09-26 09:32:27 +00:00
Rob Coekaerts 6074d86b20 [IMP] hr_holidays: refactor leave duration
The idea of current date_{from,to} computations is as follows:

The user selects the request_date_{from,end} (and optionally
request_hour_{from,to} and these inputs are then processed into a
date_{to,from}, taking into account the type of leave, the work schedule
(resource_calendar) and time zone (since date_{to,from} are saved in UTC
while the request_dates are stored in the user's timezone.

However, in practice this computation is very messy, resulting in
date_{to,from} needing to be specified in all demo data and test cases,
even though it should be derived from the request dates. Various
superfluous or poorly named methods also exist in this flow
(eg _get_start_or_end_from_attendance which really performs a timezone
conversion, the logic of which resource calendar to use is scattered
across the whole model etc).

date_{to,from} are used many times as inputs throughout the code, with
code being present te inverse compute request_date_{from,to} from these
values. However in reality this is not possible to do consistently.

Therefore with this commit, we restore request_date_{from,to} as the
sole possible inputs, with date_{from,to} being derived from them. In
addition, the timezone and resource calendar are consolidated into their
own fields, with a single computation method computing them.

task-3081565

Part-of: odoo/odoo#119317
2023-09-26 09:32:27 +00:00
Rob Coekaerts 88b55a658e [FIX] hr_work_entry_holidays: remove faulty test
Removed this test because
  1. What it was testing doesn't make sense, namely the behaviour of
     resource leave creation when you explicitly set the resource
     calendar id of the employee to a different one than the one on the
     current running contract, which is an inconsistent state that
     generates warning messages when you try to do so.
  2. The test wasn't testing that correctly because it was only testing
     whether two resource leaves were created, but not whether they were
     actually created in the two different calendars, which was not the
     case.

Part-of: odoo/odoo#119317
2023-09-26 09:32:27 +00:00
Thibault Delavallée 8409ebe5fb [FIX] various: update query counters to runbot state
Update (some) query counters according to runbot state.

Also make some tests deterministic when involving company name.

Task-36879 (Mail: Support MultiCompany Aliases)

closes odoo/odoo#135288

Related: odoo/enterprise#47345
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-19 16:37:13 +00:00
Julien Carion (juca) 1a44537095 [IMP] mail: avatar card preview v2
This commit changes the behavior of the avatar card preview so that it
is now triggered on click instead of on hover and the previous behavior
of the click event (open chat) is therefore removed. It also adds the
functionality to the Message and Activity components of discuss so that
clicking on the avatar inside these components will also show the card.
It also makes sure that the id of the user is added to the persona even
if nothing indicates that it should.

task-3442819

closes odoo/odoo#131355

Related: odoo/enterprise#47084
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-09-15 16:45:50 +00:00
Chong Wang (cwg) 13957b6281 [FIX] core: support cr.execute_values
psycopg2.extras.execute_values was introduced in PR #101237
however it pypasses the override logic for cr.execute. As a result
1. --log-sql cannot log these queries
2. assertQueryCount cannot notice these queries
...

This commit create a new api cr.execute_values to support the same SQL feature
without losing the override logic for cr.execute

closes odoo/odoo#131190

Related: odoo/enterprise#47374
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-09-14 11:22:42 +00:00
tong-odooandYannick Tivisse ac8b080234 [FIX] hr_work_entry_contract: work entry timezone issue for attendance
Steps to reproduce:

- Install Attendances app and Employee app
- Setup an employee with a contract which work entry source is from
attendance
- Change the working schedule to different timezone, for example
Asia/Hong_Kong
- By default the working schedule should be start to work from 0800 to 1700
- Now create an attendance in the first day of the contract, i.e.
1st May 2023, check in time 0700, check out time 2000
- The total work hours should be 13
- However, in the work entry, the genearted work entry is 0800-2000, only
12 work hours.

Current behaviour:
The generated work entry mismatches the value of the attendance

Expected behaviour:
The work entry should match the attendance

Explanation:
This issue is casued by the timezone issue. When the system generate
the work entry, it will calculate the date_from datetime and date_to datetime.
Then it will compare between the attendance and the date_from datetime to choose
the larger datetime to put inside the work entry as start time.

However, the date_from datetime didn't consider the timezone of the working schedule.
In the above example, Asia/Hong Kong time is UTC+8 time. Therefore if we convert
the attendance time back to UTC time. It is check in time 30 April 2023, 2300 to
check out time 1 May 2023, 1200. In the mean time, if we compare between the date_from
datetime (1 May 2023, 0000) and the attendance check in time (30 April 2023, 2300).
The system will take the date_from time and therefore the generated work entry time
is incorrect.

task-3468012

closes odoo/odoo#134533

X-original-commit: 2baf4e3ebcd9ce3beb47ee2881aa3e8bd8a74cbf
Related: odoo/enterprise#47007
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2023-09-08 15:26:08 +00:00
Mélanie Peyrat (mepe) d4f1fb9f10 [IMP] hr_holidays: a time off (duration >= 1day) is displayed as full day
If the duration time off is greater than or equal to 1 day, then it
should be displayed as a whole day event.
Now it's not a case and can be misleading.

Moreover, this change increases querycount for the following reason:
When we create allday calendar event, on top of usual queries -
"calendar_event"."stop_date" and "calendar_event"."start_date" are read.

Note, start_date and end_date are only set for allday events.

task-3103848

closes odoo/odoo#113865

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-09-04 17:10:02 +00:00
Thomas Lefebvre (thle) f24f2d6384 [FIX] hr_work_entry_holidays: ensure the consistency of leaves
Steps to reproduce:
-------------------
- install `hr_work_entry_holidays` module
- create an employee and add two contracts:
    - from 2023-01-01 to 2023-06-30 with a full time (5/5) resource
      which is expired
    - from 2023-07-01 to 2023-12-31 with a partial time (4/5) resource
      which is running
      (doesn't work on Wednesday)
- create an allocation with 10 days
- with the employee, create two leaves:
    - 3 days during the first semester with one Wednesday
    - 3 days during the second semester with one Wednesday

Issue:
------
Leave duration is based on the current contract.
If we change the type of leave by modifying its days/hours unit,
we will get inconsistencies between days and hours for leave taken
in a period belonging to another contract.

Cause:
------
Expired contracts are not taken into account
when calculating the number of days and hours.

Solution:
---------
Add `close` state to contract search.

opw-3419380

closes odoo/odoo#132144

X-original-commit: 249f8c836f606c0dfc5f3b6e64ad9b319b5a4602
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-08-21 07:19:51 +02:00
Yannick Tivisse b9b165db7d [FIX] hr_work_entry_contract: Correctly compute work entries for edge timezones
closes odoo/odoo#124222

Related: odoo/upgrade#4699
Related: odoo/enterprise#41253
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-08-17 10:32:54 +02:00
Romeo Fragomeli 73e7c20573 [IMP] *,test_mail,test_mail_full: update query count
* = crm,hr_work_entry_holidays

This commit changes the value of the "QueryCount" as `mail_enterprise`
executes a new query to search for devices associated with the partner.

Task ID: 3123678

closes odoo/odoo#127198

Related: odoo/enterprise#43577
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-07-19 18:24:10 +02:00
Wolfgang Taferner 945ed63bb8 [FIX] hr_work_entry_holidays: a leave can be of type other as well
The previous domain fix 84d8bf8167
was skipping all potential leaves of type other left out for work entries
therefore properly inherit instead of overriding and add the proper domain

closes odoo/odoo#128527

X-original-commit: 076d2179ad2f19c0ff8be043e492bdc7b780baef
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-07-15 12:00:42 +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
Pierre-Yves Dufays c8b27bd3a0 [IMP] crm, hr_work_entry_holidays, test_mail{_full}: update query count
In order to display the unfollow link or not in emails or in the inbox, the
system need to query the followers of the document. This is what explains the
added queries.

See odoo/odoo#107978

Task-3061864
2023-05-10 13:21:07 +02:00
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Kevin Baptiste efb5564fd5 [FIX] hr_work_entry: correct add item to list
The fix introduced in #110559 was partially wrong, the employee ID was
not properly added to the list and would crash.

> TypeError: 'int' object is not iterable

closes odoo/odoo#117217

X-original-commit: a7914d43d7d1835a76486bb66de753b29a24dd70
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-31 08:50:55 +02:00
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +01:00
Raphael Collet e962860c6f [IMP] core: introduce search_fetch() and fetch()
This fulfills the goal of searching and fetching fields in a single SQL
query.  We introduce the new method search_fetch() for that purpose.
Also introduce method fetch() to fetch some fields for a recordset if
they are not in cache yet.

The call graph is as follows:

    search()        calls   search_fetch()
    search_read()   calls   search_fetch() and _read_format()
    read()          calls   fetch() and _read_format()

    search_count()  calls   _search()
    search_fetch()  calls   _search() and _fetch_query()
    fetch()         calls   _search() and _fetch_query()

The methods _search() and _fetch_query() are usually the ones to
override to implement business-specific logic.  The method _search()
returns a Query object to retrieve the records that satisfy the given
domain and are accessible for reading.  The method _fetch_query() uses a
Query object to retrieve fields from the database and store them in
cache.

Also use search_fetch() to save one query in search_read() and the
reading of one2many fields.

Part-of: odoo/odoo#112126
2023-03-05 15:12:55 +01:00
Xavier BOL (xbo)andYannick Tivisse 1648c25cc9 [IMP] resource: make working schedule optional in resource model
closes odoo/odoo#110548

Related: odoo/upgrade#4248
Related: odoo/enterprise#36101
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2023-02-22 20:25:16 +01:00