From a35a7f59315c1a4e124fa516c438a3bcc64fda5b Mon Sep 17 00:00:00 2001 From: Pratima Gupta Date: Mon, 23 Jul 2018 13:28:48 +0200 Subject: [PATCH] [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). --- addons/calendar/__manifest__.py | 1 + addons/calendar/data/calendar_data.xml | 279 +------------------------ addons/calendar/data/mail_data.xml | 279 +++++++++++++++++++++++++ 3 files changed, 281 insertions(+), 278 deletions(-) create mode 100644 addons/calendar/data/mail_data.xml diff --git a/addons/calendar/__manifest__.py b/addons/calendar/__manifest__.py index 47707a492de..0d623bfe651 100644 --- a/addons/calendar/__manifest__.py +++ b/addons/calendar/__manifest__.py @@ -28,6 +28,7 @@ If you need to manage your meetings, you should install the CRM module. 'security/calendar_security.xml', 'data/calendar_cron.xml', 'data/calendar_data.xml', + 'data/mail_data.xml', 'views/mail_activity_views.xml', 'views/calendar_templates.xml', 'views/calendar_views.xml', diff --git a/addons/calendar/data/calendar_data.xml b/addons/calendar/data/calendar_data.xml index 8f4a4774f0e..29083593e32 100644 --- a/addons/calendar/data/calendar_data.xml +++ b/addons/calendar/data/calendar_data.xml @@ -1,8 +1,6 @@ - - Invitation calendar.event @@ -51,280 +49,5 @@ hours email - - - Calendar: Meeting Invitation - ${object.event_id.user_id.email or ''} - ${object.event_id.name} invitation - - ${('' if object.partner_id and object.partner_id.email and object.partner_id.email==object.email else object.email|safe)} - ${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False } - - -% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'} - - - - - -
- ${user.company_id.name} - -

- Accept - Decline - View -

-
- - - - -
-
-
-
-
- -
- - - - -
-

Invitation to ${object.event_id.name}

-

- Dear ${object.common_name},
- ${object.event_id.user_id.partner_id.name} invited you for the ${object.event_id.name} meeting of ${object.event_id.user_id.company_id.name}.

- - - -
-
- ${object.event_id.get_interval('dayname', tz=object.partner_id.tz if not object.event_id.allday else None)} -
-
- ${object.event_id.get_interval('day', tz=object.partner_id.tz if not object.event_id.allday else None)} -
-
${object.event_id.get_interval('month', tz=object.partner_id.tz if not object.event_id.allday else None)}
-
${not object.event_id.allday and object.event_id.get_interval('time', tz=object.partner_id.tz) or ''}
-
- -

Details of the event

-
    - % if object.event_id.location: -
  • Location: ${object.event_id.location} - (View Map) -
  • - % endif - % if object.event_id.description : -
  • Description: ${object.event_id.description}
  • - % endif - % if not object.event_id.allday and object.event_id.duration -
  • Duration: ${('%dH%02d' % (object.event_id.duration,(object.event_id.duration*60)%60))}
  • - % endif -
  • Attendees -
      - % for attendee in object.event_id.attendee_ids: -
    • -
      - % if attendee.common_name != object.common_name: - ${attendee.common_name} - % else: - You - % endif -
    • - % endfor -
  • -
-
-
-
]]>
-
- - - Calendar: Date updated - ${object.event_id.user_id.email or ''} - ${object.event_id.name}: Date updated - - ${('' if object.partner_id and object.partner_id.email and object.partner_id.email==object.email else object.email|safe)} - ${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False } - - -% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'} - - - - - -
- ${user.company_id.name} - -

- Accept - Decline - View -

-
- - - - -
-
-
-
-
- -
- - - - -
-

${object.event_id.name} date updated

-

- Dear ${object.common_name},
- The date of the meeting has been upated. The meeting ${object.event_id.name} created by ${object.event_id.user_id.partner_id.name} is now scheduled for ${object.event_id.get_display_time_tz(tz=object.partner_id.tz)}. -

- - - -
-
- ${object.event_id.get_interval('dayname', tz=object.partner_id.tz if not object.event_id.allday else None)} -
-
- ${object.event_id.get_interval('day', tz=object.partner_id.tz if not object.event_id.allday else None)} -
-
${object.event_id.get_interval('month', tz=object.partner_id.tz if not object.event_id.allday else None)}
-
${not object.event_id.allday and object.event_id.get_interval('time', tz=object.partner_id.tz) or ''}
-
- -

Details of the event

-
    - % if object.event_id.location: -
  • Location: ${object.event_id.location} - (View Map) -
  • - % endif - % if object.event_id.description : -
  • Description: ${object.event_id.description}
  • - % endif - % if not object.event_id.allday and object.event_id.duration -
  • Duration: ${('%dH%02d' % (object.event_id.duration,(object.event_id.duration*60)%60))}
  • - % endif -
  • Attendees -
      - % for attendee in object.event_id.attendee_ids: -
    • -
      - % if attendee.common_name != object.common_name: - ${attendee.common_name} - % else: - You - % endif -
    • - % endfor -
  • -
-
-
-
]]>
-
- - - Calendar: Reminder - ${object.event_id.user_id.email or ''} - ${object.event_id.name} - Reminder - - ${('' if object.partner_id and object.partner_id.email and object.partner_id.email==object.email else object.email|safe)} - ${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False } - - -% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'} - - - - - -
- ${user.company_id.name} - -

- Accept - Decline - View -

-
- - - - -
-
-
-
-
- -
- - - - -
-

Reminder for ${object.event_id.name}

-

- Dear ${object.common_name},
- This is a reminder for the below event : -

- - - -
-
- ${object.event_id.get_interval('dayname', tz=object.partner_id.tz if not object.event_id.allday else None)} -
-
- ${object.event_id.get_interval('day', tz=object.partner_id.tz if not object.event_id.allday else None)} -
-
${object.event_id.get_interval('month', tz=object.partner_id.tz if not object.event_id.allday else None)}
-
${not object.event_id.allday and object.event_id.get_interval('time', tz=object.partner_id.tz) or ''}
-
- -

Details of the event

-
    - % if object.event_id.location: -
  • Location: ${object.event_id.location} - (View Map) -
  • - % endif - % if object.event_id.description : -
  • Description: ${object.event_id.description}
  • - % endif - % if not object.event_id.allday and object.event_id.duration -
  • Duration: ${('%dH%02d' % (object.event_id.duration,(object.event_id.duration*60)%60))}
  • - % endif -
  • Attendees -
      - % for attendee in object.event_id.attendee_ids: -
    • -
      - % if attendee.common_name != object.common_name: - ${attendee.common_name} - % else: - You - % endif -
    • - % endfor -
  • -
-
-
-
]]>
-
-
+ \ No newline at end of file diff --git a/addons/calendar/data/mail_data.xml b/addons/calendar/data/mail_data.xml new file mode 100644 index 00000000000..c7b1dafcea7 --- /dev/null +++ b/addons/calendar/data/mail_data.xml @@ -0,0 +1,279 @@ + + + + + Calendar: Meeting Invitation + ${object.event_id.user_id.email or ''} + ${object.event_id.name} invitation + + ${('' if object.partner_id and object.partner_id.email and object.partner_id.email==object.email else object.email|safe)} + ${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False } + + +% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'} + + + + + +
+ ${user.company_id.name} + +

+ Accept + Decline + View +

+
+ + + + +
+
+
+
+
+ +
+ + + + +
+

Invitation to ${object.event_id.name}

+

+ Dear ${object.common_name},
+ ${object.event_id.user_id.partner_id.name} invited you for the ${object.event_id.name} meeting of ${object.event_id.user_id.company_id.name}.

+ + + +
+
+ ${object.event_id.get_interval('dayname', tz=object.partner_id.tz if not object.event_id.allday else None)} +
+
+ ${object.event_id.get_interval('day', tz=object.partner_id.tz if not object.event_id.allday else None)} +
+
${object.event_id.get_interval('month', tz=object.partner_id.tz if not object.event_id.allday else None)}
+
${not object.event_id.allday and object.event_id.get_interval('time', tz=object.partner_id.tz) or ''}
+
+ +

Details of the event

+
    + % if object.event_id.location: +
  • Location: ${object.event_id.location} + (View Map) +
  • + % endif + % if object.event_id.description : +
  • Description: ${object.event_id.description}
  • + % endif + % if not object.event_id.allday and object.event_id.duration +
  • Duration: ${('%dH%02d' % (object.event_id.duration,(object.event_id.duration*60)%60))}
  • + % endif +
  • Attendees +
      + % for attendee in object.event_id.attendee_ids: +
    • +
      + % if attendee.common_name != object.common_name: + ${attendee.common_name} + % else: + You + % endif +
    • + % endfor +
  • +
+
+
+
]]>
+
+ + + Calendar: Date updated + ${object.event_id.user_id.email or ''} + ${object.event_id.name}: Date updated + + ${('' if object.partner_id and object.partner_id.email and object.partner_id.email==object.email else object.email|safe)} + ${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False } + + +% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'} + + + + + +
+ ${user.company_id.name} + +

+ Accept + Decline + View +

+
+ + + + +
+
+
+
+
+ +
+ + + + +
+

${object.event_id.name} date updated

+

+ Dear ${object.common_name},
+ The date of the meeting has been upated. The meeting ${object.event_id.name} created by ${object.event_id.user_id.partner_id.name} is now scheduled for ${object.event_id.get_display_time_tz(tz=object.partner_id.tz)}. +

+ + + +
+
+ ${object.event_id.get_interval('dayname', tz=object.partner_id.tz if not object.event_id.allday else None)} +
+
+ ${object.event_id.get_interval('day', tz=object.partner_id.tz if not object.event_id.allday else None)} +
+
${object.event_id.get_interval('month', tz=object.partner_id.tz if not object.event_id.allday else None)}
+
${not object.event_id.allday and object.event_id.get_interval('time', tz=object.partner_id.tz) or ''}
+
+ +

Details of the event

+
    + % if object.event_id.location: +
  • Location: ${object.event_id.location} + (View Map) +
  • + % endif + % if object.event_id.description : +
  • Description: ${object.event_id.description}
  • + % endif + % if not object.event_id.allday and object.event_id.duration +
  • Duration: ${('%dH%02d' % (object.event_id.duration,(object.event_id.duration*60)%60))}
  • + % endif +
  • Attendees +
      + % for attendee in object.event_id.attendee_ids: +
    • +
      + % if attendee.common_name != object.common_name: + ${attendee.common_name} + % else: + You + % endif +
    • + % endfor +
  • +
+
+
+
]]>
+
+ + + Calendar: Reminder + ${object.event_id.user_id.email or ''} + ${object.event_id.name} - Reminder + + ${('' if object.partner_id and object.partner_id.email and object.partner_id.email==object.email else object.email|safe)} + ${object.partner_id and object.partner_id.email and object.partner_id.email==object.email and object.partner_id.id or False } + + +% set colors = {'needsAction': 'grey', 'accepted': 'green', 'tentative': '#FFFF00', 'declined': 'red'} + + + + + +
+ ${user.company_id.name} + +

+ Accept + Decline + View +

+
+ + + + +
+
+
+
+
+ +
+ + + + +
+

Reminder for ${object.event_id.name}

+

+ Dear ${object.common_name},
+ This is a reminder for the below event : +

+ + + +
+
+ ${object.event_id.get_interval('dayname', tz=object.partner_id.tz if not object.event_id.allday else None)} +
+
+ ${object.event_id.get_interval('day', tz=object.partner_id.tz if not object.event_id.allday else None)} +
+
${object.event_id.get_interval('month', tz=object.partner_id.tz if not object.event_id.allday else None)}
+
${not object.event_id.allday and object.event_id.get_interval('time', tz=object.partner_id.tz) or ''}
+
+ +

Details of the event

+
    + % if object.event_id.location: +
  • Location: ${object.event_id.location} + (View Map) +
  • + % endif + % if object.event_id.description : +
  • Description: ${object.event_id.description}
  • + % endif + % if not object.event_id.allday and object.event_id.duration +
  • Duration: ${('%dH%02d' % (object.event_id.duration,(object.event_id.duration*60)%60))}
  • + % endif +
  • Attendees +
      + % for attendee in object.event_id.attendee_ids: +
    • +
      + % if attendee.common_name != object.common_name: + ${attendee.common_name} + % else: + You + % endif +
    • + % endfor +
  • +
+
+
+
]]>
+
+
+