Commit Graph
394 Commits
Author SHA1 Message Date
Florian Damhaut 386e54c9e2 [FIX] calendar: Error stop displaying private name
Step to reproduce:
- Two internal users, A and B
- As A, create a calendar event and set its privacy to private
- As B, display everybody's calendar
- Double click on the private event created by A
- Click on save

Current Behaviour:
- True name is shown as part of the error

Behaviour After PR:
- For private event not related to the users, 'Busy' or it's translation is shown to the user

opw-2723904

closes odoo/odoo#82485

X-original-commit: 704a47a520c789906b7e98ef48e5cb4f6592a13a
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
2022-01-11 08:36:45 +00:00
Rémy Baranx (bar) 828e6468fe [FIX] calendar: use given attendee states at event creation
When an event is created from an external calendar account such as
Google or Outlook, attendee info such as email and state may be given,
and should be taken into account.

For example, if the current user who is syncing his calendar is not
the organizer of the event, his attendee state should be set to
'needsAction' and not automatically set to 'accepted'.

opw-2489815

closes odoo/odoo#81636

X-original-commit: eb1adbd6af4b01a8b3b5b16dbf2d6c32eec852e6
Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-23 08:44:38 +00:00
Rémy Baranx (bar) 8153d0b12f [IMP] calendar: inform user about event attendees with invalid email addresses
If some attendees of an event have an empty or invalid email address,
the organizer of this event should be informed that these attendees
won't receive any email notifications.

opw-2667016

closes odoo/odoo#79368

Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-22 15:45:46 +00:00
Chong Wang (cwg) db5b055138 [FIX] calendar: fix recurrence name
change the wrong recurrence name like
"Every 1 Months on the -1 Last for 3 events"
to
"Every 1 Months on the Last Thursday for 3 events"

before this task,
If you create a recurrence event and invite another partner in calendar with
* Repeat Every: xxx "Months"
* Day of Month: Day of month: Last Thurday
The recurrence name in the email would be like
"Every 1 Months on the -1 Last for 3 events"

closes odoo/odoo#78809

Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-01 09:30:02 +00:00
Didier (did) 1afcc9c368 [IMP] bus, mail, *: improve longpolling bus notification format
* = auth_signup, calendar, im_livechat, snailmail_account, survey, test_mail,
    web_editor, website_crm_iap_reveal, website_livechat

The aim of this PR is to improve/fix various flaws and limitation of the current
API, to make it easier to use and more efficient.

Notification are now defined with 3 distinct parts:

- the channel determines which client(s) should receive it
- the type determines how it should be handled
- the payload determines any extra information helpful for handling it

Channel
=======

Business code
-------------

- Record channel is introduced for ease of subscribing to and sending
  notifications to specific partners, channels, documents, ...
- String channel is still supported (but it is converted internally to the tuple
  channel).
- Tuple channel is still supported without any change (but should be avoided
  whenever possible due to its complex syntax).

The channel is no longer sent to the client. When the channel was used for
business purpose, the information it contained has been moved into either the
new type, or the payload itself.

Technical note
--------------

All channels are now internally converted to the tuple (db, ...) channel, which
is necessary for the platform code (saas/sh).

Internally, the bus.bus table is not changed, type and payload are grouped
together into what was (and still is) called message.

Type
====

Type is introduced to uniformize the way notifications are sent and handled.
All existing notifications already had some kind of manually-built type in them.
This is now officially supported at the bus API.

In client code this will allow (to be done in future commits) to register one
handler per specific type, instead of having to iterate and to filter all
received notifications on every handler.

Payload
=======

Payload (ex message) did not change, it can still be anything depending on
business needs.

Few adaptations:
- When the type was included on the payload, the type has been moved to the new
  type parameter.
- When the channel was used in business code, its data has been copied into the
  payload.

task-1891151

closes odoo/odoo#79201

X-original-commit: 543af27c7d6836ffac9e80ff8490b6ddbd849221
Related: odoo/enterprise#21998
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-29 16:05:23 +00:00
Audric Onockx (auon) 700a50223e [FIX] calendar : Server error when mark a scheduled activity as done
Reproduce :

CRM.
Go to a task and schedule next activity.
Then mark this activity as done.
Write a feedback.
Result :

Server error traceback
Solution :

The written feedback is given as a kwarg to translate.
opw-2641747

closes odoo/odoo#76985

X-original-commit: 222bda82e034869590530fc634428dca596be198
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
Signed-off-by: Audric Onockx <auon-odoo@users.noreply.github.com>
2021-09-23 08:36:57 +00:00
Thibault DelavalléeandVictor Feyens d875bcd79d [IMP] gamification, google_drive, project: limit usage of search on ir.model
Purpose of this commit is to globally improve code performance by limiting
search impact by using cache when accessing ir.model.

Note that tests are left untouched as they are generally done using admin
(or at least data preparation is done as admin). Diff is kept small currently.

Task-2638444
PR odoo/odoo#76005

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Victor Feyens <vfe@odoo.com>
2021-09-08 07:56:03 +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 415d49f3f1 [FIX] calendar: allow to copy event without messing with attendees
Before this commit, when an event was duplicated, the attendee records were shared between copies. Accepting an event in one event would set the same answer on the other.
After this commit, the attendee records are recreated based on the partner and attendee status are reset.

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
Arnaud Joset 3466ccfe01 [IMP] calendar: allow to display all fields of private events for attendees
Before this commit, attendees were not able to see private event information.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:21:00 +00:00
Arnaud Joset 9f53946ccf [IMP] calendar: prevent usererror when grouping by private fields.
Before this commit, read_group with private fields would automatically raise an user error, preventing the action.
This commit filter out the private records that the user should not access and display the public ones according to the current user.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:20:59 +00:00
Arnaud Joset 24a36c6c8f [IMP] calendar: rename calendar.contacts model
Before this commit, the 'magic' model calendar.contacts name was misleading. This model is only used to save calendar view preferences in the calendar app.
As the calendar events are already mentionning attendees, partners, users, the 'contact' name for a technical field was confusing.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:20:59 +00:00
Arnaud Joset 8cb96696b8 [MOV] calendar: rename calendar_contact to calendar_filter
Before this commit, the model calendar.contacts was only used for UI purpose and could easily be confused with calendar.attendee or partner_ids.

Taskid: 2484335
Part-of: odoo/odoo#68700
2021-08-26 10:20:58 +00:00
Thibault Francois 6ec80fe459 [FIX] calendar: expected singleton error with _find_attendee
Issue
-----

Opening the calendar view may lead to an expected singleton error
because _find_attendee my return a recordset with a len > 1

Solution
--------
Return the first element of the filtered list to match the behavior
described in the doc string

closes odoo/odoo#75277

X-original-commit: b3a17e8c233f0b31c61609fefbc24241c3d12ae4
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-08-24 06:49:03 +00:00
Adrien Widart 75584fb881 [FIX] crm: invite partners on quick creation of meeting
When creating a meeting from a partner/lead, the invitations won't be
created/sent

To reproduce the error:
1. Open a lead
2. Click on Meeting
3. Create a meeting
    - On meeting creation, directly click on "Create", not "Edit"

Error: No invitation has been sent. When editing the created event,
there isn't any invitation on Invitations tab. Same error will happen
when opening the form of a customer instead of a lead (step 1)

For an attendee to be created, the partners associated with the meeting
must be explicitly listed in the creation values:
https://github.com/odoo/odoo/blob/3e20e68f0790a0b0f3b5c4d43f59f235b7d20fef/addons/calendar/models/calendar_event.py#L710-L713
However, in the above use case, the partners identifiers are given
through the context. This explains why the attendees are not created.

OPW-2531496

closes odoo/odoo#75353

X-original-commit: a8b4f8f6c009d8abd7210973005fd755ac3bc573
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-08-20 07:48:33 +00:00
Martin Trigaux c7bac3dee0 [IMP] *: make ir.model.data helper private
No reason to interfact with them directly in RPC
2021-08-10 13:49:04 +02:00
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