From 4131edb896457a97912cde66d2de9695bb953413 Mon Sep 17 00:00:00 2001 From: Jose Luis Date: Wed, 13 Feb 2019 19:49:54 +0100 Subject: [PATCH] [ADD] Checkin logo in res_compay information --- hotel_l10n_es/models/inherit_res_company.py | 29 ++++++++++++------ .../src/img/{logo_alda_bn.png => logo_bn.png} | Bin hotel_l10n_es/views/inherit_res_company.xml | 2 ++ .../views/report_viajero_document.xml | 3 +- 4 files changed, 23 insertions(+), 11 deletions(-) rename hotel_l10n_es/static/src/img/{logo_alda_bn.png => logo_bn.png} (100%) diff --git a/hotel_l10n_es/models/inherit_res_company.py b/hotel_l10n_es/models/inherit_res_company.py index 66feae8ac..4e70c4b01 100644 --- a/hotel_l10n_es/models/inherit_res_company.py +++ b/hotel_l10n_es/models/inherit_res_company.py @@ -19,7 +19,16 @@ # along with this program. If not, see . # ############################################################################## -from openerp import models, fields, api +import base64 +from odoo import models, fields +from odoo import modules + + +def get_default_img(): + with open(modules.get_module_resource('hotel_l10n_es', 'static/src/img', + 'logo_bn.png'), + 'rb') as f: + return base64.b64encode(f.read()) class Inherit_res_company(models.Model): @@ -28,19 +37,21 @@ class Inherit_res_company(models.Model): property_name = fields.Char('Property name', help='Name of the Hotel/Property.') ine_tourism = fields.Char('Tourism number', - help='Registration number in the Ministry of \ + help='Registration number in the Ministry of \ Tourism. Used for INE statistics.') ine_rooms = fields.Integer('Rooms Available', default=0, - help='Used for INE statistics.') + help='Used for INE statistics.') ine_seats = fields.Integer('Beds available', default=0, - help='Used for INE statistics.') + help='Used for INE statistics.') ine_permanent_staff = fields.Integer('Permanent Staff', default=0, - help='Used for INE statistics.') + help='Used for INE statistics.') ine_eventual_staff = fields.Integer('Eventual Staff', default=0, - help='Used for INE statistics.') + help='Used for INE statistics.') 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') + help='Used to generate the name of the file that \ + will be given to the police. 10 Caracters') ine_category_id = fields.Many2one('tourism.category', - help='Hotel category in the Ministry of \ + help='Hotel category in the Ministry of \ Tourism. Used for INE statistics.') + checkin_img = fields.Binary(string="Image in checkin", + default=get_default_img()) diff --git a/hotel_l10n_es/static/src/img/logo_alda_bn.png b/hotel_l10n_es/static/src/img/logo_bn.png similarity index 100% rename from hotel_l10n_es/static/src/img/logo_alda_bn.png rename to hotel_l10n_es/static/src/img/logo_bn.png diff --git a/hotel_l10n_es/views/inherit_res_company.xml b/hotel_l10n_es/views/inherit_res_company.xml index 6c5c7f206..a44eb3729 100644 --- a/hotel_l10n_es/views/inherit_res_company.xml +++ b/hotel_l10n_es/views/inherit_res_company.xml @@ -1,6 +1,7 @@ + view.company.form res.company @@ -18,6 +19,7 @@ + diff --git a/hotel_l10n_es/views/report_viajero_document.xml b/hotel_l10n_es/views/report_viajero_document.xml index 5d3c71d2d..7cbd2e354 100644 --- a/hotel_l10n_es/views/report_viajero_document.xml +++ b/hotel_l10n_es/views/report_viajero_document.xml @@ -7,8 +7,7 @@
- +

PART OF TRAVELERS ENTRY

Document number: / ( )