From d4c17f89e0c9e28752c1b1fb41b10521fd64b24b Mon Sep 17 00:00:00 2001 From: Oscar Date: Sun, 25 Jul 2021 20:05:54 -0500 Subject: [PATCH] Fix reports --- channel.py | 4 +-- city.py | 3 -- company.py | 4 --- configuration.py | 4 --- exceptions.py | 3 +- guests_list.ods => guests_list.fods | Bin housekeeping.ods => housekeeping.fods | Bin housekeeping.xml | 2 +- ...ome_daily.ods => invoice_income_daily.fods | Bin location.py | 6 +--- operation.py | 4 --- operation.xml | 2 +- policy.py | 2 +- product.py | 3 +- rooms_occupancy.ods => rooms_occupancy.fods | Bin sale.xml | 2 +- service.ods => service.fods | Bin service.xml | 2 +- setup.py | 29 +++++------------- ...s_by_month.ods => statistics_by_month.fods | Bin 20 files changed, 17 insertions(+), 53 deletions(-) rename guests_list.ods => guests_list.fods (100%) rename housekeeping.ods => housekeeping.fods (100%) rename invoice_income_daily.ods => invoice_income_daily.fods (100%) rename rooms_occupancy.ods => rooms_occupancy.fods (100%) rename service.ods => service.fods (100%) rename statistics_by_month.ods => statistics_by_month.fods (100%) diff --git a/channel.py b/channel.py index 4999f0d..d5ac943 100644 --- a/channel.py +++ b/channel.py @@ -5,8 +5,6 @@ from trytond.pyson import Eval, If from trytond.transaction import Transaction from trytond.pool import Pool -__all__ = ['SaleChannel', 'ChannelTax'] - class SaleChannel(ModelSQL, ModelView): 'Sale Channel' @@ -21,7 +19,7 @@ class SaleChannel(ModelSQL, ModelView): domain=[ ('id', If(Eval('context', {}).contains('company'), '=', '!='), Eval('context', {}).get('company', 0)), - ], select=True) + ], select=True) commission = fields.Numeric('Commission', required=True, digits=(16, 2)) debit_account = fields.Many2One('account.account', 'Debit Account', domain=[ diff --git a/city.py b/city.py index 0a69f59..a5b9efe 100644 --- a/city.py +++ b/city.py @@ -2,9 +2,6 @@ # this repository contains the full copyright notices and license terms. from trytond.model import ModelView, ModelSQL, fields -__all__ = ['MigrationCity'] - - class MigrationCity(ModelSQL, ModelView): "Migration City" __name__ = "hotel.migration_city" diff --git a/company.py b/company.py index 2a894f4..08a5d3a 100644 --- a/company.py +++ b/company.py @@ -12,7 +12,3 @@ class Company(metaclass=PoolMeta): rnt_code = fields.Char('Registro Nacional de Turismo') matricula_mercantil = fields.Char('Matricula Mercantil') national_tourism_registry = fields.Char('National Tourism Registry') - - @classmethod - def __setup__(cls): - super(Company, cls).__setup__() diff --git a/configuration.py b/configuration.py index 7c2d3e4..a8bdd82 100644 --- a/configuration.py +++ b/configuration.py @@ -64,10 +64,6 @@ class Configuration(ModelSQL, ModelView): booking_email_template = fields.Many2One('email.template', 'Booking Template Email') - @classmethod - def __setup__(cls): - super(Configuration, cls).__setup__() - @staticmethod def default_company(): return Transaction().context.get('company') or False diff --git a/exceptions.py b/exceptions.py index 20f4831..76ab392 100644 --- a/exceptions.py +++ b/exceptions.py @@ -1,8 +1,7 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from trytond.exceptions import UserError, UserWarning -# from trytond.model.exceptions import ValidationError +from trytond.exceptions import UserError class BadOperationError(UserError): diff --git a/guests_list.ods b/guests_list.fods similarity index 100% rename from guests_list.ods rename to guests_list.fods diff --git a/housekeeping.ods b/housekeeping.fods similarity index 100% rename from housekeeping.ods rename to housekeeping.fods diff --git a/housekeeping.xml b/housekeeping.xml index e87b9ab..3dfbbc6 100644 --- a/housekeeping.xml +++ b/housekeeping.xml @@ -126,7 +126,7 @@ this repository contains the full copyright notices and license terms. --> Housekeeping Service Report hotel.print_housekeeping_service.report - hotel/housekeeping.ods + hotel/housekeeping.fods hotel.print_housekeeping_service.start diff --git a/invoice_income_daily.ods b/invoice_income_daily.fods similarity index 100% rename from invoice_income_daily.ods rename to invoice_income_daily.fods diff --git a/location.py b/location.py index 3c22524..e21cbe4 100644 --- a/location.py +++ b/location.py @@ -7,13 +7,9 @@ class HotelLocation(ModelSQL, ModelView): "Hotel Location" __name__ = "hotel.location" name = fields.Char('Name', required=True, translate=True) - parent = fields.Many2One('hotel.location','Parent', select=True) + parent = fields.Many2One('hotel.location', 'Parent', select=True) childs = fields.One2Many('hotel.location', 'parent', string='Children') - @classmethod - def __setup__(cls): - super(HotelLocation, cls).__setup__() - def get_rec_name(self, name): if self.parent: return self.parent.get_rec_name(name) + ' / ' + self.name diff --git a/operation.py b/operation.py index 48bd921..2aa2518 100644 --- a/operation.py +++ b/operation.py @@ -371,10 +371,6 @@ class Operation(Workflow, ModelSQL, ModelView): raise AccessError(gettext('hotel.msg_missing_configuration_housekeeping_rooms')) Housekeeping.write(housekeepings, values) - # def get_sale(self, name=None): - # if self.sale_line: - # return self.sale_line.sale.id - @classmethod def _get_origin(cls): return ['hotel.operation.maintenance', 'hotel.booking.line'] diff --git a/operation.xml b/operation.xml index 835f74d..f537b56 100644 --- a/operation.xml +++ b/operation.xml @@ -331,7 +331,7 @@ this repository contains the full copyright notices and license terms. --> Statistics by Month Report hotel.statistics_by_month.report - hotel/statistics_by_month.ods + hotel/statistics_by_month.fods ods diff --git a/policy.py b/policy.py index e695bbf..f1a775e 100644 --- a/policy.py +++ b/policy.py @@ -1,4 +1,4 @@ -#This file is part of Presik. The COPYRIGHT file at the top level of +# 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 trytond.model import ModelView, ModelSQL, fields diff --git a/product.py b/product.py index fbc2dc0..c869436 100755 --- a/product.py +++ b/product.py @@ -13,8 +13,7 @@ KIND = [ ] -class Template: - __metaclass__ = PoolMeta +class Template(metaclass=PoolMeta): __name__ = 'product.template' kind = fields.Selection(KIND, 'Kind') channel_code = fields.Char('Channel Code') diff --git a/rooms_occupancy.ods b/rooms_occupancy.fods similarity index 100% rename from rooms_occupancy.ods rename to rooms_occupancy.fods diff --git a/sale.xml b/sale.xml index bc1b65b..9dbc645 100644 --- a/sale.xml +++ b/sale.xml @@ -8,7 +8,7 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig Report Invoice Income Daily hotel.invoice_income_daily_report - hotel/invoice_income_daily.ods + hotel/invoice_income_daily.fods hotel.invoice_income_daily.start diff --git a/service.ods b/service.fods similarity index 100% rename from service.ods rename to service.fods diff --git a/service.xml b/service.xml index 3a9de48..49e3777 100644 --- a/service.xml +++ b/service.xml @@ -8,7 +8,7 @@ this repository contains the full copyright notices and license terms. --> Service hotel.service hotel.service - hotel/service.ods + hotel/service.fods form_print diff --git a/setup.py b/setup.py index 4577da2..084cc65 100644 --- a/setup.py +++ b/setup.py @@ -27,10 +27,10 @@ def get_require_version(name): require = '%s >= %s.%s.dev0, < %s.%s' else: require = '%s >= %s.%s, < %s.%s' - require %= (name, major_version, minor_version, - major_version, minor_version + 1) + require %= (name, major_version, minor_version, major_version, minor_version + 1) return require + config = ConfigParser() config.readfp(open('tryton.cfg')) info = dict(config.items('tryton')) @@ -76,12 +76,12 @@ setup(name=name, packages=[ 'trytond.modules.%s' % MODULE, 'trytond.modules.%s.tests' % MODULE, - ], + ], package_data={ 'trytond.modules.%s' % MODULE: (info.get('xml', []) + ['tryton.cfg', 'view/*.xml', 'locale/*.po', '*.odt', '*.fodt', - '*.ods', 'icons/*.svg']), - }, + '*.ods', '*.fods', 'icons/*.svg']), + }, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Plugins', @@ -90,25 +90,12 @@ setup(name=name, 'Intended Audience :: Financial and Insurance Industry', 'Intended Audience :: Legal Industry', 'License :: OSI Approved :: GNU General Public License (GPL)', - 'Natural Language :: Bulgarian', - 'Natural Language :: Catalan', - 'Natural Language :: Chinese (Simplified)', - 'Natural Language :: Czech', - 'Natural Language :: Dutch', 'Natural Language :: English', - 'Natural Language :: French', - 'Natural Language :: German', - 'Natural Language :: Hungarian', - 'Natural Language :: Italian', - 'Natural Language :: Portuguese (Brazilian)', - 'Natural Language :: Russian', - 'Natural Language :: Slovenian', 'Natural Language :: Spanish', 'Operating System :: OS Independent', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Office/Business', diff --git a/statistics_by_month.ods b/statistics_by_month.fods similarity index 100% rename from statistics_by_month.ods rename to statistics_by_month.fods