diff --git a/pms_l10n_es/models/__init__.py b/pms_l10n_es/models/__init__.py index 2f6f191dd..7f0a2ff29 100644 --- a/pms_l10n_es/models/__init__.py +++ b/pms_l10n_es/models/__init__.py @@ -3,3 +3,4 @@ from . import pms_property from . import pms_log_institution_traveller_report from . import res_country_state +from . import pms_ine_tourism_category diff --git a/pms_l10n_es/models/pms_ine_tourism_category.py b/pms_l10n_es/models/pms_ine_tourism_category.py new file mode 100644 index 000000000..2680579ab --- /dev/null +++ b/pms_l10n_es/models/pms_ine_tourism_category.py @@ -0,0 +1,16 @@ +from odoo import fields, models + + +class PmsIneTourismCategory(models.Model): + _name = "pms.ine.tourism.category" + _description = "Hotel category in the Ministry of Tourism. Used for INE statistics." + + name = fields.Char("Category", required=True) + category_type = fields.Char("Category type", required=True) + + def name_get(self): + data = [] + for record in self: + display_value = record.category_type + " (" + record.name + ") " + data.append((record.id, display_value)) + return data diff --git a/pms_l10n_es/security/ir.model.access.csv b/pms_l10n_es/security/ir.model.access.csv index 36ef563cc..45ee01d1e 100644 --- a/pms_l10n_es/security/ir.model.access.csv +++ b/pms_l10n_es/security/ir.model.access.csv @@ -1,3 +1,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink user_access_traveller_report_wizard,user_access_traveller_report_wizard,model_traveller_report_wizard,pms.group_pms_user,1,1,1,1 user_access_traveller_report_logs,user_access_traveller_report_logs,model_pms_log_institution_traveller_report,pms.group_pms_user,1,1,1,1 +user_access_pms_ine_tourism_category,user_access_pms_ine_tourism_category,model_pms_ine_tourism_category,pms.group_pms_user,1,1,1,1 diff --git a/pms_l10n_es/views/pms_ine_tourism_category.xml b/pms_l10n_es/views/pms_ine_tourism_category.xml new file mode 100644 index 000000000..ff9064992 --- /dev/null +++ b/pms_l10n_es/views/pms_ine_tourism_category.xml @@ -0,0 +1,39 @@ + + + + pms.ine.tourism.category.form + pms.ine.tourism.category + +
+ + + + + + +
+
+
+ + pms.ine.tourism.category.tree + pms.ine.tourism.category + + + + + + + + + INE Categories + pms.ine.tourism.category + tree,form + + +