This commit is contained in:
oscar alvarez 2022-08-22 15:54:41 -05:00
parent d665ea4c51
commit 6cd016f9dd
6 changed files with 100 additions and 3 deletions

View file

@ -1055,10 +1055,12 @@ class Booking(Workflow, ModelSQL, ModelView):
config = pool.get('hotel.configuration')(1)
Template = pool.get('email.template')
email = self.party.email
template = config.booking_email_template
template.subject = f'{template.subject} No. {self.number}'
if email:
Template.send(config.booking_email_template, self, email)
Template.send(template, self, email)
else:
raise UserError(gettext('El cliente no tiene un correo asociado'))
raise UserError(gettext('hotel.msg_missing_party_email'))
@fields.depends('price_list', 'breakfast_included')
def on_change_price_list(self):

View file

@ -12,3 +12,4 @@ class Company(metaclass=PoolMeta):
rnt_code = fields.Char('Registro Nacional de Turismo')
matricula_mercantil = fields.Char('Matricula Mercantil')
national_tourism_registry = fields.Char('National Tourism Registry')
logo_link = fields.Char('Logo Link')

89
data/template_email.html Normal file
View file

@ -0,0 +1,89 @@
<html>
<head>
<style>
body {
font-family: Helvetica, sans-serif;
padding-right: 30px;
padding-left: 30px;
}
p {
margin-top: 5px;
margin-bottom: 5px;
}
</style>
</head>
<body>
<div style="text-align: center; background-color: #eae6e4ff;">
<img width="300" alt="image_logo" src="{{record.company.logo_link}}" />
</div>
<br />
<p>Estimado cliente</p>
<p><b>{{record.party.rec_name}}</b></p>
<br />
<p>¡Bienvenido al {{record.company.party.commercial_name}}!</p>
Le damos una calurosa bienvenida a nuestra hermosa ciudad. A continuación
encontrará la información relacionada con su reserva.<br />
<br />
<table class="default">
{% for line in record.lines %}
<tr>
<td>Número de Reserva / Booking:</td>
<td><b>{{record.number}}</b></td>
</tr>
<tr>
<td>Acomodación / Accommodation:</td>
<td><b>{{line.product.rec_name}}</b></td>
</tr>
<tr>
<td>Canal / Channel:</td>
<td><b>{{record.channel and record.channel.name}}</b></td>
</tr>
<tr>
<td>Fecha de llegada / Arrival date:</td>
<td><b>{{line.arrival_date}}</b></td>
</tr>
<tr>
<td>Fecha de salida / Departure date:</td>
<td><b>{{line.departure_date}}</b></td>
</tr>
<tr>
<td>Número de personas / Hosts quantity:</td>
<td><b>{{line.host_quantity}}</b></td>
</tr>
{% endfor %}
</table>
<br />
<p><b>Información Relevante / Relevant Information</b></p>
<p>
{{record.company.party.commercial_name}} tiene aprobados los protocolos de
bioseguridad por la autoridad local.
</p>
<br />
<p>Atentamente / Best regards</p>
<p>
<b>Servicio al Cliente, {{record.company.party.commercial_name}}</b>
</p>
<p />
<p>{{record.company.party.addresses[0].street}}</p>
<p>{{record.company.party.city_name}}</p>
<p>Teléfono {{record.company.party.phone}}</p>
<p>Cel. {{record.company.party.mobile}}</p>
<p>
<a href="{{record.company.party.website}}">
{{record.company.party.website}}
</a>
</p>
<div style="margin-top: 30px; margin-bottom: 10px;">
<img
alt="Software for hotels"
src="https://res.cloudinary.com/presik-com/image/upload/v1661200297/banner_emails_jumq4s.png"
/>
</div>
<p style="text-align: center;">
<a href="https://www.presik.com" style="color: #554400ff;">
Powered by presik.com
</a>
</p>
</body>
</html>

View file

@ -84,5 +84,8 @@ this repository contains the full copyright notices and license terms. -->
<record model="ir.message" id="msg_missing_payment_mode">
<field name="text">Missing payment mode in channel!</field>
</record>
<record model="ir.message" id="msg_missing_party_email">
<field name="text">Missing party email!</field>
</record>
</data>
</tryton>

View file

@ -1,5 +1,5 @@
[tryton]
version=6.0.27
version=6.0.28
depends:
party
company

View file

@ -14,6 +14,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="national_tourism_registry"/>
<label name="property_code"/>
<field name="property_code"/>
<label name="logo_link"/>
<field name="logo_link" widget="url"/>
</page>
</xpath>
</data>