diff --git a/__init__.py b/__init__.py index 725a693..ecfdaab 100644 --- a/__init__.py +++ b/__init__.py @@ -15,6 +15,7 @@ from . import product from . import sale from . import service from . import policy +from . import dash def register(): @@ -59,6 +60,8 @@ def register(): housekeeping.HotelTask, housekeeping.HousekeepingServiceStart, room.CleanningDays, + dash.DashApp, + dash.AppHotelPlanner, # folio.TransferfolioStart, # folio.TransferChargeStart, # folio.CheckOutfolioFailed, diff --git a/booking.py b/booking.py index 074e0b3..846c948 100644 --- a/booking.py +++ b/booking.py @@ -15,7 +15,7 @@ from trytond.transaction import Transaction from trytond.pool import Pool from trytond.exceptions import UserError from trytond.i18n import gettext -from constants import ( +from .constants import ( STATE_BOOKING, REGISTRATION_STATE, REASON, GUARANTEE, SATISFACTION, MEDIA, PLAN, INVOICE_METHOD, COMPLEMENTARY, ) @@ -550,6 +550,8 @@ class Booking(Workflow, ModelSQL, ModelView): }) invoice.save() invoice.update_taxes([invoice]) + for payment in self.payments: + pass @classmethod def _get_new_invoice(cls, data): diff --git a/dash.py b/dash.py new file mode 100644 index 0000000..e293f2a --- /dev/null +++ b/dash.py @@ -0,0 +1,36 @@ +# 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.pool import PoolMeta +from trytond.model import fields, ModelView, ModelSQL + + +class DashApp(metaclass=PoolMeta): + __name__ = 'dash.app' + + @classmethod + def _get_origin(cls): + origins = super(DashApp, cls)._get_origin() + origins.extend(['dash.app.hotel_planner']) + return origins + + @classmethod + def get_selection(cls): + options = super(DashApp, cls).get_selection() + options.extend([ + ('planner', 'Planner'), + ]) + return options + + +class AppHotelPlanner(ModelSQL, ModelView): + 'App Hotel Planner' + __name__ = 'dash.app.hotel_planner' + company = fields.Many2One('company.company', 'Company', required=True) + + @classmethod + def __setup__(cls): + super(AppHotelPlanner, cls).__setup__() + + @staticmethod + def default_company(): + return Transaction().context.get('company') or None diff --git a/tryton.cfg b/tryton.cfg index b2cfee6..b774706 100644 --- a/tryton.cfg +++ b/tryton.cfg @@ -1,5 +1,5 @@ [tryton] -version=6.0.7 +version=6.0.8 depends: party company @@ -10,9 +10,9 @@ depends: sale_price_list account_voucher party_personal - company_timezone email commission + dash xml: hotel.xml configuration.xml