Commit Graph
85 Commits
Author SHA1 Message Date
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
stefanorigano (SRI) 46b762a1f1 [REF] web, *: milk colors
*: google_calendar, hr_holidays, hr_skills_slides, mail,
microsoft_calendar, point_of_sale, web_editor, website_livechat,
website_sale

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:12 +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
Fabien Pinckaers a1c447bf84 [IMP] google/microsoft_calendar: remove unnecessary CSS (better look without)
closes odoo/odoo#115061

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2023-03-13 14:20:24 +01:00
Victor Feyens 24ccf7d9b0 [CLN] *: useless type info for actions
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).

closes odoo/odoo#114539

Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-03-08 17:33:37 +01:00
pedrambiria 60845c8d73 [FIX] microsoft_calendar: prevent spamming after syncing the 2nd user
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

closes odoo/odoo#112931

X-original-commit: 86862f2527341247b75df155de16b09d44a7eee6
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-02-17 11:01:42 +01:00
Renaud Thiry 7b6638407d [FIX] calendar: redirect to auth url
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

closes odoo/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>
2023-02-03 09:28:30 +01:00
Ivan Yelizariev 153fe67f46 [FIX] microsoft_calendar: avoid errors on events without user_id
Field `user_id` of `event.event` is not required

https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/event/models/event_event.py#L119-L121

---

So, `ensure_one` might raise an error in `_microsoft_patch  >
microsoft_calendar_token > _get_microsoft_calendar_token`

https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/microsoft_calendar/models/microsoft_sync.py#L404-L420

https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/microsoft_calendar/models/microsoft_sync.py#L51-L53

https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/microsoft_calendar/models/res_users.py#L35-L39

---

`_microsoft_patch` is used for syncing Odoo data with Outlook calendar

https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/microsoft_calendar/models/calendar_attendee.py#L23-L51

https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/microsoft_calendar/models/microsoft_sync.py#L96

https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/microsoft_calendar/models/microsoft_sync.py#L204

---

Ignoring such an error seems fine, because `_microsoft_patch` is used after
commiting the changes to database anyway

https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/microsoft_calendar/models/microsoft_sync.py#L24-L49

---

closes odoo/odoo#111587

Ref: https://sentry.io/organizations/online/issues/3907527262/
X-original-commit: 68c5e649af67b8dc1f9c2470356b72011b32e393
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
2023-02-03 01:13:39 +01:00
Denis Ledoux b4a7996e96 [IMP] base, *: change the API of init hooks to pass env
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
2023-02-01 10:25:01 +01:00
niyasraphy 5a88ed886a [FIX] {}_calendar, google_recaptcha: fix field alignment in settings
before this commit, the field and labels are aligned in different lines in the settings.

closes odoo/odoo#109683

X-original-commit: 5844a0446ef9712027aa08fc239bbb858d164b87
Signed-off-by: Arnaud Joset <arj@odoo.com>
2023-01-11 22:43:14 +01:00
Renaud Thiry 53cad6f9f7 [FIX] calendar: show dialog when sync unconfigured
## 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
2022-11-25 17:56:31 +01:00
Renaud Thiry 13db30cba5 [FIX] calendar: show calendar sync when installed
## 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
2022-11-25 17:56:31 +01:00
William Braeckman 6a42ec7c73 [IMP] calendar: migrate attendee_calendar to wowl2
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

closes odoo/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>
2022-09-28 20:29:51 +02:00
Rémy Baranx (bar) e00622efee [FIX] microsoft_calendar: cancelled event without Odoo organizer
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.

closes odoo/odoo#87844

Task-id: 2746046
X-original-commit: f54a56a91e75e3de8b54a7c6c76164929a11a431
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-09-21 18:02:38 +02:00
Martin Trigaux 1a8772769e [I18N] *: export 16.0 source terms
closes odoo/odoo#100573

Related: odoo/enterprise#31507
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-09-20 13:48:49 +02:00
Gorash 39ea7a1fab [IMP] web/all: XML templates are now declared into the python manifest.
Adapt all manifest, split some XML file and update JavaScript files.

Part-of: odoo/odoo#95500
2022-09-14 20:25:01 +02:00
Florian Charlier ba2b0020df [IMP] calendar, *: configure provider
* = 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
2022-09-07 23:10:17 +02:00
Rémy Baranx (bar) 77e89e893c [FIX] microsoft_calendar: issue when archiving several events
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).

closes odoo/odoo#96761

X-original-commit: 1a66343327f9ea9f59ba25ea63e26331cabb65b5
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-07-27 19:20:15 +02:00
Rémy Baranx (bar) 2fbfbf0dce [FIX] calendar, microsoft_calendar: backport bugfixes from master
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)

closes odoo/odoo#95736

X-original-commit: 5e83318a7240585371efd31e407829793f3e732f
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-07-12 13:21:27 +02:00
Rémy Baranx (bar) 90480ce2d1 [IMP] microsoft_calendar: get videocall URL from a Outlook event
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

closes odoo/odoo#74785

Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-07-11 13:48:40 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Romeo Fragomeli ac584e171d [REF] *: BS5: Migrate Badge
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
2022-07-07 13:30:18 +02:00
pedrambiria d3f3f44f7a [FIX] microsoft_calendar: fix the DateTime range
Before this commit, the DateTime range for getting events was six years,
while the Microsoft range limit is five years.

opw-2819858

closes odoo/odoo#93657

X-original-commit: 56f9b7646269d953c3068a12f20436d3afc970b1
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2022-06-15 10:00:16 +02:00
Fabio Barbero fc79bd1e0e [IMP] sm modules: "neutralise" genders
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

closes odoo/odoo#91292

Related: odoo/enterprise#27302
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-16 10:09:32 +02:00
pedrambiria fb6b959fef [FIX] microsoft_calendar: sync events without body property
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

closes odoo/odoo#89634

X-original-commit: 13d57ff5e714bee96fb930c1b8050816bf22c268
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2022-05-09 12:57:42 +02:00
Victor Feyens 42bad1a6d2 [IMP] *: remove useless keys from manifests
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, ...

closes odoo/odoo#90209

Related: odoo/enterprise#26807
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-05-03 13:31:16 +02:00
Florian Damhaut d9f16de7bb [FIX] microsoft_calendar: Send html description to outlook
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

closes odoo/odoo#87411

X-original-commit: 4c3b69a30d5724dfef2b179ac8eaeecb8ff3da42
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
2022-03-29 10:56:36 +02:00
Loan (lse) 68663f1b2b [FIX] microsoft_calendar: prevent parallel JS calls to sync_data
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

closes odoo/odoo#85754

X-original-commit: d25b3d783fd08cd1c84095da554f52b463422bc2
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-03-07 10:41:44 +00:00
Jorge Pinna Puissant bc20eb4790 [IMP] test_lint, *: enable no-unused-vars rule
Part-of: odoo/odoo#85569
2022-03-02 13:05:42 +00:00
pedrambiria 2a13a4088b [FIX] microsoft_calendar: add 'none' state to attendee state convertor
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

closes odoo/odoo#85367

X-original-commit: 1fbd14728980bfabc466efeb437f9f7ce105dfac
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-28 12:55:59 +00:00
Fabien Pinckaers 10a5796d4b [IMP] speed up load_menus() by using SVG icons instead of png
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)

closes odoo/odoo#84280

Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-02-12 08:55:18 +00:00
Florian Damhaut ab43fab05a [FIX] microsoft_calendar: fetch full description
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

closes odoo/odoo#84362

X-original-commit: c2b545fd8d91b7d24380ada07adee02f24623ecf
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-02-10 16:35:40 +00:00
Yolann Sabauxandandro19951 e10ae3f024 [FIX] google_calendar, microsoft_calendar: ignore no partner created
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 #82109
fixes #78678

closes odoo/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>
2022-01-17 08:38:45 +00:00
Martin Trigaux 9c16f38fd5 [FIX] microsoft_calendar: use recent dates
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__()].

closes odoo/odoo#82849

X-original-commit: 86911c4e9b9f86f3b9a5625b973e78103a7b0286
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-01-16 12:33:08 +00:00
Rémy Baranx (bar) 5716f6fabf [FIX] microsoft_calendar: do not call Outlook API during sync
When we are syncing Outlook events with Odoo events, there is no need
to call back the Outlook API to patch/delete some events.

closes odoo/odoo#80404

X-original-commit: c0094ec99e5fc24b650a257d4792f4be8b09a661
Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-11-25 15:19:49 +00:00
Kevin Baptiste b90ee11ef3 [FIX] hr_holidays, *_calendar: disable sync on new leave
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.

closes odoo/odoo#80160

Taskid: 2693265
X-original-commit: 88884292e105eab2c36b2a334c617ac4978fa79c
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-22 11:56:46 +00:00
Florian Damhaut fb6525f82d [FIX] microsoft_calendar : Only sync-write on existing element
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

closes odoo/odoo#79889

X-original-commit: 067d911b9bb105d8d86dd6bcf85181dd3cbadd8f
Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-11-17 09:11:55 +00:00
alt-odoo b92ca15aca [FIX] microsoft_calendar: avoid deadlock at token refresh
We should rollback manually first to avoid concurrent access errors/deadlocks when
trying to refresh microsoft calendar token.

opw-2630601

closes odoo/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>
2021-10-06 13:50:56 +00:00
Martin Trigaux ef8ad324b0 [I18N] *: export 15.0 source terms
closes odoo/odoo#76542

X-original-commit: 63e6807437295519a0f4705fb88644d6d557ca3a
Related: odoo/enterprise#20882
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-09-16 07:17:40 +00:00
Arnaud Joset 7dbc9ec17a [FIX] microsoft_calendar: rename sync range ICP parameter
Before this commit, the ICP used to get the date range of events to sync was improperly named.

closes odoo/odoo#76083

Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-09-07 15:50:21 +00:00
Raphael ColletandXavier Dollé 1595c0ee27 [REF] core: replace thread-local "envs" by cursor-bound "transaction"
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().

closes odoo/odoo#75598

Related: odoo/enterprise#20451
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
2021-09-03 15:45:46 +00:00
Arnaud Joset 1f5c0fdc25 [FIX] google_calendar,microsoft_calendar: hide sync buttons on non calendae views
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.

closes odoo/odoo#75702

Taskid: 2633415
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-31 10:01:10 +00:00
Arnaud Joset b19dc63468 [IMP] calendar,google_calendar,microsoft_calendar: allow to create events with non-default attendee state
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.

closes odoo/odoo#68700

Taskid: 2484335
Related: odoo/upgrade#2537
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-26 10:21:02 +00:00
Arnaud Joset f7d16b4599 [IMP] microsoft_calendar: apply the google_calendar improvements into this module
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
2021-08-26 10:21:02 +00:00
Arnaud Joset 40fd44f618 [IMP] calendar,google_calendar,microsoft_calendar: Improve UI
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
2021-08-26 10:21:02 +00:00
Arnaud Joset 966d0fae41 [IMP] calendar,google_calendar,microsoft_calendar: change sync button and attendee status
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
2021-08-26 10:21:01 +00:00
Arnaud Joset bb9f21d945 [IMP] calendar,google_calendar,google_calendar: allow modifying all event in recurrence
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
2021-08-26 10:21:00 +00:00
Zelong Lin 51ff8b09db [REF] *: convert JS files to ES6 modules
* = hr, hr_holidays, sms, snailmail, website_livechat, account_invoice_extract,
approvals, documents, mail_enterprise, calendar, crm, mrp, note, website_slides,
crm_enterprise, sign, social, voip

task-2510656

closes odoo/odoo#72712

Related: odoo/enterprise#19241
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-08-24 14:31:55 +00:00
Xavier-Do 288595f558 [FIX] *: add explicit license to all manifest
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.

closes odoo/odoo#74245

Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-26 13:09:57 +00:00
Adrien Widart 28818c46ed [FIX] microsoft_calendar: archive cancelled recurrence occurrence
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

closes odoo/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>
2021-07-20 15:49:01 +00:00