Commit Graph
51 Commits
Author SHA1 Message Date
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
Kevin Baptiste 86aa7b78aa [IMP] *: introduce data-hotkey on form and modal views
Define `data-hotkey` on most used action buttons.

For the modals, the following keys are dedicated for "special"
actions:
 - Alt+G: add
 - Alt+V: save
 - Alt+Z: cancel

closes odoo/odoo#73275

Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-15 08:39:49 +00:00
Martin Trigaux 6758868731 [I18N] *: export saas-14.4 source terms
Without demo data

closes odoo/odoo#73560

X-original-commit: 802e46541117573e028b711ea33dad9df9075a39
Related: odoo/enterprise#19602
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-07-12 10:57:37 +00:00
Arnaud Joset 8bd566e05a [FIX] microsoft_calendar: send attendee answer to microsoft
Before this commit, the events were not synced when the attendee state was modified.

closes odoo/odoo#73297

X-original-commit: faeaee43adb77fd0d4c36b68a548ac3ab35fdadc
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-07-06 16:07:00 +00:00
Arnaud Joset 722ea57aa0 [FIX] microsoft_calendar: find attendee based on mail and favour the one with internal users
Before this commit, attendee were found based on the email sent by Microsoft.
When multiple partners would match the mail, the first one was selected but we should favour the partner with a user.
The method _mail_find_partner_from_emails has this exact purpose and therefore is used.

X-original-commit: 4f944f89a5785a2569842dc402c484f21b7aa121
2021-07-06 16:07:00 +00:00
dht-odoo dbf1ab157d [IMP] calendar: improves field type from text to html
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).

Adding a new method convert_online_event_desc_to_text
Because online events have fixed format for the description,
this method removes some specific html tags, and converts it into
readable plaintext (to be used in external calendars).

Models -> Fields

1) calendar.event -> description

Task Id: 2499504

X-original-commit: 0d5ca6a6fe8821b4ec19dd603bde116518721792
2021-06-07 05:24:08 +00:00
Raphael Collet 35a9f6c27a [FIX] core: SELF_READABLE_FIELDS and SELF_WRITEABLE_FIELDS on res.users
Avoid setting up those lists with method __init__() on the model, since
the model's class no longer has the expected parent classes.
2021-05-06 07:30:24 +00:00
Nicolas Lempereur 7517487770 [FIX] microsoft_calendar: permanent event no traceback on open
When synchronizing microsoft calendar events, if the event is permanent
Microsoft says the endDate is "0001-01-01": we save that and this causes
an error when it is being parsed in javascript since we require a date
with higher than 1000 years in require('web.field_utils').parseDate
function.

With this changeset, we do not set endDate if the type of the event is
not endDate (as shown[^1] in the documentation endDate only makes sense
for event of type endDate).

[^1]: https://docs.microsoft.com/en-us/graph/outlook-schedule-recurring-events#recurrence-ranges

opw-2479029
fixes #69481
closes #69944

closes odoo/odoo#70009

X-original-commit: 7aa233e63a8c82cce8336adb99418a96e061268f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-04-28 12:34:39 +00:00
Jérémy Hennecart ac13964244 [IMP] calendar: improve the way calendar event are displayed
With this commit we try to improve the way the events are displayed
to the user. Now, an event is displayed for each attendee of the event
that are selected in the filter. These events are displayed correctly
based on the status of the attendee in the event.
The colors displayed for the events now represent the attendees and not the
organizer.

If an attendee edit an event, it is edited for all others attendees.
Also, when an attendee that is not the organizer try to delete the event,
then the event is now declined in place of being deleted. If the organizer
delete the event, it is deleted for all attendees.

In case of an event where all attendees have declined it but the organizer,
the organizer see now a danger icon before the name of the event and it's
outlined and not filled with color, no matter of the actual status of the
organizer in the event.

task-2196775
COM PR: odoo/odoo#55190
ENT PR: odoo/enterprise#12196
UPG PR: odoo/upgrade#1532
2021-04-15 16:07:12 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
Jérémy Hennecart f87a0eb763 [REF] calendar: prepare alarm communication configuration
Purpose of this commit is to ease sending mail to attendees using template
by using a template record instead of an xml id. Indeed this allow having
flows using a configurable template instead of an hardcoded one.

Code in calendar_sms is split into main models to ease future improvements
related to SMS.

Taks ID-2191254
COM PR odoo/odoo#68443
2021-03-30 12:14:59 +00:00
Adrien Widart 642f72bfcc [FIX] microsoft_calendar: warn user if attendee without email
When syncing both Odoo and Outlook Calendar, if one Odoo event has an
attendee who does not have any email adress, it will lead to a traceback
error.

To reproduce the error:
1. Create a partner P who does not have an email address
2. In Calendar, create an event E with P
3. Sync with Outlook

Error: An Odoo Error is raised. When syncing from Outlook to Odoo, it
also sync the E-event (in case the latter has been updated on Outlook).
The Microsoft2Odoo syncing uses the email address of each attendee.
Since P does not have any, this creates the error.

Although Odoo allows the use of participants without email, this is not
the case for Outlook. On Outlook Calendar, as soon as a user adds an
attendee to an Event, Outlook will want to send an invitation before
saving this event (so, if the participant does not have any email
address, it won't be possible to save the event).

When syncing, the E-event will be added to Outlook Calendar. However,
for the same reasons as in the previous paragraph, it will not be
possible to update this event from Outlook Calendar.

Therefore, the solution is to prevent the user from having attendees
without email when his calendar is synchronized with Outlook.

OPW-2439027

closes odoo/odoo#68407

X-original-commit: dbb65f3abfbc7d6e3d8167839659eac79b1e6b31
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-03-26 14:13:15 +00:00
YOGRAJ TANDELandMohammed Shekha 7fb9c81296 [IMP] calendar,lunch: change field names
with this commit we changes field names for week days like su, mo, tu etc. to
sun, mon, tue and so on in calendar module, this is going to be used in
task 2317795 where we developed recurrency module for recurrency mixin.

Also with this commit we change field names of weekdays in lunch module to have
same name as we have in calendar and project module so that we can easily use
custom widget "web_weekly_recurrence" instead of defining boolean field in xml
for each day.

task-2335399

Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-03-26 12:25:44 +00:00
Thibault Francois 30f4be4889 [FIX] (google|microsoft)_calendar: make sync more resilient
Issue
-----
- Currently the cron can take too much time and timeout.
  In case of timeout process data are rollback.
  The sync per user also crash and stop the process for all user and make
  the transaction rollback

  In both case we cannot ensure that all user will end up synchronized

- The real time sync can end up in deadlock:
  If you create a holiday, it trigger a write on the user and the
  creation of an event that will be synchronize with google

  The synchronization may ask for a new token if this request fail
  a new cursor is create to empty on the user the refresh token.
  2 cursor that are trying to write on the same record => Deadlock

- Bad refresh token management
  When the refresh token is not anymore valid it's erased but
  the calendar_token and validity are kept. Is odoo consider
  the token valid it will try to sync an event with google|microsoft
  despite the refresh token is not valid anymore. Of course this lead to
  an error and the impossibility to create an event anymore without
  manually wiping the calendar_token and calendar_token_validity

- Error 401 are handled in context manager
(google|microsoft)_calendar_token, but get_*_calendar_token never raise
http error only user error.

Solution
---------

- Improve cron resilience
	- Commit between each user and rollback in case of issue for a user
	- Solve the issue when stop < start
        - Solve issue with rrule not being the first element in the list
          of recurrence
	- Improve perf when searching for organizer
	- In order to limit the volume during the first synchronization, we only
	synchronized event from x days in the past to x days in the future with
	x = 365 by default
	- Limit the number of event to synchronize to google each time to 200,
	since this operation is time consuming (1 request is sent per event)

- Avoid deadlock
  A new cursor is not needed, we only need to ensure that write on the
  user is done with a clean cursor and will be commited despite the error
  raise. So rollabck before the write and commit explicitly afterwards

- Erase properly all the token and the token validity if the refresh token is not valid anymore
	- For google calendar, erase also the token in case of 401
          error: Wrong client id, this mean the database parameter have been
          change and all the user should reconfigure the synchronization

- Directly handle error 401 with error 400 in refresh_token method

closes odoo/odoo#66250

X-original-commit: 486f69abad6226e5ce016ad89a0eeb103d709a3f
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-25 09:55:10 +00:00
Krupal OzaandThibault Delavallee bc9bc2686c [IMP] calendar: improve main data templates
Purpose of this commit is to make templates easier to preview and edit as
weel as to improve their content.

This is achieved notably by lessening use of custom rendering context and
trying to fix as much error-prone jinja statements.

In this commit we also make ``calendar_template_meeting_reminder`` template
looking more like other templates. There were some rendering differences that
do not seem really wanted.

``calendar_template_meeting_reminder`` was also using an old ``force_event_id``
key not replaced by recurrent_id field on attendee.

This commit improves few strings of the invitation mail being sent while
booking an online appointment. Online appointment is computed based on
``appointment_type_id`` field being defined. Some tweaks in wording made it
necessary to know if recipient is the responsible, customer or an added
attendee on the event, leading to some tooling code added on event model.

The main changes includes

 * for customer, remove the CTAs to accept / decline event as attendee are
   automatically set as accepted;
 * depending on recipient, improve wording of the mail accordingly and mention
   appointment type in the mail;

Task ID-2199620
COM PR odoo/odoo#64925
ENT PR odoo/enterprise#15914
UPG PR odoo/upgrade#2282

Co-Authored-By: Krupal Oza <koz@odoo.com>
Co-Authored-By: Thibault Delavallee <tde@odoo.com>
2021-03-24 15:16:42 +00:00
Martin Trigaux 9741ef5ee6 [I18N] *: export saas-14.2 source terms
For odoo-master Transifex project, no demo data

closes odoo/odoo#66500

X-original-commit: 813931ac850e5ba4181259a5957ec72226fb670c
Related: odoo/enterprise#16510
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-19 08:02:58 +00:00
Adrien Widart 69fddf832f [FIX] microsoft_calendar: add current partner to attendees
When synced, if the user has an event on Microsoft Calendar and if this
user is not the organizer (he is only an attendee), he will have to
enable "Everybody's calendars" on Odoo Calendar to see this event.

To reproduce the error:
(Need one Google/Microsoft account A01 and one Microsoft account A02)
1. With A01, on Google/Microsoft calendar, create an event and invite A02
2. On Odoo, enable the sync with Microsoft
	- See [instructions](https://www.odoo.com/documentation/user/14.0/general/calendars/outlook/outlook_calendar.html)
3. Go to Odoo Calendar, click on "Sync With Outlook"
	- ! The sync must be done with A02

Error: The event is not displayed. The user must enable "Everybody's
calendars" to see it.

The problem comes from the attendees creation: it uses Microsoft
attendees' email address to link a partner with the event. However,
nothing ensures or requires that A02's email address is the same than
current partner's one. As a result, it is possible that the current
partner is not among the attendees. Moreover, Microsoft does not say
which attendee is the synced one. Thus, this fix always adds the current
partner to the attendees, so he will no longer need to enable
"Everybody's calendars".

OPW-2439189

closes odoo/odoo#66103

X-original-commit: 7579787c101923d450217cd167f50b9fcf21c690
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-02-12 16:32:09 +00:00
Aurélien (avd) 8488086f94 [FIX] google/microsoft_calendar: Use the standard field whitelist on res.users
Purpose
=======

Better use standard mechanism right ?

closes odoo/odoo#64869

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-01-22 09:55:53 +00:00
Aurélien (avd) daefd9e22b [IMP] microsoft_calendar: change color of synched pill.
closes odoo/odoo#64660

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-01-18 09:23:19 +00:00
Kevin Baptiste 0c4ee216d7 [IMP] microsoft_account: allow configuration of endpoints
The endpoints were hardcoded in the application code. This commit aims
at making them overridable with system parameters:

 - `microsoft_account.auth_endpoint` defaults to
    https://login.microsoftonline.com/common/oauth2/v2.0/authorize

 - `microsoft_account.token_endpoint` defaults to
    https://login.microsoftonline.com/common/oauth2/v2.0/token

This change allows customers to restrict the tenant the API targets[0].

[0] https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols#endpoints

closes odoo/odoo#62945

Taskid: 2413197
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-07 10:19:27 +00:00
Kevin Baptiste 9724230ea1 [FIX] google/microsoft_calendar: reset correct user account
closes odoo/odoo#64184

Taskid: 2416820
X-original-commit: 3363a264d96817eed4fa1fdaa62b238656f107e1
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-01-07 08:24:43 +00:00
Andrea Grazioso (agr-odoo) e7c92594f0 [FIX] microsoft_calendar: fix recurrence event creation
Create an event as follows:

- Recurrent
- Repeat every 1 Months
- Until End date <far in future>
- Day of Month Day of Month First Monday

An exception will raise

opw-2412598

closes odoo/odoo#63601

X-original-commit: 4cb599f694eecd2a3c96ed25a055f0b9030a5864
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-12-18 17:40:10 +00:00
Martin Trigaux 3f13751e9b [I18N] *: export saas-14.1 source terms
Without demo data

closes odoo/odoo#63238

X-original-commit: 4e6683973b1d1ecc67f1312a8ef98b1272e2d5a5
Related: odoo/enterprise#15268
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-12-11 12:30:42 +00:00
Aurélien (avd) 005741e509 [IMP] microsoft_calendar: add stop synchronization button
Add the possibility to stop/restart the synchronization with
Outlook calendar.

Change the calendar event popover in the calendar view to
display an Archive button if event synced at least once.

Add some tests for the new stop/restart feature.

(PS: this is essentially the same commit as the one for the
google_calendar module except for the JS popover and python
tests).
2020-12-10 10:23:10 +01:00
Adrien Widart 78eecf1a81 [FIX] microsoft_calendar: disable Odoo emails
When synced with Outlook, if a user adds an event to the Odoo Calendar,
both Outlook and Odoo will send an invitation to attendees.

To reproduce the error:
(Need calendar)
1. Set up a mail catcher
2. Clean the calendar
3. Sync with Outlook
	- [Steps](https://www.odoo.com/documentation/user/14.0/general/calendars/outlook/outlook_calendar.html)
4. In Calendar, create a new event
	- Add some attendees
5. Save

=> The attendees will receive two invitations: one from Odoo and a
second from Outlook.

When synced, Odoo should not manage the emails sending.

OPW-2387296

closes odoo/odoo#63028

X-original-commit: 694452e5581aa28ae89024a6b5f70a273fb2bdf8
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-08 14:03:29 +00:00
Krina Oza 036b7720d0 [IMP] various: Updated App icons for various modules
In this commit icons of the following modules are updated:

-fetmail
-hr_skills
-iap
-mail_bot
-microsoft_calendar
-partner_autocomplete
-payment_alipay
-payment_odoo_by_adyen
-payment_payulatam
-sale_timesheet
-sms
-snailmail
-test_exceptions

TaskID:2378861

closes odoo/odoo#62291

Related: odoo/enterprise#14958
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-11-25 11:09:53 +00:00
Adrian Torres 679185f3e8 [IMP] *: replace all raises inside unlink by api.ondelete
With this commit, all instances of errors being raised inside
`BaseModel.unlink` overrides are moved into methods decorated with
`api.ondelete` which is safer.
2020-12-04 09:16:16 +00:00
Martin Trigaux 1658473bf2 [FIX] *: rephrase, correct typos
Courtesy of Transifex's translators for reporting bad/unclear sentences.

closes odoo/odoo#62564

X-original-commit: 9b3b2e8d711e3be75b1faffaf6f4f8f4ec90186e
Related: odoo/enterprise#15038
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-11-30 07:07:58 +00:00
Raphael Collet 1398b6b44c [IMP] tests: deprecate SavepointCase
closes odoo/odoo#62031

Related: odoo/enterprise#14872
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-11-24 13:23:32 +00:00
Lavish Chhatwani 348a5c8467 [IMP] calendar,{google,microsoft}_calendar: merge duplicate 'Calendar' tabs
Before this commit
- If Google Calendar and Outlook Calendar are installed, there are two
  'Calendar' tabs displayed on the user form view which is confusing
  and they both share very similar fields.
- Also, in calendar the 'Sync with Google' and 'Sync with Microsoft'
  buttons were not having the same size.

After Commit :
- Now only one 'Calendar tab is there which contains two groups, one
  for 'Google Calendar' and one for 'Office 365 Calendar'.
- Top margin is added on 'Reset Account' button for both Google and
  Microsoft groups for better UI.
- In calendar, 'Sync with Google' and 'Sync with Microsoft' buttons are
  having the same size.

Note - The scss files are not much needed anymore and thus were removed.
       Also to avoid a bridge module just for the sake of empty container,
       we add it in calendar itself.

Task Id-2323205
PR #56551

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-13 07:31:58 +00:00
Martin Trigaux e79531c136 [I18N] *: export 14.0 source terms
Including demo data this time

closes odoo/odoo#58862

X-original-commit: 575abde110acb3d12b25f177a863374becef0894
Related: odoo/enterprise#13705
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-29 17:52:02 +00:00
jbm-odoo edee29613d [FIX] microsoft_calendar: Badge when sync is active
Add a cron to sync events in Microsoft calendar
In Google and Microsoft calendar: remove 'sync with ...' button
when the synchronization is already activated, and replace it by a
badge.

closes odoo/odoo#58197

Taskid: 2329313
X-original-commit: 255eb91dd5e9fb39a7625064d1ba8e0b492bfb85
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
2020-09-22 10:08:27 +00:00
Raphael Collet 317765c8f3 [IMP] core: deprecate method cr.after()
Use the more convenient `cr.postcommit.add()` instead.

closes odoo/odoo#57043

X-original-commit: e9e37091a65d5ae2caa9eb6728abaffb7c9555a8
Related: odoo/enterprise#12928
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-09-03 14:29:39 +00:00
Martin Trigaux 90d85eb9c5 [I18N] export saas-13.5 source terms
Without demo data

closes odoo/odoo#56869

X-original-commit: 33f251b6489455cd7221f2c62dee0400a69784b8
Related: odoo/enterprise#12836
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-09-01 11:18:00 +00:00
Victor Feyens c482fdbf05 [IMP] various: improve code style and performance by improve `all()` usage
PURPOSE

Clean code. Be more performance oriented.

SPECIFICATIONS

Improvements applied in this commit

  * not all() --> any(not) for earlier returns;
  * all([generator]) --> all(generator) to avoid unnecessary list casting.
    This code construct is better managed by all;

This commit will probably not have a big performance effect on standard
production databases. However each performance and cleaning improvement
is welcomed.

LINKS

Task ID-2328619

closes odoo/odoo#56810

X-original-commit: 1cc6bb1231401ea7f501d2f5b5e9641ec8734850
Related: odoo/enterprise#12802
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-08-31 13:59:27 +00:00