Commit Graph
909 Commits
Author SHA1 Message Date
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
Jeremy Kersten 75e1d93344 [IMP] google_calendar: rename google_cal[endar]_account_id
Rename from google_cal_account_id to google_calendar_account_id, to have
the complete 'service' name into the field and allow to use it from a
generic way in oauth2callback from google_account e.g.

task-2497212
pr-95744

closes odoo/odoo#95744

Related: odoo/upgrade#3673
Signed-off-by: Christophe Simonis <chs@odoo.com>
2022-08-10 14:43:02 +02:00
Jeremy Kersten 05b409f8f1 [REF] google_account, google_calendar: clean and make it overridable
This commit removes outdated method no more used since we delete oog
apps like gdrive.
This commit remove the logging of sensitive infos.
This commit allows to override easily api key.

task-2497212
pr-95744

Part-of: odoo/odoo#95744
2022-08-10 14:43:01 +02:00
pedrambiria 8b6341c1ff [REV] google_calendar: not sending emails to existing event attendees"
There was an issue with this fix.

This reverts commit 8ebb44420c3e2dcc0d990d2646486654b4b2955d.

closes odoo/odoo#96421

X-original-commit: 29f0c7635c900324631fe3562399c3ced5bc15f7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-07-21 00:50:39 +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
pedrambiria fb36e02de5 [FIX] google_calendar: not sending emails to existing event attendees
Before this commit: syncing with google led to sending emails to
attendees of existing future events on Odoo.

Steps to reproduce the first issue:

	- Install 'google_calendar' module
	- Integrate with Google Calendar in setting
	- Add an event to the Odoo calendar for future date
	- Add one external attendee to the event
	- Sync with Google

	Invitation emails would be sent to the attendees of the events.

Solution

	It's possible to not send emails to the attendees in api calls. So
the solution is to not send emails to the attendees for the syncing
time.

opw-2819046

closes odoo/odoo#95781

X-original-commit: ac78ad6bf806ae3233ad38399771745edc8dc00d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2022-07-12 07:31:41 +02:00
Thibault Delavallée 40f4ea486b [UPD] various: update query counters
closes odoo/odoo#95556

Related: odoo/enterprise#29247
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-07-08 14:34:04 +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
Victor Feyens 680473748f [FIX] google_calendar: access to all tokens for the settings user.
Now that the settings user implies having internal user rights 
(base.group_user), the access rules for users are applied and the test 
test_system_user_should_be_able_to_reset_any_tokens failed.

This commit adds a generic ir rule giving all rights on gg calendar 
credentials to "Settings" users, aka base.group_system group.

Part-of: odoo/odoo#91909
2022-06-23 23:48:31 +02:00
Rémy Baranx (bar) ed02c32853 [FIX] google_calendar: allow user to reset his own tokens only
Each user should be able to reset his own google calendar token.
An admin user (from `base.group_system`) should be able to reset any tokens.

Task-2673934

closes odoo/odoo#83397

Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-06-14 10:35:54 +02:00
Arnaud Joset fe2be46214 [FIX] google_calendar: remove dead code
The _sync_google_calendar method was copied in https://github.com/odoo/odoo/commit/24c2d7e9d609f02b1814be0faf82352bfeb45d96
in the google.calendar.credentials model from res.users but it was not useful
or used. This method makes more sense on res.users model.

closes odoo/odoo#92835

X-original-commit: f78431507ec9a5e2d9f1d2847d723e1f7bfeca11
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-06-03 09:46:46 +02:00
pedrambiria 40d4679093 [FIX] google_calendar: allow to sync a private contact
Before this commit: if a user is the attendee of an event containing
a private contact, the user couldn't sync with google calendar. Because
of the "res.partner.rule.private.employee" record rule restriction.

Steps to reproduce the issue:
 1. Create users A and B
 2. Enable "Access to Private Addresses" for user A and disable it for B
 3. Login with user A
 4. Integrate with Google Calendar in setting
 5. Create a contact with private address (type = 'private')
 6. Sync with Google Calendar in the calendar module
 7. Create an event with user B and the private contact as attendees
 8. Reset account of google calendar from user A setting
 9. Login with user B
 10. Try to sync with Google Calendar

 => You will receive an access error

The solution is not to allow any user to add private contacts as an
attendee. Also, create a new contact with the same email if it wants to
match existing private contact with a google event attendee.

opw-2850552

closes odoo/odoo#92624

X-original-commit: 96ee1ef45954bd27632da9c2cef3cf9ba44caca0
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2022-06-01 15:23:06 +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
thcl-odoo b6e08d662d [FIX] google_calendar: add show_as on sync
Current behavior :
When a Google Agenda event is created with "Show as" set to Available,
Show as (`show_as`) isn't set accordingly

Steps :
- Install Calendar
- setup and activate Google Calendar sync
- Create an event and set "Show as" on Available
- Refresh Odoo calendar to sync it
-> Created event "show as" is set to Busy

OPW-2805096

closes odoo/odoo#90261

X-original-commit: ff56f8126e105f2196843fed1646a3081f25aff3
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Claude Thibault (thcl) <thcl@odoo.com>
2022-05-04 10:55:47 +02:00
thcl-odoo a784ddab33 [FIX] google_calendar: add Meeting URL on sync
Current behavior :
When a Google Agenda event is created with a meeting, the Meeting URL
(`videocall_location`) isn't set at creation.

Steps :
- Install Calendar
- setup and activate Google Calendar sync
- Create an event with a meeting via Google Calendar
- Refresh Odoo calendar to sync it
-> Created event doesn't contains a Meeting URL

OPW-2805096

X-original-commit: f85dfa2b3cb1fa03dcaa10b93fc5309b3a04eae6
Part-of: odoo/odoo#90261
2022-05-04 10:55:46 +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
pedrambiria f43995eab8 [FIX] google_calendar: Prevent resyncing of synced recurrence events
Before this commit: When you sync the Odoo calendar with Google for the
first time, it will resync all of the created recurrence events with
Google after fetching all of the Google events. The problem is that it
chooses the 'accepted' state by default for the current user's state.
If you were invited to events and you hadn't accepted that, it would
update your status and send an email per event for all attendees.

Steps to reproduce the issue:
 1. Create two new google accounts ( you'll bombard with emails)
 2. Create a recurrent event without ending with the first account and
choose the second account as a guest.(don't accept)
 3. Sync second account with Odoo
  => It'll send about 700 emails

The solution is to prevent synced recurrence events from syncing and.

opw-2691146

closes odoo/odoo#89633

X-original-commit: 084aeb239e85a4e3abb3e233af68c6838dfbb3d7
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-04-26 14:28:49 +02:00
Leonardo Pavan Rocha e0c922c82a [IMP] google_calendar, hr_holidays, hr_work_entry_holidays: update query count
In 2685472 new computed fields were added in calendar_event. This commit
updates the query counter tests that were failing.

task-2685472

closes odoo/odoo#79654

Related: odoo/upgrade#3182
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-04-01 10:36:10 +02:00
Abdelouahab (abla) 6246ec0f46 [FIX] google_calendar : fix default reminder
To reproduce
============

- Sync Google Calendar to Odoo
- Create an event in GCaledar without setting a notification
In Odoo Notification reminder is set

Purpose
=======

we use default reminder given by Google which is notification 30 minutes before even if the event
doesn't have a reminder.

Specification
=============

To solve the issue we use empty reminder instead of the default given by google if no reminder is set.

opw-2792364

closes odoo/odoo#87592

X-original-commit: a25d38dd252a657ea44c822a227e415337003672
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
2022-03-30 17:35:26 +02:00
Thibault Delavallée 1fb856a980 [UPD] various: update query counters (and comments)
Purpose is to update counters according to current runbot's state. This eases
checking impact of future performance improvements done.

Task-2631088 (Appointment: profile and add performance tests)

closes odoo/odoo#85838

X-original-commit: b0c7a6397526ad2698fac0701e4323c019ea8bf6
Related: odoo/enterprise#25002
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-03-07 10:41:47 +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
Arnaud Joset a67dc7e151 [FIX] google_calendar: chose internal users when portal and internal users share the same email
Before this commit, when two users shared the same mail, they were ordered by alphabetical order.
This commit makes sure that the internal user is preferred.

closes odoo/odoo#84805

X-original-commit: 992b7a00f8eb567aed730420d0d10fa476fb9dd7
Signed-off-by: Thibault Francois <tfr@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-02-17 16:41:56 +00:00
Arnaud Joset 968cd5ff33 [FIX] google_calendar: increase debug when all events in a recurrence are deleted.
Before this commit, a lot of events and mail followers would be deleted and recreated.
This PR commit aims to identify the issue and fix it.

X-original-commit: d0adfb0b269d21a2284e9608c75bd6f1afffa9a8
Part-of: odoo/odoo#84805
2022-02-17 16:41:56 +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
Thibault Delavallée ef9429231c [IMP] various: update query counters
Notably after odoo/odoo@f9442f47eb query counters are heavily impacted
and a lot of them has lessened.

closes odoo/odoo#83832

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-02 18:14:54 +00:00
Thibault Delavallée 07fb346919 [IMP] various: update counters
Update some counters at latest runbot results, just to have updated counters.
Note that some counters are somehow not deterministic, hence not updating
everything.

Task-2712450 (Mail/Sale: Improve 'Pay Now' notification template)

Part-of: odoo/odoo#82167
2022-01-31 17:47:29 +00:00
Arnaud Joset c654700291 [FIX] google_calendar: allow deletion of attendee with the same email
Before this commit, when a recurrent event would have several partners with the same email, a traceback would occurs:

```py
~/src/odoo/15.0/addons/google_calendar/models/calendar_recurrence_rule.py in _write_from_google(self, gevent, vals)
    111             if email_normalize(odoo_attendee_email) not in emails:
    112                 attendee = existing_attendees.exists().filtered(lambda att: att.email == email_normalize(odoo_attendee_email))
--> 113                 self.calendar_event_ids.write({'need_sync': False, 'partner_ids': [(3, attendee.partner_id.id)]})
    114
    115         # Update the recurrence values

~/src/odoo/15.0/odoo/fields.py in get(self, record, owner)
   4062         elif size == 1:
   4063             return ids[0]
-> 4064         raise ValueError("Expected singleton: %s" % record)
   4065
   4066     def set(self, record, value):
```

closes odoo/odoo#83040

X-original-commit: 670961cd8140143c6e5a82b37dd6030758165485
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-01-20 08:21:58 +00:00
Arnaud Joset cbff2f508f [FIX] google_calendar: avoid cachemiss error when record has been deleted between write and patch
In some cases, the module can patch an event but if it is deleted, some write will fails.

This fix prevent the following traceback:

```py
Traceback (most recent call last):
  File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1057, in __get__
    value = env.cache.get(record, self)
  File "/home/odoo/src/odoo/15.0/odoo/api.py", line 889, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'calendar.event(30350266,).attendee_ids'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/odoo/src/odoo/15.0/odoo/api.py", line 886, in get
    return field_cache[record._ids[0]]
KeyError: 30350266

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1057, in __get__
    value = env.cache.get(record, self)
  File "/home/odoo/src/odoo/15.0/odoo/api.py", line 889, in get
    raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'calendar.event(30350266,).show_as'

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/odoo/src/odoo/15.0/addons/google_calendar/models/google_sync.py", line 43, in called_after
    func(self.with_env(env), *args, **kwargs)
  File "/home/odoo/src/odoo/15.0/addons/google_calendar/models/google_sync.py", line 234, in _google_patch
    self.need_sync = False
  File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1217, in __set__
    records.write({self.name: write_value})
  File "/home/odoo/src/odoo/15.0/addons/google_calendar/models/calendar.py", line 55, in write
    res = super(Meeting, self.with_context(dont_notify=notify_context)).write(values)
  File "/home/odoo/src/odoo/15.0/addons/calendar/models/calendar_event.py", line 491, in write
    previous_attendees = self.attendee_ids
  File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 3389, in __get__
    return super().__get__(records, owner)
  File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 2603, in __get__
    return super().__get__(records, owner)
  File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1083, in __get__
    recs._fetch_field(self)
  File "/home/odoo/src/odoo/15.0/odoo/models.py", line 3276, in _fetch_field
    self._read(fnames)
  File "/home/odoo/src/odoo/15.0/odoo/models.py", line 3346, in _read
    self.check_access_rule('read')
  File "/home/odoo/src/odoo/15.0/odoo/models.py", line 3553, in check_access_rule
    invalid = self - self._filter_access_rules_python(operation)
  File "/home/odoo/src/odoo/15.0/odoo/models.py", line 3608, in _filter_access_rules_python
    return self.sudo().filtered_domain(dom or [])
  File "/home/odoo/src/odoo/15.0/odoo/models.py", line 5511, in filtered_domain
    data = rec.mapped(key)
  File "/home/odoo/src/odoo/15.0/odoo/models.py", line 5436, in mapped
    recs = recs._fields[name].mapped(recs)
  File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1176, in mapped
    self.__get__(first(remaining), type(remaining))
  File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1087, in __get__
    raise MissingError("\n".join([
odoo.exceptions.MissingError: Record does not exist or has been deleted.
(Record: calendar.event(30350266,), User: XXX)
```

X-original-commit: 2f0c9ca75de616da61e327259d03a8831b8e159b
Part-of: odoo/odoo#83040
2022-01-20 08:21:58 +00:00
Arnaud Joset 58addb377e [FIX] google_calendar: improve error handling when the record does not exists anymore.
Before this commit, the following traceback could be encountered when events were deleted:

```py
Traceback (most recent call last):
  File "/home/odoo/src/odoo/15.0/addons/google_calendar/models/google_sync.py", line 43, in called_after
    func(self.with_env(env), *args, **kwargs)
  File "/home/odoo/src/odoo/15.0/addons/google_calendar/models/google_sync.py", line 233, in _google_patch
    self._google_error_handling(e)
  File "/home/odoo/src/odoo/15.0/addons/google_calendar/models/google_sync.py", line 177, in _google_error_handling
    start = self.start and self.start.strftime('%Y-%m-%d at %H:%M') or _("undefined time")
  File "/home/odoo/src/odoo/15.0/odoo/fields.py", line 1087, in __get__
    raise MissingError("\n".join([
odoo.exceptions.MissingError: Record does not exist or has been deleted.
(Record: calendar.event(28241777,), User: XXXX)
```

X-original-commit: e77cbc639032e7f58345942330102b37e7a55971
Part-of: odoo/odoo#83040
2022-01-20 08:21:58 +00:00
Arnaud Joset 8847d391e4 [FIX] google_calendar: fix attendee deletion
When an attendee is deleted in google, we need to sync the odoo attendees and delete the ones that do not exist anymore in google.
Unfortunately, by doing so, we introduced an issue. We filtered attendees that were no longer existing when we looped on the attendee emails.

```py
odoo.exceptions.MissingError: Record does not exist or has been deleted.
(Record: calendar.attendee(YYY,), User: XXX)
```

This commit ensure that we filter only existing attendees.

X-original-commit: 0fb1002c9bb027d1694b834c52e4492a03c8a09d
Part-of: odoo/odoo#83040
2022-01-20 08:21:58 +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
Rémy Baranx (bar) 846367530a [FIX] google_calendar: empty event name in google calendar
As explained at https://github.com/odoo/odoo/blob/171e42e380a46463b4359166955dc4c5f6ccf42e/addons/google_calendar/models/calendar.py#L206,
When there is no Odoo user who is the owner of the updated event,
modification are limited to some fields only.

In this case, that means we must use the `PATCH` method instead of the `PUT`
one to avoid erasing all not modified fields such the event name.

opw-2694739

closes odoo/odoo#81341

X-original-commit: 960e63a75350c28f186e55d69bffea6d51dcf7f1
Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-17 10:10:49 +00:00
Arnaud Joset 4196ea9dc2 [FIX] google_calendar: prevent traceback when resetting the google tokens from the reset account wizard
Before this commit, the account reset would fail with the following traceback:

```py
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/odoo/src/odoo/15.0/odoo/http.py", line 643, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/odoo/src/odoo/15.0/odoo/http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
AttributeError: 'res.users' object has no attribute '_set_auth_tokens'
```

This commit allows to use the wizard.

opw-2705169

closes odoo/odoo#80918

X-original-commit: 9f2aa5c87a9809899cba872e6a0428f86c687b9a
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-06 16:49:24 +00:00
alt-odoo fd96a99eef [FIX] google_calendar: don't delete several times the same attendee
Small side effect of commit https://github.com/odoo/odoo/commit/b19dc634684aab239575b9a9e784c7420d110b7d

When deleting old attendees, we are removing the partner id associated with the email
from the partner_ids set on the event.

As the same partner can be set on more than one event, we need to loop only once
on each attendee email, otherwise we will face the error "Record does not exist
or has been deleted."

Also, when deleting partner_ids on an event, the attendee is already automatically
removed as well in _attendees_values method, there is no need to do it manually, as
it will raise the error a second time.

opw-2694428
opw-2695915

closes odoo/odoo#80828

X-original-commit: 766a1ad50a9dbc85ed2f9083f881781b7d5ec96c
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
2021-12-03 11:18:53 +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
Arnaud Joset de183583b2 [FIX] calendar,google_calendar: send correct datetime for events in recurrences.
google_calendar: before this commit, the timezone of recurring events was not properly tested.
when an recurrence was created in Odoo, the start and stop datetime were incorrectly set before https://github.com/odoo/odoo/pull/76546/commits/182f0cab58dd4e8a8ce1a3af5eaf8c3d8bea51e6. This commit test this behavior.

calendar: add recurrence information in mail invitation
https://github.com/odoo/odoo/commit/bc9bc2686ca142a7348dc48e0b7f8e74fdd42e10  removed the recurrent template variable that is used to add recurrence information in the mail invitation.

FW port of https://github.com/odoo/odoo/pull/76546

closes odoo/odoo#77559

X-original-commit: e1d1e9ee20e6de4c9b9873e533ff9c89d7b392ef
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-10-01 10:09:47 +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
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 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 24c2d7e9d6 [IMP] google_calendar: move credentials from res_user table to a dedicated table
Before this commit, several token related data were stored on the res_users table. During event sync, the table could be locked and this commit aims to move these data to a dedicated table to avoid bottleneck effets.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:21:01 +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
Thibault Delavallée 5620e2f2e3 [IMP] various: update query counters
Update query counters according to last runbot state. This helps spotting
query counters change linked to this PR.

Task ID-2377974
Community PR odoo/odoo#61467
2021-08-18 13:33:20 +00:00
Arnaud Joset 80e1259fd9 [FIX] google_calendar: prevent weird behavior when partner email and user email differs.
This commit allows using different mail on the user and the partner without experiencing weird behaviors.

Before this commit, sometimes when user would set a different email on his user_id and his main partner, the sync event would not be visible as long as the event was not accepted in Google.

closes odoo/odoo#74903

X-original-commit: bca4532890432d994c0941042f4eff75485c87ce
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-10 08:44:28 +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