From eeb43074e740674ffb8eb9844e347f14edb93e94 Mon Sep 17 00:00:00 2001 From: Dario Lodeiros Date: Thu, 10 Jan 2019 17:59:36 +0100 Subject: [PATCH] [WIP] l10n_es --- hotel_l10n_es/__manifest__.py | 4 +- .../data/{code_ine.csv => code.ine.csv} | 0 ...egory_tourism.csv => tourism.category.csv} | 0 hotel_l10n_es/models/inherit_res_company.py | 2 +- hotel_l10n_es/report/report_parte_viajero.xml | 26 +++----- hotel_l10n_es/views/category_tourism.xml | 24 +++---- hotel_l10n_es/views/report_viajero.xml | 64 +++++++++---------- hotel_l10n_es/wizard/ine_wizard.py | 2 +- .../wizard/inherit_checkin_wizard.py | 2 +- hotel_l10n_es/wizard/police_wizard.py | 6 +- 10 files changed, 61 insertions(+), 69 deletions(-) rename hotel_l10n_es/data/{code_ine.csv => code.ine.csv} (100%) rename hotel_l10n_es/data/{category_tourism.csv => tourism.category.csv} (100%) diff --git a/hotel_l10n_es/__manifest__.py b/hotel_l10n_es/__manifest__.py index 0c15d72ea..39e66b520 100644 --- a/hotel_l10n_es/__manifest__.py +++ b/hotel_l10n_es/__manifest__.py @@ -36,8 +36,8 @@ 'partner_firstname', ], 'data': [ - 'data/code_ine.csv', - 'data/category_tourism.csv', + 'data/code.ine.csv', + 'data/tourism.category.csv', 'data/report_viajero_paperformat.xml', 'report/report_parte_viajero.xml', 'views/report_viajero.xml', diff --git a/hotel_l10n_es/data/code_ine.csv b/hotel_l10n_es/data/code.ine.csv similarity index 100% rename from hotel_l10n_es/data/code_ine.csv rename to hotel_l10n_es/data/code.ine.csv diff --git a/hotel_l10n_es/data/category_tourism.csv b/hotel_l10n_es/data/tourism.category.csv similarity index 100% rename from hotel_l10n_es/data/category_tourism.csv rename to hotel_l10n_es/data/tourism.category.csv diff --git a/hotel_l10n_es/models/inherit_res_company.py b/hotel_l10n_es/models/inherit_res_company.py index eaac5073c..66feae8ac 100644 --- a/hotel_l10n_es/models/inherit_res_company.py +++ b/hotel_l10n_es/models/inherit_res_company.py @@ -41,6 +41,6 @@ class Inherit_res_company(models.Model): police_number = fields.Char('Police number', size=10, help='Used to generate the name of the file that \ will be given to the police. 10 Caracters') - ine_category_id = fields.Many2one('category.tourism', + ine_category_id = fields.Many2one('tourism.category', help='Hotel category in the Ministry of \ Tourism. Used for INE statistics.') diff --git a/hotel_l10n_es/report/report_parte_viajero.xml b/hotel_l10n_es/report/report_parte_viajero.xml index a5cc7abf4..05d42a824 100644 --- a/hotel_l10n_es/report/report_parte_viajero.xml +++ b/hotel_l10n_es/report/report_parte_viajero.xml @@ -1,18 +1,12 @@ - - + + - - - - - - - + diff --git a/hotel_l10n_es/views/category_tourism.xml b/hotel_l10n_es/views/category_tourism.xml index 9cbe392aa..fff2798a2 100644 --- a/hotel_l10n_es/views/category_tourism.xml +++ b/hotel_l10n_es/views/category_tourism.xml @@ -2,23 +2,23 @@ - - category.tourism.view.form - category.tourism + + tourism.category.view.form + tourism.category
@@ -38,9 +38,9 @@ - - category.tourism.view.tree - category.tourism + + tourism.category.view.tree + tourism.category diff --git a/hotel_l10n_es/views/report_viajero.xml b/hotel_l10n_es/views/report_viajero.xml index a1100599d..cd1c00917 100644 --- a/hotel_l10n_es/views/report_viajero.xml +++ b/hotel_l10n_es/views/report_viajero.xml @@ -1,35 +1,33 @@ - - - + diff --git a/hotel_l10n_es/wizard/ine_wizard.py b/hotel_l10n_es/wizard/ine_wizard.py index 3db0ce061..fd8009cda 100644 --- a/hotel_l10n_es/wizard/ine_wizard.py +++ b/hotel_l10n_es/wizard/ine_wizard.py @@ -84,7 +84,7 @@ class IneWizard(models.TransientModel): ('enter_date', '<=', m_f_d_search), ('exit_date', '>=', m_e_d_search)], order="enter_date") lines = lines.sorted( - key=lambda r: str(r.partner_id.code_ine)+r.enter_date) + key=lambda r: str(r.partner_id.code_ine_id)+r.enter_date) if len(lines) > 0: diff --git a/hotel_l10n_es/wizard/inherit_checkin_wizard.py b/hotel_l10n_es/wizard/inherit_checkin_wizard.py index 0da1ecacd..438c04685 100644 --- a/hotel_l10n_es/wizard/inherit_checkin_wizard.py +++ b/hotel_l10n_es/wizard/inherit_checkin_wizard.py @@ -98,7 +98,7 @@ class CheckinWizard(models.TransientModel): birthdate_date_cardex = fields.Date("Birthdate") - code_ine_cardex = fields.Many2one('code_ine', + code_ine_cardex = fields.Many2one('code.ine', help='Country or province of origin. Used for INE statistics.') # TODO: Add tags in the cardex not in the partner anb move this field to out of localization diff --git a/hotel_l10n_es/wizard/police_wizard.py b/hotel_l10n_es/wizard/police_wizard.py index c27be2c10..a9b9462b4 100644 --- a/hotel_l10n_es/wizard/police_wizard.py +++ b/hotel_l10n_es/wizard/police_wizard.py @@ -55,7 +55,7 @@ class PoliceWizard(models.TransientModel): and (line.partner_id.firstname is not False) and (line.partner_id.lastname is not False)): - if len(line.partner_id.code_ine.code) == 5: + if len(line.partner_id.code_ine_id.code) == 5: content += "2|"+line.partner_id.document_number.upper( ) + "||" else: @@ -80,10 +80,10 @@ class PoliceWizard(models.TransientModel): content += datetime.datetime.strptime( line.partner_id.birthdate_date, "%Y-%m-%d").date().strftime("%Y%m%d") + "|" - if len(line.partner_id.code_ine.code) == 5: + if len(line.partner_id.code_ine_id.code) == 5: content += u'ESPAÑA|' else: - content += line.partner_id.code_ine.name.upper()[0:21] + content += line.partner_id.code_ine_id.name.upper()[0:21] content += "|" content += datetime.datetime.strptime( line.enter_date,