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>
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>
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>
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.
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
PURPOSE
Clean organization of templates in odoo apps: mail.template records in data,
qweb templates (views) used directly in code, notably using post with view.
Purpose is to ease future improvements in posting based on templates.
SPECIFICATIONS
* move those templates in their own file to ease their discovering and
maintenance;
* put them into data (as those are not views even if it contains qweb)
* guidelines are now :
-> Qweb templates should be in data/mail_templates.xml;
-> mail.template records should be in data/mail_template_data.xml;
* put their declaration in no update when not done if template has no
technical code or complex dependency on underlying code;
* move found mail data (mail.message.subtype or mail.activity.type) records
in a mail_data file that should contain only "core" records linked to mail;
LINKS
Task ID-2375767
COM PR odoo/odoo#61814
ENT PR odoo/enterprise#14775
UPG PR odoo/upgrade#1936
Behavior prior to the commit:
- the accept link in the reminder email for a meeting has a parameter
`event_id`, instead of `id`, which causes an error 500 when the user
tries to accept the meeting
Behavior after the commit:
- the accept link uses the correct `id` parameter
opw-2366173
closesodoo/odoo#62087
X-original-commit: a1073325ed7cb231dcce27c8b2d2df67821bbdf4
Signed-off-by: Nicolas Galler <ngaller@users.noreply.github.com>
This commit removes the `state` field of calendar events.
The field was not displayed on any view and never used by any business code.
Task 2126717
PR #42031
PR Enterprise odoo/enterprise#8006
This commit refactors the event attendees and notifications according
to the recurring event refactoring.
Some (very) basic reminder tests are also added.
Task 2126717
PR #42031
PR Enterprise odoo/enterprise#8006
RATIONALE
Mail template model holds a field telling odoo mail engine to automatically
add the current user's signature to the body. Its use depends on the use
case
* using the template in the composer on a single record: it is displayed
in the rendered template in the composer, meaning people could change it.
This behavior is interesting as it allows to see the email content;
* using the template in the composer in mass mail mode: it is not displayed
as only the raw jinja is displayed. It is therefore not obvious that it
will be appended to the body of the mail. People could add it manually and
have 2 signatures as a result;
A mechanism automatically adding a signature to sent emails when posting a
message is already implemented and is based on template existence. If a
template has been used when posting, no signature is added in sent emails.
Otherwise it is automatically added. This behavior should not change.
Behavior will therefore be
* use a template -> specify signature usage in it manually through jinja;
* do not use a template -> signature added in sent emails;
SPECIFICATIONS
Remove user_signature.
Update template body accordingly. In customer oriented templates that are using
it and do not already contain it, manually add a call to user.signature within
the jinja code. When set to False, just remove its declaration.
Quickly clean some signature integration.
LINKS
Task ID 2089252
Community PR odoo/odoo#39482
Enterprise PR odoo/enterprise#6459
Upgrade PR odoo/upgrate#761
Related: odoo/enterprise#6459
Related: odoo/upgrade#761
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
When a calendar event is created with a duration of for example 20
minutes, the end time appears as the start time + 19 minutes.
Because of the rounding of the duration (20 minutes = 0.333... hours),
the end time is incorrectly set (xx:19:59.998...) then displayed. Since
the duration can only be set by the minute, we round it before computing
the end time.
opw-2122853
closesodoo/odoo#40655
X-original-commit: f6ae9f0aea5a250cbff6734de8a43a1b741394a7
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Reproduce this bug
- Install Calendar
- Create a recurring event starting at the date of yesterday
(later than your actual time)
- Set the recurrency to every day, 1 time (today)
- Click on the today's event
- Add attendees > Invitations > Send mail
- Run the mail queue manually (Technical > Scheduled actions)
The mail you sent are for the date of yesterday
The behavior is the same for the reminders
Cause
The mail are sent with the `_send_mail_to_attendees` method
who pass the attendee_id to the templates.
The `attendee_id.event_id` is always the first one.
This commit pass the correct event to the template via the context.
I replaced only the dates values in the template.
closesodoo/odoo#40320
X-original-commit: 1926c6cfea0e21842fbd71fd85629b13fce9b413
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
This branch is the combination of several optimizations in the ORM:
* store field values once in the cache: the cache reflects more
faithfully the database, only fields that explicitly depend on the
context have an extra indirection in the cache;
* delay recomputations by default: use method `recompute` to explicitly
flush out pending recomputations;
* delay updates in method `write`: updates are stored in a data
structure that can be flushed efficiently to the database with method
`flush` (which also flush out recomputations);
* make method `modified` take advantage of inverse fields to inverse
dependencies;
* filter records by evaluating a domain on records in Python;
* a computed field with `readonly=False` behaves like a normal field
with an onchange method;
* computed fields are computed in superuser mode by default.
Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien
Pinckaers.
closesodoo/odoo#35659
Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
Purpose
=======
Parentheses in the label of units of measure sometimes make
reading needlessly uncomfortable.
Specification
=============
Remove parentheses in the name of every standard uom.uom and hardcoded
occurence on views/field names.
TaskID: 2030444
closesodoo/odoo#34492
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, the standard mail templates for calendar
did not have a language
After this commit, we set it to the the partner's language
OPW 1946686
closesodoo/odoo#32717
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Improve usability of fields 'reminder_ids' (calendar.appointment.type)
and 'alarm_ids' (calendar.event)
If the user does not set a meaningful 'name' on a newly created calendar.alarm,
it is a pain to select the desired record from those fields.
(Also, user should be able to edit existing calendar.alarm)
Related Task ID: 1923205
closesodoo/odoo#30129
Purpose: use more email_formatted when possible, clean and simplify
email_from, email_to and partner_to computation.
Next step is to try to extract some common patterns in tools or methods in
order to simplify template creation and customization.
Related to task 1972615
Linked to PR #32872
Purpose of this commit is to rename type column to something matching the
the real business use of the field. That way it is easier to find and grep
in the code. It also lessens potential conflicts with type build-in python
function. It also lessens conflicts when using the field in JS as type
is a build-in attribute.
Renaming type column is a long-living issue. We choose to do it at the
beginning of the v13 development to catch errors as soon as possible.
This commit is linked to task ID 1896245. It is also a subpart of community
PR #27599.
In this commit we improve templates used in calendar. Purpose of this commit
is to have templates that embed or use standard Odoo email layouts to make
them look modern and have a common style across all emails.
Main guidelines
* better use of div / p / br to try to lessen layout issues, especially
when updating templates using the editor;
* correctly sequence the templates fields definition;
* correctly set templates values notably auto_delete and user_signature
fields to avoid confusion;
* correctly layout the email content using light notification email. It
can either propagate the layout choice through various send mail methods
or directly embed the styling in the templates for more technical or
complex templates;
* use email_formatted computed field when possible to avoid having hand-made
from / to addresses;
* fix various typos and improve subjects when necessary;
Content of emails is not necessarily updated as the purpose of this task is
about styling, not content itself.
This commit is linked to task ID 1843136 (and 1868112) and to PR #25412
(and #25889).
It lessen noise on other data when updating templates. As they are subject
to frequent changes it is better to have them located in a single file.
It is also easier to find when searching for mail templates. This allows
calendar to comply more with the guidelines.
By the way also remove a falsy comment in calendar data.
This commit is linked to task ID 1843136 (and 1868112) and to PR #25412
(and #25889).
This commit improves the use of mail activities by allowing their
integration with the calendar. Activity types now have a category
field that can be used to trigger some specific behavior. First
specific behavior is to have activity types of meeting category.
Creating activities of this type trigger a jump to the calendar to
schedule the meeting. Meeting activities and calender events are
linked to be able to easily navigate through the document, its activities
and its meetings.
Configuration is done using a category on activity types instead of some
hardcoded "meeting" activity to avoid issues with master data and to be
able to choose which activity type should trigger this behavior.
- fix access rights issue when viewing events:
Previously, with an attendee token, you could have access
to all events by simply changing the id in the url.
Now an extra verification is made to check if the attendee is
related to the event.
- fix small mail template display issue
- raise sequence of "Actions" submenu in the technical settings
(to allow insertion of submenus between Email and Actions)
Purpose
=======
External links in the data sometimes open in the same tab, the users loses times as he has to come back (and looses the context).
Specification
=============
Any external links in data (planners, settings) should open in new tabs.
The purpose of this commit is to handle code execution only in server
action and delegate schedule management to ir_cron model.
ir.cron model now inherits from ir.actions.server. Fields model, function
and args are removed as well as the logic to handle them. There is no
more code manipulation and evaluation in ir_cron, only a call to the run
method of ir.actions.server.
Cron form view use server action form view as primary view. This way
automated actions use the same base form as server actions with
cron details added.
Thanks to @fpodoo for the original idea and preliminary work. Thanks to
@jpr-odoo for first developments. Thanks to @jem-odoo for reviewing.
Change color #a24689 to #875A7B
Commit https://github.com/odoo/enterprise/commit/8ac1c19fac7615fecd51e670f798d13158a4e53c
changed the odoo interface violet by changing the main LESS variable
but forgot there was many direct occurences in XML/HTML/... (for
example for the mobile browser color).
Even if it's community the odoo interface violet is used at many places
(module description, XML demo data, ...).
As we will soon improve the sanitizer we will be able to sanitize email
templates body. However this implies some cleaning in the templates to
be sure mako is not considered as invalid html / xml and therefore removed
from the template body.
- move `get_ics_file` from calendar.attendee to calendar.event
- remove calendar.event arguments to convert method into
`api.multi`, which make more sense
- `create_attendees` now returns recordset instead of list of ids
- change signature of `get_interval` method
Migration of all python code, mostly withtout chagnes. And adapting
xml files to guidelines.
On calendar.py, some changes have been perform to make the migration works :
- `_compute` method has been split into `_compute_dates`, `_compute_attendee` and `_compute_display_time`.
- remove unused method `onchange_partner_ids`, `check_partners_email`
- make `compute_rule_string` use a cache record instead of a value
dict to avoid crashes
- remove `new_invitation_token` method, and make it a default value on attendee creation
- add a default value on `day` field, otherwise the "Please select a
proper day of the month" exception is raised during the onchange