Fix reports

This commit is contained in:
Oscar 2021-07-25 20:05:54 -05:00
parent ccb3a3d492
commit d4c17f89e0
20 changed files with 17 additions and 53 deletions

View File

@ -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=[

View File

@ -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"

View File

@ -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__()

View File

@ -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

View File

@ -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):

View File

@ -126,7 +126,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">Housekeeping Service Report</field>
<field name="model"></field>
<field name="report_name">hotel.print_housekeeping_service.report</field>
<field name="report">hotel/housekeeping.ods</field>
<field name="report">hotel/housekeeping.fods</field>
</record>
<record model="ir.ui.view" id="print_housekeeping_service_start_view_form">
<field name="model">hotel.print_housekeeping_service.start</field>

View File

@ -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

View File

@ -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']

View File

@ -331,7 +331,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">Statistics by Month Report</field>
<field name="model"></field>
<field name="report_name">hotel.statistics_by_month.report</field>
<field name="report">hotel/statistics_by_month.ods</field>
<field name="report">hotel/statistics_by_month.fods</field>
<field name="template_extension">ods</field>
</record>
<record model="ir.ui.view" id="print_hotel_statistics_by_month_start_view_form">

View File

@ -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

View File

@ -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')

View File

@ -8,7 +8,7 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
<field name="name">Report Invoice Income Daily</field>
<field name="model"></field>
<field name="report_name">hotel.invoice_income_daily_report</field>
<field name="report">hotel/invoice_income_daily.ods</field>
<field name="report">hotel/invoice_income_daily.fods</field>
</record>
<record model="ir.ui.view" id="invoice_income_daily_start_view_form">
<field name="model">hotel.invoice_income_daily.start</field>

View File

@ -8,7 +8,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="name">Service</field>
<field name="model">hotel.service</field>
<field name="report_name">hotel.service</field>
<field name="report">hotel/service.ods</field>
<field name="report">hotel/service.fods</field>
</record>
<record model="ir.action.keyword" id="report_service_keyword">
<field name="keyword">form_print</field>

View File

@ -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',