Added a test asserting the correct functionality of single events deletion.
X-original-commit: 2676c0e1b9988e862d2c21479d34372b1a5c9cea
Part-of: odoo/odoo#127980
- Improve performances, as the ir.rule restricting private partners
visibility is also applied on res.users by inheritance, on each
prefetch.
- Solve the issue of partners set as followers on records (eg: application
form) and then made private, making them impossible to contact via the
chatter.
- Solve the multiple access issues when trying to access the bank
account, or the private address for non HR people like the accountants
forcing the usage of sudo in the business code.
TaskID: 3101400
Issue:
------
Since commit 3f145af00307383e2d0a0891d05b8db59b13662a
Some events that belong to a recurrence and
have been modified are not detected as existing.
The `full_recurring_event_id` method blocks these events.
Solution:
---------
Test regex expressions before using them.
opw-3344408
closesodoo/odoo#123333
X-original-commit: f34fa6e905b9426be8040d4e021f1849b3373184
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.
This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).
closesodoo/odoo#121629
Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Prior to this commit, the SVG's viewBox attribute was missing, which
prevented svgs from being scaled.
This commit fixes this issue.
task-3326633
Part of task-3326263
X-original-commit: 30300c373ad1c63a6cf8b035cae0785a09c6933f
Part-of: odoo/odoo#121886
Steps to reproduce:
-------------------
We google calendar, create a recurring event with
three occurrences.
We obtain 3 events in chronological order:
- A
- B
- C
Change the title of the event B and apply the changes
to the following events.
We get:
- A: First title
- B: Second title
- C: Second title
Modify the schedule of event C and apply the changes
only to this event.
We get:
- A: First title + First schedule
- B: Second title + First schedule
- C: Second title + Second schedule
Synchronize Google calendar with Odoo.
Issue:
------
Event C is "duplicated".
Event C will exist with the first schedule
and the second schedule.
Cause:
------
A recurrent event with `google_id` is equal to
`ID_RANGE_TIMESTAMP` can be rescheduled.
If this is the case, its `google_id`
will be equal to `ID_TIMESTAMP`.
We do not manage the deletion of the event
that belongs to the old `google id`.
Solution:
---------
When we detect a recurring event with
a modified schedule, we have to delete the event
from the old `google_id`
(which is the event with the old schedule).
For this, it is necessary to find
the old `google_id` based on the elements contained
in the `id` and the `recurringEventId` of the event.
opw-3143680
closesodoo/odoo#121825
X-original-commit: 3f145af00307383e2d0a0891d05b8db59b13662a
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
Before this commit: it was possible to create an event for another user as
its organizer. But even if that user has a synchronized Google calendar, it
will be sent by the current user token, and it causes several issues.
The solution is to use the event's organizer token if it exists.
opw-3076595
closesodoo/odoo#120368
X-original-commit: 966943168dc9da0622485a46b0786ed5765eaf77
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
[FIX] *: selectors in tours
[FIX][TMP] account: CogMenu selector in tours
[FIX][TMP] web*: Breadcrumb targetting in tours
Adds a `o_breadcrumb` class to target the whole breadcrumb, no matter
how much elements it contains (collapsed parts, visible path, single
name...).
add classname on last breadcrumb item
[FIX][TMP] project: View buttons selector in tours (moved away from CP)
[FIX][TMP] project: Kanban selectors in tours (quick create)
[FIX][TMP] *: SearchBar selectors in tours (toggle menu)
[FIX][TMP] *: ButtonBox selector in tours
[WIP][IMP] web: add toggleSearchBarMenu in search helpers
adapt and unskip 3 list tests
adapt and unskip calendar tests
unskip web_tour test that actually pass
post rebase fix
allow to lose cell focus after multi edition (given to searchbar) - bug reported, to check later
post rebase fixes
fix
Part-of: odoo/odoo#116641
Steps to reproduce:
- Install 'CRM' module (for test purpose)
- Configure the google calendar credentials on Odoo
- Go to CRM -> Configuration -> Activity Types and create a new one
- Set 'Meeting' as Action
- As default note, add some bullet points:
```
Hello :
- First point
- Second point
- Third point
```
- Open any Opportunity and create a new Activity (in the chatter)
- Select 'Meeting' as activity type and open the calendar
- Add a new event (description should be field with the default note)
- Open the event (on Odoo and/or Google Calendar)
Issue:
The description of the event is broken (bullet points missing).
Cause:
When syncing the event from Odoo to Google Calendar, the description
is converted to plain text (using `html2plaintext` function).
Then, when syncing the event from Google Calendar to Odoo,
the description is also updated locally with the remote one.
Solution:
Don't convert the description to plain text but use
`tools.html_sanitize` on the html content instead to sanitize it.
opw-3105194
closesodoo/odoo#119695
X-original-commit: 21f3f9aa31a44840077b80d27aaee8160b391308
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
In sentry we receive like 2k syncing issue from google_calendar.
This commit converts `_logger.error` to `_logger.warning` because we don't
need an erro for that
sentry-4121123364
https://online.sentry.io/issues/4121123364closesodoo/odoo#119742
X-original-commit: e797712561113f098edc1346995cecd7e96ad362
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Achraf <abz@odoo.com>
Issue:
------
It is possible to create recurring events
that are in the same DST period.
Unfortunately, the basic event is sometimes duplicated
Cause:
------
The cause comes from the Daylight Saving Time (DST).
With the base event, we create a recurrence.
This recurrence will create all the events
of the recurrence.
To achieve this, with the basic event, we create all the ranges.
Then, we compare these ranges to remove those which already have
events.
Logically, we must reconcile the first range with the base event.
Sometimes the range of the base event and the first range
calculated to generate the occurrences do not match.
The consequence is the creation of a new event.
The cause of this problem is that we go back too far to find
the starting date of the period from which we will generate the ranges.
For example, in the case of a recurrence with a frequency of `MONTHLY`,
we will take the first date of the month.
And if we are in the month when the DST changes,
we will have the problem.
Solution:
---------
The solution is not to go back
if we encounter a difference in the DSTs
between the starting date of the base event
and the starting date for generating the ranges.
opw-3143680
closesodoo/odoo#119073
X-original-commit: 065dd4a2548ff0da6cf23a7ac62321ce99500d35
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
When using message_post, the body format must be explicitly specified.
If html is expected, a Markup object should be used.
If text is given, the content will be escaped.
Before this PR:
message_post was unaware if the content of a message was HTML or
text. This lead to multiple situation where the content was
incorrectly considered as HTML and led to display errors.
In
self.message_post(body="Hello %s!" % self.name)
if the name contained HTML, it would be evaluated.
In
self.message_post(body="Contact Raoul <raoul@caramail.be>")
the email would not be displayed as considered as unknown HTML and
discarded by the sanitizer
Now each call must explict the type of content.
Use the escape() helper to properly combine Markup and translations.
It would also be acceptable to use Markup() to wrap a static
translation but escape is better as one can not guarantee the content
of a translation.
closesodoo/odoo#111850
Related: odoo/documentation#3612
Related: odoo/enterprise#36728
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, when an event was synced with internal and external users,
the corresponding partners were merged like this:
1) partner corresponding to internal users
2) regular partner
If the list of emails provided by google was in another order: regular partners
then internal, there were an issue:
```
emails = [a.get('email') for a in google_attendees] # sorted by google, external then internal for example
partners = self._get_sync_partner(emails) # always internal then external partners
for attendee in zip(emails, partners, google_attendees):
# we are associating the external email with internal partner
# the external attendee is skipped because we take the user partner
```
This commit makes sure to return the partner is the order of the mails in _get_sync_partner.
closesodoo/odoo#118355
X-original-commit: ae442c20878277da93feb8761f5ed556c0c735b2
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
They dates from < 2027 and are quite outdated. Favour the nl
translation instead.
n_BE is not on Transifex so it was not possible to correct bad
translations.
closesodoo/odoo#115845
X-original-commit: d04c8b7e484db8306d858c891a7a2b11885fdcd9
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.
The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.
closesodoo/odoo#114533
Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The type fields of actions already defaults to
the model name in the base model definition.
Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).
closesodoo/odoo#114539
Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
When following recurring meeting are imported through google calendar
synchronisation, it happens that a meeting get unexpectedly
duplicated in Odoo, what will in turn duplicate the event on google
and send invitations to all the existing attendees.
As calendar.recurrence.calendar_event_ids is a One2many field,
the update using self was setting the base_event_id's recurrence_id
field to the last record of self recordset. Due to this, the event
will not be considered to filter out the existing_ranges in
calendar.recurrence._reconcile_events function.
Therefore, a calendar.event will in turn be created using the same
start and end datetime as the base_event_id of the calendar.recurrence.
OPW-3143680
closesodoo/odoo#114392
X-original-commit: d1587758ac642b0181e660ea48222385d01098e3
Signed-off-by: Arnaud Joset <arj@odoo.com>
This task integrate the rating feature in mail.thread which adds one query in
the unlink method (for deleting the related rating) on model that were not
inheriting from rating.mixin.
Task-2674649
Part-of: odoo/odoo#103966
Before this commit: if a different `web.base.url` is set with
`web.base.url.freeze`, during the first synchronization of Google
calendar it will show a mismatch URL error. The problem is that we
send the `redirect_uri` based on the `web.base.url` in the
`_get_authorize_uri` function.
The solution is to use the request root URL instead.
opw-3101741
closesodoo/odoo#113215
X-original-commit: 6d713e69e6f412c05fe2af81fb263e09713b4821
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Since we create a google meet link when we create an event, we get an
issue with the appoitments that generate their own videocall links. That
lead to send a Odoo discuss link to the customer, and then set the
google meet link in the sales person calendar.
As the insert of google event is done post commit of the transaction,
and there is no way to generate a google meet link before the creation
of an event, there is no trivial fix to generate the google mette link
at the right moment. We just don't generate the google link when a Odoo
discuss link is already there.
closesodoo/odoo#113192
X-original-commit: 1a1a8e48995cfe37a0c8536bbcfc3341d76499ef
Signed-off-by: Masereel Pierre <pim@odoo.com>
Before this commit: In some cases where some events won't sync to
Odoo properly you got the "Unable to use a closed cursor." error. The
problem is that `_from_google_ids` function returns a recordset, and the
underlying cursor may be closed.
Steps to reproduce the issue:
1. Create user_A and user_B in Odoo
2. Sync user_A and user_B with Google calendar
3. Create an event with user_B on the Google calendar
4. Run the "Google Calendar: synchronization" cron
5. Change the created event's owner to user_A on the Google calendar
6. Run the "Google Calendar: synchronization" cron
=> You will get this error on the log, and the event won't sync:
```
Traceback (most recent call last):
File "/home/odoo/src/odoo/odoo/api.py", line 886, in get
return field_cache[record._ids[0]]
KeyError: 99
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/odoo/src/odoo/odoo/fields.py", line 1061, in __get__
value = env.cache.get(record, self)
File "/home/odoo/src/odoo/odoo/api.py", line 889, in get
raise CacheMiss(record, field)
odoo.exceptions.CacheMiss: 'calendar.event(99,).google_id'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/odoo/src/odoo/addons/google_calendar/models/res_users.py", line 91, in _sync_all_google_calendar
user.with_user(user).sudo()._sync_google_calendar(google)
File "/home/odoo/src/odoo/addons/google_calendar/models/res_users.py", line 70, in _sync_google_calendar
synced_events = self.env['calendar.event']._sync_google2odoo(events - recurrences, default_reminders=default_reminders)
File "/home/odoo/src/odoo/addons/google_calendar/models/google_sync.py", line 147, in _sync_google2odoo
existing = google_events.exists(self.env)
File "/home/odoo/src/odoo/addons/google_calendar/utils/google_event.py", line 180, in exists
events.odoo_ids(env)
File "/home/odoo/src/odoo/addons/google_calendar/utils/google_event.py", line 88, in odoo_ids
found = self._load_odoo_ids_from_db(env, model)
File "/home/odoo/src/odoo/addons/google_calendar/utils/google_event.py", line 111, in _load_odoo_ids_from_db
mapping = {e.google_id: e.id for e in odoo_events} # {google_id: odoo_id}
File "/home/odoo/src/odoo/addons/google_calendar/utils/google_event.py", line 111, in <dictcomp>
mapping = {e.google_id: e.id for e in odoo_events} # {google_id: odoo_id}
File "/home/odoo/src/odoo/odoo/fields.py", line 1087, in __get__
recs._fetch_field(self)
File "/home/odoo/src/odoo/odoo/models.py", line 3276, in _fetch_field
self._read(fnames)
File "/home/odoo/src/odoo/addons/calendar/models/calendar_event.py", line 436, in _read
super()._read(fields)
File "/home/odoo/src/odoo/odoo/models.py", line 3343, in _read
cr.execute(query_str, params + [sub_ids])
File "<decorator-gen-20>", line 2, in execute
File "/home/odoo/src/odoo/odoo/sql_db.py", line 89, in check
raise psycopg2.OperationalError('Unable to use a closed cursor.')
```
The solution is to use ormcache on a function that returns the ids of the
events.
opw-3098799
closesodoo/odoo#112517
X-original-commit: 831e2e916541a95a1b932d9f58b3592ecee0c685
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Before this commit, when an event containing only the creator was created in Google Calendar, the creator's attendee status in Odoo was marked as 'needsAction'. Now, when an event like this is created (in Google Calendar), the event is automatically accepted in Odoo.
A test was added to make sure that new events with only the creator are automatically accepted.
closes odoo/odoo#112195
Task: 2782961
Related-to: #68700
X-original-commit: 6d0ead3d73477614dc1bd97a95b695f80925fdd3
Signed-off-by: Arnaud Joset <arj@odoo.com>
In 16.0, at 6a42ec7c73
an error was introduced redirecting users to the configuration panel
when clicking the 'sync' button for extenal providers in calendar.
This simply replaces that call with a redirect to an authentication url
received from the back-end.
task-3131128
closesodoo/odoo#111392
X-original-commit: 0574c18acd70c3fe52cdb5cbe563ffa02f5f5ad3
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thiry Renaud (reth) <reth@odoo.com>
When we are creating an event in odoo and synchronise it with google,
the google meet link is not automatically generated. To ease the use of
the meeting, we'll auto generate the google meet link.
closesodoo/odoo#110847
Task-id: 2945998
Signed-off-by: Masereel Pierre <pim@odoo.com>
Overriding the _compute_field_value in order to only prefetch the currently requested field
opw-3141262
closesodoo/odoo#110489
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
Update counters according to latest runbot counters. It allows to better spot
side effects of upcoming changes.
Task-2710804 (Mail: Clean MailThread Posting API)
Part-of: odoo/odoo#99482
before this commit, the field and labels are aligned in different lines in the settings.
closesodoo/odoo#109683
X-original-commit: 5844a0446ef9712027aa08fc239bbb858d164b87
Signed-off-by: Arnaud Joset <arj@odoo.com>
When creating an employee with an associated user, the work email of the
employee is copied from the user (or actually the partner associated with the
user).
However since this [commit], both the mobile_phone and work_email fields on the
employee are computed fields based on a linked partner in the work_contact_id
field. This partner is created on the fly if it did not previously exist.
Both of these behaviors interact in such a way, that the linked partner of the
employee is created automatically using the email from the linked partner of
the user. This is a bug, since both linked partners of the employee and the
user should be the same.
The bug is easily resolved by adding the work_contact_id field directly to the
values dict for the creation of the employee (instead of the work_email).
Reproduction steps: the bug can be easily triggered by repeatedly installing
and uninstalling the employees app. An extra partner gets created for each
employee in the master or demo data, after each install/uninstall cycle.
[commit]: https://github.com/odoo/odoo/commit/3c6060b7bbe9c67aca8073ef43c1e89fb7e820ca
opw-3031187
closesodoo/odoo#108045
X-original-commit: 35b7e0e128f1cfd72c11ebb16d68bc48fdcbdb57
Related: odoo/enterprise#35004
Signed-off-by: Kevin Baptiste <kba@odoo.com>
## Issue
Currently if an administrator installs one of the sync modules but does
not set any credentials. If the user tries to sync their calendar
they are met with an error.
## Fix
Make sure they get a clear dialog explaining why they cannot sync.
task - 3056311
X-original-commit: 6ec6a3764c5e5460aa8a1cdfa228740606fdfe13
Part-of: odoo/odoo#106517
## Issue
Regular users were not able to see the sync button
used to sync with external calendar services even after
these services were configured
## Fix
Conditionally display the whole sync section until one of the
services is configured.
Override the display conditions when one of the relevant modules are
installed.
task - 3056311
X-original-commit: 29f820cfd421859a2b480725ba2a81a515509b88
Part-of: odoo/odoo#106517
Issue
When the google and outlook sync plugins are not installed the admin user should see an option to install them from the calendar but other users should not see anything.
Fix
This replaces the 'groups' attribute in the calendar controller template with a t-if and a dynamic check as OWL doesn't process 'groups'.
task - 3056311
X-original-commit: 4d5b7d4b5347c958f37b8f40e9edfae7cd78c2ca
Part-of: odoo/odoo#106517
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
closesodoo/odoo#102870
X-original-commit: 5a56e37a5f54662b1f3593930738e51c010abab7
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Before this commit: if an event's attendee didn't have a state, it couldn't
get synced with Google.
The solution is first to set a default value for it.
opw-2915661
closesodoo/odoo#102865
X-original-commit: 89b53744c668183913b8a188730bd350fe778807
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Migrates the attendee_calendar view aswell as the modules patching it.
The code has been simplified as much as possible to reduce complexity
while still retaining a similar flow.
TaskId-2999194
closesodoo/odoo#101492
X-original-commit: ee14c3ec4830454d80a63793a91f6d1c838363f1
Related: odoo/enterprise#31963
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Before this commit: if one recurrence event in the google calendar
contains an attendee with one of the alias emails, it wouldn't get synced
and raise an error.
The solution is to remove those attendees.
opw-2963825
closesodoo/odoo#101037
X-original-commit: c9fa96604950f61c079627b88495130365d3b534
Signed-off-by: Arnaud Joset <arj@odoo.com>
* = google_calendar, microsoft_calendar, web
Purpose:
Allow to install appropriate module and configure calendar provider credentials
in fewer steps, without needing to go to general settings, etc.
This requires that both buttons are visible from the start.
In this commit, we also prepare the ability to extend this configuration wizard
for the appointment onboarding (see ENT PR).
Task-2852375
Part of Task-2900763
Part-of: odoo/odoo#97105
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
closesodoo/odoo#95744
Related: odoo/upgrade#3673
Signed-off-by: Christophe Simonis <chs@odoo.com>
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
There was an issue with this fix.
This reverts commit 8ebb44420c3e2dcc0d990d2646486654b4b2955d.
closesodoo/odoo#96421
X-original-commit: 29f0c7635c900324631fe3562399c3ced5bc15f7
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
As several customers complained about lot of bugs in microsoft_calendar in 14.0,
It has been decided to backport bug fixes of the model layer from master to 14.0,
without the need of an upgrade script (no new field, ...).
In master, we use 2 ids (organizer event id + universal id) instead of only one,
to handle Odoo <-> Outlook sync correctly when several attendees sync their Outlook
calendar with their Odoo calendar. For that, we have added a new field.
To report this bug fix in 14.0, the existing field which stores the organizer event id,
is now a string storing both ids separated by a ':' as follow: 'organizer_event_id:universal_id'.
2 new compute fields have been added to be able to use these 2 ids more easily.
(all commits from the original PR have been squashed to ease forward-port)
closesodoo/odoo#95736
X-original-commit: 5e83318a7240585371efd31e407829793f3e732f
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
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
closesodoo/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>