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
stdout:
stderr:
17:49:30.703303 git.c:344 trace: built-in: git cherry-pick 3c8bdde81d508fdee301f13bcbc6e4eefc9fb02c
error: Cherry-picking is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit.
fatal: cherry-pick failed
----------
status:
closesodoo/odoo#71390
X-original-commit: 7033f4aa7d1c65ad13dcd19e66378b101b56238b
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Move the meeting stat button and kanban pill from CRM to Calendar, purpose is to
allow its usage even if CRM is not installed as this makes more sense since this
field is usually related to Calendar.
Increase query number limit in company leave test, in order to take into account
the newly introduced query in Calendar.
UPG-PR: https://github.com/odoo/upgrade/pull/2423
Task-2514473
closesodoo/odoo#69846
Related: odoo/upgrade#2423
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Turn off calendar.attendees notification during synced_events creation
to improve performances. The calendar notification are only computed
once after all the synced events have been created.
Add a flag in google_calendar.js to avoid retriggering synchronization
while navigating the calendar view if the past synchronization is still
pending.
opw: 2450259 + fixes/adaptations to 14.3 branch
FW of https://github.com/odoo/odoo/pull/69619closesodoo/odoo#70035
X-original-commit: 28ccb2b88a7793058c81aabffb43071165886f40
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
This commit follows https://github.com/odoo/odoo/pull/64948
Before this commit, the mail composer was not properly used. It was not started with a model and business document ids.
This commit also reverts a keyword context value for the sms composer.
closesodoo/odoo#69910
Taskid: 2342252
X-original-commit: 14629c8e1778269dc2ccc0dedd5e39b23c78669f
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
When creating a recurrent event, an SQL contraint requires the field
`day` to be correcly defined. However, if the recurrence rule is like
"every last Monday of the month", the field becomes useless and may be
undefined. As a result, the SQL constraint will prevent the creation of
such a recurrent event.
For example, the situation will happen when the user creates this
recurrent event on Microsoft Calendar and then tries to sync with Odoo.
The recurrent event data will contain:
```python
{
'rrule_type': 'monthly',
'day': 0,
'byday': '2',
'month_by': 'day',
'weekday': 'TU',
# ...
}
```
OPW-2439814
closesodoo/odoo#69387
X-original-commit: 02886f65e9026e1f7617c8b23c3d87edd358b168
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
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
Problem
-------
Writing on a calendar.event trigger _setup_alarms that may need
to read on an ir.cron depending on the alarm setup.
Non admin user are not allow to read ir.cron and thus an access
error is trigger.
Solution
--------
Read the cron in sudo mode
closesodoo/odoo#68592
X-original-commit: a039bfdf6bc0548d5ed1910f195bf0c62d77d6d0
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is needed for the enterprise PR linked below.
It will be needed to notify followers if a calendar event
gets cancelled (archived)
LINKS:
TaskID: #2223519
Community PR: odoo/odoo#68022
Enterprise PR:odoo/enterprise#17141
The purpose is to allow the user to have the opportunity to manage what is
going to be send as reminders. He can now access to the template or create
a new one when the type of reminder is email or sms. In case of a simple
notification, a new text field is added to add custom content.
Task ID-2191254
COM PR odoo/odoo#68443
UPG PR odoo/upgrade#2313
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
add mail_tz to calendar_attendee model in order to make it easier to change the
timezone displayed in the mail template so that we can use it to make the
appointment time shown on the email reminder sent to the attendees consistent
with the time shown on the website page.
Change the invitation mail template and use the mail_tz field to display time
field instead of using the partner's timezone in order to make the time shown
in the invitation consistent with the time shown on the website page.
Remove the get_interval method in the calendar_event model and use standard
formatting tools instead, as this is more conveniant than having a custom
method for formatting dates, For this reason the format_time function located
in tools/misc.py has been modified to be capable of handling timezones in
order to be able to display time in the correct timezone, furthermore, this
function has been added to the rendering context provided in the
mail_render_mixin file to be used in email templates.
see: https://github.com/odoo/enterprise/pull/16204
Task-2451154
closesodoo/odoo#65729
Related: odoo/enterprise#16204
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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>
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>
Purpose is to ease understanding of code. Notably we apply guidelines that
should have been applied at refactoring time, notably
* set all compute fields together right below fields as it eases model
discovering;
* set CRUD methods as a whole after compute fields;
* group other methods by main use and put tools at the file's end;
This commit causes some diff but we feel this is necessary to ease future
modifications in those models, as they are quite big and important.
Task ID-2199620
COM PR odoo/odoo#64925
Purpose is to ease model understanding. This commit causes some diff but
those models gain readability after being ordered by main field section.
It would have been better to do it at refactoring time but time was short
to do it at that time.
Task ID-2199620
COM PR odoo/odoo#64925
Before this commit, the default stop was equal to default start, creating events with duration = 0.
closesodoo/odoo#67146
Taskid: 2475473
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
* Replace the "Snooze 7d" action for lead-related activities linked to
a calendar event by a "Reschedule" action, which will redirect the user
to the calendar view with the focus on the next event related to the
opportunity
- The "Snooze 7d" action only impacted the activity and not the meeting,
and snoozing a meeting is not very logical anyway. The "Reschedule" fits
better in this use case.
* It was discussed to show only a modal allowing to reschedule the next
calendar event, but that could lead to inconsistent states (out of order
sequence of scheduled events, if the first is rescheduled after the
second).
* The reschedule option will be shown next to any activity related to a
calendar_event regardless of its activity type. There are some edge cases
that we may want to change in the future :
- When changing the activity type of a 'meeting' activity associated to
a calendar event to any other activity type, but without removing the
calendar event, the reschedule action is still showing (since the event
is still ongoing and was not deleted from the calendar).
- Conversely, with a meeting which is not (yet?) related to a calendar event,
the reschedule action will not be available.
* Add a new field to MailActivityMixin in the calendar module context. This
field is the event linked to the next activity, if there is one such event.
It is used to check whether the reschedule action should be available to the user.
* Add a test for this new field to validate the expected behavior.
* Add the priority widget to the priority field in the opportunity tree view
Task ID : 2410217
PR : https://github.com/odoo/odoo/pull/63370
Context
-------
in the module website_calendar, the controller create
an event with alarm with the Public user and the company of the public
user
and set partner_ids that may belong to a different company
Issue
-----
The company of the user that create the event remains in the context
and _notify_next_alarm check for each user which event should be notify
using with user of the partner that may be notified and check the access
rules to filter the event the partner should actually see.
The check of the acces rules need env.companies that remains the company
of the user that create the event which the current user may not see
which trigger the following error.
"Access to unauthorized or invalid companies."
Solution
--------
Wipe the company in the context when calling get_next_notif
closesodoo/odoo#66999
X-original-commit: 7fe9012301f606e153ad2ad04c392aa193c182f3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit improves multiple small details in the calendar application.
UI, UX mostly:
* some labels were confusing
* the invisible attribute were not set in popover view
* the sample data were missing
* ...
taskid: 2342252
Issue
- Install 'Calendar' module
- Create new event from Calendar view
- Edit event
- Set True to 'Recurrent' in options tab
- Repeat every 2 weeks
- Until : Number of repetitions 2
- Save and go back to calendar view
- Events are shifted (+ 1 week)
Cause
The rrule.rrule (who create the generator with the recurrence ranges dates) use
by default `calendar.firstweekday()` as first week day ('wkst').
Solution
If recurrence frequency is 'weekly', get first week day based on user language,
and add it as param ('wkst') to the rrule.rrule.
https://dateutil.readthedocs.io/en/stable/rrule.html#classes
opw-2448325
closesodoo/odoo#66311
X-original-commit: 5e85ee521edb70d4d2c7cdbf59c29794a8cd98b9
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
Co-authored-by: LucasLefevre (lul) <lul@odoo.com>
Fine tunning of c8f031ad77, this commit has the missing code
compatibility for sms_calendar.
closesodoo/odoo#65064
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The calendar reminders are emails or web notifications sent moments
before an event start. The mechanism to send web notifications is
controlled by the browser, it fetches all the future notifications and
uses `setTimeout()` to delay them. The mechanism to send emails was
controlled by a cron, every 30 minutes the cron would look for the
coming events and send the mail reminder.
The cron was running every 30 minutes even if there was no event. The
best precision was 30 minutes.
The new mechanism use cron triggers, every time one add email reminders,
triggers are created to call the cron at the precise moment the alarm is
set. The cron no longer send emails for events in the coming 30 minutes
as those will be triggered too.
closesodoo/odoo#64560
Task: 2416741
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
There is code that automatically enable or disable the cron whether it
exists alarms. As alarms are automatically added, the cron is actually
always enabled.
When emails related to calendar events are sent email_from is set from
templates like invite template. Author of those email is however not set
and current user is used as default value.
In this commit we do as done in templates and try to set event responsible
as user, and fall back on current user if not set.
This notably solves an issue when using website_calendar. Appointments are
done using public user and mails have public user as author. This leads to
emails not being accessible or having a false email_from.
Task ID-2413792
closesodoo/odoo#64061
X-original-commit: c01d95d371e859002f09520d3a97436f3b3087b8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
STEPS:
* Update cron "Calendar: Event Reminder": set Execute every 2 minutes
* create a recurring event:
* date: now() - 8 weeks
* time: now() + 1 hour + 3 minutes
* Repeat every 1 week, until "now() + 8 weeks"
* Reminders: "Notification-1 hour", "Email-1 hour", "SMS-1 hour"
* wait 3 minutes
* Wait 0-5 minutes
* Check menu ``[[ Settings ]] >> Technical >> Discuss >> Messages``
* Check menu ``[[ Settings ]] >> Technical >> Phone / SMS >> SMS``
BEFORE: you get mail/sms/UI notifications for all passed dates
AFTER: you get mail/sms/UI notifications only for the comming event
WHY: in v13.0-, recurring calendar.event records were virtual, so
_get_occurrences was used to generate those virtual records. In Odoo v14+ it's not needed
---
opw-2389877
closesodoo/odoo#63466
X-original-commit: 0e434d8cedd6ff9c65e539febeef220b0334e584
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
This commit adds a link to each calendar.event to join a video call
hosted on Jitsi.
The domain of the Jitsi instance can be configured using the
configuration parameter `website_jitsi.jitsi_server_domain` (defaults to
meet.jit.si).
TaskID: 2367543
Before this commit, a notification was sent to all the attendees
whenever a past event was modified.
Now the notification is only sent if the event is taking place in the
future.
closesodoo/odoo#63015
Taskid: 2409394
X-original-commit: e31819bccec604ba61c053015304abebdd189690
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Issue
- Install "Calendar" and "Studio" modules
- Go to Calendar app an open any event
- Switch to Studio mode
- Add a selection field X in the form then close Studio
- Go to list view and try group by X
Error message : "Grouping by X is not allowed."
Cause
`_get_public_fields` does not get custom fields created with studio.
Solution
Add custom fields to public fields.
opw-2402667
closesodoo/odoo#62640
X-original-commit: a2388931710e1043540bbf2de131d4783af17d0b
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
What are the steps to reproduce your issue ?
1. Install "google_calendar"
2. Log in with "admin"
3. Create an eventX with "admin" and "demo" has attendees
4. Run "Google Calendar Synchronization" from "Scheduled Actions"
What is currently happening ?
eventX is successfully added to Google but without admin
if you sync Odoo to Google one more time, Google will overwrite eventX
and it will remove admin from attendees
What are you expecting to happen ?
Sync Odoo to Google and Google to Odoo without lost attendees
Why is this happening ?
Because there is a filter that prevent addition of current user to the attendees
How to fix the bug ?
Remove the filter
This reverts commit 287ee0f83ae6fd457e5356860c8a8ab5a4e66754.
opw-2382443
closesodoo/odoo#62416
X-original-commit: f6a610d0b1379aa97ad97fb7494a5d269da87775
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
WHY: odoo translation framework still cannot properly handle terms that have
different translations, so we need to avoid english terms with double meaning.
Also, this improves term understanding for translators.
---
closes odoo/odoo#61668
Discussion: #60765#61272
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The purpose of this commit is to have reliable calendar event reminder.
Before, the reminders was not send directly and was instead put in mailing
queue, which was leading to some delay. This is due do mail_notify_force_send
context key being force to False when being in cron mode. However here we
do not want to have calendar cron scheduling emails, then mailing cron
sending them as it implies two delays.
In order to try to send reminder mails as soon as possible compared to their
schedule let us send mails directly during the calendar cron.
Task ID-2331999
closesodoo/odoo#60598
X-original-commit: 232a3c4c65dd60215a5def010da8559a9ffb2378
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Issue
- Install "Calender"
- Install "Google Calendar"
- Try to sync google in "Calendar"
Every created events will trigger the sending mail to attendees
even if the event date is past
Cause
'events' was not filtered
Solution
Filter 'events' to get all the events that have not yet happened
opw-2358123
closesodoo/odoo#60414
X-original-commit: 3b1df8f57e0cd342fe7f9ff7bd34100b2c821569
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
And other reported English mistakes in source string
Courtesy of Transifex translators
And remove leftover from gengo
closesodoo/odoo#59022
X-original-commit: 26efc84c5cac47a2cc83d7b084f8b71528fec6c7
Related: odoo/enterprise#13781
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When creating an event through the quickcreate, the user creating the
event was not set as attendee.
closesodoo/odoo#58631
Taskid: 2334943
X-original-commit: 07d799a5f676ed68fd2ffd9cd9bac3269f947ad1
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
TL;DR
=====
Improve performances with nearly a factor of 2. Use case, call action_validate on hr.leave for 100 employees
- 1987 requests -> 844 requests
- 1300 ms -> 700 ms
Purpose
=======
The first purpose of this commit is to add a test ensuring the number of request while creating
a company leave for 100 employees, if 15 of them already have a leave during that period.
It includes, the mass leave generation, and the conflicts resolutions. (Cancelling/Splitting the
already existing one and adapting the dates accordingly).
The second one is to reduce the number of request for this test.
In term of requests, currently we have:
- 5154 requests without bypassing the mail tracking + the activities management
- 1987 requests when bypassing the mail post-process (this is the current value, the bypassing was
already done several month ago)
- 844 requests with all the optimization done in resource/calendar/hr_holidays
In terms of execution time, we have a reduction from +- 1300 ms to call the method action_validate
to +- 700 ms
As the performances issues severity increases with the number of leaves to create and the real time access
to the database, on the production base, we reduced the execution time to generate more than 500 hr.leaves
from several minutes to 21 seconds. A fix to avoid deadlock was already made at
https://github.com/odoo/enterprise/pull/10740/files
Some contortions were made to avoid changing a signature method in a stable release and thus
introducing for each method a second one, with the "batched" implementation, to keep a retro-compatibility
for the existing custom code.
But surely this could be cleaned in the master version. The old one will be deprecated while waiting to be
removed in a few versions.
closesodoo/odoo#56534
Taskid: 2256705
X-original-commit: 8c96a887d3f05680c923dcd44f9c70c0e5e0bd32
Related: odoo/enterprise#12670
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Previously, creation of the 'All day' event was not possible in some
scenarios due to constraint error, even with proper configuration.
Scenario 1: (main spec of the task)
------------------------------------
- go to form view of calendar event
- create a new event
- enter future datetime in 'Starting at' field
- tick the 'All day' checkbox
- enter the end date which is greater than start date
- try to save the record
Scenario 2:
------------------------------------
- go to form view of calendar event
- create a new event
- enter future datetime in 'Starting at' field
- try to save the record
Scenario 3:
------------------------------------
- go to form view of calendar event
- create a new event
- enter any datetime in 'Starting at' field
- enter duration -1.00 hour
- tick the 'All day' checkbox
- enter the end date which is greater than start date
- try to save the record
In all above scenarios, user is not able to save the record even if
the there is no obvioius wrong configuration.
All of the above bugs are result of a recent refactoring[1]
where some redundant fields were removed.
The first two scenarios are result of 'stop' date not being computed
proerly based on 'start' in case the duration is set to '00:00'
(which is default duration) while the third one is due to lack of
proper check in the constraint after the fields used to validate
starting and ending dates were removed.
This commit fixes the issue by improving the compute method and by
ensuring proper validation in the constraint.
[1] - https://github.com/odoo/odoo/pull/42031/commits/6bafd7c677d016e82473f01bd0a3381ac3b24bbd
Task Id: 2299212
PR #54673closesodoo/odoo#56411
X-original-commit: cc5d090c267bac892d2e8200f8e55de88c5a0af2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: D J <dja@odoo.com>
Use _for_xml_id to replace all the self.env.ref().read()[0]
This has the advantage of having a single point of control and to add
the fields filtering and model verification.
Add sudo for other operations on ir.actions.*
This commit fixes all issues detected by the new pylint
gettext-variable test.
It converts some calls to the new syntax
_("Foo %s", bar)
to progressively migrate the code to the new syntax.
A few calls were not technically incorrect but still detected by the
linter.
_("Foo" +
"Bar")
has been converted to
_("Foo"
"Bar")
as it has the same effect and make sure the argument is of type
asteroid.Const instead of BinOp).
closesodoo/odoo#53683
Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>