Refactory housekeeping
This commit is contained in:
parent
f51ca098f6
commit
2e6cd726be
15
__init__.py
15
__init__.py
|
@ -6,7 +6,6 @@ from . import configuration
|
||||||
from . import room
|
from . import room
|
||||||
from . import booking
|
from . import booking
|
||||||
from . import folio
|
from . import folio
|
||||||
from . import housekeeping
|
|
||||||
from . import company
|
from . import company
|
||||||
from . import city
|
from . import city
|
||||||
from . import party
|
from . import party
|
||||||
|
@ -44,8 +43,8 @@ def register():
|
||||||
booking.BookingStatementLine,
|
booking.BookingStatementLine,
|
||||||
booking.StatementPaymentForm,
|
booking.StatementPaymentForm,
|
||||||
statement.StatementLine,
|
statement.StatementLine,
|
||||||
housekeeping.Housekeeping,
|
# housekeeping.Housekeeping,
|
||||||
housekeeping.HousekeepingCleaningType,
|
# housekeeping.HousekeepingCleaningType,
|
||||||
party.Party,
|
party.Party,
|
||||||
channel.SaleChannel,
|
channel.SaleChannel,
|
||||||
channel.ChannelTax,
|
channel.ChannelTax,
|
||||||
|
@ -69,14 +68,14 @@ def register():
|
||||||
service.ServiceLine,
|
service.ServiceLine,
|
||||||
service.ServiceKind,
|
service.ServiceKind,
|
||||||
service.CreateDailyServicesStart,
|
service.CreateDailyServicesStart,
|
||||||
housekeeping.HotelHousekeepingTask,
|
|
||||||
housekeeping.HotelTask,
|
|
||||||
housekeeping.HousekeepingServiceStart,
|
|
||||||
room.CleanningDays,
|
room.CleanningDays,
|
||||||
|
room.CleaningType,
|
||||||
dash.DashApp,
|
dash.DashApp,
|
||||||
dash.AppHotelPlanner,
|
dash.AppHotelPlanner,
|
||||||
invoice.InvoiceLine,
|
invoice.InvoiceLine,
|
||||||
invoice.Invoice,
|
invoice.Invoice,
|
||||||
|
room.HotelTask,
|
||||||
|
room.HousekeepingStart,
|
||||||
# folio.TransferfolioStart,
|
# folio.TransferfolioStart,
|
||||||
# folio.TransferChargeStart,
|
# folio.TransferChargeStart,
|
||||||
# folio.CheckOutfolioFailed,
|
# folio.CheckOutfolioFailed,
|
||||||
|
@ -96,7 +95,7 @@ def register():
|
||||||
sale.InvoiceIncomeDailyReport,
|
sale.InvoiceIncomeDailyReport,
|
||||||
sale.InvoiceSimplifiedReport,
|
sale.InvoiceSimplifiedReport,
|
||||||
service.ServiceReport,
|
service.ServiceReport,
|
||||||
housekeeping.HousekeepingServiceReport,
|
room.HousekeepingReport,
|
||||||
module='hotel', type_='report')
|
module='hotel', type_='report')
|
||||||
Pool.register(
|
Pool.register(
|
||||||
booking.SelectRooms,
|
booking.SelectRooms,
|
||||||
|
@ -111,7 +110,7 @@ def register():
|
||||||
folio.StatisticsByMonth,
|
folio.StatisticsByMonth,
|
||||||
folio.ReverseCheckout,
|
folio.ReverseCheckout,
|
||||||
service.CreateDailyServices,
|
service.CreateDailyServices,
|
||||||
housekeeping.HousekeepingService,
|
room.Housekeeping,
|
||||||
sale.InvoiceIncomeDaily,
|
sale.InvoiceIncomeDaily,
|
||||||
party.CreateGuest,
|
party.CreateGuest,
|
||||||
# folio.ChangeRoom,
|
# folio.ChangeRoom,
|
||||||
|
|
BIN
booking.fodt
BIN
booking.fodt
Binary file not shown.
|
@ -49,7 +49,7 @@ class Booking(Workflow, ModelSQL, ModelView):
|
||||||
party = fields.Many2One('party.party', 'Customer', required=False,
|
party = fields.Many2One('party.party', 'Customer', required=False,
|
||||||
select=True, help="Person or company owner of the booking.",
|
select=True, help="Person or company owner of the booking.",
|
||||||
states={
|
states={
|
||||||
'required': Eval('state') == 'check_in',
|
# 'required': Eval('state') == 'check_in',
|
||||||
'readonly': Not(In(Eval('state'), ['offer', 'confirmed'])),
|
'readonly': Not(In(Eval('state'), ['offer', 'confirmed'])),
|
||||||
})
|
})
|
||||||
contact = fields.Char('Contact', states=STATES_CHECKIN,
|
contact = fields.Char('Contact', states=STATES_CHECKIN,
|
||||||
|
@ -420,6 +420,9 @@ class Booking(Workflow, ModelSQL, ModelView):
|
||||||
return
|
return
|
||||||
|
|
||||||
payment_mode = bk.channel.payment_mode
|
payment_mode = bk.channel.payment_mode
|
||||||
|
if not payment_mode:
|
||||||
|
raise UserError(gettext('hotel.msg_missing_payment_mode'))
|
||||||
|
|
||||||
party = bk.channel.agent.party
|
party = bk.channel.agent.party
|
||||||
account_id = Voucher.get_account('receipt', payment_mode)
|
account_id = Voucher.get_account('receipt', payment_mode)
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,6 @@ class Configuration(ModelSQL, ModelView):
|
||||||
'configuration', 'product', 'Default Charges')
|
'configuration', 'product', 'Default Charges')
|
||||||
check_in_time = fields.Time('Check In Time', required=True)
|
check_in_time = fields.Time('Check In Time', required=True)
|
||||||
check_out_time = fields.Time('Check Out Time', required=True)
|
check_out_time = fields.Time('Check Out Time', required=True)
|
||||||
default_accommodation = fields.Many2One('product.product',
|
|
||||||
'Default Accommodation')
|
|
||||||
taxes_exception_rule = fields.Many2One('account.tax.rule', 'Taxes Exception Rule')
|
taxes_exception_rule = fields.Many2One('account.tax.rule', 'Taxes Exception Rule')
|
||||||
default_channel_seller = fields.Many2One('hotel.channel', 'Default Channel')
|
default_channel_seller = fields.Many2One('hotel.channel', 'Default Channel')
|
||||||
company = fields.Many2One('company.company', 'Company', required=True,
|
company = fields.Many2One('company.company', 'Company', required=True,
|
||||||
|
@ -54,11 +52,11 @@ class Configuration(ModelSQL, ModelView):
|
||||||
], 'Full Clean Time')
|
], 'Full Clean Time')
|
||||||
full_clean_lapse = fields.Integer('Full Clean Lapse', help='In Days')
|
full_clean_lapse = fields.Integer('Full Clean Lapse', help='In Days')
|
||||||
age_children_policy = fields.Integer('Age Children Policy', help='In Days')
|
age_children_policy = fields.Integer('Age Children Policy', help='In Days')
|
||||||
cleaning_check_out = fields.Many2One('hotel.housekeeping.cleaning_type',
|
cleaning_check_out = fields.Many2One('hotel.room.cleaning_type',
|
||||||
'Cleaning Check Out')
|
'Cleaning Check Out')
|
||||||
cleaning_check_in = fields.Many2One('hotel.housekeeping.cleaning_type',
|
cleaning_check_in = fields.Many2One('hotel.room.cleaning_type',
|
||||||
'Cleaning Check In')
|
'Cleaning Check In')
|
||||||
cleaning_occupied = fields.Many2One('hotel.housekeeping.cleaning_type',
|
cleaning_occupied = fields.Many2One('hotel.room.cleaning_type',
|
||||||
'Cleaning Occupied')
|
'Cleaning Occupied')
|
||||||
quarantine_rooms = fields.Numeric('Quarantine Rooms', digits=(2, 0), help='In days')
|
quarantine_rooms = fields.Numeric('Quarantine Rooms', digits=(2, 0), help='In days')
|
||||||
booking_email_template = fields.Many2One('email.template',
|
booking_email_template = fields.Many2One('email.template',
|
||||||
|
|
37
folio.py
37
folio.py
|
@ -219,23 +219,21 @@ class Folio(ModelSQL, ModelView):
|
||||||
raise UserError(gettext('hotel.msg_missing_select_room'))
|
raise UserError(gettext('hotel.msg_missing_select_room'))
|
||||||
rec.set_registration_number()
|
rec.set_registration_number()
|
||||||
rec.check_room()
|
rec.check_room()
|
||||||
cls.update_room(rec.room, 'dirty')
|
cls.update_room(rec, 'check_in')
|
||||||
cls.write(records, {'registration_state': 'check_in'})
|
cls.write(records, {'registration_state': 'check_in'})
|
||||||
|
|
||||||
def check_room(self):
|
def check_room(self):
|
||||||
Housekeeping = Pool().get('hotel.housekeeping')
|
if self.room.state != 'clean':
|
||||||
rooms = Housekeeping.search([
|
raise UserError(
|
||||||
('room', '=', self.room.id)
|
gettext('hotel.msg_room_no_clean', s=self.room.name)
|
||||||
])
|
)
|
||||||
if not rooms or rooms[0].state != 'clean':
|
|
||||||
raise UserError(gettext('hotel.msg_room_no_clean', s=self.room.name))
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ModelView.button
|
@ModelView.button
|
||||||
def check_out(cls, records):
|
def check_out(cls, records):
|
||||||
for record in records:
|
for record in records:
|
||||||
cls.write([record], {'registration_state': 'check_out'})
|
cls.write([record], {'registration_state': 'check_out'})
|
||||||
cls.update_room(record.room, 'dirty')
|
cls.update_room(record, 'check_out')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ModelView.button
|
@ModelView.button
|
||||||
|
@ -257,14 +255,21 @@ class Folio(ModelSQL, ModelView):
|
||||||
return 'pending'
|
return 'pending'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def update_room(cls, room, state):
|
def update_room(cls, folio, status):
|
||||||
Housekeeping = Pool().get('hotel.housekeeping')
|
pool = Pool()
|
||||||
hk_rooms = Housekeeping.search([
|
Configuration = pool.get('hotel.configuration')
|
||||||
('room', '=', room.id),
|
config = Configuration.get_configuration()
|
||||||
])
|
cleaning_type_id = None
|
||||||
for hk_room in hk_rooms:
|
if status in 'check_in' and config.cleaning_occupied:
|
||||||
hk_room.state = state
|
cleaning_type_id = config.cleaning_occupied.id
|
||||||
hk_room.save()
|
elif status in 'check_out' and config.cleaning_check_out:
|
||||||
|
cleaning_type_id = config.cleaning_check_out.id
|
||||||
|
|
||||||
|
room = folio.room
|
||||||
|
room.state = 'dirty'
|
||||||
|
if cleaning_type_id:
|
||||||
|
room.cleaning_type = cleaning_type_id
|
||||||
|
room.save()
|
||||||
|
|
||||||
def get_invoice_state(self, name=None):
|
def get_invoice_state(self, name=None):
|
||||||
if self.invoice_line:
|
if self.invoice_line:
|
||||||
|
|
Binary file not shown.
|
@ -11,11 +11,16 @@ from trytond.pool import Pool
|
||||||
STATES = {'invisible': (Eval('type') != 'service')}
|
STATES = {'invisible': (Eval('type') != 'service')}
|
||||||
|
|
||||||
|
|
||||||
class HousekeepingCleaningType(ModelSQL, ModelView):
|
class RoomCleaningType(ModelSQL, ModelView):
|
||||||
"Housekeeping Cleaning Type"
|
"Room Cleaning Type"
|
||||||
__name__ = "hotel.housekeeping.cleaning_type"
|
__name__ = "hotel.housekeeping.cleaning_type"
|
||||||
name = fields.Char('Name', required=True, select=True)
|
name = fields.Char('Name', required=True, select=True)
|
||||||
description = fields.Text('Description')
|
description = fields.Text('Description')
|
||||||
|
kind = fields.Selection([
|
||||||
|
('tweak', 'Tweak'),
|
||||||
|
('deep', 'Deep'),
|
||||||
|
('standard', 'Standard'),
|
||||||
|
], 'Kind', required=True)
|
||||||
|
|
||||||
|
|
||||||
class Housekeeping(Workflow, ModelSQL, ModelView):
|
class Housekeeping(Workflow, ModelSQL, ModelView):
|
||||||
|
@ -44,8 +49,10 @@ class Housekeeping(Workflow, ModelSQL, ModelView):
|
||||||
start_date_assigned = fields.Date('Start Date Assigned')
|
start_date_assigned = fields.Date('Start Date Assigned')
|
||||||
end_date_assigned = fields.Date('End Date Assigned')
|
end_date_assigned = fields.Date('End Date Assigned')
|
||||||
notes = fields.Text('Notes')
|
notes = fields.Text('Notes')
|
||||||
check_in_time = fields.Function(fields.Time('Check In Time'), 'get_check_in_time')
|
check_in_time = fields.Function(fields.Time('Check In Time'),
|
||||||
check_out_time = fields.Function(fields.Time('Check In Time'), 'get_check_out_time')
|
'get_check_in_time')
|
||||||
|
check_out_time = fields.Function(fields.Time('Check In Time'),
|
||||||
|
'get_check_out_time')
|
||||||
amenities = fields.Function(fields.Many2Many('hotel.room-hotel.amenities',
|
amenities = fields.Function(fields.Many2Many('hotel.room-hotel.amenities',
|
||||||
'room', 'amenities', 'Amenities'), 'get_amenities')
|
'room', 'amenities', 'Amenities'), 'get_amenities')
|
||||||
|
|
||||||
|
@ -165,87 +172,3 @@ class Housekeeping(Workflow, ModelSQL, ModelView):
|
||||||
# for line in lines:
|
# for line in lines:
|
||||||
# occupancies.add(line.id)
|
# occupancies.add(line.id)
|
||||||
# return list(occupancies)
|
# return list(occupancies)
|
||||||
|
|
||||||
|
|
||||||
class HotelTask(ModelSQL, ModelView):
|
|
||||||
"Hotel Task"
|
|
||||||
__name__ = "hotel.task"
|
|
||||||
name = fields.Char('Name Task', required=True, select=True)
|
|
||||||
frecuency = fields.Integer('Frecuency', select=True, help='In days')
|
|
||||||
quantity = fields.Integer('Quantity', select=True)
|
|
||||||
|
|
||||||
|
|
||||||
class HotelHousekeepingTask(ModelView, ModelSQL):
|
|
||||||
'Hotel Housekeeping Task'
|
|
||||||
__name__ = 'hotel.housekeeping.task'
|
|
||||||
housekeeping = fields.Many2One('hotel.housekeeping', 'Hotel Housekeeping',
|
|
||||||
ondelete='CASCADE', select=True, required=True)
|
|
||||||
task = fields.Many2One('hotel.task', 'Task', select=True, required=True)
|
|
||||||
frecuency = fields.Integer('Frecuency', select=True, help='In days')
|
|
||||||
quantity = fields.Integer('Quantity', select=True)
|
|
||||||
|
|
||||||
@fields.depends('task', 'frecuency')
|
|
||||||
def on_change_task(self, name=None):
|
|
||||||
if self.task:
|
|
||||||
self.frecuency = self.task.frecuency
|
|
||||||
|
|
||||||
|
|
||||||
class HousekeepingServiceStart(ModelView):
|
|
||||||
'Print Housekeeping Service Start'
|
|
||||||
__name__ = 'hotel.print_housekeeping_service.start'
|
|
||||||
date = fields.Date('Date', required=True)
|
|
||||||
employee = fields.Many2One('company.employee', 'Employee')
|
|
||||||
company = fields.Many2One('company.company', 'Company', required=True)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def default_date():
|
|
||||||
Date_ = Pool().get('ir.date')
|
|
||||||
return Date_.today()
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def default_company():
|
|
||||||
return Transaction().context.get('company')
|
|
||||||
|
|
||||||
|
|
||||||
class HousekeepingService(Wizard):
|
|
||||||
'Housekeeping Service'
|
|
||||||
__name__ = 'hotel.print_housekeeping_service'
|
|
||||||
start = StateView('hotel.print_housekeeping_service.start',
|
|
||||||
'hotel.print_housekeeping_service_start_view_form', [
|
|
||||||
Button('Cancel', 'end', 'tryton-cancel'),
|
|
||||||
Button('Open', 'print_', 'tryton-print', default=True),
|
|
||||||
])
|
|
||||||
print_ = StateReport('hotel.print_housekeeping_service.report')
|
|
||||||
|
|
||||||
def do_print_(self, action):
|
|
||||||
company = self.start.company
|
|
||||||
data = {
|
|
||||||
'date': self.start.date,
|
|
||||||
'employee': self.start.employee.id if self.start.employee else None,
|
|
||||||
'company': company.id,
|
|
||||||
}
|
|
||||||
return action, data
|
|
||||||
|
|
||||||
def transition_print_(self):
|
|
||||||
return 'end'
|
|
||||||
|
|
||||||
|
|
||||||
class HousekeepingServiceReport(Report):
|
|
||||||
__name__ = 'hotel.print_housekeeping_service.report'
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def get_context(cls, records, header, data):
|
|
||||||
report_context = super().get_context(records, header, data)
|
|
||||||
pool = Pool()
|
|
||||||
Company = pool.get('company.company')
|
|
||||||
Housekeeping = pool.get('hotel.housekeeping')
|
|
||||||
|
|
||||||
dom = []
|
|
||||||
if data['employee']:
|
|
||||||
dom.append(('employee.id', '=', data['employee']))
|
|
||||||
|
|
||||||
housekeepings = Housekeeping.search(dom)
|
|
||||||
report_context['records'] = housekeepings
|
|
||||||
report_context['company'] = Company(data['company']).party.name
|
|
||||||
report_context['date'] = datetime.now()
|
|
||||||
return report_context
|
|
||||||
|
|
|
@ -81,5 +81,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<record model="ir.message" id="msg_missing_customer">
|
<record model="ir.message" id="msg_missing_customer">
|
||||||
<field name="text">Missing party or customer to pay!</field>
|
<field name="text">Missing party or customer to pay!</field>
|
||||||
</record>
|
</record>
|
||||||
|
<record model="ir.message" id="msg_missing_payment_mode">
|
||||||
|
<field name="text">Missing payment mode in channel!</field>
|
||||||
|
</record>
|
||||||
</data>
|
</data>
|
||||||
</tryton>
|
</tryton>
|
||||||
|
|
184
room.py
184
room.py
|
@ -1,13 +1,27 @@
|
||||||
#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.
|
# this repository contains the full copyright notices and license terms.
|
||||||
from trytond.model import ModelView, ModelSQL, fields
|
from trytond.model import ModelView, ModelSQL, Workflow, fields
|
||||||
from trytond.pyson import Eval
|
from trytond.pyson import Eval
|
||||||
|
from trytond.wizard import (
|
||||||
|
Wizard, StateView, Button, StateTransition, StateReport
|
||||||
|
)
|
||||||
|
from trytond.pool import Pool
|
||||||
|
from trytond.report import Report
|
||||||
|
|
||||||
|
|
||||||
STATES = {'readonly': (Eval('state') != 'draft')}
|
class CleaningType(ModelSQL, ModelView):
|
||||||
|
"Room Cleaning Type"
|
||||||
|
__name__ = "hotel.room.cleaning_type"
|
||||||
|
name = fields.Char('Name', required=True, select=True)
|
||||||
|
description = fields.Text('Description')
|
||||||
|
kind = fields.Selection([
|
||||||
|
('tweak', 'Tweak'),
|
||||||
|
('deep', 'Deep'),
|
||||||
|
('standard', 'Standard'),
|
||||||
|
], 'Kind', required=True)
|
||||||
|
|
||||||
|
|
||||||
class Room(ModelSQL, ModelView):
|
class Room(Workflow, ModelSQL, ModelView):
|
||||||
'Room'
|
'Room'
|
||||||
__name__ = 'hotel.room'
|
__name__ = 'hotel.room'
|
||||||
name = fields.Char('Name', required=True)
|
name = fields.Char('Name', required=True)
|
||||||
|
@ -33,19 +47,87 @@ class Room(ModelSQL, ModelView):
|
||||||
# TODO: Maybe add require a Current State field
|
# TODO: Maybe add require a Current State field
|
||||||
min_unit_price = fields.Numeric('Min. Unit Price', digits=(16, 4))
|
min_unit_price = fields.Numeric('Min. Unit Price', digits=(16, 4))
|
||||||
max_unit_price = fields.Numeric('Max. Unit Price', digits=(16, 4))
|
max_unit_price = fields.Numeric('Max. Unit Price', digits=(16, 4))
|
||||||
|
state = fields.Selection([
|
||||||
|
('inspected', 'Inspected'),
|
||||||
|
('dirty', 'Dirty'),
|
||||||
|
('clean', 'Clean'),
|
||||||
|
('maintenance', 'Maintenance'),
|
||||||
|
], 'Status', required=True, readonly=True)
|
||||||
|
state_string = state.translated('state')
|
||||||
|
cleaning_type = fields.Many2One('hotel.room.cleaning_type',
|
||||||
|
'Cleaning Type', required=False)
|
||||||
|
last_check_in = fields.DateTime('Last Check In')
|
||||||
|
last_check_out = fields.DateTime('Last Check Out')
|
||||||
|
housekeeping = fields.Many2One('company.employee', 'Employee')
|
||||||
|
notes = fields.Text('Notes')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __setup__(cls):
|
def __setup__(cls):
|
||||||
super(Room, cls).__setup__()
|
super(Room, cls).__setup__()
|
||||||
|
cls._transitions |= set((
|
||||||
|
('clean', 'dirty'),
|
||||||
|
('clean', 'inspected'),
|
||||||
|
('clean', 'maintenance'),
|
||||||
|
('dirty', 'clean'),
|
||||||
|
('dirty', 'maintenance'),
|
||||||
|
('dirty', 'inspected'),
|
||||||
|
('maintenance', 'inspected'),
|
||||||
|
('maintenance', 'dirty'),
|
||||||
|
('inspected', 'dirty'),
|
||||||
|
('inspected', 'maintenance'),
|
||||||
|
('inspected', 'clean'),
|
||||||
|
))
|
||||||
|
cls._buttons.update({
|
||||||
|
'clean': {
|
||||||
|
'invisible': Eval('state').in_(['maintenance', 'clean']),
|
||||||
|
},
|
||||||
|
'dirty': {
|
||||||
|
'invisible': Eval('state').in_(['dirty']),
|
||||||
|
},
|
||||||
|
'inspected': {
|
||||||
|
'invisible': Eval('state').in_(['inspected']),
|
||||||
|
},
|
||||||
|
'maintenance': {
|
||||||
|
'invisible': Eval('state').in_(['maintenance']),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def default_active():
|
def default_active():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@fields.depends('start_mnt', 'end_mnt')
|
@staticmethod
|
||||||
def on_change_start_mnt(self):
|
def default_state():
|
||||||
if not self.start_mnt:
|
return 'dirty'
|
||||||
self.end_mnt = None
|
|
||||||
|
@classmethod
|
||||||
|
@ModelView.button
|
||||||
|
@Workflow.transition('clean')
|
||||||
|
def clean(cls, records):
|
||||||
|
for rec in records:
|
||||||
|
rec.cleaning_type = None
|
||||||
|
rec.save()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
@ModelView.button
|
||||||
|
@Workflow.transition('dirty')
|
||||||
|
def dirty(cls, records):
|
||||||
|
Config = Pool().get('hotel.configuration')
|
||||||
|
config = Config.get_configuration()
|
||||||
|
for rec in records:
|
||||||
|
rec.cleaning_type = config.cleaning_occupied.id
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
@ModelView.button
|
||||||
|
@Workflow.transition('maintenance')
|
||||||
|
def maintenance(cls, records):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
@ModelView.button
|
||||||
|
@Workflow.transition('inspected')
|
||||||
|
def inspected(cls, records):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class RoomAmenities(ModelSQL):
|
class RoomAmenities(ModelSQL):
|
||||||
|
@ -74,10 +156,6 @@ class Amenities(ModelSQL, ModelView):
|
||||||
'invisible': Eval('type') != 'lingerie',
|
'invisible': Eval('type') != 'lingerie',
|
||||||
}, depends=['type'])
|
}, depends=['type'])
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def __setup__(cls):
|
|
||||||
super(Amenities, cls).__setup__()
|
|
||||||
|
|
||||||
|
|
||||||
class RoomClassification(ModelSQL, ModelView):
|
class RoomClassification(ModelSQL, ModelView):
|
||||||
'Room Classification'
|
'Room Classification'
|
||||||
|
@ -109,3 +187,87 @@ class RoomTemplate(ModelSQL):
|
||||||
ondelete='CASCADE')
|
ondelete='CASCADE')
|
||||||
template = fields.Many2One('product.template', 'Product Template',
|
template = fields.Many2One('product.template', 'Product Template',
|
||||||
required=True, ondelete='CASCADE')
|
required=True, ondelete='CASCADE')
|
||||||
|
|
||||||
|
|
||||||
|
class HousekeepingStart(ModelView):
|
||||||
|
'Print Housekeeping Service Start'
|
||||||
|
__name__ = 'hotel.print_housekeeping.start'
|
||||||
|
date = fields.Date('Date', required=True)
|
||||||
|
employee = fields.Many2One('company.employee', 'Employee')
|
||||||
|
company = fields.Many2One('company.company', 'Company', required=True)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def default_date():
|
||||||
|
Date_ = Pool().get('ir.date')
|
||||||
|
return Date_.today()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def default_company():
|
||||||
|
return Transaction().context.get('company')
|
||||||
|
|
||||||
|
|
||||||
|
class Housekeeping(Wizard):
|
||||||
|
'Housekeeping Service'
|
||||||
|
__name__ = 'hotel.print_housekeeping'
|
||||||
|
start = StateView('hotel.print_housekeeping.start',
|
||||||
|
'hotel.print_housekeeping_start_view_form', [
|
||||||
|
Button('Cancel', 'end', 'tryton-cancel'),
|
||||||
|
Button('Open', 'print_', 'tryton-print', default=True),
|
||||||
|
])
|
||||||
|
print_ = StateReport('hotel.print_housekeeping.report')
|
||||||
|
|
||||||
|
def do_print_(self, action):
|
||||||
|
company = self.start.company
|
||||||
|
data = {
|
||||||
|
'date': self.start.date,
|
||||||
|
'employee': self.start.employee.id if self.start.employee else None,
|
||||||
|
'company': company.id,
|
||||||
|
}
|
||||||
|
return action, data
|
||||||
|
|
||||||
|
def transition_print_(self):
|
||||||
|
return 'end'
|
||||||
|
|
||||||
|
|
||||||
|
class HousekeepingReport(Report):
|
||||||
|
__name__ = 'hotel.print_housekeeping.report'
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_context(cls, records, header, data):
|
||||||
|
report_context = super().get_context(records, header, data)
|
||||||
|
pool = Pool()
|
||||||
|
Company = pool.get('company.company')
|
||||||
|
Housekeeping = pool.get('hotel.housekeeping')
|
||||||
|
|
||||||
|
dom = []
|
||||||
|
if data['employee']:
|
||||||
|
dom.append(('employee.id', '=', data['employee']))
|
||||||
|
|
||||||
|
housekeepings = Housekeeping.search(dom)
|
||||||
|
report_context['records'] = housekeepings
|
||||||
|
report_context['company'] = Company(data['company'])
|
||||||
|
report_context['date'] = datetime.now()
|
||||||
|
return report_context
|
||||||
|
|
||||||
|
|
||||||
|
class HotelTask(ModelSQL, ModelView):
|
||||||
|
"Hotel Task"
|
||||||
|
__name__ = "hotel.task"
|
||||||
|
name = fields.Char('Name Task', required=True, select=True)
|
||||||
|
frecuency = fields.Integer('Frecuency', select=True, help='In days')
|
||||||
|
quantity = fields.Integer('Quantity', select=True)
|
||||||
|
|
||||||
|
|
||||||
|
# class HotelHousekeepingTask(ModelView, ModelSQL):
|
||||||
|
# 'Hotel Housekeeping Task'
|
||||||
|
# __name__ = 'hotel.housekeeping.task'
|
||||||
|
# room = fields.Many2One('hotel.room', 'Hotel Housekeeping',
|
||||||
|
# ondelete='CASCADE', select=True, required=True)
|
||||||
|
# task = fields.Many2One('hotel.task', 'Task', select=True, required=True)
|
||||||
|
# frecuency = fields.Integer('Frecuency', select=True, help='In days')
|
||||||
|
# quantity = fields.Integer('Quantity', select=True)
|
||||||
|
#
|
||||||
|
# @fields.depends('task', 'frecuency')
|
||||||
|
# def on_change_task(self, name=None):
|
||||||
|
# if self.task:
|
||||||
|
# self.frecuency = self.task.frecuency
|
||||||
|
|
145
room.xml
145
room.xml
|
@ -193,5 +193,150 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
</record>
|
</record>
|
||||||
<menuitem name="Room Classification" parent="hotel.menu_configuration" sequence="50"
|
<menuitem name="Room Classification" parent="hotel.menu_configuration" sequence="50"
|
||||||
action="act_room_classification_form" id="menu_hotel_room_classification"/>
|
action="act_room_classification_form" id="menu_hotel_room_classification"/>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="room_housekeeping_view_form">
|
||||||
|
<field name="model">hotel.room</field>
|
||||||
|
<field name="type">form</field>
|
||||||
|
<field name="name">room_housekeeping_form</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.ui.view" id="room_housekeeping_view_tree">
|
||||||
|
<field name="model">hotel.room</field>
|
||||||
|
<field name="type">tree</field>
|
||||||
|
<field name="name">room_housekeeping_tree</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window" id="act_room_housekeeping_form">
|
||||||
|
<field name="name">Housekeeping</field>
|
||||||
|
<field name="res_model">hotel.room</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window.view" id="act_room_housekeeping_form_view1">
|
||||||
|
<field name="sequence" eval="1"/>
|
||||||
|
<field name="view" ref="room_housekeeping_view_tree"/>
|
||||||
|
<field name="act_window" ref="act_room_housekeeping_form"/>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window.view" id="act_room_housekeeping_form_view2">
|
||||||
|
<field name="sequence" eval="2"/>
|
||||||
|
<field name="view" ref="room_housekeeping_view_form"/>
|
||||||
|
<field name="act_window" ref="act_room_housekeeping_form"/>
|
||||||
|
</record>
|
||||||
|
<menuitem parent="menu_hotel" sequence="30" icon="hotel-housekeeping"
|
||||||
|
action="act_room_housekeeping_form" id="menu_housekeeping_form"/>
|
||||||
|
|
||||||
|
<!-- Model Access -->
|
||||||
|
<!-- <record model="ir.model.access" id="access_housekeeping">
|
||||||
|
<field name="model" search="[('model', '=', 'hotel.housekeeping')]"/>
|
||||||
|
<field name="perm_read" eval="False"/>
|
||||||
|
<field name="perm_write" eval="False"/>
|
||||||
|
<field name="perm_create" eval="False"/>
|
||||||
|
<field name="perm_delete" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record model="ir.model.access" id="access_housekeeping_group_hotel">
|
||||||
|
<field name="model" search="[('model', '=', 'hotel.housekeeping')]"/>
|
||||||
|
<field name="group" ref="group_hotel"/>
|
||||||
|
<field name="perm_read" eval="True"/>
|
||||||
|
<field name="perm_write" eval="False"/>
|
||||||
|
<field name="perm_create" eval="False"/>
|
||||||
|
<field name="perm_delete" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record model="ir.model.access" id="access_housekeeping_group_hotel_frontdesk">
|
||||||
|
<field name="model" search="[('model', '=', 'hotel.housekeeping')]"/>
|
||||||
|
<field name="group" ref="group_hotel_frontdesk"/>
|
||||||
|
<field name="perm_read" eval="True"/>
|
||||||
|
<field name="perm_write" eval="True"/>
|
||||||
|
<field name="perm_create" eval="False"/>
|
||||||
|
<field name="perm_delete" eval="False"/>
|
||||||
|
</record>
|
||||||
|
<record model="ir.model.access" id="access_housekeeping_group_hotel_admin">
|
||||||
|
<field name="model" search="[('model', '=', 'hotel.housekeeping')]"/>
|
||||||
|
<field name="group" ref="group_hotel_admin"/>
|
||||||
|
<field name="perm_read" eval="True"/>
|
||||||
|
<field name="perm_write" eval="True"/>
|
||||||
|
<field name="perm_create" eval="True"/>
|
||||||
|
<field name="perm_delete" eval="True"/>
|
||||||
|
</record> -->
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="room_cleaning_type_view_form">
|
||||||
|
<field name="model">hotel.room.cleaning_type</field>
|
||||||
|
<field name="type">form</field>
|
||||||
|
<field name="name">room_cleaning_type_form</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.ui.view" id="room_cleaning_type_view_tree">
|
||||||
|
<field name="model">hotel.room.cleaning_type</field>
|
||||||
|
<field name="type">tree</field>
|
||||||
|
<field name="name">room_cleaning_type_tree</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window" id="act_room_cleaning_type_form">
|
||||||
|
<field name="name">Cleaning Type</field>
|
||||||
|
<field name="res_model">hotel.room.cleaning_type</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window.view" id="act_room_cleaning_type_form_view1">
|
||||||
|
<field name="sequence" eval="15"/>
|
||||||
|
<field name="view" ref="room_cleaning_type_view_tree"/>
|
||||||
|
<field name="act_window" ref="act_room_cleaning_type_form"/>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window.view" id="act_room_cleaning_type_form_view2">
|
||||||
|
<field name="sequence" eval="20"/>
|
||||||
|
<field name="view" ref="room_cleaning_type_view_form"/>
|
||||||
|
<field name="act_window" ref="act_room_cleaning_type_form"/>
|
||||||
|
</record>
|
||||||
|
<menuitem name="Cleaning Type" parent="hotel.menu_configuration"
|
||||||
|
sequence="50" action="act_room_cleaning_type_form"
|
||||||
|
id="menu_hotel_room_cleaning_type"/>
|
||||||
|
|
||||||
|
<!-- <record model="ir.ui.view" id="housekeeping_task_view_form">
|
||||||
|
<field name="model">hotel.housekeeping.task</field>
|
||||||
|
<field name="type">form</field>
|
||||||
|
<field name="name">housekeeping_task_form</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.ui.view" id="housekeeping_task_view_tree">
|
||||||
|
<field name="model">hotel.housekeeping.task</field>
|
||||||
|
<field name="type">tree</field>
|
||||||
|
<field name="name">housekeeping_task_tree</field>
|
||||||
|
</record> -->
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="task_view_form">
|
||||||
|
<field name="model">hotel.task</field>
|
||||||
|
<field name="type">form</field>
|
||||||
|
<field name="name">task_form</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.ui.view" id="task_view_tree">
|
||||||
|
<field name="model">hotel.task</field>
|
||||||
|
<field name="type">tree</field>
|
||||||
|
<field name="name">task_tree</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window" id="act_task_housekeeping_form">
|
||||||
|
<field name="name">Tasks Housekeeping</field>
|
||||||
|
<field name="res_model">hotel.task</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window.view" id="act_task_housekeeping_form_view1">
|
||||||
|
<field name="sequence" eval="15"/>
|
||||||
|
<field name="view" ref="task_view_tree"/>
|
||||||
|
<field name="act_window" ref="act_task_housekeeping_form"/>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.act_window.view" id="act_task_housekeeping_form_view2">
|
||||||
|
<field name="sequence" eval="20"/>
|
||||||
|
<field name="view" ref="task_view_form"/>
|
||||||
|
<field name="act_window" ref="act_task_housekeeping_form"/>
|
||||||
|
</record>
|
||||||
|
<menuitem name="Task HouseKeeping" parent="hotel.menu_configuration" sequence="50"
|
||||||
|
action="act_task_housekeeping_form" id="menu_hotel_task_housekeeping"/>
|
||||||
|
|
||||||
|
<record model="ir.action.report" id="report_housekeeping">
|
||||||
|
<field name="name">Housekeeping Report</field>
|
||||||
|
<field name="model"></field>
|
||||||
|
<field name="report_name">hotel.print_housekeeping.report</field>
|
||||||
|
<field name="report">hotel/housekeeping.fods</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.ui.view" id="print_housekeeping_start_view_form">
|
||||||
|
<field name="model">hotel.print_housekeeping.start</field>
|
||||||
|
<field name="type">form</field>
|
||||||
|
<field name="name">housekeeping_start_form</field>
|
||||||
|
</record>
|
||||||
|
<record model="ir.action.wizard" id="wizard_print_housekeeping">
|
||||||
|
<field name="name">Housekeeping Report</field>
|
||||||
|
<field name="wiz_name">hotel.print_housekeeping</field>
|
||||||
|
</record>
|
||||||
|
<menuitem parent="hotel.menu_reporting" id="menu_housekeeping_report"
|
||||||
|
action="wizard_print_housekeeping"/>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</tryton>
|
</tryton>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[tryton]
|
[tryton]
|
||||||
version=6.0.24
|
version=6.0.25
|
||||||
depends:
|
depends:
|
||||||
party
|
party
|
||||||
company
|
company
|
||||||
|
@ -23,7 +23,6 @@ xml:
|
||||||
location.xml
|
location.xml
|
||||||
booking.xml
|
booking.xml
|
||||||
folio.xml
|
folio.xml
|
||||||
housekeeping.xml
|
|
||||||
company.xml
|
company.xml
|
||||||
city.xml
|
city.xml
|
||||||
party.xml
|
party.xml
|
||||||
|
|
|
@ -10,8 +10,6 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<field name="hotel_service_sequence"/>
|
<field name="hotel_service_sequence"/>
|
||||||
<label name="registration_card_sequence"/>
|
<label name="registration_card_sequence"/>
|
||||||
<field name="registration_card_sequence"/>
|
<field name="registration_card_sequence"/>
|
||||||
<label name="default_accommodation"/>
|
|
||||||
<field name="default_accommodation"/>
|
|
||||||
<label name="check_in_time"/>
|
<label name="check_in_time"/>
|
||||||
<field name="check_in_time"/>
|
<field name="check_in_time"/>
|
||||||
<label name="check_out_time"/>
|
<label name="check_out_time"/>
|
||||||
|
@ -26,8 +24,6 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<field name="storage_by_default"/>
|
<field name="storage_by_default"/>
|
||||||
<label name="payment_term"/>
|
<label name="payment_term"/>
|
||||||
<field name="payment_term"/>
|
<field name="payment_term"/>
|
||||||
<label name="default_channel_seller"/>
|
|
||||||
<field name="default_channel_seller"/>
|
|
||||||
<label name="age_children_policy"/>
|
<label name="age_children_policy"/>
|
||||||
<field name="age_children_policy"/>
|
<field name="age_children_policy"/>
|
||||||
<label name="booking_email_template"/>
|
<label name="booking_email_template"/>
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||||
this repository contains the full copyright notices and license terms. -->
|
this repository contains the full copyright notices and license terms. -->
|
||||||
<tree>
|
<tree>
|
||||||
<field name="booking_sequence"/>
|
|
||||||
<field name="company"/>
|
<field name="company"/>
|
||||||
<field name="check_in_time"/>
|
<field name="check_in_time"/>
|
||||||
<field name="check_out_time"/>
|
<field name="check_out_time"/>
|
||||||
|
|
|
@ -4,6 +4,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||||
<form>
|
<form>
|
||||||
<label name="name"/>
|
<label name="name"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
|
<label name="kind"/>
|
||||||
|
<field name="kind"/>
|
||||||
<separator name="description" colspan="4"/>
|
<separator name="description" colspan="4"/>
|
||||||
<field name="description" colspan="4"/>
|
<field name="description" colspan="4"/>
|
||||||
</form>
|
</form>
|
|
@ -3,5 +3,6 @@
|
||||||
this repository contains the full copyright notices and license terms. -->
|
this repository contains the full copyright notices and license terms. -->
|
||||||
<tree>
|
<tree>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
|
<field name="kind"/>
|
||||||
<field name="description"/>
|
<field name="description"/>
|
||||||
</tree>
|
</tree>
|
|
@ -2,33 +2,23 @@
|
||||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||||
this repository contains the full copyright notices and license terms. -->
|
this repository contains the full copyright notices and license terms. -->
|
||||||
<form>
|
<form>
|
||||||
<label name="room"/>
|
<label name="name"/>
|
||||||
<field name="room"/>
|
<field name="name"/>
|
||||||
<label name="employee"/>
|
<label name="housekeeping"/>
|
||||||
<field name="employee"/>
|
<field name="housekeeping" widget="selection"/>
|
||||||
<label name="availability"/>
|
|
||||||
<field name="availability"/>
|
|
||||||
<label name="state"/>
|
|
||||||
<field name="state"/>
|
|
||||||
<label name="start_date_assigned"/>
|
|
||||||
<field name="start_date_assigned"/>
|
|
||||||
<label name="end_date_assigned"/>
|
|
||||||
<field name="end_date_assigned"/>
|
|
||||||
<label name="cleaning_type"/>
|
<label name="cleaning_type"/>
|
||||||
<field name="cleaning_type" widget="selection"/>
|
<field name="cleaning_type" widget="selection"/>
|
||||||
|
<label name="state"/>
|
||||||
|
<field name="state"/>
|
||||||
<notebook colspan="4">
|
<notebook colspan="4">
|
||||||
<page string="Tasks" id="tasks">
|
<page string="Tasks" id="tasks">
|
||||||
<field name="tasks" colspan="2"/>
|
<!-- <field name="tasks" colspan="2"/> -->
|
||||||
<field name="amenities" colspan="2"/>
|
<field name="amenities" colspan="2"/>
|
||||||
</page>
|
</page>
|
||||||
<page string="Info Addtional" id="comments">
|
<page string="Info Addtional" id="comments">
|
||||||
<separator string="Check List" colspan="4" id="check_list"/>
|
|
||||||
<field name="check_list" colspan="4"/>
|
|
||||||
<separator string="Notes" colspan="4" id="notes"/>
|
<separator string="Notes" colspan="4" id="notes"/>
|
||||||
<field name="notes" colspan="4"/>
|
<field name="notes" colspan="4"/>
|
||||||
</page>
|
</page>
|
||||||
<page string="Amenities" id="amenities">
|
|
||||||
</page>
|
|
||||||
</notebook>
|
</notebook>
|
||||||
<group col="5" colspan="4" id="buttons">
|
<group col="5" colspan="4" id="buttons">
|
||||||
<button name="clean" string="Clean"
|
<button name="clean" string="Clean"
|
|
@ -2,11 +2,10 @@
|
||||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||||
this repository contains the full copyright notices and license terms. -->
|
this repository contains the full copyright notices and license terms. -->
|
||||||
<tree >
|
<tree >
|
||||||
<field name="room"/>
|
<field name="name"/>
|
||||||
<field name="employee"/>
|
<field name="housekeeping"/>
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
<field name="cleaning_type"/>
|
<field name="cleaning_type"/>
|
||||||
<field name="availability"/>
|
|
||||||
<button name="clean" string="Clean"/>
|
<button name="clean" string="Clean"/>
|
||||||
<button name="dirty" string="Dirty"/>
|
<button name="dirty" string="Dirty"/>
|
||||||
<button name="inspected" string="Inspected"/>
|
<button name="inspected" string="Inspected"/>
|
Loading…
Reference in New Issue