diff --git a/booking.fodt b/booking.fodt index 2dd61b3..8e25735 100644 Binary files a/booking.fodt and b/booking.fodt differ diff --git a/folio.py b/folio.py index 2a8a32f..dfade19 100644 --- a/folio.py +++ b/folio.py @@ -264,9 +264,11 @@ class Folio(ModelSQL, ModelView): if status in 'check_in' and config.cleaning_occupied: cleaning_type_id = config.cleaning_occupied.id room.last_check_in = datetime.now() + room.last_check_out = None elif status in 'check_out' and config.cleaning_check_out: cleaning_type_id = config.cleaning_check_out.id room.last_check_out = datetime.now() + room.last_check_in = None room.state = 'dirty' if cleaning_type_id: diff --git a/locale/es.po b/locale/es.po index a1ef8eb..0ee46f3 100644 --- a/locale/es.po +++ b/locale/es.po @@ -70,6 +70,10 @@ msgctxt "field:hotel.booking,channel_commission:" msgid "Channel Commission" msgstr "Comisión del Canal" +msgctxt "field:hotel.booking,channel_icon:" +msgid "Channel Icon" +msgstr "Icono del Canal" + msgctxt "field:hotel.booking,channel_invoice:" msgid "Channel Invoice" msgstr "Factura del Canal" @@ -82,6 +86,10 @@ msgctxt "field:hotel.booking,code:" msgid "Code" msgstr "Código" +msgctxt "field:hotel.booking,collect_amount:" +msgid "Collect Amount" +msgstr "Valor Recibido" + msgctxt "field:hotel.booking,comments:" msgid "Comments" msgstr "Comentarios" @@ -290,6 +298,10 @@ msgctxt "field:hotel.channel,agent:" msgid "Agent" msgstr "Agente" +msgctxt "field:hotel.channel,code:" +msgid "Code" +msgstr "Código / Número Interno" + msgctxt "field:hotel.channel,collection_mode:" msgid "Collection Mode" msgstr "Modo de Cobro" @@ -318,6 +330,10 @@ msgctxt "field:hotel.channel,extra_commissions:" msgid "Extra Commissions" msgstr "Comisiones Extras" +msgctxt "field:hotel.channel,invoice_to:" +msgid "Invoice To" +msgstr "Facturar a" + msgctxt "field:hotel.channel,name:" msgid "Name" msgstr "Nombre" @@ -326,6 +342,10 @@ msgctxt "field:hotel.channel,payment_method:" msgid "Payment Method" msgstr "Método de pago" +msgctxt "field:hotel.channel,payment_mode:" +msgid "Receipt - Payment Mode" +msgstr "Ingreso - Modo de Pago" + msgctxt "field:hotel.channel,price_list:" msgid "Price List" msgstr "Tarifa" @@ -402,6 +422,18 @@ msgctxt "field:hotel.configuration,cleaning_occupied:" msgid "Cleaning Occupied" msgstr "Limpieza Ocupada" +msgctxt "field:hotel.configuration,cleaning_type_deep:" +msgid "Cleaning Deep" +msgstr "Limpieza Profunda" + +msgctxt "field:hotel.configuration,cleaning_type_standard:" +msgid "Cleaning Standard" +msgstr "Limpieza Estandar" + +msgctxt "field:hotel.configuration,cleaning_type_tweak:" +msgid "Cleaning Tweak" +msgstr "Retoque" + msgctxt "field:hotel.configuration,company:" msgid "Company" msgstr "Empresa" @@ -430,6 +462,10 @@ msgctxt "field:hotel.configuration,hotel_service_sequence:" msgid "Hotel Service Sequence" msgstr "Secuencia de Servicio" +msgctxt "field:hotel.configuration,payment_term:" +msgid "Payment Term" +msgstr "Plazo de Pago" + msgctxt "field:hotel.configuration,quarantine_rooms:" msgid "Quarantine Rooms" msgstr "Cuarentena" @@ -438,6 +474,10 @@ msgctxt "field:hotel.configuration,registration_card_sequence:" msgid "Registration Card Sequence" msgstr "Secuencia de Tarjeta de Registro" +msgctxt "field:hotel.configuration,storage_by_default:" +msgid "Storage By Default" +msgstr "Almacen por Defecto" + msgctxt "field:hotel.configuration,taxes_exception_rule:" msgid "Taxes Exception Rule" msgstr "Regla de Excepción de Impuestos" @@ -830,6 +870,10 @@ msgctxt "field:hotel.housekeeping.cleaning_type,description:" msgid "Description" msgstr "Descripción" +msgctxt "field:hotel.housekeeping.cleaning_type,kind:" +msgid "Kind" +msgstr "Clase" + msgctxt "field:hotel.housekeeping.cleaning_type,name:" msgid "Name" msgstr "Nombre" @@ -878,6 +922,50 @@ msgctxt "field:hotel.location,parent:" msgid "Parent" msgstr "Padre" +msgctxt "field:hotel.maintenance,action:" +msgid "Action" +msgstr "Acción" + +msgctxt "field:hotel.maintenance,criticality:" +msgid "Criticality" +msgstr "Criticidad" + +msgctxt "field:hotel.maintenance,description:" +msgid "Description" +msgstr "Descripción" + +msgctxt "field:hotel.maintenance,end_date:" +msgid "End Maintenance" +msgstr "Fin de Matenimiento" + +msgctxt "field:hotel.maintenance,inspected_by:" +msgid "Inspected By" +msgstr "Inspeccionada Por" + +msgctxt "field:hotel.maintenance,issue:" +msgid "Issue" +msgstr "Asunto" + +msgctxt "field:hotel.maintenance,register_date:" +msgid "Date" +msgstr "Fecha" + +msgctxt "field:hotel.maintenance,room:" +msgid "Room" +msgstr "Habitación" + +msgctxt "field:hotel.maintenance,start_date:" +msgid "Start Maintenance" +msgstr "Inicio de Mantenimiento" + +msgctxt "field:hotel.maintenance,state:" +msgid "State" +msgstr "Estado" + +msgctxt "field:hotel.maintenance,total_days:" +msgid "Total Days" +msgstr "Total Días" + msgctxt "field:hotel.migration_city,code:" msgid "Code" msgstr "Código" @@ -926,6 +1014,18 @@ msgctxt "field:hotel.print_guests_list.start,date:" msgid "Date" msgstr "Fecha" +msgctxt "field:hotel.print_housekeeping.start,company:" +msgid "Company" +msgstr "Empresa" + +msgctxt "field:hotel.print_housekeeping.start,date:" +msgid "Date" +msgstr "Fecha" + +msgctxt "field:hotel.print_housekeeping.start,employee:" +msgid "Employee" +msgstr "Empleado" + msgctxt "field:hotel.print_housekeeping_service.start,company:" msgid "Company" msgstr "Empresa" @@ -967,17 +1067,37 @@ msgid "Amenities" msgstr "Comodidades" msgctxt "field:hotel.room,channel_id:" -msgid "Channel ID" +msgid "Channel Manager ID" msgstr "ID Canal" msgctxt "field:hotel.room,classification:" msgid "Classification" msgstr "Clasificación" +msgctxt "field:hotel.room,cleaning_type:" +msgid "Cleaning Type" +msgstr "Tipo de Limipeza" + msgctxt "field:hotel.room,code:" msgid "Code" msgstr "Código" +msgctxt "field:hotel.room,housekeeping:" +msgid "Employee" +msgstr "Empleado" + +msgctxt "field:hotel.room,last_check_in:" +msgid "Last Check In" +msgstr "Último Check-In" + +msgctxt "field:hotel.room,last_check_out:" +msgid "Last Check Out" +msgstr "Último Check-Out" + +msgctxt "field:hotel.room,last_clean:" +msgid "Last Clean" +msgstr "Última Limpieza" + msgctxt "field:hotel.room,location:" msgid "Location" msgstr "Ubicación" @@ -998,10 +1118,18 @@ msgctxt "field:hotel.room,name:" msgid "Name" msgstr "Nombre" +msgctxt "field:hotel.room,notes:" +msgid "Notes" +msgstr "Observaciones" + msgctxt "field:hotel.room,space:" msgid "Space" msgstr "Espacio" +msgctxt "field:hotel.room,state:" +msgid "Status" +msgstr "Estado" + msgctxt "field:hotel.room,templates:" msgid "Hotel Room - Product Accommodation" msgstr "Habitación - Acomodación" @@ -1026,6 +1154,18 @@ msgctxt "field:hotel.room.classification,name:" msgid "Name" msgstr "Nombre" +msgctxt "field:hotel.room.cleaning_type,description:" +msgid "Description" +msgstr "Descripción" + +msgctxt "field:hotel.room.cleaning_type,kind:" +msgid "Kind" +msgstr "Clase de Limpieza" + +msgctxt "field:hotel.room.cleaning_type,name:" +msgid "Name" +msgstr "Nombre del registro" + msgctxt "field:hotel.service,company:" msgid "Company" msgstr "Empresa" @@ -1347,7 +1487,7 @@ msgid "Main contact or person how request booking" msgstr "Contacto principal o persona quien solicita la reserva" msgctxt "help:hotel.booking,media:" -msgid "Media from booking coming from." +msgid "Way through which the booking arrives." msgstr "Medio por el cual se hace la reserva." msgctxt "help:hotel.booking,number:" @@ -1396,6 +1536,10 @@ msgctxt "help:hotel.housekeeping.task,frecuency:" msgid "In days" msgstr "En días" +msgctxt "help:hotel.maintenance,register_date:" +msgid "The date of register of the issue" +msgstr "Fecha de registro del problema" + msgctxt "help:hotel.room,space:" msgid "Space on m2" msgstr "Espacio en m2" @@ -1496,6 +1640,10 @@ msgctxt "model:hotel.location,name:" msgid "Hotel Location" msgstr "Locaciones de Hotel" +msgctxt "model:hotel.maintenance,name:" +msgid "Hotel Maintenance" +msgstr "Mantenimiento de la Propiedad" + msgctxt "model:hotel.migration_city,name:" msgid "Migration City" msgstr "Ciudad de Migración" @@ -1520,6 +1668,10 @@ msgctxt "model:hotel.print_guests_list.start,name:" msgid "Guests List Start" msgstr "Lista de Huespedes" +msgctxt "model:hotel.print_housekeeping.start,name:" +msgid "Print Housekeeping Service Start" +msgstr "Ama de Llaves" + msgctxt "model:hotel.print_housekeeping_service.start,name:" msgid "Print Housekeeping Service Start" msgstr "Ama de Llaves" @@ -1548,6 +1700,10 @@ msgctxt "model:hotel.room.classification,name:" msgid "Room Classification" msgstr "Clasificación de Habitación" +msgctxt "model:hotel.room.cleaning_type,name:" +msgid "Room Cleaning Type" +msgstr "Tipo de Limpieza" + msgctxt "model:hotel.service,name:" msgid "Service" msgstr "Servicio" @@ -1604,13 +1760,9 @@ msgctxt "model:ir.action,name:act_hotel_configuration_form" msgid "Hotel Configuration" msgstr "Configuración del Hotel" -msgctxt "model:ir.action,name:act_housekeeping_cleaning_type_form" -msgid "Cleaning Type" -msgstr "Tipo de Limpieza" - -msgctxt "model:ir.action,name:act_housekeeping_form" -msgid "Housekeeping" -msgstr "Ama de Llaves" +msgctxt "model:ir.action,name:act_hotel_maintenance_form" +msgid "Maintenance" +msgstr "Mantenimiento" msgctxt "model:ir.action,name:act_location_tree" msgid "Locations" @@ -1632,10 +1784,18 @@ msgctxt "model:ir.action,name:act_room_classification_form" msgid "Room Classification" msgstr "Clasificación de Habitación" +msgctxt "model:ir.action,name:act_room_cleaning_type_form" +msgid "Cleaning Type" +msgstr "Tipo de Limipeza" + msgctxt "model:ir.action,name:act_room_form" msgid "Room" msgstr "Habitación" +msgctxt "model:ir.action,name:act_room_housekeeping_form" +msgid "Housekeeping" +msgstr "Ama de Llaves" + msgctxt "model:ir.action,name:act_service_kind_tree" msgid "Service Kind" msgstr "Clase de Servicio" @@ -1684,8 +1844,8 @@ msgctxt "model:ir.action,name:report_hotel_service" msgid "Service" msgstr "Servicio" -msgctxt "model:ir.action,name:report_housekeeping_service" -msgid "Reporte de Ama de Llaves" +msgctxt "model:ir.action,name:report_housekeeping" +msgid "Housekeeping Report" msgstr "Reporte de Ama de Llaves" msgctxt "model:ir.action,name:report_invoice_income_daily" @@ -1728,8 +1888,8 @@ msgctxt "model:ir.action,name:wizard_print_guests_list" msgid "Guests List" msgstr "Lista de Huespedes" -msgctxt "model:ir.action,name:wizard_print_housekeeping_service" -msgid "HouseKeeping Service" +msgctxt "model:ir.action,name:wizard_print_housekeeping" +msgid "Housekeeping Report" msgstr "Reporte de Ama de Llaves" msgctxt "model:ir.action,name:wizard_print_invoice_income_daily" @@ -1760,11 +1920,6 @@ msgctxt "model:ir.action.act_window.domain,name:act_booking_form_domain_all" msgid "All" msgstr "Todos" -msgctxt "" -"model:ir.action.act_window.domain,name:act_booking_form_domain_check_out" -msgid "Check Out" -msgstr "Check Out" - msgctxt "" "model:ir.action.act_window.domain,name:act_booking_form_domain_confirmed" msgid "Confirmed" @@ -1809,6 +1964,26 @@ msgctxt "" msgid "Present" msgstr "Presentes" +msgctxt "" +"model:ir.action.act_window.domain,name:act_hotel_maintenance_form_domain_all" +msgid "All" +msgstr "Todos" + +msgctxt "" +"model:ir.action.act_window.domain,name:act_hotel_maintenance_form_domain_confirmed" +msgid "Confirmed" +msgstr "Confirmado" + +msgctxt "" +"model:ir.action.act_window.domain,name:act_hotel_maintenance_form_domain_draft" +msgid "Draft`" +msgstr "Borrador" + +msgctxt "" +"model:ir.action.act_window.domain,name:act_hotel_maintenance_form_domain_in_progress" +msgid "In Progress" +msgstr "En progreso" + msgctxt "model:ir.action.act_window.domain,name:act_service_form_domain_all" msgid "All" msgstr "Todos" @@ -1832,7 +2007,7 @@ msgstr "Hoy" msgctxt "model:ir.message,text:msg_accommodation_not_defined" msgid "The room %s has not accommodation" -msgstr "" +msgstr "La habitación %s no tiene acomodación" msgctxt "model:ir.message,text:msg_check_time_not_configured" msgid "The check out time is not configured!" @@ -1870,6 +2045,10 @@ msgctxt "model:ir.message,text:msg_missing_confirm_booking" msgid "Missing Confirm Booking" msgstr "Falta confirmar la reserva" +msgctxt "model:ir.message,text:msg_missing_customer" +msgid "Missing party or customer to pay!" +msgstr "Falta definir el tercero o cliente que paga!" + msgctxt "model:ir.message,text:msg_missing_default_configuration" msgid "" "Missing default configuration for check-in time or check-out time or " @@ -1884,6 +2063,10 @@ msgctxt "model:ir.message,text:msg_missing_party_holder" msgid "Missing party holder!" msgstr "Falta el cliente / titular!" +msgctxt "model:ir.message,text:msg_missing_payment_mode" +msgid "Missing payment mode in channel!" +msgstr "Falta definir el modo de pago en el canal!" + msgctxt "model:ir.message,text:msg_missing_select_room" msgid "Missing select room!" msgstr "Falta seleccionar la habitación!" @@ -2008,9 +2191,9 @@ msgctxt "model:ir.ui.menu,name:menu_hotel_configuration" msgid "Configuration" msgstr "Configuración" -msgctxt "model:ir.ui.menu,name:menu_hotel_housekeeping_cleaning_type" -msgid "Cleaning Type" -msgstr "Tipo de Limpieza" +msgctxt "model:ir.ui.menu,name:menu_hotel_maintenance" +msgid "Maintenance" +msgstr "Mantenimiento" msgctxt "model:ir.ui.menu,name:menu_hotel_manager" msgid "Manager Report" @@ -2028,6 +2211,10 @@ msgctxt "model:ir.ui.menu,name:menu_hotel_room_classification" msgid "Room Classification" msgstr "Clasificación de Habitación" +msgctxt "model:ir.ui.menu,name:menu_hotel_room_cleaning_type" +msgid "Cleaning Type" +msgstr "Tipo de Limipeza" + msgctxt "model:ir.ui.menu,name:menu_hotel_service" msgid "Service" msgstr "Servicios" @@ -2044,9 +2231,9 @@ msgctxt "model:ir.ui.menu,name:menu_housekeeping_form" msgid "Housekeeping" msgstr "Ama de Llaves" -msgctxt "model:ir.ui.menu,name:menu_housekeeping_service" -msgid "HouseKeeping Service" -msgstr "Servicio de Ama de Llaves" +msgctxt "model:ir.ui.menu,name:menu_housekeeping_report" +msgid "Housekeeping Report" +msgstr "Reporte de Ama de Llaves" msgctxt "model:ir.ui.menu,name:menu_invoice_income_daily" msgid "Invoice Income Daily Report" @@ -5994,6 +6181,18 @@ msgctxt "selection:hotel.booking,type_complementary:" msgid "In House" msgstr "En Casa" +msgctxt "selection:hotel.channel,code:" +msgid "Booking" +msgstr "Reserva" + +msgctxt "selection:hotel.channel,code:" +msgid "Despegar" +msgstr "" + +msgctxt "selection:hotel.channel,code:" +msgid "Expedia" +msgstr "" + msgctxt "selection:hotel.channel,collection_mode:" msgid "After-Sale" msgstr "Post-Venta" @@ -6002,6 +6201,14 @@ msgctxt "selection:hotel.channel,collection_mode:" msgid "Anticipated" msgstr "Anticipado" +msgctxt "selection:hotel.channel,invoice_to:" +msgid "Channel" +msgstr "Canal" + +msgctxt "selection:hotel.channel,invoice_to:" +msgid "Customer" +msgstr "Cliente / Titular" + msgctxt "selection:hotel.channel,payment_method:" msgid "At Destination" msgstr "En Destino" @@ -6190,6 +6397,82 @@ msgctxt "selection:hotel.housekeeping,state:" msgid "Maintenance" msgstr "Mantenimiento" +msgctxt "selection:hotel.housekeeping.cleaning_type,kind:" +msgid "Deep" +msgstr "Profunda" + +msgctxt "selection:hotel.housekeeping.cleaning_type,kind:" +msgid "Standard" +msgstr "Estándar" + +msgctxt "selection:hotel.housekeeping.cleaning_type,kind:" +msgid "Tweak" +msgstr "Retoque" + +msgctxt "selection:hotel.maintenance,criticality:" +msgid "Important" +msgstr "Importante" + +msgctxt "selection:hotel.maintenance,criticality:" +msgid "Low" +msgstr "Baja" + +msgctxt "selection:hotel.maintenance,criticality:" +msgid "Urgent" +msgstr "Urgente" + +msgctxt "selection:hotel.maintenance,state:" +msgid "Canceled" +msgstr "Cancelado" + +msgctxt "selection:hotel.maintenance,state:" +msgid "Confirmed" +msgstr "Confirmado" + +msgctxt "selection:hotel.maintenance,state:" +msgid "Draft" +msgstr "Borrador" + +msgctxt "selection:hotel.maintenance,state:" +msgid "Finished" +msgstr "Terminado" + +msgctxt "selection:hotel.maintenance,state:" +msgid "In progress" +msgstr "En Progreso" + +msgctxt "selection:hotel.maintenance,state:" +msgid "in_progress" +msgstr "" + +msgctxt "selection:hotel.room,state:" +msgid "Clean" +msgstr "Limpiar" + +msgctxt "selection:hotel.room,state:" +msgid "Dirty" +msgstr "Sucia" + +msgctxt "selection:hotel.room,state:" +msgid "Inspected" +msgstr "Inspecionada" + +msgctxt "selection:hotel.room,state:" +msgid "Maintenance" +msgstr "Mantenimiento" + +msgctxt "selection:hotel.room.cleaning_type,kind:" +msgid "Deep" +msgstr "Profunda" + +msgctxt "selection:hotel.room.cleaning_type,kind:" +msgid "Standard" +msgstr "Estándar" + +msgctxt "selection:hotel.room.cleaning_type,kind:" +msgid "Tweak" +msgstr "Retoque" + msgctxt "selection:hotel.service,state:" msgid "Checked" msgstr "Revisado" @@ -6614,6 +6897,14 @@ msgctxt "wizard_button:hotel.print_guests_list,start,print_:" msgid "Open" msgstr "Abrir" +msgctxt "wizard_button:hotel.print_housekeeping,start,end:" +msgid "Cancel" +msgstr "Cancelar" + +msgctxt "wizard_button:hotel.print_housekeeping,start,print_:" +msgid "Open" +msgstr "Abrir" + msgctxt "wizard_button:hotel.print_housekeeping_service,start,end:" msgid "Cancel" msgstr "Cancelar" diff --git a/room.py b/room.py index c6b5dac..e21c5b7 100644 --- a/room.py +++ b/room.py @@ -1,6 +1,6 @@ #This file is part of Presik. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from datetime import datetime +from datetime import datetime, date, timedelta from trytond.model import ModelView, ModelSQL, Workflow, fields from trytond.pyson import Eval @@ -57,8 +57,9 @@ class Room(Workflow, ModelSQL, ModelView): ('maintenance', 'Maintenance'), ], 'Status', required=True, readonly=True) state_string = state.translated('state') - cleaning_type = fields.Many2One('hotel.room.cleaning_type', - 'Cleaning Type', required=False) + cleaning_type = fields.Function(fields.Many2One( + 'hotel.room.cleaning_type', 'Cleaning Type', required=False), + 'get_cleaning_type') last_check_in = fields.DateTime('Last Check In') last_check_out = fields.DateTime('Last Check Out') last_clean = fields.DateTime('Last Clean') @@ -109,6 +110,7 @@ class Room(Workflow, ModelSQL, ModelView): @Workflow.transition('clean') def clean(cls, records): for rec in records: + rec.last_clean = datetime.now() rec.cleaning_type = None rec.save() @@ -133,6 +135,33 @@ class Room(Workflow, ModelSQL, ModelView): def inspected(cls, records): pass + def get_cleaning_type(self, name=None): + pool = Pool() + Config = pool.get('hotel.configuration') + Folio = pool.get('hotel.folio') + config = Config.get_configuration() + today = date.today() + yesterday = today - timedelta(days=-1) + read = Folio.search_read + folios = read([ + ('room', '=', self.id), + ('departure_date', '=', today) + ], fields_names=['registration_state'], + ) + if folios: + return config.cleaning_check_out.id + else: + folios = read([ + ('room', '=', self.id), + ('departure_date', '>', today), + ('arrival_date', '<', today), + ], fields_names=['registration_state'], + ) + if folios: + return config.cleaning_occupied.id + else: + return config.cleaning_check_in.id + class RoomAmenities(ModelSQL): 'Room - Amenities'