From 38ce8debb624b657f02dda5e85e632feb18c44cf Mon Sep 17 00:00:00 2001 From: braisab Date: Wed, 1 Sep 2021 22:22:16 +0200 Subject: [PATCH] [IMP]:change mail_information and privacy_policy fields from Text to Html type and added default property email templates --- pms/models/pms_property.py | 35 +++++++++++++++++++++++++++++--- pms/views/pms_property_views.xml | 14 ++++++++++--- 2 files changed, 43 insertions(+), 6 deletions(-) diff --git a/pms/models/pms_property.py b/pms/models/pms_property.py index a15e283c8..2bd052bc6 100644 --- a/pms/models/pms_property.py +++ b/pms/models/pms_property.py @@ -115,12 +115,41 @@ class PmsProperty(models.Model): compute="_compute_availability", ) - mail_information = fields.Char( + mail_information = fields.Html( string="Mail Information", + help="Additional information of the mail" ) - privacy_policy = fields.Char( - string="Privacy Policy" + privacy_policy = fields.Html( + string="Privacy Policy", + help="Mail privacy policy " + ) + + property_confirmed_template = fields.Many2one( + string="Confirmation Template", + help="Confirmation email template", + comodel_name="mail.template", + default=lambda self: self.env["mail.template"] + .search([("name", "=", "Confirmed Reservation")]) + .id, + ) + + property_modified_template = fields.Many2one( + string="Modification Template", + help="Modification email template", + comodel_name="mail.template", + default=lambda self: self.env["mail.template"] + .search([("name", "=", "Modified Reservation")]) + .id, + ) + + property_canceled_template = fields.Many2one( + string="Cancellation Template", + help="Cancellation email template", + comodel_name="mail.template", + default=lambda self: self.env["mail.template"] + .search([("name", "=", "Cancelled Reservation")]) + .id, ) @api.depends_context( diff --git a/pms/views/pms_property_views.xml b/pms/views/pms_property_views.xml index f2177a632..f62b968f8 100644 --- a/pms/views/pms_property_views.xml +++ b/pms/views/pms_property_views.xml @@ -86,9 +86,17 @@ - - - + + + + + + + +