From 9ee2687dacb6a34aa4a3afb8e630d7cac34f3634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo=20Lodeiros?= Date: Mon, 12 Oct 2020 19:34:04 +0200 Subject: [PATCH] [WIP] Clean Refactoring --- pms/__init__.py | 2 +- pms/__manifest__.py | 9 - pms/data/email_template_cancel.xml | 713 ----------- pms/data/email_template_exit.xml | 583 --------- pms/data/email_template_reserv.xml | 1046 ----------------- pms/data/menus.xml | 7 - pms/i18n/es.po | 1 - pms/models/pms_checkin_partner.py | 18 - pms/models/pms_folio.py | 312 +---- pms/models/pms_reservation.py | 155 +-- pms/models/pms_service.py | 1 - pms/report/pms_folio_templates.xml | 4 +- pms/views/pms_folio_views.xml | 98 +- pms/views/pms_reservation_views.xml | 160 +-- pms/views/pms_service_views.xml | 1 - pms/wizard/__init__.py | 8 - pms/wizard/folio_make_invoice_advance.py | 651 ---------- .../folio_make_invoice_advance_views.xml | 163 --- pms/wizard/massive_changes.py | 308 ----- pms/wizard/massive_changes.xml | 123 -- pms/wizard/massive_price_reservation_days.py | 39 - pms/wizard/massive_price_reservation_days.xml | 48 - pms/wizard/service_on_day.py | 44 - pms/wizard/service_on_day.xml | 29 - pms/wizard/split_reservation.py | 22 - pms/wizard/split_reservation.xml | 28 - pms/wizard/wizard_reservation.py | 687 ----------- pms/wizard/wizard_reservation.xml | 177 --- 28 files changed, 32 insertions(+), 5405 deletions(-) delete mode 100644 pms/data/email_template_cancel.xml delete mode 100644 pms/data/email_template_exit.xml delete mode 100644 pms/data/email_template_reserv.xml delete mode 100644 pms/wizard/__init__.py delete mode 100644 pms/wizard/folio_make_invoice_advance.py delete mode 100644 pms/wizard/folio_make_invoice_advance_views.xml delete mode 100644 pms/wizard/massive_changes.py delete mode 100644 pms/wizard/massive_changes.xml delete mode 100644 pms/wizard/massive_price_reservation_days.py delete mode 100644 pms/wizard/massive_price_reservation_days.xml delete mode 100644 pms/wizard/service_on_day.py delete mode 100644 pms/wizard/service_on_day.xml delete mode 100644 pms/wizard/split_reservation.py delete mode 100644 pms/wizard/split_reservation.xml delete mode 100644 pms/wizard/wizard_reservation.py delete mode 100644 pms/wizard/wizard_reservation.xml diff --git a/pms/__init__.py b/pms/__init__.py index 4d7a49b5e..773da928d 100644 --- a/pms/__init__.py +++ b/pms/__init__.py @@ -1,4 +1,4 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models -from . import wizard +#from . import wizard diff --git a/pms/__manifest__.py b/pms/__manifest__.py index 4eb5c41ca..83c35a8ce 100644 --- a/pms/__manifest__.py +++ b/pms/__manifest__.py @@ -31,17 +31,9 @@ "data/cron_jobs.xml", "data/pms_data.xml", "data/pms_sequence.xml", - "data/email_template_cancel.xml", - "data/email_template_reserv.xml", - "data/email_template_exit.xml", "report/pms_folio.xml", "report/pms_folio_templates.xml", "templates/pms_email_template.xml", - "wizard/massive_changes.xml", - "wizard/massive_price_reservation_days.xml", - "wizard/service_on_day.xml", - "wizard/split_reservation.xml", - "wizard/wizard_reservation.xml", "views/general.xml", "data/menus.xml", "views/pms_amenity_views.xml", @@ -70,7 +62,6 @@ "views/product_pricelist_views.xml", "views/product_template_views.xml", "views/webclient_templates.xml", - "wizard/folio_make_invoice_advance_views.xml", ], "demo": ["demo/pms_master_data.xml", "demo/pms_reservation.xml"], "qweb": ["static/src/xml/pms_base_templates.xml",], diff --git a/pms/data/email_template_cancel.xml b/pms/data/email_template_cancel.xml deleted file mode 100644 index 741fbc9b3..000000000 --- a/pms/data/email_template_cancel.xml +++ /dev/null @@ -1,713 +0,0 @@ - - - - - - - Cancel Reservation-Send by Email - Cancelación de su reserva en ${object.company_id.property_name} - ${(object.partner_id.id or '')} - - - - - /*Global Styles*/ - .global { - margin: 0; - padding: 0; - min-width: 100% !important; - } - a { - color: #5e96ea; - text-decoration: none; - font-weight: bold; - } - img { - height: auto; - } - .content { - border: 1px solid #eeeeee; - } - .logo { - font-family: sans-serif; - font-size: 36px; - font-weight: bold; - color: #ffffff; - } - .link a { - font-family: sans-serif; - font-size: 12px; - color: #ffffff; - } - .subheading { - font-size: 14px; - color: #cccccc; - font-family: sans-serif; - font-weight: bold; - padding: 0 0 0 0; - text-transform: uppercase; - letter-spacing: 1px; - } - .h1 { - font-family: sans-serif; - font-size: 48px; - font-weight: bold; - line-height: 56px; - color: #ffffff; - padding: 0 0 0 0; - } - .h2 { - font-family: sans-serif; - font-size: 18px; - font-weight: bold; - color: #444444; - padding: 0 0 0 0; - text-transform: uppercase; - letter-spacing: 0.5px; - } - .h3 { - font-family: sans-serif; - font-size: 24px; - font-weight: regular; - color: #555555; - padding: 0 0 0 0; - } - .h4 { - font-family: sans-serif; - font-size: 18px; - font-weight: bold; - color: #666666; - padding: 0 0 0 0; - } - .paragraph { - font-family: sans-serif; - font-size: 14px; - line-height: 22px; - color: #666666; - font-weight: 200; - padding: 20px 0 0 0; - } - .listitem { - font-family: sans-serif; - font-size: 15px; - color: #666666; - font-weight: 200; - padding: 0 0 20px 0; - } - .smalltext { - font-family: sans-serif; - font-size: 14px; - color: #cccccc; - padding: 3px 0 0 0; - } - .borderbottom { - border-bottom: 1px solid #f2eeed; - } - /*Media Queries*/ - @media only screen and (max-width: 651px) { - .columns { - width: 100% !important; - } - .columncontainer { - display: block !important; - width: 100% !important; - } - .paragraph, - .listitem { - font-size: 18px; - } - .link { - float: left; - } - } - @media only screen and (min-width: 651px) { - .content { - width: 650px !important; - } - } - -
- - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
- Alda Hotels - - - - - - -
- - - - - - -
- - - - - - - -
-
-
- - - - - - - - - - - - - - - -
Tu reserva se ha cancelado en ${object.company_id.property_name}
- - - - - - -
- -
-
Hola ${object.partner_id.firstname}
- Tu reserva en ${object.company_id.property_name} se ha anulado correctamente. No es necesario que hagas nada más. - Si la cancelación conlleva la devolución de alguna cantidad, nos pondremos en contacto contigo. - En caso de que tengas alguna duda, estaremos encantados de atenderte. -
- - - - - - -
- -
Contactar -
-
-
-
-
- - - - - - - -
- - - - - - -
- Cancelación -
-
- - - - - - -
- - - - - - - - - - - - - - -
Datos de tu reserva cancelada
- ${object.partner_id.name} -
- % if object.partner_id.contact_address: - ${object.partner_id.contact_address}
- % endif -
- % for rline in object.get_grouped_reservations_json('cancelled'): - - ${rline['num']} x ${rline['room_type']['name']} - % if rline['childrens'] == 0: - (${rline['adults']} Adultos) - % else: - (${rline['adults']} Adultos + ${rline['childrens']} Niños) - % endif -
-
-
- Entrada: ${format_tz(rline['checkin']+ ' 00:00:00', format="%d de %B de %Y")}
- Salida: ${format_tz(rline['checkout']+ ' 00:00:00', format="%d de %B de %Y")}
- Nº de noches: ${rline['nights']}

- % endfor -
-
-
-
- - - - - - - -
- - - - - - -
- Pago -
-
- - - - - - -
- - - - - - - - - - - - - - -
IMPORTES
- Noches: ${len(object.reservation_ids[0].reservation_lines)}
- Base imponible: ${object.amount_untaxed} €
- I.V.A (10%): ${object.amount_tax} €
- Precio total: ${object.amount_total} €
- Coste de cancelación: [[importe]]
-
-
-
-
-
-
- - - - - - - - - -
- - - - - - -
- - - - - -
-
-
- - - - - -
-
-
- - - - - - -
- - - - - - - - - - - -
NUESTRAS REDES SOCIALES
-
-
- - - - - - - - -
- - - - - - -
- - - - - - - - - - - - - - - - - - -
- - Facebook - -
Facebook
- - - - - - -
-
-
Toda la actualidad de nuestros alojamientos, así como ofertas y promociones.
- - - - - - -
- - -
Dale - a Me gusta
-
- -
-
-
-
- - - - - - -
- - - - - - - - - - - - - - - - - - -
- - Instagram - -
Instagram
- - - - - - -
-
-
Cada detalle cuenta, y es por eso que tratamos de reflejarlo en nuestras fotos.
- - - - - - -
- - -
#Entra -
-
- -
-
-
-
- - - - - - -
- - - - - - - - - - - - - - - - - - -
- - Twitter - -
Twitter
- - - - - - -
-
-
Propuestas al minuto para hacer de tu viaje una experiencia inmejorable.
- - - - - - -
- - -
Síguenos -
-
- -
-
-
-
-
- - - - - - - - -
¡Esperamos verte - pronto!
-
- - - - - -
- Alda Hotels - - - - - -
-
- -
-
- ]]> -
-
-
-
diff --git a/pms/data/email_template_exit.xml b/pms/data/email_template_exit.xml deleted file mode 100644 index 4aeec1d78..000000000 --- a/pms/data/email_template_exit.xml +++ /dev/null @@ -1,583 +0,0 @@ - - - - - - - Exit Reservation-Send by Email - Gracias por alojarse con nosotros en ${object.company_id.property_name} - ${(object.partner_id.id or '')} - - - /*Global Styles*/ - .marco {bgcolor:#f6f6f6; margin: 0; padding: 0; min-width: 100%!important;} - a { color: #5e96ea; text-decoration: none; font-weight: bold;} - img {height: auto;} - .content { border: 1px solid #eeeeee; } - .logo {font-family: sans-serif; font-size: 36px; font-weight: bold; color: #ffffff;} - .link a {font-family: sans-serif; font-size: 12px; color: #ffffff;} - .subheading {font-size: 14px; color: #cccccc; font-family: sans-serif; font-weight: bold; padding: 0 0 0 0; text-transform: uppercase; letter-spacing: 1px;} - .h1 {font-family: sans-serif; font-size: 48px; font-weight: bold; line-height: 56px; color: #ffffff; padding: 0 0 0 0;} - .h2 {font-family: sans-serif; font-size: 18px; font-weight: bold; color: #444444; padding: 0 0 0 0; text-transform: uppercase; letter-spacing: 0.5px;} - .h3 {font-family: sans-serif; font-size: 24px; font-weight: regular; color: #555555; padding: 0 0 0 0;} - .h4 {font-family: sans-serif; font-size: 18px; font-weight: bold; color: #666666; padding: 0 0 0 0;} - .paragraph {font-family: sans-serif; font-size: 14px; line-height: 22px; color: #666666; font-weight: 200; padding: 20px 0 0 0;} - .listitem {font-family: sans-serif; font-size: 15px; color: #666666; font-weight: 200; padding: 0 0 20px 0;} - .smalltext { font-family: sans-serif; font-size: 14px; color: #cccccc; padding: 3px 0 0 0; } - .borderbottom {border-bottom: 1px solid #f2eeed;} - /*Media Queries*/ - @media only screen and (max-width: 651px){ - .columns{width:100% !important;} - .columncontainer{display:block !important; width:100% !important;} - .paragraph, .listitem {font-size: 18px;} - .link { float: left;} - } - @media only screen and (min-width: 651px) { - .content {width: 650px !important;} - } - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- Alda Hotels - - - - -
- - - - -
- - - - - -
-
-
- - - - - - - - - - - - -
¡Muchas gracias por tu visita! -
-

__

-
Hola ${object.partner_id.firstname},
- Esperamos que hayas disfrutado de la ciudad, y que muy especialmente te hayas sentido a gusto en nuestro alojamiento. Todo el equipo de ${object.company_id.property_name} te agradece tu estancia en nuestro centro y te desea un feliz regreso.
- Recibe un cordial saludo y esperamos volver a verte.
-
-
- - - - -
- - - - -
- - - - - - - - - -
Disfruta de tu descuento de cliente -
-

__

-
- - - - - - -
Solo por ser cliente de Alda Hotels disfruta, automáticamente, de hasta un 10% de descuento en cualquiera de nuestros establecimientos, totalmente transferible y sin fecha de caducidad.
-
-
- Descuento 10% - - - -
-
-
- - - - -
- - - - -
- - - - - - - - - -
¿Tienes algo que comentarnos? -
-

__

-
- - - - - - - -
Cada día intentamos dar un mejor servicio, es por ello que si quieres aportar alguna propuesta o crítica constructiva, te invitamos a utilizar el siguiente formulario. Estamos encantados de recibir tus propuestas. Todas serán leídas y tenidas en cuenta, y atenderemos aquellas que nos permitan nuestros medios y posibilidades.
-
- - -
Entrar al formulario ▶ -
-
- -
- - - - - -
-
-
-
- - - - - -
- - - - -
- Localización -
-
- - - - -
- - - - - - - - - - -
nuestros alojamientos
Descubre dónde estamos -
Estamos presentes a lo largo del territorio peninsular. Si quieres saber dónde puedes alojarte con nosotros, pincha en el mapa.
-
-
- Mapa - - - - - - - -
-
- - - -
- - - -
-
-
- - - - - - - - - -
- - - - -
- - - -
-
-
- - - -
-
- - - -
-
- - - - -
- - - -
-
-
-
- - - - -
- - - - - - - - - -
NUESTRAS REDES SOCIALES -   -
-
-
- - - - - - -
- - - - -
- - - - - - - - - - - - - - - - -
Facebook -
Facebook
- - - - -
  -
-
Toda la actualidad de nuestros alojamientos, así como ofertas y promociones.
- - - - -
- - - -
Dale a Me gusta
-
- -
-
-
-
- - - - -
- - - - - - - - - - - - - - - - -
Instagram -
Instagram
- - - - -
  -
-
Cada detalle cuenta, y es por eso que tratamos de reflejarlo en nuestras fotos. -
- - - - -
- - -
#Entra -
-
- -
-
-
-
- - - - -
- - - - - - - - - - - - - - - - -
Twitter -
Twitter -
- - - - -
  -
-
Propuestas al minuto para hacer de tu viaje una experiencia inmejorable. -
- - - - -
- - -
Síguenos -
-
- -
-
-
-
-
- - - - - - -
¡Muchas gracias por alojarte con nosotros! -
-
- - - -
- Alda Hotels - - - -
-
- -
-
]]>
-
-
-
diff --git a/pms/data/email_template_reserv.xml b/pms/data/email_template_reserv.xml deleted file mode 100644 index ae155002a..000000000 --- a/pms/data/email_template_reserv.xml +++ /dev/null @@ -1,1046 +0,0 @@ - - - - - - - Confirm Reservation-Send by Email - Confirmación de los detalles de su reserva en ${object.company_id.property_name} - ${(object.partner_id.id or '')} - - - - /*Global Styles*/ - .marco { - bgcolor: #f6f6f6; - margin: 0; - padding: 0; - min-width: 100% !important; - } - - a { - color: #5e96ea; - text-decoration: none; - font-weight: bold; - } - - img { - height: auto; - } - - .content { - border: 1px solid #eeeeee; - } - - .logo { - font-family: sans-serif; - font-size: 36px; - font-weight: bold; - color: #ffffff; - } - - .link a { - font-family: sans-serif; - font-size: 12px; - color: #ffffff; - } - - .subheading { - font-size: 14px; - color: #cccccc; - font-family: sans-serif; - font-weight: bold; - padding: 0 0 0 0; - text-transform: uppercase; - letter-spacing: 1px; - } - - .h1 { - font-family: sans-serif; - font-size: 48px; - font-weight: bold; - line-height: 56px; - color: #ffffff; - padding: 0 0 0 0; - } - - .h2 { - font-family: sans-serif; - font-size: 18px; - font-weight: bold; - color: #444444; - padding: 0 0 0 0; - text-transform: uppercase; - letter-spacing: 0.5px; - } - - .h3 { - font-family: sans-serif; - font-size: 24px; - font-weight: regular; - color: #555555; - padding: 0 0 0 0; - } - - .h4 { - font-family: sans-serif; - font-size: 18px; - font-weight: bold; - color: #666666; - padding: 0 0 0 0; - } - - .paragraph { - font-family: sans-serif; - font-size: 14px; - line-height: 22px; - color: #666666; - font-weight: 200; - padding: 20px 0 0 0; - } - - .listitem { - font-family: sans-serif; - font-size: 15px; - color: #666666; - font-weight: 200; - padding: 0 0 20px 0; - } - - .smalltext { - font-family: sans-serif; - font-size: 14px; - color: #cccccc; - padding: 3px 0 0 0; - } - - .borderbottom { - border-bottom: 1px solid #f2eeed; - } - - /*Media Queries*/ - @media only screen and (max-width: 651px) { - .columns { - width: 100% !important; - } - - .columncontainer { - display: block !important; - width: 100% !important; - } - - .paragraph, - .listitem { - font-size: 18px; - } - - .link { - float: left; - } - } - - @media only screen and (min-width: 651px) { - .content { - width: 650px !important; - } - } - -
-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- Alda Hotels - - - - -
- - - - -
- - - - - -
-
-
- - - - - - - - - - - - - -
Confirmación de reserva - en - ${object.company_id.property_name}
-

__

-
Hola ${object.partner_id.firstname}
- Tu reserva en ${object.company_id.property_name} queda confirmada. Te esperamos el día ${object.reservation_ids[0].checkin[8:10]} del ${object.reservation_ids[0].checkin[5:7]} de - ${object.reservation_ids[0].checkin[0:4]}. Si podemos ayudarte en cualquier tipo de gestión, no dudes en hacérnoslo saber.
-
- - - - -
- -
Contactar -
-
-
-
-
- - - - - -
- - - - -
- - - - - - - - - - - - - -
¿Llegarás más - tarde de las 17:00 horas?
-

__

-
En ese caso te rogamos que te pongas en contacto con nosotros para facilitarte las instrucciones - necesarias.
-
- - - - -
- - -
Contactar -
-
- -
-
-
-
- - - - -
- - - - -
- - - - - - - -
- Servicios
- - - - - - - - - - - - - - - - - -
- Info - Información turística
- Wifi - Wi-Fi gratuito
- Restauracion - Restauración
- Parking - Parking
-
-
-
-
-
- - - - - -
- - - - -
- Alda Hotels -
-
- - - - -
- - - - - - - - - - - - -
Datos de tu - reserva
- ${object.partner_id.name} -
- % if object.partner_id.contact_address: - ${object.partner_id.contact_address}
- % endif - % if object.partner_id.phone: - Tel.: ${object.partner_id.phone}
- % endif - % if object.partner_id.mobile: - Mov.: ${object.partner_id.mobile}
- % endif -
- % for rline in object.get_grouped_reservations_json('confirm'): - - ${rline['num']} x ${rline['room_type']['name']} - % if rline['childrens'] == 0: - (${rline['adults']} Adultos) - % else: - (${rline['adults']} Adultos + ${rline['childrens']} Niños) - % endif -
-
- Entrada: ${format_tz(rline['checkin']+ ' 00:00:00', format="%d de %B de %Y")}
- Salida: ${format_tz(rline['checkout']+ ' 00:00:00', format="%d de %B de %Y")}
- Nº de noches: ${rline['nights']}

- - % endfor - -
-

Información importante

- En caso de cancelar tu reserva, podrás hacerlo de manera gratuita hasta las 23:59 horas del día anterior a tu llegada. -
Esta reserva está sujeta al pago de la primera noche antes de las 15:00 h del día de entrada. En caso que la tarjeta no sea válida, nos pondremos en contacto contigo para que nos facilites un nuevo método de pago. De no poder verificar correctamente la tarjeta, tu reserva podrá ser cancelada.
- En reservas con tarifas no reembolsables no se podrá ni cancelar ni modificar, por ello no se reembolsará el dinero. En este tipo de tarifas, se procederá a cargar el importe total de la reserva en el momento de su confirmación, en la tarjeta facilitada.
-
-
-
- - - - -
- - - - - - - - - -
Mapa
- - - - - -
- Ver mapa -
-

-
- -

- -

- - - - -
- - - - -
- - -
-
-
-
-
- - - - - -
- - - - -
- Importes -
-
- - - - -
- - - - - - - - - - - - -
IMPORTES
- Noches: ${object.get_grouped_reservations_json('confirm')|sum(attribute='nights')} -
- Base imponible: ${object.amount_untaxed} €
- I.V.A (10%): ${object.amount_tax} €
- Precio total: ${object.amount_total} €
-
-
-
-
-
- - - - - -
- - - - -
- Habitacion -
-
- - - - -
-
-
Información de la - habitación
- % set room_type_ids = object.reservation_ids.filtered('to_send').mapped('room_type_id.id') - % set room_types = user.env['pms.room.type'].browse(room_type_ids) - % for room_type in room_types: - - % if room_type.product_id.name: -
- ${room_type.product_id.name} -
- % else: -
- Habitación ${loop.index} -
- % endif -
- Esta habitación cuenta con TV, Wi-Fi gratuita, calefacción y baño privado. -
- % endfor -
-
-
-
- - - - -
- - - - -
- - - - - - - - - - - -
Información - adicional
- - -

__

- -
-
-
-
-
- - - - - -
- - - - -
- Coche -
-
- - - - -
- - - - - - - - - - - - -
Cómo acceder
- En coche -
-

-
- Pulse en este enlace, - para - conocer como llegar desde su ubicación actual -

- -

Si vienes en coche, podrás aparcar en los alrededores del hotel, aunque la zona de playa cuenta con zona azul. También disponemos de parking propio para clientes (bajo disponibilidad).

-
-
-
-
- - - - - -
- - - - -
- Bus -
-
- - - - -
- - - - - - - - - - - - -
Cómo acceder
- En autobús o tren -
Si vienes en autobús podrás venir desde A Coruña en las líneas 20, 22 y 1A, que te dejarán cerca de Ponte da Pasaxe. Desde allí, tendrás unos 15 minutos andando hasta el hotel.
-
-
-
-
- - - - - - - - - -
- - - - -
- - - - -
- - - - - - - - - - -
${object.company_id.city}
Santa Cristina es un lugar privilegiado. Playas de arena fina y blanca, paisajes impresionantes y unos alrededores dignos de conocer.
- - - - -
- - - -
-
-
-
-
- - - - -
- -
-
- - - - -
- -
-
- - - - -
- - - - -
- - - - - - - - - -
${object.company_id.property_name}
El Hotel Alda Santa Cristina se encuentra a pie de playa, por lo que disfruta de unas vistas impresionantes de la ría de O Burgo. Además, a escasos minutos en coche, podrás estar en el centro de A Coruña.
-
-
-
-
- - - - -
- - - - - - - - - -
NUESTRAS REDES SOCIALES
-
-
- - - - - - -
- - - - -
- - - - - - - - - - - - - - - - -
- - Facebook - -
- Facebook
- - - - -
- -
-
Toda la actualidad de nuestros alojamientos, así como ofertas y promociones.
- - - - -
- - -
Dale - a Me gusta
-
- -
-
-
-
- - - - -
- - - - - - - - - - - - - - - - -
- - Instagram - -
- Instagram
- - - - -
- -
-
Cada detalle cuenta, y es por eso que tratamos de reflejarlo en nuestras fotos.
- - - - -
- - -
#Entra -
-
- -
-
-
-
- - - - -
- - - - - - - - - - - - - - - - -
- - Twitter - -
- Twitter
- - - - -
- -
-
Propuestas al minuto para hacer de tu viaje una experiencia inmejorable.
- - - - -
- - -
Síguenos -
-
- -
-
-
-
-
- - - - - - -
¡Muchas gracias por - alojarte - con nosotros!
-
- - - -
- Alda Hotels - - - -
-
- -
-
-]]> - - - - diff --git a/pms/data/menus.xml b/pms/data/menus.xml index 89ce00b3c..4eb21769f 100644 --- a/pms/data/menus.xml +++ b/pms/data/menus.xml @@ -34,11 +34,4 @@ sequence="10" groups="pms.group_pms_manager" /> - diff --git a/pms/i18n/es.po b/pms/i18n/es.po index 9c289a761..0eca6fec0 100644 --- a/pms/i18n/es.po +++ b/pms/i18n/es.po @@ -7896,7 +7896,6 @@ msgstr "Precio de venta" #. module: hotel #: model:ir.model.fields,field_description:hotel.field_hotel_folio_channel_type -#: model:ir.model.fields,field_description:hotel.field_hotel_folio_team_id #: model:ir.model.fields,field_description:hotel.field_hotel_folio_wizard_channel_type #: model:ir.model.fields,field_description:hotel.field_hotel_reservation_channel_type #: model:ir.model.fields,field_description:hotel.field_hotel_service_channel_type diff --git a/pms/models/pms_checkin_partner.py b/pms/models/pms_checkin_partner.py index 354bc47e1..2eef7b194 100644 --- a/pms/models/pms_checkin_partner.py +++ b/pms/models/pms_checkin_partner.py @@ -166,24 +166,6 @@ class PmsCheckinPartner(models.Model): record.update(vals) if record.reservation_id.state == "confirm": record.reservation_id.state = "booking" - if record.reservation_id.splitted: - master_reservation = ( - record.reservation_id.parent_reservation - or record.reservation_id - ) - splitted_reservs = self.env["pms.reservation"].search( - [ - ("splitted", "=", True), - "|", - ("parent_reservation", "=", master_reservation.id), - ("id", "=", master_reservation.id), - ("folio_id", "=", record.folio_id.id), - ("id", "!=", record.id), - ("state", "=", "confirm"), - ] - ) - if splitted_reservs: - splitted_reservs.update({"state": "booking"}) return { "type": "ir.actions.do_nothing", } diff --git a/pms/models/pms_folio.py b/pms/models/pms_folio.py index 43ba5256d..0d2951f54 100644 --- a/pms/models/pms_folio.py +++ b/pms/models/pms_folio.py @@ -30,7 +30,7 @@ class PmsFolio(models.Model): @api.model def _get_default_pms_property(self): - return self.env.user.pms_property_id + return self.env.user.pms_property_id #TODO: Change by property env variable (like company) # Fields declaration name = fields.Char( @@ -128,7 +128,6 @@ class PmsFolio(models.Model): readonly=False, help="Invoice address for current group.", ) - partner_parent_id = fields.Many2one(related="partner_id.parent_id") partner_invoice_state_id = fields.Many2one(related="partner_invoice_id.state_id") partner_invoice_country_id = fields.Many2one( related="partner_invoice_id.country_id" @@ -140,14 +139,6 @@ class PmsFolio(models.Model): segmentation_ids = fields.Many2many( "res.partner.category", string="Segmentation", ondelete="restrict" ) - team_id = fields.Many2one( - "crm.team", - string="Sales Team", - ondelete="restrict", - compute="_compute_team_id", - store=True, - readonly=False, - ) client_order_ref = fields.Char(string="Customer Reference", copy=False) reservation_type = fields.Selection( [("normal", "Normal"), ("staff", "Staff"), ("out", "Out of Service")], @@ -254,28 +245,6 @@ class PmsFolio(models.Model): readonly=True, default="no", ) - partner_invoice_vat = fields.Char(related="partner_invoice_id.vat") - partner_invoice_name = fields.Char( - related="partner_invoice_id.name", string="Partner Name" - ) - partner_invoice_street = fields.Char( - related="partner_invoice_id.street", string="Street" - ) - partner_invoice_street2 = fields.Char( - related="partner_invoice_id.street", string="Street2" - ) - partner_invoice_zip = fields.Char(related="partner_invoice_id.zip") - partner_invoice_city = fields.Char(related="partner_invoice_id.city") - partner_invoice_email = fields.Char(related="partner_invoice_id.email") - partner_invoice_lang = fields.Selection(related="partner_invoice_id.lang") - # WorkFlow Mail Fields----------------------------------------------- - has_confirmed_reservations_to_send = fields.Boolean( - compute="_compute_has_confirmed_reservations_to_send" - ) - has_cancelled_reservations_to_send = fields.Boolean( - compute="_compute_has_cancelled_reservations_to_send" - ) - has_checkout_to_send = fields.Boolean(compute="_compute_has_checkout_to_send") # Generic Fields----------------------------------------------------- internal_comment = fields.Text(string="Internal Folio Notes") cancelled_reason = fields.Text("Cause of cancelled") @@ -328,14 +297,6 @@ class PmsFolio(models.Model): or False ) - @api.depends("partner_id") - def _compute_team_id(self): - for folio in self: - folio.team_id = ( - self.partner_id.team_id.id - or self.env["crm.team"]._get_default_team_id() - ) - @api.depends( "state", "reservation_ids.invoice_status", "service_ids.invoice_status" ) @@ -490,89 +451,6 @@ class PmsFolio(models.Model): } record.update(vals) - @api.depends("reservation_ids") - def _compute_has_confirmed_reservations_to_send(self): - has_to_send = False - if self.reservation_type != "out": - for rline in self.reservation_ids: - if rline.splitted: - master_reservation = rline.parent_reservation or rline - has_to_send = ( - self.env["pms.reservation"].search_count( - [ - ("splitted", "=", True), - ("folio_id", "=", self.id), - ("to_send", "=", True), - ("state", "in", ("confirm", "booking")), - "|", - ("parent_reservation", "=", master_reservation.id), - ("id", "=", master_reservation.id), - ] - ) - > 0 - ) - elif rline.to_send and rline.state in ("confirm", "booking"): - has_to_send = True - break - self.has_confirmed_reservations_to_send = has_to_send - else: - self.has_confirmed_reservations_to_send = False - - @api.depends("reservation_ids") - def _compute_has_cancelled_reservations_to_send(self): - has_to_send = False - if self.reservation_type != "out": - for rline in self.reservation_ids: - if rline.splitted: - master_reservation = rline.parent_reservation or rline - has_to_send = ( - self.env["pms.reservation"].search_count( - [ - ("splitted", "=", True), - ("folio_id", "=", self.id), - ("to_send", "=", True), - ("state", "=", "cancelled"), - "|", - ("parent_reservation", "=", master_reservation.id), - ("id", "=", master_reservation.id), - ] - ) - > 0 - ) - elif rline.to_send and rline.state == "cancelled": - has_to_send = True - break - self.has_cancelled_reservations_to_send = has_to_send - else: - self.has_cancelled_reservations_to_send = False - - @api.depends("reservation_ids") - def _compute_has_checkout_to_send(self): - has_to_send = True - if self.reservation_type != "out": - for rline in self.reservation_ids: - if rline.splitted: - master_reservation = rline.parent_reservation or rline - nreservs = self.env["pms.reservation"].search_count( - [ - ("splitted", "=", True), - ("folio_id", "=", self.id), - ("to_send", "=", True), - ("state", "=", "done"), - "|", - ("parent_reservation", "=", master_reservation.id), - ("id", "=", master_reservation.id), - ] - ) - if nreservs != len(self.reservation_ids): - has_to_send = False - elif not rline.to_send or rline.state != "done": - has_to_send = False - break - self.has_checkout_to_send = has_to_send - else: - self.has_checkout_to_send = False - # Action methods def action_pay(self): @@ -647,144 +525,6 @@ class PmsFolio(models.Model): "target": "new", } - def send_reservation_mail(self): - """ - This function opens a window to compose an email, - template message loaded by default. - @param self: object pointer - """ - # Debug Stop ------------------- - # import wdb; wdb.set_trace() - # Debug Stop ------------------- - self.ensure_one() - ir_model_data = self.env["ir.model.data"] - try: - template_id = ir_model_data.get_object_reference( - "pms", "email_template_reservation" - )[1] - except ValueError: - template_id = False - try: - compose_form_id = ir_model_data.get_object_reference( - "mail", "email_compose_message_wizard_form" - )[1] - except ValueError: - compose_form_id = False - ctx = dict() - ctx.update( - { - "default_model": "pms.folio", - "default_res_id": self._ids[0], - "default_use_template": bool(template_id), - "default_template_id": template_id, - "default_composition_mode": "comment", - "force_send": True, - "mark_so_as_sent": True, - } - ) - return { - "type": "ir.actions.act_window", - "view_type": "form", - "view_mode": "form", - "res_model": "mail.compose.message", - "views": [(compose_form_id, "form")], - "view_id": compose_form_id, - "target": "new", - "context": ctx, - "force_send": True, - } - - def send_exit_mail(self): - """ - This function opens a window to compose an email, - template message loaded by default. - @param self: object pointer - """ - # Debug Stop ------------------- - # import wdb; wdb.set_trace() - # Debug Stop ------------------- - self.ensure_one() - ir_model_data = self.env["ir.model.data"] - try: - template_id = ir_model_data.get_object_reference( - "pms", "mail_template_pms_exit" - )[1] - except ValueError: - template_id = False - try: - compose_form_id = ir_model_data.get_object_reference( - "mail", "email_compose_message_wizard_form" - )[1] - except ValueError: - compose_form_id = False - ctx = dict() - ctx.update( - { - "default_model": "pms.reservation", - "default_res_id": self._ids[0], - "default_use_template": bool(template_id), - "default_template_id": template_id, - "default_composition_mode": "comment", - "force_send": True, - "mark_so_as_sent": True, - } - ) - return { - "type": "ir.actions.act_window", - "view_type": "form", - "view_mode": "form", - "res_model": "mail.compose.message", - "views": [(compose_form_id, "form")], - "view_id": compose_form_id, - "target": "new", - "context": ctx, - "force_send": True, - } - - def send_cancel_mail(self): - """ - This function opens a window to compose an email, - template message loaded by default. - @param self: object pointer - """ - self.ensure_one() - ir_model_data = self.env["ir.model.data"] - try: - template_id = ir_model_data.get_object_reference( - "pms", "mail_template_pms_cancel" - )[1] - except ValueError: - template_id = False - try: - compose_form_id = ir_model_data.get_object_reference( - "mail", "email_compose_message_wizard_form" - )[1] - except ValueError: - compose_form_id = False - ctx = dict() - ctx.update( - { - "default_model": "pms.reservation", - "default_res_id": self._ids[0], - "default_use_template": bool(template_id), - "default_template_id": template_id, - "default_composition_mode": "comment", - "force_send": True, - "mark_so_as_sent": True, - } - ) - return { - "type": "ir.actions.act_window", - "view_type": "form", - "view_mode": "form", - "res_model": "mail.compose.message", - "views": [(compose_form_id, "form")], - "view_id": compose_form_id, - "target": "new", - "context": ctx, - "force_send": True, - } - # ORM Overrides @api.model def create(self, vals): @@ -842,7 +582,7 @@ class PmsFolio(models.Model): for record in self: if record.reservation_type == "normal" and record.reservation_ids: filtered_reservs = record.reservation_ids.filtered( - lambda x: x.state != "cancelled" and not x.parent_reservation + lambda x: x.state != "cancelled" ) mapped_checkin_partner = filtered_reservs.mapped( "checkin_partner_ids.id" @@ -853,54 +593,6 @@ class PmsFolio(models.Model): ) record.checkin_partner_pending_count = sum(mapped_checkin_partner_count) - def get_grouped_reservations_json(self, state, import_all=False): - self.ensure_one() - info_grouped = [] - for rline in self.reservation_ids: - if ( - (import_all or rline.to_send) - and not rline.parent_reservation - and rline.state == state - ): - dates = (rline.checkin, rline.checkout) - vals = { - "num": len( - self.reservation_ids.filtered( - lambda r: r.checkin == dates[0] - and r.checkout == dates[1] - and r.room_type_id.id == rline.room_type_id.id - and (r.to_send or import_all) - and not r.parent_reservation - and r.state == rline.state - ) - ), - "room_type": { - "id": rline.room_type_id.id, - "name": rline.room_type_id.name, - }, - "checkin": dates[0], - "checkout": dates[1], - "nights": len(rline.reservation_line_ids), - "adults": rline.adults, - "childrens": rline.children, - } - founded = False - for srline in info_grouped: - if ( - srline["num"] == vals["num"] - and srline["room_type"]["id"] == vals["room_type"]["id"] - and srline["checkin"] == vals["checkin"] - and srline["checkout"] == vals["checkout"] - ): - founded = True - break - if not founded: - info_grouped.append(vals) - return sorted( - sorted(info_grouped, key=lambda k: k["num"], reverse=True), - key=lambda k: k["room_type"]["id"], - ) - def _get_tax_amount_by_group(self): self.ensure_one() res = {} diff --git a/pms/models/pms_reservation.py b/pms/models/pms_reservation.py index 4b7c255dd..aed6de165 100644 --- a/pms/models/pms_reservation.py +++ b/pms/models/pms_reservation.py @@ -28,9 +28,7 @@ class PmsReservation(models.Model): if folio and folio.reservation_ids: return folio.reservation_ids[0].checkin else: - tz_property = self.env.user.pms_property_id.tz - today = fields.Date.context_today(self.with_context(tz=tz_property)) - return fields.Date.from_string(today).strftime(DEFAULT_SERVER_DATE_FORMAT) + return fields.Date.today() def _get_default_checkout(self): folio = False @@ -41,11 +39,7 @@ class PmsReservation(models.Model): if folio and folio.reservation_ids: return folio.reservation_ids[0].checkout else: - tz_property = self.env.user.pms_property_id.tz - today = fields.Date.context_today(self.with_context(tz=tz_property)) - return (fields.Date.from_string(today) + timedelta(days=1)).strftime( - DEFAULT_SERVER_DATE_FORMAT - ) + return fields.Date.today() + timedelta(1) def _get_default_arrival_hour(self): folio = False @@ -71,6 +65,17 @@ class PmsReservation(models.Model): else: return default_departure_hour + def _get_default_segmentation(self): + folio = False + segmentation_ids = False + if "folio_id" in self._context: + folio = self.env["pms.folio"].search( + [("id", "=", self._context["folio_id"])] + ) + if folio and folio.segmentation_ids: + segmentation_ids = folio.segmentation_ids + return segmentation_ids + @api.model def _default_diff_invoicing(self): """ @@ -134,11 +139,6 @@ class PmsReservation(models.Model): store=True, readonly=False, ) - partner_invoice_state_id = fields.Many2one(related="partner_invoice_id.state_id") - partner_invoice_country_id = fields.Many2one( - related="partner_invoice_id.country_id" - ) - partner_parent_id = fields.Many2one(related="partner_id.parent_id") closure_reason_id = fields.Many2one(related="folio_id.closure_reason_id") company_id = fields.Many2one( related="folio_id.company_id", string="Company", store=True, readonly=True @@ -170,8 +170,12 @@ class PmsReservation(models.Model): ) # TODO: Warning Mens to update pricelist checkin_partner_ids = fields.One2many("pms.checkin.partner", "reservation_id") - parent_reservation = fields.Many2one("pms.reservation", string="Parent Reservation") - segmentation_ids = fields.Many2many(related="folio_id.segmentation_ids") + segmentation_ids = fields.Many2many( + "res.partner.category", + string="Segmentation", + ondelete="restrict", + default=_get_default_segmentation, + ) currency_id = fields.Many2one( "res.currency", related="pricelist_id.currency_id", @@ -251,18 +255,6 @@ class PmsReservation(models.Model): default=_get_default_departure_hour, help="Default Departure Hour (HH:MM)", ) - partner_invoice_vat = fields.Char(related="partner_invoice_id.vat") - partner_invoice_name = fields.Char(related="partner_invoice_id.name") - partner_invoice_street = fields.Char( - related="partner_invoice_id.street", string="Street" - ) - partner_invoice_street2 = fields.Char( - related="partner_invoice_id.street", string="Street2" - ) - partner_invoice_zip = fields.Char(related="partner_invoice_id.zip") - partner_invoice_city = fields.Char(related="partner_invoice_id.city") - partner_invoice_email = fields.Char(related="partner_invoice_id.email") - partner_invoice_lang = fields.Selection(related="partner_invoice_id.lang") # TODO: As checkin_partner_count is a computed field, it can't not # be used in a domain filer Non-stored field # pms.reservation.checkin_partner_count cannot be searched @@ -276,11 +268,6 @@ class PmsReservation(models.Model): compute="_compute_checkin_partner_count", search="_search_checkin_partner_pending", ) - customer_sleep_here = fields.Boolean( - default=True, - string="Include customer", - help="Indicates if the customer sleeps in this room", - ) overbooking = fields.Boolean("Is Overbooking", default=False) reselling = fields.Boolean("Is Reselling", default=False) nights = fields.Integer("Nights", compute="_computed_nights", store=True) @@ -314,20 +301,6 @@ class PmsReservation(models.Model): string="Internal Folio Notes", related="folio_id.internal_comment" ) preconfirm = fields.Boolean("Auto confirm to Save", default=True) - # TODO: to_send in this module?¿ - to_send = fields.Boolean( - "To Send", default=True, compute="_compute_to_send", store=True, readonly=False, - ) - has_confirmed_reservations_to_send = fields.Boolean( - related="folio_id.has_confirmed_reservations_to_send", readonly=True - ) - has_cancelled_reservations_to_send = fields.Boolean( - related="folio_id.has_cancelled_reservations_to_send", readonly=True - ) - has_checkout_to_send = fields.Boolean( - related="folio_id.has_checkout_to_send", readonly=True - ) - to_print = fields.Boolean("Print", help="Print in Folio Report", default=True) invoice_status = fields.Selection( [ ("invoiced", "Fully Invoiced"), @@ -423,7 +396,7 @@ class PmsReservation(models.Model): @api.depends("reservation_line_ids", "reservation_line_ids.room_id") def _compute_room_id(self): - for reservation in self: + for reservation in self.filtered("reservation_line_ids"): reservation.room_id = reservation.reservation_line_ids[0].room_id @api.depends("room_id") @@ -530,6 +503,7 @@ class PmsReservation(models.Model): # TODO: Warning change de pricelist? reservation.pricelist_id = pricelist_id + #REVIEW: Dont run with set room_type_id -> room_id(compute)-> No set adults¿? @api.depends("room_id") def _compute_adults(self): for reservation in self: @@ -539,8 +513,6 @@ class PmsReservation(models.Model): elif reservation.adults == False: reservation.adults = 0 - # REVIEW: Adult not computed with room_type set - @api.depends("checkin", "checkout", "state") def _compute_to_send(self): for reservation in self: @@ -726,30 +698,6 @@ class PmsReservation(models.Model): # Action methods - def open_invoices_reservation(self): - invoices = self.folio_id.mapped("move_ids") - action = self.env.ref("account.action_move_out_invoice_type").read()[0] - if len(invoices) > 1: - action["domain"] = [("id", "in", invoices.ids)] - elif len(invoices) == 1: - action["views"] = [(self.env.ref("account.view_move_form").id, "form")] - action["res_id"] = invoices.ids[0] - else: - action = self.env.ref("pms.action_view_folio_advance_payment_inv").read()[0] - action["context"] = { - "default_reservation_id": self.id, - "default_folio_id": self.folio_id.id, - } - return action - - def create_invoice(self): - action = self.env.ref("pms.action_view_folio_advance_payment_inv").read()[0] - action["context"] = { - "default_reservation_id": self.id, - "default_folio_id": self.folio_id.id, - } - return action - def open_folio(self): action = self.env.ref("pms.open_pms_folio1_form_tree_all").read()[0] if self.folio_id: @@ -904,7 +852,6 @@ class PmsReservation(models.Model): "checkin": checkin or self.checkin, "checkout": checkout or self.checkout, "folio_id": self.folio_id.id, - "parent_reservation": self.parent_reservation.id, "state": self.state, "overbooking": self.overbooking, "reselling": self.reselling, @@ -933,23 +880,6 @@ class PmsReservation(models.Model): record.reservation_line_ids.update({"cancel_discount": 0}) if record.folio_id.state != "confirm": record.folio_id.action_confirm() - - if record.splitted: - master_reservation = record.parent_reservation or record - splitted_reservs = pms_reserv_obj.search( - [ - ("splitted", "=", True), - "|", - ("parent_reservation", "=", master_reservation.id), - ("id", "=", master_reservation.id), - ("folio_id", "=", record.folio_id.id), - ("id", "!=", record.id), - ("state", "not in", ("confirm", "booking")), - ] - ) - if master_reservation.checkin_partner_ids: - record.update({"state": "booking"}) - splitted_reservs.confirm() return True def button_done(self): @@ -971,20 +901,6 @@ class PmsReservation(models.Model): _logger.info("Modified Reservation - No Penalty") record.write({"state": "cancelled", "cancelled_reason": cancel_reason}) # record._compute_cancelled_discount() - if record.splitted: - master_reservation = record.parent_reservation or record - splitted_reservs = self.env["pms.reservation"].search( - [ - ("splitted", "=", True), - "|", - ("parent_reservation", "=", master_reservation.id), - ("id", "=", master_reservation.id), - ("folio_id", "=", record.folio_id.id), - ("id", "!=", record.id), - ("state", "!=", "cancelled"), - ] - ) - splitted_reservs.action_cancel() record.folio_id.compute_amount() def compute_cancelation_reason(self): @@ -1008,20 +924,6 @@ class PmsReservation(models.Model): for record in self: record.state = "draft" record.reservation_line_ids.update({"cancel_discount": 0}) - if record.splitted: - master_reservation = record.parent_reservation or record - splitted_reservs = self.env["pms.reservation"].search( - [ - ("splitted", "=", True), - "|", - ("parent_reservation", "=", master_reservation.id), - ("id", "=", master_reservation.id), - ("folio_id", "=", record.folio_id.id), - ("id", "!=", record.id), - ("state", "!=", "draft"), - ] - ) - splitted_reservs.draft() # INFO: This function is not in use and should include `dto` in the search @api.model @@ -1090,21 +992,6 @@ class PmsReservation(models.Model): record.checkin_partner_ids.filtered( lambda check: check.state == "booking" ).action_done() - if record.splitted: - master_reservation = record.parent_reservation or record - splitted_reservs = self.env["pms.reservation"].search( - [ - ("splitted", "=", True), - "|", - ("parent_reservation", "=", master_reservation.id), - ("id", "=", master_reservation.id), - ("folio_id", "=", record.folio_id.id), - ("id", "!=", record.id), - ("state", "not in", ("cancelled", "done")), - ] - ) - if splitted_reservs: - splitted_reservs.update({"state": "done"}) return True def action_checks(self): diff --git a/pms/models/pms_service.py b/pms/models/pms_service.py index 4cfa1309a..6a1aed1bc 100644 --- a/pms/models/pms_service.py +++ b/pms/models/pms_service.py @@ -94,7 +94,6 @@ class PmsService(models.Model): "Quantity", compute="_compute_product_qty", store=True, readonly=False, ) is_board_service = fields.Boolean() - to_print = fields.Boolean("Print", help="Print in Folio Report") # Non-stored related field to allow portal user to # see the image of the product he has ordered product_image = fields.Binary( diff --git a/pms/report/pms_folio_templates.xml b/pms/report/pms_folio_templates.xml index 228fca62d..b379c0206 100644 --- a/pms/report/pms_folio_templates.xml +++ b/pms/report/pms_folio_templates.xml @@ -90,7 +90,7 @@ - + @@ -132,7 +132,7 @@ - + diff --git a/pms/views/pms_folio_views.xml b/pms/views/pms_folio_views.xml index 60383318a..5ddc9aac7 100644 --- a/pms/views/pms_folio_views.xml +++ b/pms/views/pms_folio_views.xml @@ -1,22 +1,11 @@ - pms.folio.form pms.folio
-
- - - +
out_to_send" invisible="1" /> -->
-