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.
closesodoo/odoo#114533
Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The type fields of actions already defaults to
the model name in the base model definition.
Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).
closesodoo/odoo#114539
Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Before this commit: If the Odoo database is shared amongst multiple
users, and another user wants to sync their Outlook calendar with Odoo
Calendar, Outlook will again pull the existing Odoo Calendar events
during the sync and treat them as new events, causing Outlook to send
email invitations to all event attendees.
Steps to reproduce the issue:
1. Create two users in Odoo
2. Create two outlook accounts
3. Change the email of Odoo's users to the same as the outlook accounts
4. Create some shared events with the second user on the first
outlook calendar and vice versa
5. Sync the first user's calendar with Outlook
6. When the events are fetched to the Odoo, sync the second user
=> emails send to the attendees
The solution is to exclude synced events from the first synchronization.
opw-2929673
closesodoo/odoo#112931
X-original-commit: 86862f2527341247b75df155de16b09d44a7eee6
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
In 16.0, at 6a42ec7c73
an error was introduced redirecting users to the configuration panel
when clicking the 'sync' button for extenal providers in calendar.
This simply replaces that call with a redirect to an authentication url
received from the back-end.
task-3131128
closesodoo/odoo#111392
X-original-commit: 0574c18acd70c3fe52cdb5cbe563ffa02f5f5ad3
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thiry Renaud (reth) <reth@odoo.com>
This is mostly a cleaning/refactoring change.
The current API for init hooks (pre, post, uninstall) is to pass
`cr, registry`.
But the first thing which was done by most
post init and uninstall hooks was to create an env using
the cr passed
e.g.
`env = api.Environment(cr, SUPERUSER_ID, {})`
and the `registry` argument was unused in all these hooks,
completely.
By changing the API of hooks to pass `env` instead
of `cr, registry`, we gain in average two lines in every
hooks:
- the line creating the env `env = api.Environment(cr, SUPERUSER_ID, {})`
- the line importing `api` and `SUPERUSER_ID`
Therefore removing ~250 lines of repeated code lines accross odoo/odoo and
odoo/enterprise.
In addition to these lines removed,
it also ease the API of init hooks for Odoo developers,
who are used to that `env` and not so much how to create an `env`
from a cursor.
Part-of: odoo/odoo#108254
before this commit, the field and labels are aligned in different lines in the settings.
closesodoo/odoo#109683
X-original-commit: 5844a0446ef9712027aa08fc239bbb858d164b87
Signed-off-by: Arnaud Joset <arj@odoo.com>
## Issue
Currently if an administrator installs one of the sync modules but does
not set any credentials. If the user tries to sync their calendar
they are met with an error.
## Fix
Make sure they get a clear dialog explaining why they cannot sync.
task - 3056311
X-original-commit: 6ec6a3764c5e5460aa8a1cdfa228740606fdfe13
Part-of: odoo/odoo#106517
## Issue
Regular users were not able to see the sync button
used to sync with external calendar services even after
these services were configured
## Fix
Conditionally display the whole sync section until one of the
services is configured.
Override the display conditions when one of the relevant modules are
installed.
task - 3056311
X-original-commit: 29f820cfd421859a2b480725ba2a81a515509b88
Part-of: odoo/odoo#106517
Migrates the attendee_calendar view aswell as the modules patching it.
The code has been simplified as much as possible to reduce complexity
while still retaining a similar flow.
TaskId-2999194
closesodoo/odoo#101492
X-original-commit: ee14c3ec4830454d80a63793a91f6d1c838363f1
Related: odoo/enterprise#31963
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
When an event is created in Outlook by an Outlook user (user A) who does not
exist in Odoo but who invites an Odoo user (user B) who syncs his calendar with
his Outlook calendar, the event will appear in the user B Odoo calendar.
If user A cancels this event in Outlook, then when user B syncs his Odoo calendar,
the event must be removed.
closesodoo/odoo#87844
Task-id: 2746046
X-original-commit: f54a56a91e75e3de8b54a7c6c76164929a11a431
Signed-off-by: Arnaud Joset <arj@odoo.com>
* = google_calendar, microsoft_calendar, web
Purpose:
Allow to install appropriate module and configure calendar provider credentials
in fewer steps, without needing to go to general settings, etc.
This requires that both buttons are visible from the start.
In this commit, we also prepare the ability to extend this configuration wizard
for the appointment onboarding (see ENT PR).
Task-2852375
Part of Task-2900763
Part-of: odoo/odoo#97105
In the `write` method, accessing the `ms_organizer_event_id` field of
`self` leads to an exception if `self` represents several records.
So, the idea of this fix is to set the `need_sync_m` field of all modified
records to `True` when at least a field to sync with Outlook is modified
(see `_get_microsoft_synced_fields()`) and then, at the end of the `write`
method, really patch or delete records that are already linked to Outlook
(that means they already have their `ms_organizer_event_id` field set).
closesodoo/odoo#96761
X-original-commit: 1a66343327f9ea9f59ba25ea63e26331cabb65b5
Signed-off-by: Arnaud Joset <arj@odoo.com>
As several customers complained about lot of bugs in microsoft_calendar in 14.0,
It has been decided to backport bug fixes of the model layer from master to 14.0,
without the need of an upgrade script (no new field, ...).
In master, we use 2 ids (organizer event id + universal id) instead of only one,
to handle Odoo <-> Outlook sync correctly when several attendees sync their Outlook
calendar with their Odoo calendar. For that, we have added a new field.
To report this bug fix in 14.0, the existing field which stores the organizer event id,
is now a string storing both ids separated by a ':' as follow: 'organizer_event_id:universal_id'.
2 new compute fields have been added to be able to use these 2 ids more easily.
(all commits from the original PR have been squashed to ease forward-port)
closesodoo/odoo#95736
X-original-commit: 5e83318a7240585371efd31e407829793f3e732f
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Basically, a Outlook event may contain a videocall URL in 2 different ways:
1) the event location may be a specific URL (such as `https://teams.microsoft.com/...`).
In this case, we use it as `videocall_location` instead of classic `location`.
We use a list of patterns to identify these specific URLs among classic locations.
2) the event may have an attribute `isOnlineMeeting` set to `True` and
the attribute `onlineMeetingUrl` set with the URL. In this case, we use
this `onlineMeetingUrl` as `videocall_location`.
opw-2601669
closesodoo/odoo#74785
Signed-off-by: Arnaud Joset <arj@odoo.com>
From [1]:
> Dropped all .badge-* color classes for background utilities
> (e.g., use .bg-primary instead of .badge-primary).
We now have to manage constrast for some badge. It's why we
add 'text-dark' at some point.
Note:
Due to the backport of 'text-bg-#{theme}', we can use this to
avoid to use 'text-dark'.
Ref:
[1] https://getbootstrap.com/docs/5.1/migration/#badges
Task ID: 2766483
Part-of: odoo/odoo#95450
Before this commit, the DateTime range for getting events was six years,
while the Microsoft range limit is five years.
opw-2819858
closesodoo/odoo#93657
X-original-commit: 56f9b7646269d953c3068a12f20436d3afc970b1
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Purpose
=======
Change all masculine nouns in Odoo's code to neutral nouns (when
possible), making sure that demo data is correctly handled. This is
particularly important since our code is open source, and nowadays lots
of machine learning models are trained on open source repositories.
With this small change we contribute to training more "fair" models, and
teaching models that "employee" or "user" != "he".
This also affects some text visible by the user, hence making it more
inclusive for Odoo users.
Task-2853046
closesodoo/odoo#91292
Related: odoo/enterprise#27302
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit: if a Microsoft event didn't have body property,
it couldn't get synced with Odoo and raised an error.
The solution is first to check if it contains the body and then gets
its content value.
opw-2765443
closesodoo/odoo#89634
X-original-commit: 13d57ff5e714bee96fb930c1b8050816bf22c268
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Remove most values uselessly specified because giving the same value as
the default one (see _DEFAULT_MANIFEST in odoo/modules/module.py)
* auto_install is Falsy by default
* author is Odoo SA by default
* summary & description are empty strings by default
* application is False by default
* test, demo, depends and data are empty lists by default
This will reduce noise/inconsistencies between manifests specifications,
simplify analysis of manifests content, ...
closesodoo/odoo#90209
Related: odoo/enterprise#26807
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Step to reproduce:
- Create a with a link in the decription
- Edit + Save multiple times
Current behaviour :
- Since c2b545fd8d91b7d24380ada07adee02f24623ecf we fetch the full
description with html tags which are rendered via the
- When we resend this message to outlook, the description
will be updated via html2plaintext.
In the case of URL, they will be added as a footnote and thus
duplicated if the url is it's own name
Behaviour after thr PR:
- We could then also send the description with the html tags to
ensure full compatibility between the description
- Using html2plaintext update the descrtiption to markdown, with some
issues, since html is now supported in the odoo editor, using
html on both end will remove the need to use html2plaintext and
the descriptions changes stemming from it.
opw-2746358
closesodoo/odoo#87411
X-original-commit: 4c3b69a30d5724dfef2b179ac8eaeecb8ff3da42
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
Before this commit:
A call to `sync_data` was made each time an event happen in the calendar
( changing the day, switching to day/week/month/year ).
This can easily saturate the server and spam the Microsoft API.
After this commit:
One call is made at a time per tab.
This PR is an adaptation of the same fix which was done only for
Google calendar at:
https://github.com/odoo/odoo/pull/69619/files#diff-8457ad89f2f7a1847af533828b40994bfc6d80e1e9d45ee7707b534bda2b0f06
and partially solve another PR that I was planning (but a bit too "overkilled"):
https://github.com/odoo/odoo/pull/85465
OPW-2749791 & OPW-2741728
closesodoo/odoo#85754
X-original-commit: d25b3d783fd08cd1c84095da554f52b463422bc2
Signed-off-by: Arnaud Joset <arj@odoo.com>
Before this commit, the 'none' state was not considered as a possible
attendee state for the microsoft, and it created an empty field in
Odoo.
This commit maps the 'none' state to the 'needsAction', based on the
microsoft documentation.
opw-2694644
closesodoo/odoo#85367
X-original-commit: 1fbd14728980bfabc466efeb437f9f7ce105dfac
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.
Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)
closesodoo/odoo#84280
Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
Step to reproduce:
- Create a event in outlook with a long description
- Load the event in Odoo
Current Behaviour:
- Odoo use the body preview to get the event description
If the body is longer then, the description in Odoo is incomplete.
Behaviour after PR:
- Change fetch option to get description as text
- Use body['content'] as description which is the full body.
opw-2746358
closesodoo/odoo#84362
X-original-commit: c2b545fd8d91b7d24380ada07adee02f24623ecf
Signed-off-by: Arnaud Joset <arj@odoo.com>
Description of the issue/feature this PR addresses: in version 15,
sometimes Google and Microsoft calendar synchronizations break with error:
Create/update: a mandatory field is not set.
Delete: another model requires the record being deleted. If possible, archive it instead.
Model: Calendar Attendee Information (calendar.attendee), Field: Contact (partner_id)
This is happening, because when Odoo is syncing an event, it will match
attendee with res.partner, if no existing partner is found, a new one
will be created unless:
- the address matches an existing mail alias ([alias_name]@[mail.catchall.domain])
- the address is invalid (eg. in outlook the email address is sometimes
in the form /o=ExchangeLabs/ou=.../cn=Recipients/cn=...
In this case we should not try to add the attendee to the odoo event.
Current behavior before PR: Error when syncing that the customer can
only solve by removing the erroneous attendee or remove the event from
their calendar.
Desired behavior after PR is merged: if the partner cannot be created
we ignore it.
opw-2670002
opw-2683889
opw-2702661
opw-2704631
opw-2711907
opw-2720032
opw-2722028
closes#82109fixes#78678closesodoo/odoo#82667
X-original-commit: 1cd470c8922119d0da0b69ab7d4b4ff746533689
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: yosa-odoo <yosa@odoo.com>
Co-authored-by: andro19951 <andro19951@gmail.com>
Test was failing since 2022-01-16, probably a max 2 years sync
FAIL: TestSyncOdoo2Microsoft.test_restart_synchronization
Traceback (most recent call last):
File "/usr/lib/python3.8/unittest/mock.py", line 1325, in patched
return func(*newargs, **newkeywargs)
File "/data/build/odoo/addons/microsoft_calendar/tests/test_sync_odoo2microsoft.py", line 21, in patched
return func(self, *args, **kwargs)
File "/data/build/odoo/addons/microsoft_calendar/tests/test_sync_odoo2microsoft.py", line 84, in test_restart_synchronization
self.assertMicrosoftEventPatched(event.microsoft_id, {
File "/data/build/odoo/addons/microsoft_calendar/tests/test_sync_odoo2microsoft.py", line 40, in assertMicrosoftEventPatched
MicrosoftSync._microsoft_patch.assert_called_once()
File "/usr/lib/python3.8/unittest/mock.py", line 892, in assert_called_once
raise AssertionError(msg)
AssertionError: Expected 'mock' to have been called once. Called 0 times.
Calls: [call._constrains(calendar.event(2049,)),
call._constrains().__iter__(),
call._constrains().__len__()].
closesodoo/odoo#82849
X-original-commit: 86911c4e9b9f86f3b9a5625b973e78103a7b0286
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When we are syncing Outlook events with Odoo events, there is no need
to call back the Outlook API to patch/delete some events.
closesodoo/odoo#80404
X-original-commit: c0094ec99e5fc24b650a257d4792f4be8b09a661
Signed-off-by: Arnaud Joset <arj@odoo.com>
On large databases, the `postcommit` hook for Google|Microsoft Calendar
was taking up to 10% of a leave validation even if the user has the sync
disabled.
This commit disables the postcommit hook for new leaves, as the event will
be synced through the cron eventually.
closesodoo/odoo#80160
Taskid: 2693265
X-original-commit: 88884292e105eab2c36b2a334c617ac4978fa79c
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
In case of m event being removed by a change in recurrence further change is then only applied on the existing events and not all past events
closesodoo/odoo#79889
X-original-commit: 067d911b9bb105d8d86dd6bcf85181dd3cbadd8f
Signed-off-by: Arnaud Joset <arj@odoo.com>
We should rollback manually first to avoid concurrent access errors/deadlocks when
trying to refresh microsoft calendar token.
opw-2630601
closesodoo/odoo#77955
X-original-commit: 5cd27e3440efae06bee6a96aee39f4d2c509ede7
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
Refactor the Environments object into a Transaction object, which is
bound to one cursor, and is no longer shared among several cursors.
The following methods/properties have been changed:
- Environment.envs no longer works (because of the design change);
- Environment.manage() is deprecated (no longer useful);
- Environment.reset() is now an instance method;
- env.clear_upon_failure() is deprecated in favor of cr.savepoint().
closesodoo/odoo#75598
Related: odoo/enterprise#20451
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
Before this commit, the sync buttons refactored in https://github.com/odoo/odoo/pull/68700 would appears in all calendar views (sale,time-off,...).
This commit only displays them in the calendar event view.
closesodoo/odoo#75702
Taskid: 2633415
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, it was not possible to create events with defined attendee state. The default value was always set.
This was a limitation when the events were part of a recurrence and all events attendee needed to be created with a known state.
To reproduce, one would create a recurrent event, sync it with Google and in Google, 'decline' this event and the following.
The attendee state was not properly set.
closesodoo/odoo#68700
Taskid: 2484335
Related: odoo/upgrade#2537
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Several imrovements have been made in google_calendar that affets the efficiency of the sync and the validity of the synched data
This commit apply the more relevant modifications to this module.
Taskid: 2484335
Part-of: odoo/odoo#68700
Before this commit, the calendar UX was not good enough. The look and feel was not modern.
This commit improves a lot of small details, remove unneeded or not mature features (like the videocall location url).
Counted recurrence now brings a better experience. When weekly or montly recurrences are created, occurences in the past are dismissed but before this commit their number was not adapted.
User would end up with less occurences than the provided number without explanations.
Taskid: 2484335
Part-of: odoo/odoo#68700
UI changes:
* Improve the sync buttons. Before this commit, the buttons would be defined in JS and take more place.
* Improve the FieldMany2ManyTagsAvatar widget.
Taskid: 2484335
Part-of: odoo/odoo#68700
Before this commit, it was not possible to reapply all events in recurrence, delete all events of a recurrence or archive them.
This commit remove that limitation by reapplying the recurrence and remove all the existing events. When the events are synched, the action_mass_archive is used and it must ensure that only a request for the recurrency should be sent.
Individual request for each event are not sent.
Taskid: 2484335
Part-of: odoo/odoo#68700
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.
closesodoo/odoo#74245
Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Suppose a recurrent event synced with both calendars. Suppose that the
current user is not the organizer. If one occurrence of the event is
cancelled, the user won't be able to sync the calendars.
To reproduce the event:
(Need two Microsoft accounts A01 and A02)
1. [On Microsoft, with A01] Create an event:
- Recurrent (next 3 days for instance)
- With A02
2. Set the address mail of current partner with A02's address
3. Sync with Microsoft
- Note that the 3 occurrences are displayed
4. [On Microsoft, with A01] Cancel one occurrence
5. Sync calendars
Error: A Validation Error is raised: "The operation cannot be completed:
- Create/update: a mandatory field is not set [...]"
At some point, the module updates each occurrence of the event and
stores the occurrence's values:
https://github.com/odoo/odoo/blob/4ae90dd6f9e28e6fdff45c7612a3a756665e1489/addons/microsoft_calendar/models/microsoft_sync.py#L213-L220
However, the cancelled occurrence will be incorrectly stored. Because it
is cancelled, `_microsoft_to_odoo_values` will return {'active': False}:
https://github.com/odoo/odoo/blob/4ae90dd6f9e28e6fdff45c7612a3a756665e1489/addons/microsoft_calendar/models/calendar.py#L63-L65
Therefore, in the previous code, `values` will contain `(<Recurrence
ID>, None, None)`
Later, when applying the recurrence, the module detects all
already-existing occurrences and the others (i.e., those that need to be
created):
https://github.com/odoo/odoo/blob/02886f65e9026e1f7617c8b23c3d87edd358b168/addons/calendar/models/calendar_recurrence.py#L190-L192
where the ranges are tuples like `(<start of the occurrence>, <end>)`.
As a result, `ranges_to_create` will contain such a tuple `(None, None)`
which makes no sense
OPW-2571398
closesodoo/odoo#74052
X-original-commit: ccad42575ae32d7e8ffe72226cbfed2284e0326e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>