Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
closesodoo/odoo#98242
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
*: im_livechat, website_livechat
Access right should be based on channel type and membership instead.
Chat always private, group always private, channel private should
disapear and be a group instead (migration needed), and other channel
always public (but they can still be further restricted with
the "allowed groups" feature)
task-2632861
closesodoo/odoo#90415
Related: odoo/enterprise#30980
Related: odoo/upgrade#3850
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Not entirely sure about TestAllocationRights. For TestEsEdiCommon
issue is quite obviously that it's inherited by tests which are
external, so when the `post_install_l10n` tag gets applied those tests
get run during "normal" l10n and they break.
closesodoo/odoo#98814
Related: odoo/enterprise#30825
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Probem:
With some time off type as default type in an allocation request
you get a traceback as soon as you try to open the allocation
request form.
Cause:
FIX commit [1] introduced the issue as it didn't consider the
possibility of a false date_from
Improvement 1:
Having a date_from False sets a False in the leave request name
displayed on the form, we change that to have an empty string
instead
Improvement 2:
The timezone bug fix in commit [1] is only applied on a specific
configuration, we applie it to all configuration of leave request
name
[1] 5a50dea2652cff014d9198f59265cf36a3ec1865
opw-2961344
closesodoo/odoo#99454
X-original-commit: 3b9a012e4a0839bc5da2daf51d56591d2863b4be
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
Currently there is no container in which to add content to the bottom of the hr
department kanban cards. Any module that wants to place content there therefore
has to create this section itself. This results in conflicts when two different
modules both try to add this section to the card. As a solution, an empty lower
section of the kanban card is created by default. Any module can then add
content to that empty section, regardless of how many or which modules are
installed.
The icon that is displayed in the employee kanban view is determined by the
field hr_icon_display, computed in the method _compute_hr_icon_display. This
method is overridden in multiple modules such as hr_holidays, hr_attendance
and hr_homeworking.
Currently this field has a state to show no icon (presence_undetermined). In
this change this state is extracted into the a separate field
show_hr_icon_display with the default state of hr_icon_display being
presence_to_define. In this way a module such as hr_attendance, which only
overrides _compute_hr_icon_display to show the default icon for everyone as a
default, now only needs to change this separate field and does not need any
knowledge of what other states exist. This reduces coupling between modules.
* = bus, hr_holidays, test_discuss_full
- use channel member instead of partner for typing
- use channel member instead of partner for all other return values from server
- remove temporary partner hack in livechat and keep public partner
- remove some obsolete convert data
- adapt format methods accordingly
task-2664853
closesodoo/odoo#98923
Related: odoo/enterprise#30760
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit will make date(time) raw_value an ISO string
instead of a native JS Date.
- Before this commit
In kanban templates:
- the raw_value property of a record's date/datetime field is
a native JS Date object.
The problem with raw_value is that JS Dates toString
method depends on the system locale and timezone.
In the code base, the usage of raw_value for date/datetime fields
usually parse the raw_value into a luxon DateTime object
in order generally to display it in a specific format, or in order
to compare it to another luxon DateTime object (e.g. the now instant).
- After this commit
The raw_value property of a record's date/datetime field
has become an ISO8601 string, instead of native JSDate toString
format (which I recall depends on system's locale and timezone).
The ISO8601 format is easier to work with.
Part-of: odoo/odoo#98980
Since odoo/odoo#96545 the number of half-days remaining were not
correct. It was showing the number of hours as days.
task-2964068
closesodoo/odoo#99055
X-original-commit: 8734ea55b4070fcc361d395923621bede94c1998
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
This commit is the continuation of task-2948676 which consists of
lightening the Thread model by moving the channel-specific behaviours to
the Channel model.
The changes revolve around the DiscussSidebarCategoryItem model. The
goal is to use channel instead of thread as identifying field for
DiscussSidebarCategoryItem, and to move channel-specific fields involved
in the computes of this model from Thread to Channel.
Changes in this commit include:
+ move `avatarCacheKey` from Thread to Channel
+ move `correspondent`
+ move `correspondentOfDmChat`
+ move `custom_channel_name`
+ move `localMessageUnreadCounter`
+ move `serverMessageUnreadCounter`
+ introduce `Channel/displayName`
+ use channel instead of thread as identifying field for
DiscussSidebarCategoryItem
Part of task-2948676.
closesodoo/odoo#98149
Related: odoo/enterprise#30457
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Due to missing default_date_{to,from} in the hr_holiday_status_id field context, an allocation planned
next year wouldn't be selectable by the user.
closesodoo/odoo#99197
X-original-commit: cd1cb57f87bd0437dad48f03c3842216366427dc
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: phwa-odoo <phwa@odoo.com>
Prior to this commit accrual levels based on worked time did not
properly compute the number of days when the period prorata was taken
into account.
TaskId-2924364
closesodoo/odoo#99183
X-original-commit: d9000d3d883ab6fa8325692f1ac5249d6822046a
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
The goal of this revision is to get rid of the `groups_id` field of the model `ir.ui.view`.
- This feature wasn't really known or used by most developers,
and not straight-forward to understand.
Removing it allows one less complicated thing to learn for developers.
Besides, thanks to odoo/odoo#95729,
changing the behavior of the `groups=` attribute,
we can easily get rid of this `groups_id` feature
by simply adding `groups=` in the elements of the views
using the `groups_id` field, it will have the same effect:
adding the elements in the view only for the users part of the specified group.
- By getting rid of the groups_id many2many field on ir.ui.view,
it makes possible to cache the view architecture without
requiring to use the groups in the cache key.
Currently, if we want to cache the view architecture,
it would be required to use the intersection of the user
groups with the groups_id groups of the view,
making it costly to compute the cache key,
therefore altering the performance point to cache the view
architectures.
Part-of: odoo/odoo#98551
Just doing the summer file cleaning. Move mail data into files named based on
their model, easing maintenance and searching for those data.
Spotted during Task-2207626 (Rating: Delay rating notification to ease feedback)
Part-of: odoo/odoo#98661
This revision is to make uniform the behavior of the `groups` attribute
on the Python model fields
and on the node in the view architecture.
In both cases, remove the node from the view completely.
Before this revision,
in a back-end view:
- In the Python model, if a field has the `groups` attribute set
and the user is not part of
the groups, the field is removed, completely, from the view.
- In the view architecture, if a node has the `groups` attribute set
and the user is not part of
the groups, the node is made invisible (not completely removed, just
made invisible).
in a front-end view:
- if a node has a "groups" or "t-groups" set and the user
is not part of the groups, the node is removed from the view.
So it's 2/3 cases removing nodes restricted to a group.
and 1/3 case making invisible nodes restricted to a group.
It's simpler to have a uniform behavior for the 3 cases,
simpler to understandard for developers.
In addition, this will help for the goal to cache back-end views.
It makes possible to convert views using the `groups_id` field
by moving the content of these views directly
in the view to which they add content which is suppose to be completely
removed when the user has not the according group.
By getting rid of the `groups_id` many2many field on `ir.ui.view`,
it makes possible to cache the view architecture without
requiring to use the groups in the cache key.
Currently, if we want to cache the view architecture,
it would be required to use the intersection of the user
groups with the `groups_id` groups of the view,
making it costly to compute the cache key,
therefore altering the performance point to cache the view
architectures.
closesodoo/odoo#95729
Related: odoo/enterprise#29592
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
As part of hr_holidays B2B, the holidays allowances were moved from hr_leave_type to hr_leave_allocation.
This didn't allow to take a leave longer than the maximum duration of an allocation. Also, despite all the
allocations could have enough days for a certain leave, it was not possible to use all available days without
splitting the leaves across the different allocations.
This commit moves the holidays allowance to the hr_leave_type to remediate the issues described above.
task-2834887
closesodoo/odoo#98317
X-original-commit: 8c37d5c7cc397e517c43c1ec13a131b4b35e48b7
Signed-off-by: phwa-odoo <phwa@odoo.com>
A test introduced with https://github.com/odoo/odoo/pull/96432
revealed an issue with the level limits for the accrual plans.
The only applied limit was the one of the current level at the end of
the run, however if for whatever reason multiple levels had to be
processed at once (if the database was shut down for a long period of
time for example), the individual levels would not apply any limit logic
to their behaviour which meant that you could have a different behaviour
between running the cron each day and running it after a long period.
This commit aims to fix that issue by applying the said limit.
OPW-2868297
closesodoo/odoo#97540
X-original-commit: 09fa1020f42d641fc0011d482cdd08aea4f4085a
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit converts the radio image field of hr_timeoff
to the new framework and renames the registry key to
time_off_radio_image.
closesodoo/odoo#97103
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Steps to reproduce:
- Create an accrual plan and an allocation request such as described
in the added test and validate the allocation request
- Run the scheduled action for accrual plan computation
- Check the number of allocated days
Expected behavior:
The first level should bring 6 days, the second 3 days and the last
1 day for a total of 10 days
Current behavior:
The 3 level give non integer values closed to the expected for a
total of 9,... days.
Explanation:
When transiting between two levels the nextcall was the last day
of the current level to have the right level, this creates an
inconsistency as the end_date of the _process_accrual_plan_level
level should go up to the first day of the next level to have the
full number of days expected. To solve the issue we change the
level selection so that if the date is the first day of the
level it is still in the previous level. We also modify the places
where the nextcall was modified when transiting level so that there
is no more one day delta anymore.
opw-2868297
closesodoo/odoo#96665
X-original-commit: 5d055130c97c5d8367c2b71fc617f588c5e15741
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Steps to reproduce:
- Create a leave request for multiple employees
- Go in the employee list
Current behavior:
The leave request is not visible in the list view
Expected behavior:
The leave request is visible in the list view
Explanation:
Previously a domain on the list view restricted the
records to the one that had an employee_id with the
right company but this condition was never met by the
the multi_employee leaves as they have no employee_id.
To solve the issue we add to the domain a condition to
accept multi_domain employee that have the right state
and the right company.
opw-2917291
closesodoo/odoo#96625
X-original-commit: f1c7c3737d3420a1356fd8e24d7970edcdb571c6
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Purpose
=======
Base the number_of_hours_display on the company calendar instead of the
employee calendar to avoid modifying the informative allocated value
in case of a working schedule change.
closesodoo/odoo#96419
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, if you are on the time off dashboard calendar of a company
that is not set as your user's default company, no time off is displayed.
Also, if you try to consult your time offs on the dashboard tree view and if
you have one leave with a leave_type without company on a company that is not
the one you're logged in, you'll get a access error.
This commit fixes both issues.
taskID 2893659
closesodoo/odoo#96199
X-original-commit: 6e604bd8bb1d6011482a9ce1778a71a108d0c610
Signed-off-by: Kevin Baptiste <kba@odoo.com>
In hr_holidays, the duration field is editable but doesn't bring any added value.
The field is errorprone and not editable if you are not HR Officer. It should be the same in every case.
The duration field should be read only on the dashboard and time off creation screens.
task-2901951
closesodoo/odoo#95534
Related: odoo/enterprise#29352
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit fixes a bad call to relativedelta missing a `day` key for an
argument.
closesodoo/odoo#95705
X-original-commit: b59e81b6c34e7a4e2f35cf719c811883b289ddb5
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
In the web client, in a real use case, it's not possible
to write on fields which are invisible,
as it's not possible to write on fields which are readonly.
This is a first step in the goal to change the behavior
of the `groups=` attribute in the back-end views,
to remove them for the view instead of making them invisible.
This is mainly to reduce the diff of the revision that will introduce
the mentioned above behavior change.
As nodes with `groups=` will be removed from the view
when the user doesn't have the group, it's no longer possible
to set a value on a field having a `groups=` the user doesn't have
in the `Form` test class, as the field will no longer be at all in the
view.
However, these unit tests shouldn't have been able to set values
on invisible fields in the first place.
This revision therefore aims to correct the unit tests setting value
on fields which were invisible because the user executing the
test was not part of the required group(s) for these fields
to be visible in the view.
closesodoo/odoo#94337
Related: odoo/enterprise#28936
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
> 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
It seems louche to use media-breakpoint-between(lg, xl,
$o-extra-grid-breakpoints) as in $o-extra-grid-breakpoints there is an
XXL value.
In short, in XXL mode the padding fallback to the value outside the
breakpoint (twice smaller).
e.g. result in CSS
```css
.o_form_view .o_form_sheet_bg > .o_form_sheet {
padding-right: 16px;
padding-left: 16px;
}
@media (min-width: 992px) and (max-width: 1533.98px) {
.o_form_view .o_form_sheet_bg > .o_form_sheet {
padding-right: 32px;
}
}
@media (min-width: 992px) and (max-width: 1533.98px) {
.o_form_view .o_form_sheet_bg > .o_form_sheet {
padding-left: 32px;
}
}
```
Part-of: odoo/odoo#95450
The test was randomly failing on nightly builds as the timeoff was
considered as started, thus preventing the user from modifying it.
closesodoo/odoo#95010
X-original-commit: 95f84086d15ed0a139e4e145dc2422a949f1ae95
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit makes various adapations in addons with respect to
the introduction of the owl kanban view. Mainly, some selectors
in scss and in tests needed to be adapted. Moreover, in some tests
that we haven't adapted yet, we must ensure that legacy form and
list views are still used (useLegacyViews).
It also contains some adaptations in kanban templates, e.g. the
replacement of moment by luxon, the removal of underscore...
Part-of: odoo/odoo#92475
Steps to reproduce:
- Create an accural plan with two levels, the first should have
its action_with_unused_accruals set as lost. The second should
start one year after the first level.
- Use this plan on a employee and make it start the first day of
the previous year.
Current behavior:
The number of allocated day is wrong and can even be negative
Expected behavior:
The days of the first level are lost and there is the right amount
of allocated days,
Eplanation:
The _end_of_the_year function was first designed to be only called
on the first day of the year but the it changed since then without
updating it's content and it can calle any day of the year now. In
this case the use of today() does not make sense and it should be
replaced by the first day of the current year.
opw-2868297
closesodoo/odoo#94897
X-original-commit: 476818972e93b32df6f25cf299f631a8f7eb3af4
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Purpose
=======
In message_notify, when called on a recordset, call model methods instead of
base one defined on MailThread. This allows to use internal methods overrides.
Also perform some linting on calls to ``message_notify`` in order to better
spot calls, parameters, ...
Task-2852908
closesodoo/odoo#92868
Related: odoo/enterprise#28038
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Now that it potentially contains guests, the previous name is no longer correct.
Part of task-2883466
closesodoo/odoo#93731
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
And use it on partner im status.
This will allow displaying the im status of guest without any other change to
components.
Part of task-2883466
Part-of: odoo/odoo#93731
When the duration of an approved time off is changed from the time off dashboard,
the holiday_status_id field is no longer editable in the form, only the duration of the leave.
This causes a traceback due to the custom form controller to update the name of the time off type
based on the allocations available.
closesodoo/odoo#93858
X-original-commit: b87e672e1e5367d774dee2de6a7c76374cc2da39
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: phwa-odoo <phwa@odoo.com>
STEPS:
* switch to serbian language
* start chat with a user who is out of office
* refresh page
BEFORE: Incorrect locale information provided
AFTER: no errors
Similar change for web module in v15: https://github.com/odoo/odoo/commit/1bb9cb89c8b5b5c55299afd3c53df14c3aea5ee7
opw-2859402
closesodoo/odoo#93479
X-original-commit: 3102b5e9cecbc973d5f774051d556d9387a8ee38
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>