Commit Graph
376 Commits
Author SHA1 Message Date
fw-bot 36bca6eb52 [IMP] calendar: Forward port of Saas 14.3 calendar perf yti
Forward port of https://github.com/odoo/odoo/pull/71808

closes odoo/odoo#72043

X-original-commit: 4f13a2214aed380c8aea984d3414caca506401bf
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-06-11 12:11:14 +00:00
Ivan Yelizariev 24fc95090a [REM] calendar: delete auto_join=False
it was made for old implementation [1] which is changed since Odoo 14.0 [2]

[1] https://github.com/odoo/odoo/commit/0c07ff7f41a7961985b0f0ef6bd7941b83507822
[2] https://github.com/odoo/odoo/commit/a27afdb5434166c3ea48c18ccfba9e8245d18e62

closes odoo/odoo#71816

Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-06-08 16:10:38 +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
fw-bot 05446fcc99 Cherry pick of 3c8bdde81d508fdee301f13bcbc6e4eefc9fb02c failed
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:

closes odoo/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>
2021-05-28 13:12:42 +00:00
nounoubensebia d01e5c5cdb [IMP] calendar, crm, hr_holidays: move meeting stat button to calendar
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

closes odoo/odoo#69846

Related: odoo/upgrade#2423
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-28 14:05:07 +00:00
fw-bot f6c03b7097 [FIX] calendar: improve calendar recurrency creation performances
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/69619

closes odoo/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>
2021-04-30 06:47:00 +00:00
Arnaud Joset 744ad956f9 [FIX] calendar,calendar_sms: repair mail and sms composer actions
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.

closes odoo/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>
2021-04-27 11:31:19 +00:00
Adrien Widart 4f1c09553f [FIX] calendar: extend month_day SQL constraint
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

closes odoo/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>
2021-04-16 10:52:07 +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
Jérémy HennecartandSimon Genin f8b6d2f17d [IMP] calendar: save filters of the calendar view for the user
- We now save the status of each filters to avoid the user to do the
same operations, if he go elsewhere in the meantime.

Task ID 2196775
COM PR: odoo/odoo#55190
ENT PR: odoo/enterprise#12196
UPG PR: odoo/upgrade#1532

Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: jeh-odoo <jeh@odoo.com>
2021-04-15 14:16:04 +00:00
Jérémy HennecartandSimon Genin a901d65550 [IMP] calendar: improve the quality of the calendar app
- Remove organisers filter from the sidebar

- Responsible becomes Organizer

Task ID 2196775
COM PR: odoo/odoo#55190
ENT PR: odoo/enterprise#12196
UPG PR: odoo/upgrade#1532

Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: jeh-odoo <jeh@odoo.com>
2021-04-15 14:15:44 +00:00
Thibault Francois 02b0fdded4 [FIX] calendar: Fix ir.cron access error on calendar.event
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

closes odoo/odoo#68592

X-original-commit: a039bfdf6bc0548d5ed1910f195bf0c62d77d6d0
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-07 07:53:03 +00:00
qmo-odoo c5a6a9661f [IMP] calendar: Add route to join existing calendar.event
Allow users to join an event via a route and an action method.
See enterprise PR for more information on the use cases.

LINKS:
TaskID: #2223519
Community PR: https://github.com/odoo/odoo/pull/68022
Enterprise PR: https://github.com/odoo/enterprise/pull/17141
2021-04-01 16:22:06 +00:00
qmo-odoo 0bb010d487 [IMP] calendar: Add tracking on active field
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
2021-04-01 15:22:45 +00:00
Jérémy Hennecart 4a616e1ab1 [IMP] calendar(_sms): add template selection on reminders
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>
2021-03-30 12:15:00 +00: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
nounoubensebia ad602bba0c [FIX] calendar_event, tools: appointment time mismatch
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

closes odoo/odoo#65729

Related: odoo/enterprise#16204
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-30 13:17:07 +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
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
Thibault Delavallée f742d0f72c [FIX] calendar: fix timezone localize
Seems like the wrong utc was used.

Task ID-2199620
COM PR odoo/odoo#64925
2021-03-24 15:09:27 +00:00
Thibault Delavallée 0c7765c4cf [FIX] calendar: try to import vobject only once
Clean code and avoid import within methods.

Task ID-2199620
COM PR odoo/odoo#64925
2021-03-24 15:09:27 +00:00
Thibault Delavallée 8952ce3bf4 [MOV] calendar: reorganize calendar event and attendee methods
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
2021-03-24 15:09:27 +00:00
Thibault Delavallée 1e9b1da0eb [MOV] calendar: reorganize calendar event and attendee fields
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
2021-03-24 15:09:27 +00:00
Arnaud Joset ce58c83872 [IMP] calendar: set default stop different than default start
Before this commit, the default stop was equal to default start, creating events with duration = 0.

closes odoo/odoo#67146

Taskid: 2475473
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-03 12:35:10 +00:00
Damien Abeloos b0134452c0 [IMP] crm: add a reschedule action for activities
* 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
2021-03-03 12:43:22 +00:00
Thibault Francois 888d1f300c [FIX] calendar: Fix access right issue on env.companies
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

closes odoo/odoo#66999

X-original-commit: 7fe9012301f606e153ad2ad04c392aa193c182f3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-03-01 12:05:16 +00:00
Arnaud Joset 2f4a91c0ce [IMP] calendar,calendar_sms,crm,google_calendar: Improve calendars
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
2021-02-25 08:25:51 +00:00
Nasreddin (bon)andLucasLefevre 81946543a7 [FIX] calendar: Add start week day to weekly recurrence rrule generator + unit test
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

closes odoo/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>
2021-02-16 19:11:04 +00:00
Julien Castiaux 193fee519c [FIX] calendar: missing cron compat fom sms_calendar
Fine tunning of c8f031ad77, this commit has the missing code
compatibility for sms_calendar.

closes odoo/odoo#65064

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-01-29 15:38:24 +00:00
Julien Castiaux c8f031ad77 [IMP] calendar: schedule reminders using triggers
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.

closes odoo/odoo#64560

Task: 2416741
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2021-01-18 15:57:41 +00:00
Julien Castiaux cbf00ae8ee [REF] calendar: remove cron activation code
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.
2021-01-15 18:58:12 +00:00
Thibault Delavallée 2ba035ba6d [FW][FIX] calendar: synchronize email_from and author_id when sending email to attendees
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

closes odoo/odoo#64061

X-original-commit: c01d95d371e859002f09520d3a97436f3b3087b8
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-01-05 10:05:15 +00:00
Ivan Yelizariev 03d6d0d3e7 [FIX] calendar, calendar_sms: stop sending wrong reminders
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

closes odoo/odoo#63466

X-original-commit: 0e434d8cedd6ff9c65e539febeef220b0334e584
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2020-12-16 15:34:38 +00:00
Kevin Baptiste 61e9b6ac4e [IMP] calendar: add link to join video call
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
2020-12-09 10:16:44 +01:00
Kevin Baptiste b0d1cb23b3 [FIX] calendar: do not send updates on past events
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.

closes odoo/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>
2020-12-08 12:20:23 +00:00
Nasreddin (bon) cc315748fc [FIX] calendar: Can't group by custom fields
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

closes odoo/odoo#62640

X-original-commit: a2388931710e1043540bbf2de131d4783af17d0b
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2020-11-30 17:14:35 +00:00
Achraf (abz) 2bc6d668b7 [FIX] calendar, google_calendar, hr_holidays: lost attendees after sync
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

closes odoo/odoo#62416

X-original-commit: f6a610d0b1379aa97ad97fb7494a5d269da87775
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-11-26 14:41:30 +00:00
Martin Trigaux e433bc57ff [FIX] *: rephrase, correct typos
Courtesy of Transifex's translators for reporting bad/unclear sentences.

closes odoo/odoo#61804

X-original-commit: f5d0f4a1ebf406583889e9e04912d40c0693343e
Related: odoo/enterprise#14769
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-11-16 16:47:28 +00:00
IEL dcf3519a64 [FIX] *: Change some terms to unambiguous ones
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>
2020-11-12 12:44:07 +00:00
Jérémy Hennecart 588086235e [FIX] base,calendar: fix calendar reminder
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

closes odoo/odoo#60598

X-original-commit: 232a3c4c65dd60215a5def010da8559a9ffb2378
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-23 09:08:54 +00:00
Achraf (abz) 4f28864617 [FIX] calendar: Dont send mail to attendees when the event date is past
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

closes odoo/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>
2020-10-21 09:12:44 +00:00
Martin Trigaux 2683184aa6 [FIX] *: fix all the typos
And other reported English mistakes in source string
Courtesy of Transifex translators

And remove leftover from gengo

closes odoo/odoo#59022

X-original-commit: 26efc84c5cac47a2cc83d7b084f8b71528fec6c7
Related: odoo/enterprise#13781
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-05 09:36:34 +00:00
Kevin Baptiste 194850bc06 [FIX] calendar: set attendees on quickcreate
When creating an event through the quickcreate, the user creating the
event was not set as attendee.

closes odoo/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>
2020-09-28 10:46:17 +00:00
Yannick Tivisse 3eec4d6a69 [FW][MERGE] resource,calendar,hr_holidays: Improve the performances
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.

closes odoo/odoo#56534

Taskid: 2256705
X-original-commit: 8c96a887d3f05680c923dcd44f9c70c0e5e0bd32
Related: odoo/enterprise#12670
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-25 15:44:07 +00:00
asa-odooandD J c66d10a971 [FIX] calendar: allow creation of 'All day' events
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 #54673

closes odoo/odoo#56411

X-original-commit: cc5d090c267bac892d2e8200f8e55de88c5a0af2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: D J <dja@odoo.com>
2020-08-24 13:07:50 +00:00
Martin Trigaux 6156f98288 [FIX] *: adapt action content retrieval
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.*
2020-08-17 09:09:02 +00:00
jbm-odoo 9dc3057e8e [ADD] calendar_microsoft: Synchronize Microsoft calendar with Odoo
TaskID 2223219

closes odoo/odoo#54936

Related: odoo/upgrade#1557
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-05 13:47:42 +00:00
Fabien Pinckaers 9dd2c7fdc8 [FIX] calendar: don't crash if vobject is not installed
closes odoo/odoo#55236

Signed-off-by: Fabien Pinckaers <fpodoo@users.noreply.github.com>
2020-07-31 07:25:27 +00:00
Martin Trigaux 400cc4f14e [FIX] *: correct all or improve code translation lookup
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).

closes odoo/odoo#53683

Related: odoo/enterprise#11467
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-06-30 10:19:59 +00:00
SEINLET Nicolas 7814ffe845 [FIX] calendar: manage empty value for non required field
closes odoo/odoo#53668

X-original-commit: c59fcf3f04909e9797f7a6568dcf248988defb3d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-06-25 12:54:01 +00:00