Commit Graph
11 Commits
Author SHA1 Message Date
Yannick Tivisse 1a9be3a869 [REF] calendar: Lint + Clean code 2020-04-09 10:59:34 +02:00
Lucas Lefèvre 7159f657a0 [REF] calendar: Refactor calendar attendees management
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
2020-04-09 10:56:37 +02:00
mcm-odooandThibault Delavallée de1743ab12 [REF] mail, various: remove user_signature field from mail.template
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>
2020-02-11 14:01:13 +00:00
Nicolas Martinelli 51f90541bf [FIX] calendar: round duration
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

closes odoo/odoo#40655

X-original-commit: f6ae9f0aea5a250cbff6734de8a43a1b741394a7
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-21 17:04:47 +00:00
fw-bot c5570c4e7d [FIX] calendar: fix wrong date for recurring event emails
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.

closes odoo/odoo#40320

X-original-commit: 1926c6cfea0e21842fbd71fd85629b13fce9b413
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
2019-11-15 10:30:01 +00:00
Christophe Simonis 8dd5a85267 [MERGE] forward port branch saas-12.3 up to 60e71302a3 2019-05-13 15:26:12 +02:00
Lucas Perais (lpe) 06b3a290f5 [FIX] calendar: templates with right lang
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

closes odoo/odoo#32717

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-16 11:43:35 +00:00
Thibault Delavallée 678e04c19d [FIX][IMP] various: improve lang computation in mail templates
Purpose: add lang definition on templates where it is missing

Related to task 1972615
Linked to PR #32872
2019-04-23 14:26:50 +00:00
Thibault Delavallée 0b74c9ab6e [FIX][IMP] various: improve recipients computation in mail templates
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
2019-04-23 14:26:50 +00:00
Pratima Gupta 8915223517 [IMP] calendar: make templates more modern and updated with Odoo guidelines
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).
2018-07-24 15:33:22 +02:00
Pratima Gupta a35a7f5931 [MOV] calendar: move mail data in their own files
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).
2018-07-24 15:33:22 +02:00