diff --git a/addons/event/data/email_template_data.xml b/addons/event/data/email_template_data.xml index b7788cba9a3..d110d05f765 100644 --- a/addons/event/data/email_template_data.xml +++ b/addons/event/data/email_template_data.xml @@ -5,113 +5,130 @@ Event: Registration Badge - ${(object.event_id.organizer_id.email or object.event_id.user_id.email or '')|safe} - ${object.partner_id.email or object.email|safe} - ${object.partner_id.lang} Your badge for ${object.event_id.name} - + ${(object.event_id.organizer_id.email or object.event_id.user_id.email or '')|safe} + ${('"%s" <%s>' % (object.partner_id.name or object.name, object.partner_id.email or object.email)) | safe} + +
+ Dear ${object.name},
+ Thank you for your inquiry.
+ Here is your badge for the event ${object.event_id.name}.
+ If you have any questions, please let us know. +

+ Thank you,
+ % if object.event_id.user_id and object.event_id.user_id.signature: + ${object.event_id.user_id.signature | safe} + % endif +
badge_of_${(object.event_id.name or '').replace('/','_')} - Dear ${object.name},

-

Thank you for your inquiry.

-

Here is your badge for the event ${object.event_id.name}.

-

If you have any questions, please let us know.

-

Best regards,

]]>
+ ${object.partner_id.lang} +
Event: Registration - ${(object.event_id.organizer_id.email or object.event_id.user_id.email or '')|safe} - ${object.partner_id.email or object.email|safe} - ${object.partner_id.lang} - Your registration at ${object.event_id.name} - + ${(object.event_id.organizer_id.email or object.event_id.user_id.email or '')|safe} + ${('"%s" <%s>' % (object.partner_id.name or object.name, object.partner_id.email or object.email)) | safe} + + +
% set date_begin = format_tz(object.event_id.date_begin, tz='UTC', format='%Y%m%dT%H%M%SZ') % set date_end = format_tz(object.event_id.date_end, tz='UTC', format='%Y%m%dT%H%M%SZ') - - - - - - - -
- - ${object.company_id.name} - - - % if 'website_url' in object.event_id and object.event_id.website_url: - View Event - % endif -
- - - -
-

- Hi, -

- We are happy to confirm your registration to the event: -

-
    -
  • Event: + + + + + + + + + + + +
    + + + +
    + Your registration
    + + ${object.name} + +
    + ${'%s' % object.company_id.name} +
    +
    +
    +
    + + - - - + + + + + + +
    +
    + Hello ${object.name or ''},
    + We are happy to confirm your registration to the event % if 'website_url' in object.event_id and object.event_id.website_url: ${object.event_id.name} % else: ${object.event_id.name} % endif - -
  • Attendee: ${object.name}
  • - -

    - See you soon, -

    -

    - - --
    + for attendee ${object.name}. +

    + % if 'website_url' in object.event_id and object.event_id.website_url: + + % endif +
    + See you soon,
    + + --
    % if object.event_id.organizer_id: ${object.event_id.organizer_id.name} % else: The organizers. % endif -
    -

    -
    - + + + + +
    +
    +
    +
    + + + + % if object.event_id.organizer_id: + + % endif + - - + + + % if object.event_id.address_id: + + % endif +
    + - - % if object.event_id.address_id.country_id.name: - - % endif
    - + + +
    From ${object.event_id.date_begin_located}
    To ${object.event_id.date_end_located}
    TZ ${object.event_id.date_tz}
    - + + + % set location = '' % if object.event_id.address_id.name: -

    ${object.event_id.address_id.name}

    +
    ${object.event_id.address_id.name}
    % endif % if object.event_id.address_id.street: -

    ${object.event_id.address_id.street}

    +
    ${object.event_id.address_id.street}
    % set location = object.event_id.address_id.street % endif % if object.event_id.address_id.street2: -

    ${object.event_id.address_id.street2}

    +
    ${object.event_id.address_id.street2}
    % set location = '%s, %s' % (location, object.event_id.address_id.street2) % endif -

    +

    % if object.event_id.address_id.city: ${object.event_id.address_id.city}, % set location = '%s, %s' % (location, object.event_id.address_id.city) @@ -124,163 +141,189 @@ ${object.event_id.address_id.zip} % set location = '%s, %s' % (location, object.event_id.address_id.zip) % endif -

    +
    % if object.event_id.address_id.country_id.name: -

    ${object.event_id.address_id.country_id.name}

    +
    ${object.event_id.address_id.country_id.name}
    % set location = '%s, %s' % (location, object.event_id.address_id.country_id.name) % endif
    - % if object.event_id.organizer_id: - - - - -
    -

    Questions about this event?

    -

    Please contact the organizer:

    -
      -
    • ${object.event_id.organizer_id.name}
    • - % if object.event_id.organizer_id.email -
    • Mail: ${object.event_id.organizer_id.email}
    • - % endif - % if object.event_id.organizer_id.phone -
    • Phone: ${object.event_id.organizer_id.phone}
    • - % endif -
    - -
    - % endif +
    +
    +
    +
    + Questions about this event? +
    Please contact the organizer:
    +
      +
    • ${object.event_id.organizer_id.name}
    • + % if object.event_id.organizer_id.email +
    • Mail: ${object.event_id.organizer_id.email}
    • + % endif + % if object.event_id.organizer_id.phone +
    • Phone: ${object.event_id.organizer_id.phone}
    • + % endif +
    +
    +
    Add this event to your calendar - Google - Outlook - Yahoo + Google + Outlook + + Yahoo
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    + Sent by ${object.company_id.name} + % if 'website_url' in object.event_id and object.event_id.website_url: +
    + Discover all our events. + % endif +
    - % if object.event_id.address_id: -
    - - - -
    - % endif - - - - - - -
    -
    Sent by ${object.company_id.name}
    - % if 'website_url' in object.event_id and object.event_id.website_url: -
    - Discover all our events. -
    - % endif -
    - - ]]> +
    + + ${object.partner_id.lang} Event: Reminder - ${(object.event_id.organizer_id.email or object.event_id.user_id.email or '')|safe} - ${object.partner_id.email or object.email|safe} - ${object.partner_id.lang} - ${object.event_id.name}: ${object.get_date_range_str()} - + ${(object.event_id.organizer_id.email or object.event_id.user_id.email or '')|safe} + ${('"%s" <%s>' % (object.partner_id.name or object.name, object.partner_id.email or object.email)) | safe} + + +
    % set date_begin = format_tz(object.event_id.date_begin, tz='UTC', format='%Y%m%dT%H%M%SZ') % set date_end = format_tz(object.event_id.date_end, tz='UTC', format='%Y%m%dT%H%M%SZ') - - - - - - - -
    - - ${object.company_id.name} - - - % if 'website_url' in object.event_id and object.event_id.website_url: - View Event - % endif -
    - - - -
    -

    - Hello, -

    -

    + + + + + + + + + + + +
    + + + +
    + Your registration
    + + ${object.name} + +
    + ${'%s' % object.company_id.name} +
    +
    +
    +
    + + - - - + + + + + + +
    +
    + Hello ${object.name},
    We are excited to remind you that the event % if 'website_url' in object.event_id and object.event_id.website_url: ${object.event_id.name} % else: - ${object.event_id.name} + ${object.event_id.name} % endif - is starting - ${object.get_date_range_str()}. -

    - We confirm your registration and hope to meet you there, -

    - - --
    + is starting ${object.get_date_range_str()}. +

    + % if 'website_url' in object.event_id and object.event_id.website_url: + + % endif +
    + We confirm your registration and hope to meet you there,
    + + --
    % if object.event_id.organizer_id: ${object.event_id.organizer_id.name} % else: The organizers. % endif -
    -

    - -
    - + + + + +
    +
    +
    +
    + + + + % if object.event_id.organizer_id: + + % endif + - - + + + % if object.event_id.address_id: + + % endif +
    + - - - % if object.event_id.address_id: - - % endif
    - + + +
    From ${object.event_id.date_begin_located}
    To ${object.event_id.date_end_located}
    TZ ${object.event_id.date_tz}
    - + % if object.event_id.address_id.country_id.name: + + + % set location = '' % if object.event_id.address_id.name: -

    ${object.event_id.address_id.name}

    +
    ${object.event_id.address_id.name}
    % endif % if object.event_id.address_id.street: -

    ${object.event_id.address_id.street}

    +
    ${object.event_id.address_id.street}
    % set location = object.event_id.address_id.street % endif % if object.event_id.address_id.street2: -

    ${object.event_id.address_id.street2}

    +
    ${object.event_id.address_id.street2}
    % set location = '%s, %s' % (location, object.event_id.address_id.street2) % endif -

    +

    % if object.event_id.address_id.city: ${object.event_id.address_id.city}, % set location = '%s, %s' % (location, object.event_id.address_id.city) @@ -293,71 +336,84 @@ ${object.event_id.address_id.zip} % set location = '%s, %s' % (location, object.event_id.address_id.zip) % endif -

    +
    % if object.event_id.address_id.country_id.name: -

    ${object.event_id.address_id.country_id.name}

    +
    ${object.event_id.address_id.country_id.name}
    % set location = '%s, %s' % (location, object.event_id.address_id.country_id.name) % endif
    - % if object.event_id.organizer_id.email: - - - - -
    -

    Questions about this event?

    -

    Please contact the organizer:

    -
      -
    • ${object.event_id.organizer_id.name}
    • - % if object.event_id.organizer_id.email -
    • Mail: ${object.event_id.organizer_id.email}
    • - % endif - % if object.event_id.organizer_id.phone -
    • Phone: ${object.event_id.organizer_id.phone}
    • - % endif -
    -
    - % endif +
    +
    +
    +
    + Questions about this event? +
    Please contact the organizer:
    +
      +
    • ${object.event_id.organizer_id.name}
    • + % if object.event_id.organizer_id.email +
    • Mail: ${object.event_id.organizer_id.email}
    • + % endif + % if object.event_id.organizer_id.phone +
    • Phone: ${object.event_id.organizer_id.phone}
    • + % endif +
    +
    +
    Add this event to your calendar - Google - Outlook - Yahoo + Google + Outlook + + Yahoo
    -
    +
    +
    +
    +
    + + + +
    +
    +
    +
    +
    + +
    + Sent by ${object.company_id.name} + % if 'website_url' in object.event_id and object.event_id.website_url: +
    + Discover all our events. + % endif +
    - % if object.event_id.address_id: -
    - - - -
    - % endif - - - - - - -
    -

    Sent by ${object.company_id.name}

    - % if 'website_url' in object.event_id and object.event_id.website_url: -
    - Discover all our events. -
    - % endif -
    - - ]]> +
    + + ${object.partner_id.lang} diff --git a/addons/event/models/event.py b/addons/event/models/event.py index e8d9fe33abe..491459b135a 100644 --- a/addons/event/models/event.py +++ b/addons/event/models/event.py @@ -482,6 +482,7 @@ class EventRegistration(models.Model): default_use_template=bool(template), default_template_id=template.id, default_composition_mode='comment', + custom_layout="mail.mail_notification_light", ) return { 'name': _('Compose Email'), diff --git a/addons/gamification/data/badge.xml b/addons/gamification/data/badge.xml index 7af0b859048..61112ffbd9a 100644 --- a/addons/gamification/data/badge.xml +++ b/addons/gamification/data/badge.xml @@ -1,3 +1,4 @@ + @@ -47,36 +48,104 @@ ${object.user_id.partner_id.id} ${object.user_id.lang} -

    -

    Congratulations ${object.user_id.name} !

    -

    You just received badge ${object.badge_id.name} !

    -
    -
    -% if object.badge_id.description - - - - - +
    - ${user.company_id.name} - - ${object.badge_id.description} -
    + + +
    + + + + + + + + + + + + + + +
    + + + +
    + Your Badge
    + + ${object.badge_id.name} + +
    + ${object.user_id.company_id.name} +
    +
    +
    +
    + + + +
    +
    + Congratulations ${object.user_id.name} !
    + You just received badge ${object.badge_id.name} !
    + % if object.badge_id.description + + + + + +
    + ${user.company_id.name} + + ${object.badge_id.description} +
    + % endif +
    + % if object.sender_id + This badge was granted by ${object.sender_id.name}. + % endif +
    + % if object.comment + ${object.comment} + % endif +

    + Thank you, +
    + % if object.sender_id and object.sender_id.signature: + ${object.sender_id.signature | safe} + % endif +
    +
    +
    +
    +
    + + + +
    + ${object.user_id.company_id.name} +
    + ${object.user_id.company_id.phone} + % if object.user_id.company_id.email + | ${object.user_id.company_id.email} + % endif + % if object.user_id.company_id.website + | + ${object.user_id.company_id.website} + + % endif +
    +
    -% endif - -
    -

    -% if object.sender_id - This badge was granted by ${object.sender_id.name}. -% endif -

    -

    -% if object.comment - ${object.comment} -% endif -

    -
    +
    + + +
    + Powered by Odoo +
    +
    + + diff --git a/addons/gamification/data/goal_base.xml b/addons/gamification/data/goal_base.xml index de76683ddc0..3552be22061 100644 --- a/addons/gamification/data/goal_base.xml +++ b/addons/gamification/data/goal_base.xml @@ -8,38 +8,40 @@ Reminder for Goal Update ${object.user_id.lang} - - Reminder ${object.name} -

    - -

    You have not updated your progress for the goal ${object.definition_id.name} (currently reached at ${object.completeness}%) for at least ${object.remind_update_delay} days. Do not forget to do it.

    - ]]>
    + +
    + Reminder ${object.name}
    +You have not updated your progress for the goal ${object.definition_id.name} (currently reached at ${object.completeness}%) for at least ${object.remind_update_delay} days. Do not forget to do it. +

    +Thank you, +
    + % if object.challenge_id.manager_id and object.challenge_id.manager_id.signature: + ${object.challenge_id.manager_id.signature | safe} + % endif +
    Simple Challenge Report Progress - - + +
    - + % set record = ctx.get('record') + % set company = record and record.company_id or user.company_id + % set challenge_lines = ctx.get('challenge_lines', []) +
    % for line in challenge_lines: - = 100: - style="font-weight:bold;" - % endif - > +
    - - % if object.visibility_mode == 'ranking': - - % endif +
    + % if object.visibility_mode == 'ranking': +
    + % endif +
    - - -

    Leaderboard

    -
    +

    Leaderboard

    +
    @@ -49,7 +51,7 @@
    -

    Personal Performance

    +
    Personal Performance
    @@ -67,11 +69,7 @@
    ${line['name']} % if line['suffix'] or line['monetary']: @@ -102,15 +100,15 @@ % for line in challenge_lines: - +
    -

    Top Achievers for goal ${line['name']}

    +
    Top Achievers for goal ${line['name']}
    - % if len(line['goals'])>2: + % if len(line['goals']) == 2:
    @@ -149,18 +147,16 @@
    ${goal['name']} -
    ${podiumPosition | safe}
    -

    - ${"%.2f" % goal['current']} - % if line['suffix'] or line['monetary']: - ${line['full_suffix']} - % endif -

    + ${"%.2f" % goal['current']} + % if line['suffix'] or line['monetary']: + ${line['full_suffix']} + % endif
    @@ -187,7 +183,7 @@ (${company.currency_id.symbol}) % endif - + @@ -220,43 +216,12 @@ % endif
    CompletenessCompleteness
    - - - - - - - -
    - - - - - -
    - ${company.name}
    - ${company.phone or ''} -
    - % if company.email: - ${company.email}
    - % endif - % if company.website: - - ${company.website} - - % endif -
    -
    - Powered by Odoo. -
    - ]]> - - + diff --git a/addons/gamification/models/challenge.py b/addons/gamification/models/challenge.py index 140576da889..ac5286813c3 100644 --- a/addons/gamification/models/challenge.py +++ b/addons/gamification/models/challenge.py @@ -551,7 +551,12 @@ class Challenge(models.Model): challenge.message_post( body=body_html, partner_ids=challenge.mapped('user_ids.partner_id.id'), - subtype='mail.mt_comment') + subtype='mail.mt_comment', + notif_layout='mail.mail_notification_light', + notif_values={ + 'model_description': challenge._description.lower(), + } + ) if challenge.report_message_group_id: challenge.report_message_group_id.message_post( body=body_html, @@ -573,12 +578,21 @@ class Challenge(models.Model): self.env['gamification.challenge'].message_post( body=body_html, partner_ids=[(4, user.partner_id.id)], - subtype='mail.mt_comment' + subtype='mail.mt_comment', + notif_layout='mail.mail_notification_light', + notif_values={ + 'model_description': self._description.lower(), + } ) if challenge.report_message_group_id: challenge.report_message_group_id.message_post( - body=body_html, - subtype='mail.mt_comment') + body=body_html, + subtype='mail.mt_comment', + notif_layout='mail.mail_notification_light', + notif_values={ + 'model_description': self._description.lower(), + } + ) return challenge.write({'last_report_date': fields.Date.today()}) ##### Challenges ##### diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py index 6cd52b2ab81..77966b00c77 100644 --- a/addons/gamification/models/goal.py +++ b/addons/gamification/models/goal.py @@ -225,7 +225,11 @@ class Goal(models.Model): self.env['mail.thread'].message_post( body=body_html, partner_ids=[ self.user_id.partner_id.id], - subtype='mail.mt_comment' + subtype='mail.mt_comment', + notif_layout='mail.mail_notification_light', + notif_values={ + 'model_description': self._description.lower(), + } ) return {'to_update': True} diff --git a/addons/mail/data/mail_data.xml b/addons/mail/data/mail_data.xml index fbbc41f5202..799e8eb6d76 100644 --- a/addons/mail/data/mail_data.xml +++ b/addons/mail/data/mail_data.xml @@ -158,20 +158,20 @@