Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions pms_l10n_es/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,91 @@ This module adds spanish localization support to property management system (PMS
.. contents::
:local:

Configuration
=============

INE occupancy surveys
~~~~~~~~~~~~~~~~~~~~~

The INE runs a monthly occupancy survey per kind of establishment. Two of
them accept an XML questionnaire and are the ones this module builds, the
hotel establishments survey (EOH) and the tourist apartments one (EOAP).
Which of the two is built comes from the INE category of the property, so
there is nothing else to choose.

On the property, under the INE settings:

#. **Tourism number**: the registration number in the tourism registry.
#. **Category**: the type and category the establishment is listed under in
the INE directory. Its survey type decides the questionnaire.
#. **Beds available excluding extra beds**: the places of the directory,
counting fixed beds only.
#. **Staff**: permanent, temporary and unpaid.
#. **Order number**: eleven characters, printed on the questionnaire. It is
fixed for the establishment, so it is kept here once filled in. The
control code is single use and is never stored.
#. **Informant**: name, job position, phone and email. Only the tourist
apartments survey carries them, where they are mandatory.

The property lists what is still missing in *INE configuration warnings*,
so the whole configuration can be completed before trying to build a file.

Rooms reported to the survey are the ones flagged *In INE*. For the tourist
apartments survey each of them also carries a typology (studio, 2-4 pax,
4-6 pax or other); left empty, it is inferred from the capacity of the room.

Provinces and countries are taken from the lists the INE publishes next to
the survey schemas, which do not always match the ones of Odoo:

* ``res.country.state`` carries the province literal of the specification,
limited to 25 characters, seeded for the 52 Spanish provinces.
* ``res.country`` carries a code of its own for the countries the INE does
not code as ISO 3166-1 alpha-3 does.

Files are built after the schema the INE publishes, which declares no
namespace. A questionnaire asking for the namespace-qualified variant
instead is served by setting the namespace in the system parameters
``pms_l10n_es.ine_xml_namespace_hotel`` or
``pms_l10n_es.ine_xml_namespace_apartments``.

Usage
=====

INE occupancy surveys
~~~~~~~~~~~~~~~~~~~~~

Go to *Reservations > Generate INE file*, pick the property and a date in
the month to report, and generate.

The questionnaire the establishment receives asks for a single week
(hotels) or fortnight (apartments), but the file always covers the whole
natural month, so the period is expanded to the month of the start date.
A file built for part of a month is rejected: the INE checks the daily
chain of every place of residence, and the first day of a partial file
never matches it.

Before handing the file over, the same content rules the INE applies after
the schema are run over it, and a file that would be rejected raises an
error naming the day and the figures behind it instead of being
downloaded.

The file is then uploaded to the IRIA portal of the INE. Note that IRIA no
longer allows editing a questionnaire once it has been uploaded.

Known issues / Roadmap
======================

* Only the hotel establishments (EOH) and tourist apartments (EOAP)
occupancy surveys accept an XML questionnaire. The rural tourism,
campings and hostels surveys have no XML channel and are answered
through the INE portal.
* The questionnaire is built here but still uploaded by hand to the IRIA
portal. The INE offers a web service to submit it, which needs no prior
registration, and it is not implemented yet.
* ``DIAS_ABIERTO_MES_REFERENCIA`` is reported as the days of the month.
A seasonal establishment open for part of it declares more days than it
opened, which dilutes its own occupancy rate.

Bug Tracker
===========

Expand Down Expand Up @@ -67,6 +152,7 @@ Contributors
* Sara Lago
* Brais Abeijon
* Miguel Padin
* David Pacheco

Maintainers
~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion pms_l10n_es/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

{
"name": "PMS Spanish Adaptation",
"version": "16.0.2.4.0",
"version": "16.0.2.5.0",
"author": "Commit [Sun], Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": True,
Expand Down
112 changes: 59 additions & 53 deletions pms_l10n_es/data/pms.ine.tourism.type.category.csv
Original file line number Diff line number Diff line change
@@ -1,53 +1,59 @@
"id","type","category"
"turism_category_1","Hoteles","H1"
"turism_category_2","Hoteles","H2"
"turism_category_3","Hoteles","H3"
"turism_category_4","Hoteles","H4"
"turism_category_5","Hoteles","H5"
"turism_category_6","Hoteles-apartamentos","AP"
"turism_category_7","Hoteles-apartamentos","HA"
"turism_category_8","Hoteles-apartamentos","HA1"
"turism_category_9","Hoteles-apartamentos","HA2"
"turism_category_10","Hoteles-apartamentos","HA3"
"turism_category_11","Hoteles-apartamentos","HA4"
"turism_category_12","Hoteles-apartamentos","HA5"
"turism_category_13","Hoteles-residencias","HR"
"turism_category_14","Hoteles-residencias","HR1"
"turism_category_15","Hoteles-residencias","HR2"
"turism_category_16","Hoteles-residencias","HR3"
"turism_category_17","Hoteles-residencias","HR4"
"turism_category_18","Hoteles-residencias","HR5"
"turism_category_19","Moteles","M1"
"turism_category_20","Moteles","M2"
"turism_category_21","Moteles","M3"
"turism_category_22","Paradores Nacionales","PN3"
"turism_category_23","Paradores Nacionales","PN4"
"turism_category_24","Paradores Nacionales","PN5"
"turism_category_25","Ciudades de vacaciones","CV1"
"turism_category_26","Ciudades de vacaciones","CV2"
"turism_category_27","Ciudades de vacaciones","CV3"
"turism_category_28","Residencias-apartamentos","RA1"
"turism_category_29","Residencias-apartamentos","RA2"
"turism_category_30","Residencias-apartamentos","RA3"
"turism_category_31","Residencias-apartamentos","RA4"
"turism_category_32","Hostales","HS"
"turism_category_33","Hostales","HS1"
"turism_category_34","Hostales","HS2"
"turism_category_35","Hostales","HS3"
"turism_category_36","Hostales","HSR"
"turism_category_37","Hostales","HSR1"
"turism_category_38","Hostales","HSR2"
"turism_category_39","Hostales","HSR3"
"turism_category_40","Hostales generales","HSE"
"turism_category_41","Casas de Huéspedes","CH"
"turism_category_42","Casas de Huéspedes","CH1"
"turism_category_43","Fondas","F1"
"turism_category_44","Fondas","F2"
"turism_category_45","Fondas","F3"
"turism_category_46","Pensiones","P"
"turism_category_47","Pensiones","P1"
"turism_category_48","Pensiones","P2"
"turism_category_49","Pensiones","P3"
"turism_category_50","Pensiones","PA"
"turism_category_51","Pensiones","PT"
"turism_category_52","Otros","Otras"
"id","type","category","survey_type"
"turism_category_1","Hoteles","H1","hotel"
"turism_category_2","Hoteles","H2","hotel"
"turism_category_3","Hoteles","H3","hotel"
"turism_category_4","Hoteles","H4","hotel"
"turism_category_5","Hoteles","H5","hotel"
"turism_category_6","Hoteles-apartamentos","AP","hotel"
"turism_category_7","Hoteles-apartamentos","HA","hotel"
"turism_category_8","Hoteles-apartamentos","HA1","hotel"
"turism_category_9","Hoteles-apartamentos","HA2","hotel"
"turism_category_10","Hoteles-apartamentos","HA3","hotel"
"turism_category_11","Hoteles-apartamentos","HA4","hotel"
"turism_category_12","Hoteles-apartamentos","HA5","hotel"
"turism_category_13","Hoteles-residencias","HR","hotel"
"turism_category_14","Hoteles-residencias","HR1","hotel"
"turism_category_15","Hoteles-residencias","HR2","hotel"
"turism_category_16","Hoteles-residencias","HR3","hotel"
"turism_category_17","Hoteles-residencias","HR4","hotel"
"turism_category_18","Hoteles-residencias","HR5","hotel"
"turism_category_19","Moteles","M1","hotel"
"turism_category_20","Moteles","M2","hotel"
"turism_category_21","Moteles","M3","hotel"
"turism_category_22","Paradores Nacionales","PN3","hotel"
"turism_category_23","Paradores Nacionales","PN4","hotel"
"turism_category_24","Paradores Nacionales","PN5","hotel"
"turism_category_25","Ciudades de vacaciones","CV1","hotel"
"turism_category_26","Ciudades de vacaciones","CV2","hotel"
"turism_category_27","Ciudades de vacaciones","CV3","hotel"
"turism_category_28","Residencias-apartamentos","RA1","hotel"
"turism_category_29","Residencias-apartamentos","RA2","hotel"
"turism_category_30","Residencias-apartamentos","RA3","hotel"
"turism_category_31","Residencias-apartamentos","RA4","hotel"
"turism_category_32","Hostales","HS","hotel"
"turism_category_33","Hostales","HS1","hotel"
"turism_category_34","Hostales","HS2","hotel"
"turism_category_35","Hostales","HS3","hotel"
"turism_category_36","Hostales","HSR","hotel"
"turism_category_37","Hostales","HSR1","hotel"
"turism_category_38","Hostales","HSR2","hotel"
"turism_category_39","Hostales","HSR3","hotel"
"turism_category_40","Hostales generales","HSE","hotel"
"turism_category_41","Casas de Huéspedes","CH","hotel"
"turism_category_42","Casas de Huéspedes","CH1","hotel"
"turism_category_43","Fondas","F1","hotel"
"turism_category_44","Fondas","F2","hotel"
"turism_category_45","Fondas","F3","hotel"
"turism_category_46","Pensiones","P","hotel"
"turism_category_47","Pensiones","P1","hotel"
"turism_category_48","Pensiones","P2","hotel"
"turism_category_49","Pensiones","P3","hotel"
"turism_category_50","Pensiones","PA","hotel"
"turism_category_51","Pensiones","PT","hotel"
"turism_category_52","Otros","Otras","hotel"
"turism_category_58","Hostales especiales","HSG","hotel"
"turism_category_53","Apartamentos turísticos","0","apartments"
"turism_category_54","Apartamentos turísticos","1","apartments"
"turism_category_55","Apartamentos turísticos","2","apartments"
"turism_category_56","Apartamentos turísticos","3","apartments"
"turism_category_57","Apartamentos turísticos","4","apartments"
106 changes: 53 additions & 53 deletions pms_l10n_es/data/res.country.state.csv
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
"id","ine_code"
base.state_es_c,"ES111"
base.state_es_vi,"ES211"
base.state_es_ab,"ES421"
base.state_es_a,"ES521"
base.state_es_al,"ES611"
base.state_es_o,"ES120"
base.state_es_av,"ES411"
base.state_es_ba,"ES431"
base.state_es_pm,"ES530"
base.state_es_b,"ES511"
base.state_es_bu,"ES412"
base.state_es_cc,"ES432"
base.state_es_ca,"ES612"
base.state_es_s,"ES130"
base.state_es_cs,"ES522"
base.state_es_ce,"ES630"
base.state_es_cr,"ES422"
base.state_es_co,"ES613"
base.state_es_cu,"ES423"
base.state_es_gi,"ES512"
base.state_es_gr,"ES614"
base.state_es_gu,"ES424"
base.state_es_ss,"ES212"
base.state_es_h,"ES615"
base.state_es_hu,"ES241"
base.state_es_j,"ES616"
base.state_es_lo,"ES230"
base.state_es_gc,"ES701"
base.state_es_le,"ES413"
base.state_es_l,"ES513"
base.state_es_lu,"ES112"
base.state_es_m,"ES300"
base.state_es_ma,"ES617"
base.state_es_ml,"ES640"
base.state_es_mu,"ES620"
base.state_es_na,"ES220"
base.state_es_or,"ES113"
base.state_es_p,"ES414"
base.state_es_po,"ES114"
base.state_es_sa,"ES415"
base.state_es_tf,"ES702"
base.state_es_sg,"ES416"
base.state_es_se,"ES618"
base.state_es_so,"ES417"
base.state_es_t,"ES514"
base.state_es_te,"ES242"
base.state_es_to,"ES425"
base.state_es_v,"ES523"
base.state_es_va,"ES418"
base.state_es_bi,"ES213"
base.state_es_za,"ES419"
base.state_es_z,"ES243"
"id","ine_code","ine_tourism_province_name"
base.state_es_c,"ES111","A CORUÑA"
base.state_es_vi,"ES211","ARABA/ALAVA"
base.state_es_ab,"ES421","ALBACETE"
base.state_es_a,"ES521","ALICANTE"
base.state_es_al,"ES611","ALMERIA"
base.state_es_o,"ES120","ASTURIAS"
base.state_es_av,"ES411","AVILA"
base.state_es_ba,"ES431","BADAJOZ"
base.state_es_pm,"ES530","BALEARES"
base.state_es_b,"ES511","BARCELONA"
base.state_es_bu,"ES412","BURGOS"
base.state_es_cc,"ES432","CACERES"
base.state_es_ca,"ES612","CADIZ"
base.state_es_s,"ES130","CANTABRIA"
base.state_es_cs,"ES522","CASTELLON"
base.state_es_ce,"ES630","CEUTA"
base.state_es_cr,"ES422","CIUDAD REAL"
base.state_es_co,"ES613","CORDOBA"
base.state_es_cu,"ES423","CUENCA"
base.state_es_gi,"ES512","GIRONA"
base.state_es_gr,"ES614","GRANADA"
base.state_es_gu,"ES424","GUADALAJARA"
base.state_es_ss,"ES212","GUIPUZKOA"
base.state_es_h,"ES615","HUELVA"
base.state_es_hu,"ES241","HUESCA"
base.state_es_j,"ES616","JAEN"
base.state_es_lo,"ES230","LA RIOJA"
base.state_es_gc,"ES701","LAS PALMAS"
base.state_es_le,"ES413","LEON"
base.state_es_l,"ES513","LLEIDA"
base.state_es_lu,"ES112","LUGO"
base.state_es_m,"ES300","MADRID"
base.state_es_ma,"ES617","MALAGA"
base.state_es_ml,"ES640","MELILLA"
base.state_es_mu,"ES620","MURCIA"
base.state_es_na,"ES220","NAVARRA"
base.state_es_or,"ES113","OURENSE"
base.state_es_p,"ES414","PALENCIA"
base.state_es_po,"ES114","PONTEVEDRA"
base.state_es_sa,"ES415","SALAMANCA"
base.state_es_tf,"ES702","TENERIFE"
base.state_es_sg,"ES416","SEGOVIA"
base.state_es_se,"ES618","SEVILLA"
base.state_es_so,"ES417","SORIA"
base.state_es_t,"ES514","TARRAGONA"
base.state_es_te,"ES242","TERUEL"
base.state_es_to,"ES425","TOLEDO"
base.state_es_v,"ES523","VALENCIA"
base.state_es_va,"ES418","VALLADOLID"
base.state_es_bi,"ES213","VIZCAKAIA"
base.state_es_za,"ES419","ZAMORA"
base.state_es_z,"ES243","ZARAGOZA"
1 change: 1 addition & 0 deletions pms_l10n_es/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from . import pms_property
from . import res_country
from . import res_country_state
from . import pms_ine_tourism_type_category
from . import pms_room
Expand Down
10 changes: 10 additions & 0 deletions pms_l10n_es/models/pms_ine_tourism_type_category.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ class PmsIneTourismCategory(models.Model):

type = fields.Char(required=True)
category = fields.Char(required=True)
survey_type = fields.Selection(
selection=[
("hotel", "Hotel Occupancy Survey (EOH)"),
("apartments", "Tourist Apartments Occupancy Survey (EOAP)"),
],
default="hotel",
required=True,
help="INE occupancy survey this category belongs to. It determines "
"the XML questionnaire format generated by the INE wizard.",
)

def name_get(self):
data = []
Expand Down
Loading
Loading