From eaeb86eb8f447f3487c682a85422a5b6648ff33f Mon Sep 17 00:00:00 2001 From: braisab Date: Wed, 1 Sep 2021 22:19:23 +0200 Subject: [PATCH] [IMP]: Added automated mails in data and confirmed, modified and cancelled mail templates --- pms/__manifest__.py | 3 + ...s_cancelled_reservation_email_template.xml | 96 +++++++++++ ...s_confirmed_reservation_email_template.xml | 151 +++++++++++++++++ pms/data/pms_data.xml | 35 +++- ...ms_modified_reservation_email_template.xml | 152 ++++++++++++++++++ 5 files changed, 436 insertions(+), 1 deletion(-) create mode 100644 pms/data/pms_cancelled_reservation_email_template.xml create mode 100644 pms/data/pms_confirmed_reservation_email_template.xml create mode 100644 pms/data/pms_modified_reservation_email_template.xml diff --git a/pms/__manifest__.py b/pms/__manifest__.py index 817de0650..5534d5e71 100644 --- a/pms/__manifest__.py +++ b/pms/__manifest__.py @@ -33,6 +33,9 @@ "security/ir.model.access.csv", "data/cron_jobs.xml", "data/pms_sequence.xml", + "data/pms_confirmed_reservation_email_template.xml", + "data/pms_modified_reservation_email_template.xml", + "data/pms_cancelled_reservation_email_template.xml", "data/pms_data.xml", "data/traveller_report_paperformat.xml", "report/pms_folio.xml", diff --git a/pms/data/pms_cancelled_reservation_email_template.xml b/pms/data/pms_cancelled_reservation_email_template.xml new file mode 100644 index 000000000..e9b264eae --- /dev/null +++ b/pms/data/pms_cancelled_reservation_email_template.xml @@ -0,0 +1,96 @@ + + + + + Cancelled Reservation + + Your reservation in ${object.pms_property_id.name} has been cancelled + ${object.pms_property_id.partner_id.email | safe} + ${(object.email and '"%s" <%s>' % (object.name, object.email) or object.partner_id.email_formatted or '') | safe} + + + + + +
+ + + + + + + + + + + + +
+ + + +
+
+ % if object.pms_property_id.partner_id.street +

${object.pms_property_id.partner_id.street}

+ % endif + % if object.pms_property_id.partner_id.street2 +

${object.pms_property_id.partner_id.street2}

+ % endif +

${object.pms_property_id.partner_id.zip}

+

${object.pms_property_id.partner_id.city}

+

${object.pms_property_id.partner_id.country_id.name}

+
+
+
+
+ Hello ${object.partner_id.name or ''},
+ Your reservation at ${object.pms_property_id.name} has been successfully canceled. +
+
+
+ + +
+
+ +
+
If you have questions please contact with us:
+
    +
  • ${object.pms_property_id.name}
  • + % if object.pms_property_id.partner_id.email +
  • Mail: ${object.pms_property_id.partner_id.email}
  • + % endif + % if object.pms_property_id.partner_id.phone +
  • Phone: ${object.pms_property_id.partner_id.phone}
  • + % endif + % if object.pms_property_id.partner_id.mobile +
  • Mobile: ${object.pms_property_id.partner_id.mobile}
  • + % endif +
+
+
+
+
+ % if object.pms_property_id.privacy_policy + + +
+ ${object.pms_property_id.privacy_policy} +
+ % endif +
+ % if object.company_id + + +
+ Sent by ${object.company_id.name} +
+
+ % endif +
+
+ ${object.partner_id.lang} +
+
+
diff --git a/pms/data/pms_confirmed_reservation_email_template.xml b/pms/data/pms_confirmed_reservation_email_template.xml new file mode 100644 index 000000000..fd29b76aa --- /dev/null +++ b/pms/data/pms_confirmed_reservation_email_template.xml @@ -0,0 +1,151 @@ + + + + + Confirmed Reservation + + ${object.company_id.name} has confirmed your reservation in ${object.pms_property_id.name} + ${object.pms_property_id.partner_id.email | safe} + ${(object.email and '"%s" <%s>' % (object.name, object.email) or object.partner_id.email_formatted or '') | safe} + + + + + +
+ + + + + + + + + + + + + + +
+ + + +
+
+ % if object.pms_property_id.partner_id.street +

${object.pms_property_id.partner_id.street}

+ % endif + % if object.pms_property_id.partner_id.street2 +

${object.pms_property_id.partner_id.street2}

+ % endif +

${object.pms_property_id.partner_id.zip}

+

${object.pms_property_id.partner_id.city}

+

${object.pms_property_id.partner_id.country_id.name}

+
+
+
+
+ Hello ${object.partner_id.name or ''},
+ We are happy to confirm your reservation in ${object.pms_property_id.name} +
+
+ See you soon,
+ +
+ ${object.company_id.name} +
+
+
+
+
+
Reservation Details
+ + + + +
+ + + + + + + + + + + + + +
+
+
+
From ${object.checkin} At ${object.arrival_hour}
+
To ${object.checkout} At ${object.departure_hour}
+
TZ ${object.pms_property_id.tz}
+
+
+
+
+
+
Room: ${object.room_type_id.name}
+
+
+
+
+
+
Price: ${object.price_room_services_set} ${object.pms_property_id.country_id.currency_id.symbol}
+
+
+
+ % if object.pms_property_id.mail_information +
+
Additional Information
+ ${object.pms_property_id.mail_information|safe} + % endif +
+
+
+ +
+ Questions about the reservation? +
Please contact with us:
+
    +
  • ${object.pms_property_id.name}
  • + % if object.pms_property_id.partner_id.email +
  • Mail: ${object.pms_property_id.partner_id.email}
  • + % endif + % if object.pms_property_id.partner_id.phone +
  • Phone: ${object.pms_property_id.partner_id.phone}
  • + % endif + % if object.pms_property_id.partner_id.mobile +
  • Mobile: ${object.pms_property_id.partner_id.mobile}
  • + % endif +
+
+
+
+
+ % if object.pms_property_id.privacy_policy + + +
+ ${object.pms_property_id.privacy_policy|safe} +
+ % endif +
+ % if object.company_id + + +
+ Sent by ${object.company_id.name} +
+
+ % endif +
+
+ ${object.partner_id.lang} +
+
+
diff --git a/pms/data/pms_data.xml b/pms/data/pms_data.xml index edfae1c26..57bd9e782 100644 --- a/pms/data/pms_data.xml +++ b/pms/data/pms_data.xml @@ -135,7 +135,40 @@ if (permit_first_letter.upper() in ['X','Y']) and id_number.name[1:8].isdigit() else: failed = True - + + + + Confirmed Reservation + False + + creation + + in_act + + + Modified Reservation + False + + write + + in_act + + + Cancelled Reservation + False + + cancel + + in_act diff --git a/pms/data/pms_modified_reservation_email_template.xml b/pms/data/pms_modified_reservation_email_template.xml new file mode 100644 index 000000000..a334916df --- /dev/null +++ b/pms/data/pms_modified_reservation_email_template.xml @@ -0,0 +1,152 @@ + + + + + Modified Reservation + + Your reservation in ${object.pms_property_id.name} has been modified + ${object.pms_property_id.partner_id.email | safe} + ${(object.email and '"%s" <%s>' % (object.name, object.email) or object.partner_id.email_formatted or '') | safe} + + + + + +
+ + + + + + + + + + + + + + + +
+ + + +
+
+ % if object.pms_property_id.partner_id.street +

${object.pms_property_id.partner_id.street}

+ % endif + % if object.pms_property_id.partner_id.street2 +

${object.pms_property_id.partner_id.street2}

+ % endif +

${object.pms_property_id.partner_id.zip}

+

${object.pms_property_id.partner_id.city}

+

${object.pms_property_id.partner_id.country_id.name}

+
+
+
+
+ Hello ${object.partner_id.name or ''},
+ Your reservation in ${object.pms_property_id.name} has been modified +
+
+ See you soon,
+ +
+ ${object.company_id.name} +
+
+
+
+
+
Reservation Details
+ + + + +
+ + + + + + + + + + + + + +
+
+
+
From ${object.checkin} At ${object.arrival_hour}
+
To ${object.checkout} At ${object.departure_hour}
+
TZ ${object.pms_property_id.tz}
+
+
+
+
+
+
Room: ${object.room_type_id.name}
+
+
+
+
+
+
Price: ${object.price_total} ${object.pms_property_id.country_id.currency_id.symbol}
+
+
+
+ % if object.pms_property_id.mail_information +
+
Additional Information
+

${object.pms_property_id.mail_information|safe}

+ % endif +
+
+
+ +
+ Questions about the reservation? +
Please contact with us:
+
    +
  • ${object.pms_property_id.name}
  • + % if object.pms_property_id.partner_id.email +
  • Mail: ${object.pms_property_id.partner_id.email}
  • + % endif + % if object.pms_property_id.partner_id.phone +
  • Phone: ${object.pms_property_id.partner_id.phone}
  • + % endif + % if object.pms_property_id.partner_id.mobile +
  • Mobile: ${object.pms_property_id.partner_id.mobile}
  • + % endif +
+
+
+
+
+ % if object.pms_property_id.privacy_policy + + +
+ ${object.pms_property_id.privacy_policy|safe} +
+ % endif +
+ % if object.company_id + + +
+ Sent by ${object.company_id.name} +
+
+ % endif +
+
+ ${object.partner_id.lang} +
+
+