From 932f01f9e2166a0a8ac06788da6fbabf7e889058 Mon Sep 17 00:00:00 2001 From: braisab Date: Mon, 29 May 2023 14:12:43 +0200 Subject: [PATCH] [IMP]pms_api_rest: added mail template to reset paswword --- pms_api_rest/__manifest__.py | 1 + .../data/pms_app_reset_password_template.xml | 99 +++++++++++++++++++ pms_api_rest/services/pms_user_service.py | 2 +- 3 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 pms_api_rest/data/pms_app_reset_password_template.xml diff --git a/pms_api_rest/__manifest__.py b/pms_api_rest/__manifest__.py index e884b0fbe..9120e04e5 100644 --- a/pms_api_rest/__manifest__.py +++ b/pms_api_rest/__manifest__.py @@ -22,6 +22,7 @@ "data": [ "data/sql_reports.xml", "data/auth_jwt_validator.xml", + "data/pms_app_reset_password_template.xml", "views/pms_property_views.xml", "views/res_users_views.xml", ], diff --git a/pms_api_rest/data/pms_app_reset_password_template.xml b/pms_api_rest/data/pms_app_reset_password_template.xml new file mode 100644 index 000000000..6de597677 --- /dev/null +++ b/pms_api_rest/data/pms_app_reset_password_template.xml @@ -0,0 +1,99 @@ + + + + + Pms Reset Password + + Restablecer ContraseƱa + "${object.company_id.name | safe}" <${(object.company_id.email or user.email) | safe}> + ${object.email_formatted | safe} + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + +
+ + ROOMDOO + +
+
+ + +
+ + ${object.name} + + + ${object.company_id.name} +
+
+ + +
+
+ A password reset was requested for the Odoo account linked to this email. + You may change your password by following this link which will remain valid during 15 minutes: +
+ + If you do not expect this, you can safely ignore this email.

+ Thanks, + % if user.signature: +
+ ${user.signature | safe} + % endif +
+
+
+ + + +
+ ${object.company_id.name} +
+ ${object.company_id.phone} + % if object.company_id.email + | ${object.company_id.email} + % endif + % if object.company_id.website + | + ${object.company_id.website} + + % endif +
+
+
+
+ ${object.lang} + +
+ +
+
diff --git a/pms_api_rest/services/pms_user_service.py b/pms_api_rest/services/pms_user_service.py index 3640e0484..23cdcf5bf 100644 --- a/pms_api_rest/services/pms_user_service.py +++ b/pms_api_rest/services/pms_user_service.py @@ -166,7 +166,7 @@ class PmsRoomTypeClassService(Component): def send_mail_to_reset_password(self, input_data): user = self.env["res.users"].sudo().search([("email", "=", input_data.userEmail)]) if user: - template_id = self.env.ref("pms.pms_reset_password_email").id + template_id = self.env.ref("pms_api_rest.pms_reset_password_email").id template = self.env['mail.template'].sudo().browse(template_id) if not template: return False