mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
Merge pull request #91 from hootel/pr_workflow_checkin
Pr workflow checkin
This commit is contained in:
@@ -48,6 +48,7 @@
|
|||||||
'views/hotel_reservation_views.xml',
|
'views/hotel_reservation_views.xml',
|
||||||
'views/hotel_room_closure_reason_views.xml',
|
'views/hotel_room_closure_reason_views.xml',
|
||||||
'views/hotel_service_views.xml',
|
'views/hotel_service_views.xml',
|
||||||
|
'views/hotel_service_line_views.xml',
|
||||||
'views/hotel_board_service_views.xml',
|
'views/hotel_board_service_views.xml',
|
||||||
'views/hotel_checkin_partner_views.xml',
|
'views/hotel_checkin_partner_views.xml',
|
||||||
'views/hotel_room_type_availability_views.xml',
|
'views/hotel_room_type_availability_views.xml',
|
||||||
|
|||||||
@@ -23,6 +23,11 @@ class HotelCheckinPartner(models.Model):
|
|||||||
self.env.context['folio_id']
|
self.env.context['folio_id']
|
||||||
])
|
])
|
||||||
return folio
|
return folio
|
||||||
|
if 'reservation_id' in self.env.context:
|
||||||
|
folio = self.env['hotel.reservation'].browse([
|
||||||
|
self.env.context['reservation_id']
|
||||||
|
]).folio_id
|
||||||
|
return folio
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _default_enter_date(self):
|
def _default_enter_date(self):
|
||||||
@@ -46,16 +51,20 @@ class HotelCheckinPartner(models.Model):
|
|||||||
reservation = self.env['hotel.reservation'].browse([
|
reservation = self.env['hotel.reservation'].browse([
|
||||||
self.env.context['reservation_id']
|
self.env.context['reservation_id']
|
||||||
])
|
])
|
||||||
return reservation.partner_id
|
if reservation.partner_id.id not in reservation.mapped(
|
||||||
|
'checkin_partner_ids.partner_id.id'):
|
||||||
|
return reservation.partner_id
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
partner_id = fields.Many2one('res.partner', default=_default_partner_id,
|
partner_id = fields.Many2one('res.partner', default=_default_partner_id,
|
||||||
required=True)
|
required=True)
|
||||||
|
email = fields.Char('E-mail', related='partner_id.email')
|
||||||
|
mobile = fields.Char('Mobile', related='partner_id.mobile')
|
||||||
reservation_id = fields.Many2one(
|
reservation_id = fields.Many2one(
|
||||||
'hotel.reservation', default=_default_reservation_id)
|
'hotel.reservation', default=_default_reservation_id)
|
||||||
folio_id = fields.Many2one('hotel.reservation',
|
folio_id = fields.Many2one('hotel.folio',
|
||||||
default=_default_folio_id, readonly=True)
|
default=_default_folio_id, readonly=True, required=True)
|
||||||
enter_date = fields.Date(default=_default_enter_date, required=True)
|
enter_date = fields.Date(default=_default_enter_date, required=True)
|
||||||
exit_date = fields.Date(default=_default_exit_date, required=True)
|
exit_date = fields.Date(default=_default_exit_date, required=True)
|
||||||
state = fields.Selection([('draft', 'Pending Entry'),
|
state = fields.Selection([('draft', 'Pending Entry'),
|
||||||
@@ -65,6 +74,7 @@ class HotelCheckinPartner(models.Model):
|
|||||||
'State', readonly=True,
|
'State', readonly=True,
|
||||||
default=lambda *a: 'draft',
|
default=lambda *a: 'draft',
|
||||||
track_visibility='onchange')
|
track_visibility='onchange')
|
||||||
|
|
||||||
|
|
||||||
# Validation for Departure date is after arrival date.
|
# Validation for Departure date is after arrival date.
|
||||||
@api.multi
|
@api.multi
|
||||||
@@ -89,10 +99,36 @@ class HotelCheckinPartner(models.Model):
|
|||||||
_('Departure date, is prior to arrival. Check it now. %s') %
|
_('Departure date, is prior to arrival. Check it now. %s') %
|
||||||
date_out)
|
date_out)
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
@api.onchange('partner_id')
|
||||||
|
def _check_partner_id(self):
|
||||||
|
for record in self:
|
||||||
|
checkins = self.env['hotel.checkin.partner'].search([
|
||||||
|
('id','!=', record.id),
|
||||||
|
('reservation_id','=', record.reservation_id.id)
|
||||||
|
])
|
||||||
|
if record.partner_id.id in checkins.mapped('partner_id.id'):
|
||||||
|
raise models.ValidationError(
|
||||||
|
_('This guest is already registered in the room'))
|
||||||
|
|
||||||
|
@api.multi
|
||||||
|
@api.constrains('partner_id')
|
||||||
|
def _check_partner_id(self):
|
||||||
|
for record in self:
|
||||||
|
checkins = self.env['hotel.checkin.partner'].search([
|
||||||
|
('id','!=', record.id),
|
||||||
|
('reservation_id','=', record.reservation_id.id)
|
||||||
|
])
|
||||||
|
if record.partner_id.id in checkins.mapped('partner_id.id'):
|
||||||
|
raise models.ValidationError(
|
||||||
|
_('This guest is already registered in the room'))
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def action_on_board(self):
|
def action_on_board(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
record.state = 'booking'
|
record.state = 'booking'
|
||||||
|
if record.reservation_id.state == 'confirm':
|
||||||
|
record.reservation_id.state = 'booking'
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def action_done(self):
|
def action_done(self):
|
||||||
|
|||||||
@@ -34,6 +34,20 @@ class HotelFolio(models.Model):
|
|||||||
def _compute_qty_delivered_updateable(self):
|
def _compute_qty_delivered_updateable(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _default_diff_invoicing(self):
|
||||||
|
"""
|
||||||
|
If the guest has an invoicing address set,
|
||||||
|
this method return diff_invoicing = True, else, return False
|
||||||
|
"""
|
||||||
|
if 'folio_id' in self.env.context:
|
||||||
|
folio = self.env['hotel.folio'].browse([
|
||||||
|
self.env.context['folio_id']
|
||||||
|
])
|
||||||
|
if folio.partner_id.id == folio.partner_invoice_id.id:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
@api.depends('state', 'room_lines.invoice_status', 'service_ids.invoice_status')
|
@api.depends('state', 'room_lines.invoice_status', 'service_ids.invoice_status')
|
||||||
def _get_invoiced(self):
|
def _get_invoiced(self):
|
||||||
"""
|
"""
|
||||||
@@ -188,7 +202,7 @@ class HotelFolio(models.Model):
|
|||||||
compute='_amount_all', track_visibility='always')
|
compute='_amount_all', track_visibility='always')
|
||||||
|
|
||||||
#Checkin Fields-----------------------------------------------------
|
#Checkin Fields-----------------------------------------------------
|
||||||
checkin_partner_ids = fields.One2many('hotel.checkin.partner', 'reservation_id')
|
checkin_partner_ids = fields.One2many('hotel.checkin.partner', 'folio_id')
|
||||||
booking_pending = fields.Integer('Booking pending',
|
booking_pending = fields.Integer('Booking pending',
|
||||||
compute='_compute_checkin_partner_count')
|
compute='_compute_checkin_partner_count')
|
||||||
checkin_partner_count = fields.Integer('Checkin counter',
|
checkin_partner_count = fields.Integer('Checkin counter',
|
||||||
@@ -211,7 +225,20 @@ class HotelFolio(models.Model):
|
|||||||
string='Invoice Address', required=True,
|
string='Invoice Address', required=True,
|
||||||
states={'done': [('readonly', True)]},
|
states={'done': [('readonly', True)]},
|
||||||
help="Invoice address for current sales order.")
|
help="Invoice address for current sales order.")
|
||||||
|
partner_invoice_vat = fields.Char(related="partner_invoice_id.vat")
|
||||||
|
partner_invoice_name = fields.Char(related="partner_invoice_id.name")
|
||||||
|
partner_invoice_street = fields.Char(related="partner_invoice_id.street")
|
||||||
|
partner_invoice_street2 = fields.Char(related="partner_invoice_id.street")
|
||||||
|
partner_invoice_zip = fields.Char(related="partner_invoice_id.zip")
|
||||||
|
partner_invoice_city = fields.Char(related="partner_invoice_id.city")
|
||||||
|
partner_invoice_state_id = fields.Many2one(related="partner_invoice_id.state_id")
|
||||||
|
partner_invoice_country_id = fields.Many2one(related="partner_invoice_id.country_id")
|
||||||
|
partner_invoice_email = fields.Char(related="partner_invoice_id.email")
|
||||||
|
partner_invoice_lang = fields.Selection(related="partner_invoice_id.lang")
|
||||||
|
partner_invoice_type = fields.Selection(related="partner_invoice_id.type")
|
||||||
|
partner_invoice_parent_id = fields.Many2one(related="partner_invoice_id.parent_id")
|
||||||
fiscal_position_id = fields.Many2one('account.fiscal.position', oldname='fiscal_position', string='Fiscal Position')
|
fiscal_position_id = fields.Many2one('account.fiscal.position', oldname='fiscal_position', string='Fiscal Position')
|
||||||
|
partner_diff_invoicing = fields.Boolean('Bill to another Address', default='_default_diff_invoicing')
|
||||||
|
|
||||||
#WorkFlow Mail Fields-----------------------------------------------
|
#WorkFlow Mail Fields-----------------------------------------------
|
||||||
has_confirmed_reservations_to_send = fields.Boolean(
|
has_confirmed_reservations_to_send = fields.Boolean(
|
||||||
@@ -253,7 +280,7 @@ class HotelFolio(models.Model):
|
|||||||
'amount_total': amount_untaxed + amount_tax,
|
'amount_total': amount_untaxed + amount_tax,
|
||||||
})
|
})
|
||||||
|
|
||||||
@api.depends('amount_total', 'payment_ids', 'return_ids')
|
@api.depends('amount_total', 'payment_ids', 'return_ids', 'reservation_type')
|
||||||
@api.multi
|
@api.multi
|
||||||
def compute_amount(self):
|
def compute_amount(self):
|
||||||
acc_pay_obj = self.env['account.payment']
|
acc_pay_obj = self.env['account.payment']
|
||||||
@@ -446,18 +473,20 @@ class HotelFolio(models.Model):
|
|||||||
'partner_invoice_id': False,
|
'partner_invoice_id': False,
|
||||||
'payment_term_id': False,
|
'payment_term_id': False,
|
||||||
'fiscal_position_id': False,
|
'fiscal_position_id': False,
|
||||||
|
'partner_diff_invoicing': False,
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
|
|
||||||
addr = self.partner_id.address_get(['invoice'])
|
addr = self.partner_id.address_get(['invoice'])
|
||||||
pricelist = self.partner_id.property_product_pricelist and \
|
pricelist = self.partner_id.property_product_pricelist and \
|
||||||
self.partner_id.property_product_pricelist.id or \
|
self.partner_id.property_product_pricelist.id or \
|
||||||
self.env['ir.default'].sudo().get('res.config.settings', 'default_pricelist_id')
|
self.env['ir.default'].sudo().get('res.config.settings', 'default_pricelist_id')
|
||||||
values = {
|
values = {
|
||||||
'pricelist_id': pricelist,
|
'pricelist_id': pricelist,
|
||||||
'payment_term_id': self.partner_id.property_payment_term_id and self.partner_id.property_payment_term_id.id or False,
|
'payment_term_id': self.partner_id.property_payment_term_id and self.partner_id.property_payment_term_id.id or False,
|
||||||
'partner_invoice_id': addr['invoice'],
|
'partner_invoice_id': addr['invoice'],
|
||||||
'user_id': self.partner_id.user_id.id or self.env.uid
|
'user_id': self.partner_id.user_id.id or self.env.uid,
|
||||||
|
'partner_diff_invoicing': False if self.partner_id.id == addr['invoice'] else True
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.env['ir.config_parameter'].sudo().get_param('sale.use_sale_note') and \
|
if self.env['ir.config_parameter'].sudo().get_param('sale.use_sale_note') and \
|
||||||
@@ -477,6 +506,20 @@ class HotelFolio(models.Model):
|
|||||||
self.reservation_type)}
|
self.reservation_type)}
|
||||||
self.update(values)
|
self.update(values)
|
||||||
|
|
||||||
|
@api.onchange('partner_diff_invoicing')
|
||||||
|
def onchange_partner_diff_invoicing(self):
|
||||||
|
if self.partner_diff_invoicing == False:
|
||||||
|
self.update({'partner_invoice_id': self.partner_id.id})
|
||||||
|
elif self.partner_id == self.partner_invoice_id:
|
||||||
|
self.update({'partner_invoice_id': self.partner_id.address_get(['invoice'])['invoice'] or None})
|
||||||
|
|
||||||
|
@api.onchange('partner_invoice_id')
|
||||||
|
def onchange_partner_invoice_id(self):
|
||||||
|
if self.partner_invoice_id and not self.partner_invoice_id.parent_id and \
|
||||||
|
self.partner_invoice_id != self.partner_id:
|
||||||
|
self.update({
|
||||||
|
'partner_invoice_parent_id': self.partner_id.id,
|
||||||
|
'partner_invoice_type': 'invoice'})
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def calcule_reservation_type(self, is_staff, current_type):
|
def calcule_reservation_type(self, is_staff, current_type):
|
||||||
@@ -587,64 +630,73 @@ class HotelFolio(models.Model):
|
|||||||
@api.depends('room_lines')
|
@api.depends('room_lines')
|
||||||
def _compute_has_confirmed_reservations_to_send(self):
|
def _compute_has_confirmed_reservations_to_send(self):
|
||||||
has_to_send = False
|
has_to_send = False
|
||||||
for rline in self.room_lines:
|
if self.reservation_type != 'out':
|
||||||
if rline.splitted:
|
for rline in self.room_lines:
|
||||||
master_reservation = rline.parent_reservation or rline
|
if rline.splitted:
|
||||||
has_to_send = self.env['hotel.reservation'].search_count([
|
master_reservation = rline.parent_reservation or rline
|
||||||
('splitted', '=', True),
|
has_to_send = self.env['hotel.reservation'].search_count([
|
||||||
('folio_id', '=', self.id),
|
('splitted', '=', True),
|
||||||
('to_send', '=', True),
|
('folio_id', '=', self.id),
|
||||||
('state', 'in', ('confirm', 'booking')),
|
('to_send', '=', True),
|
||||||
'|',
|
('state', 'in', ('confirm', 'booking')),
|
||||||
('parent_reservation', '=', master_reservation.id),
|
'|',
|
||||||
('id', '=', master_reservation.id),
|
('parent_reservation', '=', master_reservation.id),
|
||||||
]) > 0
|
('id', '=', master_reservation.id),
|
||||||
elif rline.to_send and rline.state in ('confirm', 'booking'):
|
]) > 0
|
||||||
has_to_send = True
|
elif rline.to_send and rline.state in ('confirm', 'booking'):
|
||||||
break
|
has_to_send = True
|
||||||
self.has_confirmed_reservations_to_send = has_to_send
|
break
|
||||||
|
self.has_confirmed_reservations_to_send = has_to_send
|
||||||
|
else:
|
||||||
|
self.has_confirmed_reservations_to_send = False
|
||||||
|
|
||||||
@api.depends('room_lines')
|
@api.depends('room_lines')
|
||||||
def _compute_has_cancelled_reservations_to_send(self):
|
def _compute_has_cancelled_reservations_to_send(self):
|
||||||
has_to_send = False
|
has_to_send = False
|
||||||
for rline in self.room_lines:
|
if self.reservation_type != 'out':
|
||||||
if rline.splitted:
|
for rline in self.room_lines:
|
||||||
master_reservation = rline.parent_reservation or rline
|
if rline.splitted:
|
||||||
has_to_send = self.env['hotel.reservation'].search_count([
|
master_reservation = rline.parent_reservation or rline
|
||||||
('splitted', '=', True),
|
has_to_send = self.env['hotel.reservation'].search_count([
|
||||||
('folio_id', '=', self.id),
|
('splitted', '=', True),
|
||||||
('to_send', '=', True),
|
('folio_id', '=', self.id),
|
||||||
('state', '=', 'cancelled'),
|
('to_send', '=', True),
|
||||||
'|',
|
('state', '=', 'cancelled'),
|
||||||
('parent_reservation', '=', master_reservation.id),
|
'|',
|
||||||
('id', '=', master_reservation.id),
|
('parent_reservation', '=', master_reservation.id),
|
||||||
]) > 0
|
('id', '=', master_reservation.id),
|
||||||
elif rline.to_send and rline.state == 'cancelled':
|
]) > 0
|
||||||
has_to_send = True
|
elif rline.to_send and rline.state == 'cancelled':
|
||||||
break
|
has_to_send = True
|
||||||
self.has_cancelled_reservations_to_send = has_to_send
|
break
|
||||||
|
self.has_cancelled_reservations_to_send = has_to_send
|
||||||
|
else:
|
||||||
|
self.has_cancelled_reservations_to_send = False
|
||||||
|
|
||||||
@api.depends('room_lines')
|
@api.depends('room_lines')
|
||||||
def _compute_has_checkout_to_send(self):
|
def _compute_has_checkout_to_send(self):
|
||||||
has_to_send = True
|
has_to_send = True
|
||||||
for rline in self.room_lines:
|
if self.reservation_type != 'out':
|
||||||
if rline.splitted:
|
for rline in self.room_lines:
|
||||||
master_reservation = rline.parent_reservation or rline
|
if rline.splitted:
|
||||||
nreservs = self.env['hotel.reservation'].search_count([
|
master_reservation = rline.parent_reservation or rline
|
||||||
('splitted', '=', True),
|
nreservs = self.env['hotel.reservation'].search_count([
|
||||||
('folio_id', '=', self.id),
|
('splitted', '=', True),
|
||||||
('to_send', '=', True),
|
('folio_id', '=', self.id),
|
||||||
('state', '=', 'done'),
|
('to_send', '=', True),
|
||||||
'|',
|
('state', '=', 'done'),
|
||||||
('parent_reservation', '=', master_reservation.id),
|
'|',
|
||||||
('id', '=', master_reservation.id),
|
('parent_reservation', '=', master_reservation.id),
|
||||||
])
|
('id', '=', master_reservation.id),
|
||||||
if nreservs != len(self.room_lines):
|
])
|
||||||
|
if nreservs != len(self.room_lines):
|
||||||
|
has_to_send = False
|
||||||
|
elif not rline.to_send or rline.state != 'done':
|
||||||
has_to_send = False
|
has_to_send = False
|
||||||
elif not rline.to_send or rline.state != 'done':
|
break
|
||||||
has_to_send = False
|
self.has_checkout_to_send = has_to_send
|
||||||
break
|
else:
|
||||||
self.has_checkout_to_send = has_to_send
|
self.has_checkout_to_send = False
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def send_reservation_mail(self):
|
def send_reservation_mail(self):
|
||||||
|
|||||||
@@ -78,6 +78,20 @@ class HotelReservation(models.Model):
|
|||||||
else:
|
else:
|
||||||
return default_departure_hour
|
return default_departure_hour
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def _default_diff_invoicing(self):
|
||||||
|
"""
|
||||||
|
If the guest has an invoicing address set,
|
||||||
|
this method return diff_invoicing = True, else, return False
|
||||||
|
"""
|
||||||
|
if 'reservation_id' in self.env.context:
|
||||||
|
reservation = self.env['hotel.reservation'].browse([
|
||||||
|
self.env.context['reservation_id']
|
||||||
|
])
|
||||||
|
if reservation.partner_id.id == reservation.partner_invoice_id.id:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
@api.depends('state', 'qty_to_invoice', 'qty_invoiced')
|
@api.depends('state', 'qty_to_invoice', 'qty_invoiced')
|
||||||
def _compute_invoice_status(self):
|
def _compute_invoice_status(self):
|
||||||
"""
|
"""
|
||||||
@@ -172,14 +186,12 @@ class HotelReservation(models.Model):
|
|||||||
ondelete='cascade')
|
ondelete='cascade')
|
||||||
|
|
||||||
checkin = fields.Date('Check In', required=True,
|
checkin = fields.Date('Check In', required=True,
|
||||||
default=_get_default_checkin,
|
default=_get_default_checkin)
|
||||||
track_visibility='onchange')
|
|
||||||
checkout = fields.Date('Check Out', required=True,
|
checkout = fields.Date('Check Out', required=True,
|
||||||
default=_get_default_checkout,
|
default=_get_default_checkout)
|
||||||
track_visibility='onchange')
|
real_checkin = fields.Date('Arrival', required=True,
|
||||||
real_checkin = fields.Date('Real Check In', required=True,
|
|
||||||
track_visibility='onchange')
|
track_visibility='onchange')
|
||||||
real_checkout = fields.Date('Real Check Out', required=True,
|
real_checkout = fields.Date('Departure', required=True,
|
||||||
track_visibility='onchange')
|
track_visibility='onchange')
|
||||||
arrival_hour = fields.Char('Arrival Hour',
|
arrival_hour = fields.Char('Arrival Hour',
|
||||||
default=_get_default_arrival_hour,
|
default=_get_default_arrival_hour,
|
||||||
@@ -191,7 +203,21 @@ class HotelReservation(models.Model):
|
|||||||
required=True, track_visibility='onchange')
|
required=True, track_visibility='onchange')
|
||||||
|
|
||||||
partner_id = fields.Many2one(related='folio_id.partner_id')
|
partner_id = fields.Many2one(related='folio_id.partner_id')
|
||||||
|
partner_invoice_id = fields.Many2one(related='folio_id.partner_invoice_id')
|
||||||
|
partner_invoice_vat = fields.Char(related="partner_invoice_id.vat")
|
||||||
|
partner_invoice_name = fields.Char(related="partner_invoice_id.name")
|
||||||
|
partner_invoice_street = fields.Char(related="partner_invoice_id.street")
|
||||||
|
partner_invoice_street2 = fields.Char(related="partner_invoice_id.street")
|
||||||
|
partner_invoice_zip = fields.Char(related="partner_invoice_id.zip")
|
||||||
|
partner_invoice_city = fields.Char(related="partner_invoice_id.city")
|
||||||
|
partner_invoice_state_id = fields.Many2one(related="partner_invoice_id.state_id")
|
||||||
|
partner_invoice_country_id = fields.Many2one(related="partner_invoice_id.country_id")
|
||||||
|
partner_invoice_email = fields.Char(related="partner_invoice_id.email")
|
||||||
|
partner_invoice_lang = fields.Selection(related="partner_invoice_id.lang")
|
||||||
closure_reason_id = fields.Many2one(related='folio_id.closure_reason_id')
|
closure_reason_id = fields.Many2one(related='folio_id.closure_reason_id')
|
||||||
|
partner_invoice_type = fields.Selection(related="partner_invoice_id.type")
|
||||||
|
partner_invoice_parent_id = fields.Many2one(related="partner_invoice_id.parent_id")
|
||||||
|
partner_diff_invoicing = fields.Boolean('Bill to another Address', default='_default_diff_invoicing')
|
||||||
company_id = fields.Many2one(related='folio_id.company_id', string='Company', store=True, readonly=True)
|
company_id = fields.Many2one(related='folio_id.company_id', string='Company', store=True, readonly=True)
|
||||||
reservation_line_ids = fields.One2many('hotel.reservation.line',
|
reservation_line_ids = fields.One2many('hotel.reservation.line',
|
||||||
'reservation_id',
|
'reservation_id',
|
||||||
@@ -296,8 +322,10 @@ class HotelReservation(models.Model):
|
|||||||
readonly=True,
|
readonly=True,
|
||||||
store=True,
|
store=True,
|
||||||
compute='_compute_amount_set')
|
compute='_compute_amount_set')
|
||||||
# FIXME discount per night
|
discount = fields.Float(string='Discount (€)',
|
||||||
discount = fields.Float(string='Discount (%)', digits=dp.get_precision('Discount'), default=0.0)
|
digits=dp.get_precision('Discount'),
|
||||||
|
compute='_compute_discount',
|
||||||
|
store=True)
|
||||||
|
|
||||||
analytic_tag_ids = fields.Many2many('account.analytic.tag', string='Analytic Tags')
|
analytic_tag_ids = fields.Many2many('account.analytic.tag', string='Analytic Tags')
|
||||||
|
|
||||||
@@ -551,11 +579,14 @@ class HotelReservation(models.Model):
|
|||||||
|
|
||||||
@api.onchange('partner_id')
|
@api.onchange('partner_id')
|
||||||
def onchange_partner_id(self):
|
def onchange_partner_id(self):
|
||||||
|
addr = self.partner_id.address_get(['invoice'])
|
||||||
pricelist = self.partner_id.property_product_pricelist and \
|
pricelist = self.partner_id.property_product_pricelist and \
|
||||||
self.partner_id.property_product_pricelist.id or \
|
self.partner_id.property_product_pricelist.id or \
|
||||||
self.env['ir.default'].sudo().get('res.config.settings', 'default_pricelist_id')
|
self.env['ir.default'].sudo().get('res.config.settings', 'default_pricelist_id')
|
||||||
values = {
|
values = {
|
||||||
'pricelist_id': pricelist,
|
'pricelist_id': pricelist,
|
||||||
|
'partner_invoice_id': addr['invoice'],
|
||||||
|
'partner_diff_invoicing': False if self.partner_id.id == addr['invoice'] else True
|
||||||
}
|
}
|
||||||
self.update(values)
|
self.update(values)
|
||||||
|
|
||||||
@@ -655,6 +686,21 @@ class HotelReservation(models.Model):
|
|||||||
]
|
]
|
||||||
return {'domain': {'room_id': domain_rooms}}
|
return {'domain': {'room_id': domain_rooms}}
|
||||||
|
|
||||||
|
@api.onchange('partner_diff_invoicing')
|
||||||
|
def onchange_partner_diff_invoicing(self):
|
||||||
|
if self.partner_diff_invoicing == False:
|
||||||
|
self.update({'partner_invoice_id': self.partner_id.id})
|
||||||
|
elif self.partner_id == self.partner_invoice_id:
|
||||||
|
self.update({'partner_invoice_id': self.partner_id.address_get(['invoice'])['invoice'] or None})
|
||||||
|
|
||||||
|
@api.onchange('partner_invoice_id')
|
||||||
|
def onchange_partner_invoice_id(self):
|
||||||
|
if self.partner_invoice_id and not self.partner_invoice_id.parent_id and \
|
||||||
|
self.partner_invoice_id != self.partner_id:
|
||||||
|
self.update({
|
||||||
|
'partner_invoice_parent_id': self.partner_id.id,
|
||||||
|
'partner_invoice_type': 'invoice'})
|
||||||
|
|
||||||
@api.onchange('board_service_room_id')
|
@api.onchange('board_service_room_id')
|
||||||
def onchange_board_service(self):
|
def onchange_board_service(self):
|
||||||
if self.board_service_room_id:
|
if self.board_service_room_id:
|
||||||
@@ -731,7 +777,6 @@ class HotelReservation(models.Model):
|
|||||||
for record in self:
|
for record in self:
|
||||||
record.write({
|
record.write({
|
||||||
'state': 'cancelled',
|
'state': 'cancelled',
|
||||||
'discount': 100.0,
|
|
||||||
})
|
})
|
||||||
if record.splitted:
|
if record.splitted:
|
||||||
master_reservation = record.parent_reservation or record
|
master_reservation = record.parent_reservation or record
|
||||||
@@ -790,7 +835,13 @@ class HotelReservation(models.Model):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@api.depends('reservation_line_ids', 'reservation_line_ids.discount', 'tax_ids')
|
@api.depends('reservation_line_ids.discount')
|
||||||
|
def _compute_discount(self):
|
||||||
|
for record in self:
|
||||||
|
record.discount = sum(line.price * ((line.discount or 0.0) * 0.01) \
|
||||||
|
for line in record.reservation_line_ids)
|
||||||
|
|
||||||
|
@api.depends('reservation_line_ids.price', 'discount', 'tax_ids')
|
||||||
def _compute_amount_reservation(self):
|
def _compute_amount_reservation(self):
|
||||||
"""
|
"""
|
||||||
Compute the amounts of the reservation.
|
Compute the amounts of the reservation.
|
||||||
@@ -799,7 +850,7 @@ class HotelReservation(models.Model):
|
|||||||
amount_room = sum(record.reservation_line_ids.mapped('price'))
|
amount_room = sum(record.reservation_line_ids.mapped('price'))
|
||||||
if amount_room > 0:
|
if amount_room > 0:
|
||||||
product = record.room_type_id.product_id
|
product = record.room_type_id.product_id
|
||||||
price = amount_room * (1 - (record.discount or 0.0) * 0.01)
|
price = amount_room - record.discount
|
||||||
taxes = record.tax_ids.compute_all(price, record.currency_id, 1, product=product)
|
taxes = record.tax_ids.compute_all(price, record.currency_id, 1, product=product)
|
||||||
record.update({
|
record.update({
|
||||||
'price_tax': sum(t.get('amount', 0.0) for t in taxes.get('taxes', [])),
|
'price_tax': sum(t.get('amount', 0.0) for t in taxes.get('taxes', [])),
|
||||||
@@ -858,7 +909,7 @@ class HotelReservation(models.Model):
|
|||||||
def action_pay_reservation(self):
|
def action_pay_reservation(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
partner = self.partner_id.id
|
partner = self.partner_id.id
|
||||||
amount = min(self.amount_reservation, self.folio_pending_amount)
|
amount = min(self.price_room_services_set, self.folio_pending_amount)
|
||||||
note = self.folio_id.name + ' (' + self.name + ')'
|
note = self.folio_id.name + ' (' + self.name + ')'
|
||||||
view_id = self.env.ref('hotel.account_payment_view_form_folio').id
|
view_id = self.env.ref('hotel.account_payment_view_form_folio').id
|
||||||
return{
|
return{
|
||||||
@@ -971,9 +1022,13 @@ class HotelReservation(models.Model):
|
|||||||
def _compute_checkin_partner_count(self):
|
def _compute_checkin_partner_count(self):
|
||||||
_logger.info('_compute_checkin_partner_count')
|
_logger.info('_compute_checkin_partner_count')
|
||||||
for record in self:
|
for record in self:
|
||||||
record.checkin_partner_count = len(record.checkin_partner_ids)
|
if record.reservation_type != 'out':
|
||||||
record.checkin_partner_pending_count = (record.adults + record.children) \
|
record.checkin_partner_count = len(record.checkin_partner_ids)
|
||||||
- len(record.checkin_partner_ids)
|
record.checkin_partner_pending_count = (record.adults + record.children) \
|
||||||
|
- len(record.checkin_partner_ids)
|
||||||
|
else:
|
||||||
|
record.checkin_partner_count = 0
|
||||||
|
record.checkin_partner_pending_count = 0
|
||||||
|
|
||||||
# https://www.odoo.com/es_ES/forum/ayuda-1/question/calculated-fields-in-search-filter-possible-118501
|
# https://www.odoo.com/es_ES/forum/ayuda-1/question/calculated-fields-in-search-filter-possible-118501
|
||||||
@api.multi
|
@api.multi
|
||||||
@@ -991,15 +1046,11 @@ class HotelReservation(models.Model):
|
|||||||
@api.multi
|
@api.multi
|
||||||
def action_checks(self):
|
def action_checks(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
return {
|
action = self.env.ref('hotel.open_hotel_reservation_form_tree_all').read()[0]
|
||||||
'name': _('Checkins'),
|
action['views'] = [(self.env.ref('hotel.hotel_reservation_checkin_view_form').id, 'form')]
|
||||||
'view_type': 'form',
|
action['res_id'] = self.id
|
||||||
'view_mode': 'tree,form',
|
action['target'] = 'new'
|
||||||
'res_model': 'hotel.checkin.partner',
|
return action
|
||||||
'type': 'ir.actions.act_window',
|
|
||||||
'domain': [('reservation_id', '=', self.id)],
|
|
||||||
'target': 'new',
|
|
||||||
}
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
RESERVATION SPLITTED -----------------------------------------------
|
RESERVATION SPLITTED -----------------------------------------------
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ class HotelServiceLine(models.Model):
|
|||||||
_name = "hotel.service.line"
|
_name = "hotel.service.line"
|
||||||
_order = "date"
|
_order = "date"
|
||||||
|
|
||||||
service_id = fields.Many2one('hotel.service', string='Service',
|
service_id = fields.Many2one('hotel.service', string='Service Room',
|
||||||
ondelete='cascade', required=True,
|
ondelete='cascade', required=True,
|
||||||
copy=False)
|
copy=False)
|
||||||
date = fields.Date('Date')
|
date = fields.Date('Date')
|
||||||
day_qty = fields.Integer('Units')
|
day_qty = fields.Integer('Units')
|
||||||
product_id = fields.Many2one(related='service_id.product_id')
|
product_id = fields.Many2one(related='service_id.product_id', store=True)
|
||||||
|
|
||||||
@api.constrains('day_qty')
|
@api.constrains('day_qty')
|
||||||
def no_free_resources(self):
|
def no_free_resources(self):
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<act_window
|
<act_window
|
||||||
id="action_checkin_partner"
|
id="action_checkin_partner"
|
||||||
name="Action checkin"
|
name="Action checkin"
|
||||||
res_model='hotel.checkin.partner'
|
res_model="hotel.checkin.partner"
|
||||||
view_mode="tree,form" />
|
view_mode="tree,form" />
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<field name="model">hotel.checkin.partner</field>
|
<field name="model">hotel.checkin.partner</field>
|
||||||
<field name="priority">20</field>
|
<field name="priority">20</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree editable="bottom"
|
<tree editable="bottom" create="1"
|
||||||
decoration-danger="state == 'draft'"
|
decoration-danger="state == 'draft'"
|
||||||
decoration-muted="state == 'cancelled' or state =='done'"
|
decoration-muted="state == 'cancelled' or state =='done'"
|
||||||
decoration-success="state == 'booking'">
|
decoration-success="state == 'booking'">
|
||||||
@@ -51,10 +51,13 @@
|
|||||||
help="Get in"
|
help="Get in"
|
||||||
/>
|
/>
|
||||||
<field name="partner_id" required="True"/>
|
<field name="partner_id" required="True"/>
|
||||||
|
<field name="mobile"/>
|
||||||
|
<field name="email"/>
|
||||||
<field name="enter_date"/>
|
<field name="enter_date"/>
|
||||||
<field name="exit_date"/>
|
<field name="exit_date"/>
|
||||||
<field name="reservation_id"/>
|
<field name="reservation_id" invisible="1"/>
|
||||||
<field name="state" />
|
<field name="folio_id" force_save="1" invisible="1"/>
|
||||||
|
<field name="state"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -75,10 +78,13 @@
|
|||||||
help="Get in"
|
help="Get in"
|
||||||
/>
|
/>
|
||||||
<field name="partner_id" required="True"/>
|
<field name="partner_id" required="True"/>
|
||||||
|
<field name="mobile"/>
|
||||||
|
<field name="email"/>
|
||||||
<field name="enter_date"/>
|
<field name="enter_date"/>
|
||||||
<field name="exit_date"/>
|
<field name="exit_date"/>
|
||||||
<field name="reservation_id"/>
|
<field name="reservation_id"/>
|
||||||
<field name="state" />
|
<field name="folio_id" force_save="1" invisible="1"/>
|
||||||
|
<field name="state"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -101,23 +107,38 @@
|
|||||||
/>
|
/>
|
||||||
<filter string="Checkins Tomorrow" name="enter_tomorrow"
|
<filter string="Checkins Tomorrow" name="enter_tomorrow"
|
||||||
domain="[('enter_date', '=', (context_today()+datetime.timedelta(days=1)).strftime('%Y-%m-%d')),
|
domain="[('enter_date', '=', (context_today()+datetime.timedelta(days=1)).strftime('%Y-%m-%d')),
|
||||||
('state', '=', 'draft')]"
|
('state', '=', 'confirm')]"
|
||||||
help="Show all checkins for enter tomorrow"/>
|
help="Show all checkins for enter tomorrow"/>
|
||||||
<filter string="Checkins to 7 days" name="next_res_week"
|
<filter string="Checkins to 7 days" name="next_res_week"
|
||||||
domain="[('enter_date', '<', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d')),
|
domain="[('enter_date', '<', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d')),
|
||||||
('state', '=', 'draft')]"
|
('state', '=', 'confirm')]"
|
||||||
help="Show all reservations for which date enter is before than 7 days"/>
|
help="Show all reservations for which date enter is before than 7 days"/>
|
||||||
<filter string="On Board Tomorrow" name="next_res_2week"
|
<filter string="On Board Tomorrow" name="next_res_2week"
|
||||||
domain="[('enter_date', '<', (context_today()+datetime.timedelta(days=14)).strftime('%Y-%m-%d')),
|
domain="[('enter_date', '<', (context_today()+datetime.timedelta(days=14)).strftime('%Y-%m-%d')),
|
||||||
('state', 'in', ['confirm','draft'])]"
|
('state', 'in', ['confirm','booking'])]"
|
||||||
help="Show all checkins for Tomorrow"/>
|
help="Show all checkins for Tomorrow"/>
|
||||||
<group expand="0" string="Group By">
|
<group expand="0" string="Group By">
|
||||||
<filter string="Creation Date" domain="[]"
|
<filter string="Create by Month" name="create_date_by_month"
|
||||||
context="{'group_by':'create_date'}" />
|
context="{'group_by':'create_date', 'default_order': 'create_date asc'}"/>
|
||||||
<filter string="Checkin Date" domain="[]"
|
<filter string="Create by Week" name="create_date_by_week"
|
||||||
context="{'group_by':'checkin'}" />
|
context="{'group_by':'create_date:week', 'default_order': 'create_date'}"/>
|
||||||
<filter string="Checkout Date" domain="[]"
|
<filter string="Create by Day" name="create_date_by_week"
|
||||||
context="{'group_by':'checkout'}" />
|
context="{'group_by':'create_date:day', 'default_order': 'create_date'}"/>
|
||||||
|
<separator/>
|
||||||
|
<filter string="Checkin by Month" name="checkin_by_month"
|
||||||
|
context="{'group_by':'checkin', 'default_order': 'checkin asc'}"/>
|
||||||
|
<filter string="Checkin by Week" name="checkin_by_week"
|
||||||
|
context="{'group_by':'checkin:week', 'default_order': 'checkin'}"/>
|
||||||
|
<filter string="Checkin by Day" name="checkin_by_week"
|
||||||
|
context="{'group_by':'checkin:day', 'default_order': 'checkin'}"/>
|
||||||
|
<separator/>
|
||||||
|
<filter string="Checkout by Month" name="checkout_by_month"
|
||||||
|
context="{'group_by':'checkout', 'default_order': 'checkout asc'}"/>
|
||||||
|
<filter string="Checkout by Week" name="checkout_by_week"
|
||||||
|
context="{'group_by':'checkout:week', 'default_order': 'checkout'}"/>
|
||||||
|
<filter string="Checkout by Day" name="checkout_by_week"
|
||||||
|
context="{'group_by':'checkout:day', 'default_order': 'checkout'}"/>
|
||||||
|
<separator/>
|
||||||
</group>
|
</group>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
@@ -39,33 +39,6 @@
|
|||||||
|
|
||||||
<sheet>
|
<sheet>
|
||||||
<div class=" oe_button_box">
|
<div class=" oe_button_box">
|
||||||
<button type="action" class="oe_stat_button"
|
|
||||||
id="checkin_partner_smart_button"
|
|
||||||
icon="fa-user-plus"
|
|
||||||
name="%(launch_checkin_wizard_add)d"
|
|
||||||
attrs="{'invisible': [('checkin_partner_pending_count','<=',0)]}"
|
|
||||||
context="{'partner_id': partner_id,'reservation_ids': room_lines,
|
|
||||||
'hidden_checkin_partner': True, 'folio': active_id}">
|
|
||||||
<div class="o_form_field o_stat_info">
|
|
||||||
<span class="o_stat_value"><field name="checkin_partner_pending_count"
|
|
||||||
widget="statinfo" nolabel="1"/></span>
|
|
||||||
<span class="o_stat_text">Pending Checks</span>
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<button type="object" class="oe_stat_button"
|
|
||||||
id="checkin_partner_smart_button"
|
|
||||||
icon="fa-users"
|
|
||||||
name="action_checks"
|
|
||||||
attrs="{'invisible': [('checkin_partner_count','<=',0)]}">
|
|
||||||
<div class="o_form_field o_stat_info">
|
|
||||||
<span class="o_stat_value"><field name="checkin_partner_count"
|
|
||||||
widget="statinfo" nolabel="1"/></span>
|
|
||||||
<span class="o_stat_text">Checks</span>
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
<field name="currency_id" invisible="1"/>
|
|
||||||
|
|
||||||
<button type="object" class="oe_stat_button"
|
<button type="object" class="oe_stat_button"
|
||||||
id="invoices_smart_button"
|
id="invoices_smart_button"
|
||||||
icon="fa-thumbs-up"
|
icon="fa-thumbs-up"
|
||||||
@@ -132,7 +105,8 @@
|
|||||||
<field name="email" placeholder="email"/>
|
<field name="email" placeholder="email"/>
|
||||||
<field name="mobile" placeholder="mobile"/>
|
<field name="mobile" placeholder="mobile"/>
|
||||||
<field name="phone" />
|
<field name="phone" />
|
||||||
<field name="partner_invoice_id" />
|
<field name="segmentation_ids" widget="many2many_tags" placeholder="Segmentation..."
|
||||||
|
options="{'no_create': True,'no_open': True}" />
|
||||||
<field name="cancelled_reason" attrs="{'invisible':[('state','not in',('cancel'))]}"/>
|
<field name="cancelled_reason" attrs="{'invisible':[('state','not in',('cancel'))]}"/>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
@@ -141,8 +115,6 @@
|
|||||||
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
|
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
|
||||||
<field name="reservation_type" attrs="{'readonly':[('state','not in',('draft'))]}"/>
|
<field name="reservation_type" attrs="{'readonly':[('state','not in',('draft'))]}"/>
|
||||||
<field name="channel_type" attrs="{'required':[('reservation_type','=','normal')]}"/>
|
<field name="channel_type" attrs="{'required':[('reservation_type','=','normal')]}"/>
|
||||||
<field name="segmentation_ids" widget="many2many_tags" placeholder="Segmentation..."
|
|
||||||
options="{'no_create': True,'no_open': True}" />
|
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="partner_internal_comment"/>
|
<field name="partner_internal_comment"/>
|
||||||
@@ -150,31 +122,76 @@
|
|||||||
<group>
|
<group>
|
||||||
<field name="internal_comment"/>
|
<field name="internal_comment"/>
|
||||||
</group>
|
</group>
|
||||||
|
<group colspan="2" class="oe_subtotal_footer oe_right">
|
||||||
|
<field name="amount_untaxed" sum="Untaxed amount" widget='monetary' />
|
||||||
|
<field name="amount_tax" widget='monetary' />
|
||||||
|
<div class="oe_subtotal_footer_separator oe_inline">
|
||||||
|
<label for="amount_total" />
|
||||||
|
</div>
|
||||||
|
<field name="amount_total" nolabel="1" sum="Total amount"
|
||||||
|
widget='monetary' />
|
||||||
|
</group>
|
||||||
|
<div class="oe_clear" />
|
||||||
|
<group>
|
||||||
|
<field name="note" />
|
||||||
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group invisible="1">
|
<group invisible="1">
|
||||||
<field name="invoice_ids" invisible="1"/>
|
<field name="invoice_ids" invisible="1"/>
|
||||||
<field name="invoice_status" invisible="1" />
|
<field name="invoice_status" invisible="1" />
|
||||||
|
<field name="currency_id" invisible="1"/>
|
||||||
</group>
|
</group>
|
||||||
<notebook colspan="4" col="1">
|
<notebook colspan="4" col="1">
|
||||||
<page string="Lines">
|
<page string="Reservation Rooms">
|
||||||
<field name="room_lines" colspan="4" string="Room Line"
|
<field name="room_lines" colspan="4" string="Room Line"
|
||||||
nolabel="1" context="{'from_folio':True,'room_lines':room_lines,'folio_id': id,'tree_view_ref':'hotel.hotel_reservation_view_bottom_tree', 'form_view_ref':'hotel.hotel_reservation_view_form'}"/>
|
nolabel="1" context="{'from_folio':True,'room_lines':room_lines,'folio_id': id,'tree_view_ref':'hotel.hotel_reservation_view_bottom_tree', 'form_view_ref':'hotel.hotel_reservation_view_form'}"/>
|
||||||
|
</page>
|
||||||
|
<page string="Services">
|
||||||
<separator string="Service Lines" colspan="4"/>
|
<separator string="Service Lines" colspan="4"/>
|
||||||
<field name="service_ids"
|
<field name="service_ids"
|
||||||
context="{'from_room':False,'folio_id': id,'tree_view_ref':'hotel.hotel_service_view_tree', 'form_view_ref':'hotel.hotel_service_view_form'}"
|
context="{'from_room':False,'folio_id': id,'tree_view_ref':'hotel.hotel_service_view_tree', 'form_view_ref':'hotel.hotel_service_view_form'}"
|
||||||
nolabel="1" />
|
nolabel="1" />
|
||||||
<group colspan="2" class="oe_subtotal_footer oe_right">
|
</page>
|
||||||
<field name="amount_untaxed" sum="Untaxed amount" widget='monetary' />
|
<page name="persons" string="Persons">
|
||||||
<field name="amount_tax" widget='monetary' />
|
<field name="checkin_partner_ids"
|
||||||
<div class="oe_subtotal_footer_separator oe_inline">
|
context="{
|
||||||
<label for="amount_total" />
|
'default_reservation_id': id,
|
||||||
</div>
|
'reservation_id': id,
|
||||||
<field name="amount_total" nolabel="1" sum="Total amount"
|
'tree_view_ref':'hotel.hotel_checkin_partner_reservation_view_tree',
|
||||||
widget='monetary' />
|
}"
|
||||||
</group>
|
/>
|
||||||
<div class="oe_clear" />
|
</page>
|
||||||
|
<page name="invoicing" string="Invoicing">
|
||||||
<group>
|
<group>
|
||||||
<field name="note" />
|
<field name="partner_diff_invoicing" string="Bill to another Address"/>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="partner_invoice_id"
|
||||||
|
string="Contact Invoiced"
|
||||||
|
attrs="{'invisible':[('partner_diff_invoicing','=',False)]}"/>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<group>
|
||||||
|
<field name="partner_invoice_vat" />
|
||||||
|
<field name="partner_invoice_email" />
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="partner_invoice_parent_id" />
|
||||||
|
<field name="partner_invoice_type" />
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<label for="partner_invoice_street" string="Address"/>
|
||||||
|
<div class="o_address_format">
|
||||||
|
<field name="partner_invoice_street" placeholder="Street..." class="o_address_street"/>
|
||||||
|
<field name="partner_invoice_street2" placeholder="Street 2..." class="o_address_street"/>
|
||||||
|
<field name="partner_invoice_city" placeholder="City" class="o_address_city"/>
|
||||||
|
<field name="partner_invoice_state_id" class="o_address_state" placeholder="State" options='{"no_open": True}'/>
|
||||||
|
<field name="partner_invoice_zip" placeholder="ZIP" class="o_address_zip"/>
|
||||||
|
<field name="partner_invoice_country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/>
|
||||||
|
</div>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
<page string="Other data" invisible="1">
|
<page string="Other data" invisible="1">
|
||||||
@@ -327,9 +344,9 @@
|
|||||||
<field name="view_mode">tree,form,graph</field>
|
<field name="view_mode">tree,form,graph</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<menuitem id="menu_all_folio" name="Folio"
|
<menuitem id="menu_all_folio" name="Reservations"
|
||||||
parent="hotel.hotel_management_menu" sequence="4"/>
|
parent="hotel.hotel_management_menu" sequence="4"/>
|
||||||
<menuitem name="Generate Folio" id="menu_open_hotel_folio1_form_tree_all"
|
<menuitem name="Folios" id="menu_open_hotel_folio1_form_tree_all"
|
||||||
action="open_hotel_folio1_form_tree_all" sequence="5" parent="menu_all_folio" />
|
action="open_hotel_folio1_form_tree_all" sequence="15" parent="menu_all_folio" />
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<record model="ir.ui.view" id="hotel_reservation_view_form">
|
<record model="ir.ui.view" id="hotel_reservation_view_form">
|
||||||
<field name="name">hotel.reservation.form</field>
|
<field name="name">hotel.reservation.form</field>
|
||||||
<field name="model">hotel.reservation</field>
|
<field name="model">hotel.reservation</field>
|
||||||
|
<field name="priority">20</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Reservation" >
|
<form string="Reservation" >
|
||||||
<header>
|
<header>
|
||||||
@@ -23,24 +24,26 @@
|
|||||||
<field name="has_confirmed_reservations_to_send" invisible="1" />
|
<field name="has_confirmed_reservations_to_send" invisible="1" />
|
||||||
<field name="has_cancelled_reservations_to_send" invisible="1" />
|
<field name="has_cancelled_reservations_to_send" invisible="1" />
|
||||||
<field name="has_checkout_to_send" invisible="1" />
|
<field name="has_checkout_to_send" invisible="1" />
|
||||||
|
<field name="checkin_partner_count" invisible="1" />
|
||||||
|
<button name="open_invoices_reservation"
|
||||||
|
string="Create Invoice" type="object" class="btn-primary" states="sale"
|
||||||
|
attrs="{'invisible': ['|',('state', '=', 'draft'), ('reservation_type','not in',('normal'))]}" />
|
||||||
<button name="send_reservation_mail" type="object" string="Send Confirmation Email"
|
<button name="send_reservation_mail" type="object" string="Send Confirmation Email"
|
||||||
attrs="{'invisible': [('has_confirmed_reservations_to_send', '=', False)]}" class="oe_highlight"/>
|
attrs="{'invisible': [('has_confirmed_reservations_to_send', '=', False)]}"/>
|
||||||
<button name="send_cancel_mail" type="object" string="Send Cancel Email"
|
<button name="send_cancel_mail" type="object" string="Send Cancel Email"
|
||||||
attrs="{'invisible': [('has_cancelled_reservations_to_send', '=', False)]}" class="oe_highlight"/>
|
attrs="{'invisible': [('has_cancelled_reservations_to_send', '=', False)]}" />
|
||||||
<button name="send_exit_mail" type="object" string="Send Exit Email"
|
<button name="send_exit_mail" type="object" string="Send Exit Email"
|
||||||
attrs="{'invisible': [('has_checkout_to_send', '=', False)]}" class="oe_highlight"/>
|
attrs="{'invisible': [('has_checkout_to_send', '=', False)]}" />
|
||||||
|
|
||||||
<button name="send_reservation_mail" type="object" string="Send Reservation Email" states="confirm" class="oe_highlight"/>
|
|
||||||
<button name="confirm" string="Confirm" class="oe_highlight"
|
<button name="confirm" string="Confirm" class="oe_highlight"
|
||||||
type="object"
|
type="object"
|
||||||
attrs="{'invisible':[('state','not in',('draft','cancelled'))]}"
|
attrs="{'invisible':[('state','not in',('draft','cancelled'))]}"
|
||||||
/>
|
/>
|
||||||
<button name="action_cancel" string="Cancel Reservation"
|
<button name="action_cancel" string="Cancel Reservation"
|
||||||
class="oe_highlight" type="object"
|
type="object"
|
||||||
attrs="{'invisible':['|',('folio_id', '=', False),('state','not in',('confirm','booking'))]}"
|
attrs="{'invisible':['|',('folio_id', '=', False),('state','not in',('confirm','booking'))]}"
|
||||||
/>
|
/>
|
||||||
<button name="action_reservation_checkout" string="Done"
|
<button name="action_reservation_checkout" string="Done"
|
||||||
states="booking" class="oe_highlight"
|
states="booking"
|
||||||
type="object"
|
type="object"
|
||||||
/>
|
/>
|
||||||
<button name="draft" string="Set to Draft"
|
<button name="draft" string="Set to Draft"
|
||||||
@@ -48,12 +51,12 @@
|
|||||||
type="object"
|
type="object"
|
||||||
/>
|
/>
|
||||||
<button name="%(action_hotel_split_reservation)d" string="Split"
|
<button name="%(action_hotel_split_reservation)d" string="Split"
|
||||||
type="action" class="oe_highlight"
|
type="action"
|
||||||
icon="fa-cut"
|
icon="fa-cut"
|
||||||
attrs="{'invisible':['|',('folio_id', '=', False),('state','not in',('draft','confirm','booking'))]}"
|
attrs="{'invisible':['|',('folio_id', '=', False),('state','not in',('draft','confirm','booking'))]}"
|
||||||
/>
|
/>
|
||||||
<button name="unify" string="Unify"
|
<button name="unify" string="Unify"
|
||||||
type="object" class="oe_highlight"
|
type="object"
|
||||||
icon="fa-compress"
|
icon="fa-compress"
|
||||||
attrs="{'invisible':[('splitted', '=', False)]}"
|
attrs="{'invisible':[('splitted', '=', False)]}"
|
||||||
/>
|
/>
|
||||||
@@ -90,7 +93,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<button type="action" class="oe_stat_button"
|
<button type="action" class="oe_stat_button"
|
||||||
icon="fa-list-ul"
|
icon="fa-list-ul"
|
||||||
attrs="{'invisible': [('partner_id','=',False)]}"
|
attrs="{'invisible': ['|', ('partner_id','=',False), ('reservation_type','in',('out'))]}"
|
||||||
name="%(open_hotel_reservation_form_tree_all)d"
|
name="%(open_hotel_reservation_form_tree_all)d"
|
||||||
context="{'search_default_partner_id': partner_id}">
|
context="{'search_default_partner_id': partner_id}">
|
||||||
<div class="o_form_field o_stat_info">
|
<div class="o_form_field o_stat_info">
|
||||||
@@ -111,7 +114,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
<button type="object" class="oe_stat_button" id="invoice_button"
|
<button type="object" class="oe_stat_button" id="invoice_button"
|
||||||
icon="fa-pencil-square-o" name="open_invoices_reservation">
|
icon="fa-pencil-square-o" name="open_invoices_reservation"
|
||||||
|
attrs="{'invisible': [('invoice_count','<=',0)]}">
|
||||||
<div class="o_form_field o_stat_info">
|
<div class="o_form_field o_stat_info">
|
||||||
<span class="o_stat_value">
|
<span class="o_stat_value">
|
||||||
<field name="invoice_count"/>
|
<field name="invoice_count"/>
|
||||||
@@ -129,28 +133,15 @@
|
|||||||
<span class="o_stat_text">Splitted!</span>
|
<span class="o_stat_text">Splitted!</span>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
<button type="action" class="oe_stat_button"
|
|
||||||
icon="fa-user-plus"
|
|
||||||
name="%(launch_checkin_wizard_add)d"
|
|
||||||
context="{'partner_id': partner_id,'enter_date': checkin,
|
|
||||||
'exit_date': checkout,'reservation_id': id, 'hidden_checkin_partner': True, 'edit_checkin_partner': True }"
|
|
||||||
attrs="{'invisible':['|', '|', ('state','not in',('confirm','booking')),
|
|
||||||
('checkin_partner_pending_count','=', 0),('parent_reservation','!=',False)]}">
|
|
||||||
<div class="o_form_field o_stat_info">
|
|
||||||
<span class="o_stat_value"><field name="checkin_partner_pending_count"
|
|
||||||
widget="statinfo" nolabel="1"/></span>
|
|
||||||
<span class="o_stat_text">Pending Checks</span>
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
<button type="object" class="oe_stat_button"
|
<button type="object" class="oe_stat_button"
|
||||||
icon="fa-users"
|
icon="fa-users"
|
||||||
name="action_checks"
|
name="action_checks"
|
||||||
attrs="{'invisible': ['|', ('checkin_partner_count','<=',0),
|
attrs="{'invisible': ['|', ('checkin_partner_pending_count','<=',0),
|
||||||
('parent_reservation','!=',False)]}">
|
('parent_reservation','!=',False)]}">
|
||||||
<div class="o_form_field o_stat_info">
|
<div class="o_form_field o_stat_info">
|
||||||
<span class="o_stat_value"><field name="checkin_partner_count"
|
<span class="o_stat_value"><field name="checkin_partner_pending_count"
|
||||||
widget="statinfo" nolabel="1"/></span>
|
widget="statinfo" nolabel="1"/></span>
|
||||||
<span class="o_stat_text">Checks</span>
|
<span class="o_stat_text">Pending Checks</span>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -187,60 +178,52 @@
|
|||||||
<span class="fa fa-sign-out" style="margin-right: 5px;"/>
|
<span class="fa fa-sign-out" style="margin-right: 5px;"/>
|
||||||
<field name="checkout" />
|
<field name="checkout" />
|
||||||
</h3>
|
</h3>
|
||||||
|
<field name="out_service_description" placeholder="Out service description"
|
||||||
|
attrs="{'invisible':[('reservation_type','not in',('out'))]}"/>
|
||||||
<group col="12">
|
<group col="12">
|
||||||
<group colspan="5" string="General Info" name="contact_details" >
|
<group colspan="5" string="General Info" name="contact_details" >
|
||||||
<field name="email" placeholder="email" widget="email" />
|
<field name="email" placeholder="email" widget="email"
|
||||||
<field name="mobile" placeholder="mobile" widget="phone" />
|
attrs="{'invisible': [('reservation_type','in',('out'))]}"/>
|
||||||
<field name="phone" placeholder="phone" widget="phone" />
|
<field name="mobile" placeholder="mobile" widget="phone"
|
||||||
<field name="pricelist_id"/>
|
attrs="{'invisible': [('reservation_type','in',('out'))]}"/>
|
||||||
<field name="partner_internal_comment" string="Partner Note"/>
|
<field name="phone" placeholder="phone" widget="phone"
|
||||||
|
attrs="{'invisible': [('reservation_type','in',('out'))]}"/>
|
||||||
|
<field name="pricelist_id"
|
||||||
|
attrs="{'invisible': [('reservation_type','in',('out'))]}"/>
|
||||||
|
<field name="partner_internal_comment" string="Partner Note"
|
||||||
|
attrs="{'invisible': [('reservation_type','in',('out'))]}"/>
|
||||||
<field name="cancelled_reason" attrs="{'invisible':[('state','not in',('cancelled'))]}"/>
|
<field name="cancelled_reason" attrs="{'invisible':[('state','not in',('cancelled'))]}"/>
|
||||||
</group>
|
|
||||||
<group colspan="4" string="Reservation Details" name="reservation_details">
|
|
||||||
<field name="arrival_hour"/>
|
<field name="arrival_hour"/>
|
||||||
<field name="departure_hour"/>
|
<field name="departure_hour"/>
|
||||||
<field name="nights" invisible="1"/>
|
</group>
|
||||||
|
<group colspan="4" string="Reservation Details" name="reservation_details">
|
||||||
|
<field name="nights"/>
|
||||||
<!-- TODO: How to filter to avoid show False (generic) pricelist board when exist a specific pricelist board¿? -->
|
<!-- TODO: How to filter to avoid show False (generic) pricelist board when exist a specific pricelist board¿? -->
|
||||||
<field name="board_service_room_id" domain="[
|
<field name="board_service_room_id" domain="[
|
||||||
('hotel_room_type_id', '=', room_type_id),
|
('hotel_room_type_id', '=', room_type_id),
|
||||||
('pricelist_id', 'in', [pricelist_id, False])]"
|
('pricelist_id', 'in', [pricelist_id, False])]"
|
||||||
options="{'no_create': True,'no_open': True}" />
|
options="{'no_create': True,'no_open': True}"
|
||||||
|
attrs="{'invisible': [('reservation_type','in',('out'))]}" />
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="adults"/>
|
<field name="adults" attrs="{'invisible': [('reservation_type','in',('out'))]}"/>
|
||||||
<field name="children"/>
|
<field name="children" attrs="{'invisible': [('reservation_type','in',('out'))]}"/>
|
||||||
<field name="qty_invoiced" />
|
<field name="qty_invoiced" invisible="1"/>
|
||||||
<field name="qty_to_invoice" />
|
<field name="qty_to_invoice" invisible="1"/>
|
||||||
<field name="room_type_id" on_change="1" options="{'no_create': True,'no_open': True}"
|
<field name="room_type_id" on_change="1" options="{'no_create': True,'no_open': True}"
|
||||||
attrs="{'readonly':[('state','not in',('draft'))]}"/>
|
attrs="{'readonly':[('state','not in',('draft'))]}"/>
|
||||||
<field name="channel_type" attrs="{'required':[('reservation_type','not in',('staff','out'))]}"/>
|
|
||||||
</group>
|
</group>
|
||||||
<group class="oe_subtotal_footer" style="margin-right: 20px; !important" colspan="2" name="reservation_total" string="Amounts" attrs="{'invisible':[('folio_id','=', False)]}">
|
<group class="oe_subtotal_footer" style="margin-right: 20px; !important" colspan="2" name="reservation_total" string="Amounts">
|
||||||
<!--
|
|
||||||
<field name="discount" string="Room Discount" attrs="{'invisible': [('discount_type','=','fixed')]}" />
|
|
||||||
-->
|
|
||||||
<div class="oe_subtotal_footer_separator oe_inline o_td_label">
|
<div class="oe_subtotal_footer_separator oe_inline o_td_label">
|
||||||
<!--
|
<label for="price_room_services_set" string="Reservation Total"/>
|
||||||
<label for="amount_discount" />
|
|
||||||
-->
|
|
||||||
<button name="%(action_hotel_massive_price_change_reservation_days)d" string="Massive Day Prices"
|
|
||||||
type="action" class="oe_edit_only oe_link" icon="fa-bolt"/>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- <field name="amount_discount" nolabel="1" widget='monetary' class="oe_subtotal_footer_separator" options="{'currency_field': 'currency_id'}"/> -->
|
<field name="price_room_services_set" nolabel="1" class="oe_subtotal_footer_separator" widget="monetary"/>
|
||||||
<!--
|
<field name="discount" string="Discount Room" widget="monetary"/>
|
||||||
<div class="oe_subtotal_footer_separator oe_inline o_td_label">
|
<field name="price_subtotal" invisible="1"/>
|
||||||
<label for="amount_reservation_services" />
|
<field name="price_services" string="Only Services" widget="monetary"/>
|
||||||
</div>
|
<field name="price_total" string="Only Room" widget="monetary"/>
|
||||||
-->
|
|
||||||
<!-- <field name="amount_reservation_services" nolabel="1" widget='monetary' class="oe_subtotal_footer_separator" options="{'currency_field': 'currency_id'}"/> -->
|
|
||||||
<field name="price_total" />
|
|
||||||
<!-- <field name="qty_delivered_updateable" invisible="1"/> -->
|
|
||||||
<field name="state" invisible="1"/>
|
<field name="state" invisible="1"/>
|
||||||
<!-- <field name="invoice_status" invisible="1"/> -->
|
<field name="invoice_status" invisible="1"/>
|
||||||
<!-- <field name="customer_lead" invisible="1"/> -->
|
<field name="currency_id" invisible="1"/>
|
||||||
<field name="currency_id" invisible="1"/>
|
|
||||||
<field name="price_subtotal" widget="monetary"/>
|
|
||||||
<field name="price_services" widget="monetary"/>
|
|
||||||
<field name="price_room_services_set" widget="monetary"/>
|
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<field name="folio_internal_comment" nolabel="1" placeholder="Reservation Notes"/>
|
<field name="folio_internal_comment" nolabel="1" placeholder="Reservation Notes"/>
|
||||||
@@ -251,7 +234,8 @@
|
|||||||
<!-- <field name="product_uom" string="Rent(UOM)" invisible="1" /> -->
|
<!-- <field name="product_uom" string="Rent(UOM)" invisible="1" /> -->
|
||||||
</group>
|
</group>
|
||||||
<notebook>
|
<notebook>
|
||||||
<page name="days" string="Service and Days">
|
<page name="services" string="Services"
|
||||||
|
attrs="{'invisible': [('reservation_type','in',('out'))]}">
|
||||||
<group string="Reservation Services" name="reservation_services">
|
<group string="Reservation Services" name="reservation_services">
|
||||||
<field name="service_ids"
|
<field name="service_ids"
|
||||||
context="{'default_ser_room_line': active_id, 'default_folio_id': folio_id, 'form_view_ref':'hotel.hotel_service_view_form'}"
|
context="{'default_ser_room_line': active_id, 'default_folio_id': folio_id, 'form_view_ref':'hotel.hotel_service_view_form'}"
|
||||||
@@ -293,17 +277,25 @@
|
|||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
<group string="Days" name="days">
|
|
||||||
<field name="reservation_line_ids" nolabel="1">
|
|
||||||
<tree create="false" delete="false" editable="bottom">
|
|
||||||
<field name="date" />
|
|
||||||
<field name="price" />
|
|
||||||
<field name="discount" />
|
|
||||||
</tree>
|
|
||||||
</field>
|
|
||||||
</group>
|
|
||||||
</page>
|
</page>
|
||||||
<page name="persons" string="Persons">
|
<page name="days" string="Day Pricing"
|
||||||
|
attrs="{'invisible': [('reservation_type','in',('out'))]}">
|
||||||
|
<button name="%(action_hotel_massive_price_change_reservation_days)d" string="Massive Day Prices"
|
||||||
|
type="action" icon="fa-bolt"/>
|
||||||
|
<field name="reservation_line_ids" nolabel="1">
|
||||||
|
<tree create="false" delete="false" editable="bottom">
|
||||||
|
<field name="date" />
|
||||||
|
<field name="price" />
|
||||||
|
<field name="discount" />
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</page>
|
||||||
|
<page name="persons" string="Persons"
|
||||||
|
attrs="{'invisible': [('reservation_type','in',('out'))]}">
|
||||||
|
<group>
|
||||||
|
<field name="segmentation_ids" widget="many2many_tags" placeholder="Segmentation..."
|
||||||
|
options="{'no_create': True,'no_open': True}" />
|
||||||
|
</group>
|
||||||
<field name="checkin_partner_ids"
|
<field name="checkin_partner_ids"
|
||||||
context="{
|
context="{
|
||||||
'default_reservation_id': id,
|
'default_reservation_id': id,
|
||||||
@@ -312,16 +304,47 @@
|
|||||||
}"
|
}"
|
||||||
/>
|
/>
|
||||||
</page>
|
</page>
|
||||||
|
<page name="invoicing" string="Invoicing"
|
||||||
|
attrs="{'invisible': [('reservation_type','in',('out'))]}">
|
||||||
|
<group>
|
||||||
|
<field name="partner_diff_invoicing" string="Bill to another Address"/>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="partner_invoice_id"
|
||||||
|
string="Contact Invoiced"
|
||||||
|
attrs="{'invisible':[('partner_diff_invoicing','=',False)]}"/>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<group>
|
||||||
|
<field name="partner_invoice_vat" />
|
||||||
|
<field name="partner_invoice_email" />
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="partner_invoice_parent_id" />
|
||||||
|
<field name="partner_invoice_type" />
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<label for="partner_invoice_street" string="Address"/>
|
||||||
|
<div class="o_address_format">
|
||||||
|
<field name="partner_invoice_street" placeholder="Street..." class="o_address_street"/>
|
||||||
|
<field name="partner_invoice_street2" placeholder="Street 2..." class="o_address_street"/>
|
||||||
|
<field name="partner_invoice_city" placeholder="City" class="o_address_city"/>
|
||||||
|
<field name="partner_invoice_state_id" class="o_address_state" placeholder="State" options='{"no_open": True}'/>
|
||||||
|
<field name="partner_invoice_zip" placeholder="ZIP" class="o_address_zip"/>
|
||||||
|
<field name="partner_invoice_country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/>
|
||||||
|
</div>
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
</group>
|
||||||
|
</group>
|
||||||
|
</page>
|
||||||
<page name="others" string="Others">
|
<page name="others" string="Others">
|
||||||
<group>
|
<group>
|
||||||
<field name="segmentation_ids" widget="many2many_tags" placeholder="Segmentation..."
|
|
||||||
options="{'no_create': True,'no_open': True}" />
|
|
||||||
<field name="overbooking" />
|
<field name="overbooking" />
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
|
<field name="channel_type" attrs="{'required':[('reservation_type','not in',('staff','out'))]}"/>
|
||||||
<field name="reservation_type" />
|
<field name="reservation_type" />
|
||||||
<field name="out_service_description"
|
|
||||||
attrs="{'invisible':[('reservation_type','not in',('out'))]}"/>
|
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
</notebook>
|
</notebook>
|
||||||
@@ -335,6 +358,65 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!-- Form view Checkin Partners from hotel reservation -->
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="hotel_reservation_checkin_view_form">
|
||||||
|
<field name="name">hotel.reservation.checkin.form</field>
|
||||||
|
<field name="model">hotel.reservation</field>
|
||||||
|
<field name="priority">100</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<form string="Reservation" >
|
||||||
|
<field name="reservation_type" invisible="1" />
|
||||||
|
<field name="splitted" invisible="1" />
|
||||||
|
<field name="state" invisible="1"/>
|
||||||
|
<field name="overbooking" invisible="1" />
|
||||||
|
<field name="folio_id" invisible="1" />
|
||||||
|
<field name="adults" invisible="1" />
|
||||||
|
<field name="children" invisible="1" />
|
||||||
|
<div class="alert alert-info" role="alert" style="margin-bottom:0px;"
|
||||||
|
attrs="{'invisible': ['|',('shared_folio','=',False),('splitted', '=', True)]}">
|
||||||
|
This reservation has other reservantions and/or services in the folio, you can check it in the
|
||||||
|
<bold><button class="alert-link" type="object" name="open_folio" string="Folio Form"/></bold>
|
||||||
|
</div>
|
||||||
|
<field name="shared_folio" invisible="1"/>
|
||||||
|
<sheet>
|
||||||
|
<span class="label label-danger" attrs="{'invisible': [('state', 'not in', ('cancelled'))]}">Cancelled Reservation!</span>
|
||||||
|
<span class="label label-warning" attrs="{'invisible': [('overbooking', '=', False)]}">OverBooking!</span>
|
||||||
|
<h2>
|
||||||
|
<field name="room_id" readonly="1" nolabel="1"
|
||||||
|
options="{'no_open': True}" style="margin-right: 30px;" />
|
||||||
|
<field name="partner_id" readonly="1" options="{'no_open': True}"/>
|
||||||
|
<span class="fa fa-user" style="margin-left:20px;"
|
||||||
|
attrs="{'invisible': [('reservation_type','not in',('normal'))]}"/>
|
||||||
|
<span class="fa fa-black-tie" style="margin-left:20px; color: #C67;"
|
||||||
|
attrs="{'invisible': [('reservation_type','not in',('staff'))]}"/>
|
||||||
|
|
||||||
|
<h3>
|
||||||
|
From <span class="fa fa-sign-in" style="margin: 5px;"/>
|
||||||
|
<field name="checkin" style="margin-right: 10px;"
|
||||||
|
readonly="1" />
|
||||||
|
to
|
||||||
|
<span class="fa fa-sign-out" style="margin-right: 5px;"/>
|
||||||
|
<field name="checkout" readonly="1" />
|
||||||
|
</h3>
|
||||||
|
</h2>
|
||||||
|
<group>
|
||||||
|
<field name="segmentation_ids" widget="many2many_tags" placeholder="Segmentation..."
|
||||||
|
options="{'no_create': True,'no_open': True}" />
|
||||||
|
</group>
|
||||||
|
<field name="checkin_partner_ids"
|
||||||
|
context="{
|
||||||
|
'default_reservation_id': id,
|
||||||
|
'reservation_id': id,
|
||||||
|
'tree_view_ref':'hotel.hotel_checkin_partner_reservation_view_tree',
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
</sheet>
|
||||||
|
</form>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<!-- Tree view of hotel reservation -->
|
<!-- Tree view of hotel reservation -->
|
||||||
<record model="ir.ui.view" id="hotel_reservation_view_tree">
|
<record model="ir.ui.view" id="hotel_reservation_view_tree">
|
||||||
<field name="name">hotel.reservation.tree</field>
|
<field name="name">hotel.reservation.tree</field>
|
||||||
@@ -361,9 +443,9 @@
|
|||||||
name="open_folio"
|
name="open_folio"
|
||||||
/>
|
/>
|
||||||
<field name="folio_id"/>
|
<field name="folio_id"/>
|
||||||
<button type="action" class="oe_stat_button"
|
<button type="object" class="oe_stat_button"
|
||||||
icon="fa fa-1x fa-user-plus"
|
icon="fa fa-1x fa-user-plus"
|
||||||
name="%(launch_checkin_wizard_add)d"
|
name="action_checks"
|
||||||
context="{'partner_id': partner_id,'enter_date': checkin,
|
context="{'partner_id': partner_id,'enter_date': checkin,
|
||||||
'exit_date': checkout,'reservation_id': id, 'hidden_checkin_partner': True, 'edit_checkin_partner': True }"
|
'exit_date': checkout,'reservation_id': id, 'hidden_checkin_partner': True, 'edit_checkin_partner': True }"
|
||||||
attrs="{'invisible':['|','|', ('state','not in',('confirm','booking')),('checkin_partner_pending_count','=', 0),('parent_reservation','!=',False)]}"
|
attrs="{'invisible':['|','|', ('state','not in',('confirm','booking')),('checkin_partner_pending_count','=', 0),('parent_reservation','!=',False)]}"
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<!--=== Hotel Service Line ==== -->
|
<!--=== Hotel Service Line ==== -->
|
||||||
|
|
||||||
<!-- Form view of Service Line -->
|
<!-- Form view of Service Line -->
|
||||||
<record model="ir.ui.view" id="hotel_service_line_view_form">
|
<record model="ir.ui.view" id="hotel_service_line_view_form">
|
||||||
<field name="name">hotel.service.line.form</field>
|
<field name="name">hotel.service.line.form</field>
|
||||||
@@ -9,7 +10,7 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Service Line">
|
<form string="Service Line">
|
||||||
<group>
|
<group>
|
||||||
<field name="name" />
|
<field name="product_id" />
|
||||||
<field name="day_qty"/>
|
<field name="day_qty"/>
|
||||||
<field name="date" />
|
<field name="date" />
|
||||||
</group>
|
</group>
|
||||||
@@ -17,20 +18,65 @@
|
|||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- Tree view of hotel service Line -->
|
<!-- Tree views of hotel service Line -->
|
||||||
<record model="ir.ui.view" id="hotel_service_line_view_tree">
|
<record model="ir.ui.view" id="hotel_service_line_view_tree">
|
||||||
<field name="name">hotel.service.line.tree</field>
|
<field name="name">hotel.service.line.tree</field>
|
||||||
<field name="model">hotel.service.line</field>
|
<field name="model">hotel.service.line</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Hotel By Day">
|
<tree string="Hotel By Day">
|
||||||
<field name="name" />
|
<field name="product_id" />
|
||||||
<field name="day_qty"/>
|
<field name="day_qty"/>
|
||||||
<field name="date" />
|
<field name="date" />
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!-- Action for hotel service line-->
|
<record model="ir.ui.view" id="hotel_service_line_report_view_tree">
|
||||||
|
<field name="name">hotel.service.line.report.tree</field>
|
||||||
|
<field name="model">hotel.service.line</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<tree string="Service By Day">
|
||||||
|
<field name="product_id" />
|
||||||
|
<field name="day_qty"/>
|
||||||
|
<field name="date" />
|
||||||
|
<field name="service_id" />
|
||||||
|
</tree>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- Search Views -->
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="hotel_service_line_view_search">
|
||||||
|
<field name="name">hotel.service.line.search</field>
|
||||||
|
<field name="model">hotel.service.line</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<search string="Services By Day">
|
||||||
|
<field name="service_id" />
|
||||||
|
<filter string="Today"
|
||||||
|
domain="[('date', '=', context_today().strftime('%Y-%m-%d'))]"
|
||||||
|
help="Current Booking" />
|
||||||
|
<filter string="Tomorrow"
|
||||||
|
domain="[('date', '=', (context_today()+datetime.timedelta(days=1)).strftime('%Y-%m-%d'))]"
|
||||||
|
/>
|
||||||
|
<filter string="Next 7 days"
|
||||||
|
domain="[('date', '>', context_today().strftime('%Y-%m-%d')),
|
||||||
|
('date', '<', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]"
|
||||||
|
/>
|
||||||
|
<group expand="0" string="Group By">
|
||||||
|
<filter string="By Month" name="date_by_month"
|
||||||
|
context="{'group_by':'date', 'default_order': 'date asc'}"/>
|
||||||
|
<filter string="By Week" name="date_by_week"
|
||||||
|
context="{'group_by':'date:week', 'default_order': 'date'}"/>
|
||||||
|
<filter string="By Day" name="date_by_week"
|
||||||
|
context="{'group_by':'date:day', 'default_order': 'date'}"/>
|
||||||
|
<filter string="Product" name="product_id"
|
||||||
|
context="{'group_by':'product_id', 'default_order': 'product_id'}"/>
|
||||||
|
</group>
|
||||||
|
</search>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- Action for hotel service line from Form Folio/Reservation-->
|
||||||
<record model="ir.actions.act_window" id="action_hotel_service_line_form">
|
<record model="ir.actions.act_window" id="action_hotel_service_line_form">
|
||||||
<field name="name">Hotel Services</field>
|
<field name="name">Hotel Services</field>
|
||||||
<field name="res_model">hotel.service.line</field>
|
<field name="res_model">hotel.service.line</field>
|
||||||
@@ -38,8 +84,24 @@
|
|||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<!--
|
||||||
<menuitem name="Services as Products" id="menu_open_hotel_service_line_form"
|
<menuitem name="Services as Products" id="menu_open_hotel_service_line_form"
|
||||||
action="action_hotel_service_line_form" sequence="8"
|
action="action_hotel_service_line_form" sequence="8"
|
||||||
parent="hotel.menu_hotel_service" />
|
parent="hotel.menu_hotel_service" />
|
||||||
|
-->
|
||||||
|
|
||||||
|
<act_window
|
||||||
|
id="action_service_line"
|
||||||
|
name="Services By Day"
|
||||||
|
res_model="hotel.service.line"
|
||||||
|
view_mode="tree,form"
|
||||||
|
view_id = "hotel.hotel_service_line_report_view_tree" />
|
||||||
|
|
||||||
|
<menuitem
|
||||||
|
id="menu_hotel_service_line"
|
||||||
|
name="Services by Day"
|
||||||
|
parent="hotel.hotel_reports_menu"
|
||||||
|
sequence="30"
|
||||||
|
action="action_service_line" />
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -19,10 +19,12 @@
|
|||||||
options="{'create': False, 'create_edit': False}"
|
options="{'create': False, 'create_edit': False}"
|
||||||
invisible="1" />
|
invisible="1" />
|
||||||
<!-- <field name="layout_category_id" groups="sale.group_sale_layout"/> -->
|
<!-- <field name="layout_category_id" groups="sale.group_sale_layout"/> -->
|
||||||
<field name="product_qty" invisible="0"
|
<group>
|
||||||
attrs="{'readonly': [('per_day','=',True)]}"
|
<field name="product_qty"
|
||||||
force_save="1"/>
|
attrs="{'readonly': [('per_day','=',True)]}"
|
||||||
<field name="days_qty" invisible="0"/>
|
force_save="1"/>
|
||||||
|
</group>
|
||||||
|
<field name="days_qty" invisible="1"/>
|
||||||
<field name="price_unit" invisible="1" />
|
<field name="price_unit" invisible="1" />
|
||||||
<field name="discount" invisible="1"/>
|
<field name="discount" invisible="1"/>
|
||||||
<field name="tax_ids" widget="many2many_tags"
|
<field name="tax_ids" widget="many2many_tags"
|
||||||
|
|||||||
@@ -9,9 +9,6 @@
|
|||||||
<field name="folio_ids" widget="many2many_tags"/>
|
<field name="folio_ids" widget="many2many_tags"/>
|
||||||
<field name="from_folio" invisible="1" />
|
<field name="from_folio" invisible="1" />
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='product_id']" position="after">
|
|
||||||
<field name="reservation_line_ids" widget="many2many_tags"/>
|
|
||||||
</xpath>
|
|
||||||
<xpath expr="//button[@name='%(account.action_account_invoice_payment)d']" position="attributes">
|
<xpath expr="//button[@name='%(account.action_account_invoice_payment)d']" position="attributes">
|
||||||
<attribute name="attrs">{'invisible': ['|',('from_folio','=',True)]}</attribute>
|
<attribute name="attrs">{'invisible': ['|',('from_folio','=',True)]}</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|||||||
@@ -43,8 +43,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="payment_type" widget="radio" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
|
<field name="payment_type" invisible="1"/>
|
||||||
<field name="partner_type" widget="selection" attrs="{'required': [('state', '=', 'draft'), ('payment_type', 'in', ('inbound', 'outbound'))], 'invisible': [('payment_type', 'not in', ('inbound', 'outbound'))], 'readonly': [('state', '!=', 'draft')]}"/>
|
<field name="partner_type" widget="selection" invisible="1"/>
|
||||||
<field name="partner_id" attrs="{'required': [('state', '=', 'draft'), ('payment_type', 'in', ('inbound', 'outbound'))], 'invisible': [('payment_type', 'not in', ('inbound', 'outbound'))], 'readonly': [('state', '!=', 'draft')]}" context="{'default_is_company': True, 'default_supplier': payment_type == 'outbound', 'default_customer': payment_type == 'inbound'}"/>
|
<field name="partner_id" attrs="{'required': [('state', '=', 'draft'), ('payment_type', 'in', ('inbound', 'outbound'))], 'invisible': [('payment_type', 'not in', ('inbound', 'outbound'))], 'readonly': [('state', '!=', 'draft')]}" context="{'default_is_company': True, 'default_supplier': payment_type == 'outbound', 'default_customer': payment_type == 'inbound'}"/>
|
||||||
<label for="amount"/>
|
<label for="amount"/>
|
||||||
<div name="amount_div" class="o_row">
|
<div name="amount_div" class="o_row">
|
||||||
|
|||||||
@@ -115,8 +115,8 @@ class Wizard(models.TransientModel):
|
|||||||
|
|
||||||
mobile_checkin_partner = fields.Char('Mobile')
|
mobile_checkin_partner = fields.Char('Mobile')
|
||||||
|
|
||||||
segmentation_id = fields.Many2many(
|
segmentation_ids = fields.Many2many(
|
||||||
related='reservation_id.folio_id.segmentation_ids')
|
related='reservation_id.segmentation_ids')
|
||||||
|
|
||||||
|
|
||||||
''' TODO: clean-up - list of checkins on smart button clean is not used anymore
|
''' TODO: clean-up - list of checkins on smart button clean is not used anymore
|
||||||
|
|||||||
@@ -195,10 +195,6 @@ class FolioAdvancePaymentInv(models.TransientModel):
|
|||||||
inv_obj = self.env['account.invoice']
|
inv_obj = self.env['account.invoice']
|
||||||
precision = self.env['decimal.precision'].precision_get('Product Unit of Measure')
|
precision = self.env['decimal.precision'].precision_get('Product Unit of Measure')
|
||||||
folios = self.folio_ids
|
folios = self.folio_ids
|
||||||
|
|
||||||
for folio in folios:
|
|
||||||
if folio.partner_invoice_id != self.partner_invoice_id:
|
|
||||||
raise UserError(_('The billing directions must match'))
|
|
||||||
|
|
||||||
if self.advance_payment_method == 'all':
|
if self.advance_payment_method == 'all':
|
||||||
inv_data = self._prepare_invoice()
|
inv_data = self._prepare_invoice()
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ class MassivePriceChangeWizard(models.TransientModel):
|
|||||||
_name = 'hotel.wizard.massive.price.reservation.days'
|
_name = 'hotel.wizard.massive.price.reservation.days'
|
||||||
|
|
||||||
new_price = fields.Float('New Price', default=1, min=1)
|
new_price = fields.Float('New Price', default=1, min=1)
|
||||||
|
change_price = fields.Boolean('Change Prices', default=False)
|
||||||
|
new_discount = fields.Float('New Discount', default=0, min=1)
|
||||||
|
change_discount = fields.Boolean('Change Discounts', default=False)
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def massive_price_change_days(self):
|
def massive_price_change_days(self):
|
||||||
@@ -18,29 +21,16 @@ class MassivePriceChangeWizard(models.TransientModel):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
cmds = []
|
cmds = []
|
||||||
for rline in reservation_id.reservation_lines:
|
for rline in reservation_id.reservation_line_ids:
|
||||||
cmds.append((
|
cmds.append((
|
||||||
1,
|
1,
|
||||||
rline.id,
|
rline.id,
|
||||||
{
|
{
|
||||||
'price': self.new_price
|
'price': self.new_price if self.change_price == True else rline.price,
|
||||||
|
'discount': self.new_discount if self.change_discount == True else rline.discount
|
||||||
}
|
}
|
||||||
))
|
))
|
||||||
reservation_id.write({
|
reservation_id.write({
|
||||||
'reservation_lines': cmds
|
'reservation_line_ids': cmds
|
||||||
})
|
})
|
||||||
# FIXME: For some reason need force reservation price calcs
|
|
||||||
reservation_id._computed_amount_reservation()
|
|
||||||
# FIXME: Workaround for dispatch updated price
|
|
||||||
reservation_id.folio_id.write({
|
|
||||||
'room_lines': [
|
|
||||||
(
|
|
||||||
1,
|
|
||||||
reservation_id.id, {
|
|
||||||
'reservation_lines': cmds
|
|
||||||
}
|
|
||||||
)
|
|
||||||
]
|
|
||||||
})
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -7,7 +7,14 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Massive Price Change" >
|
<form string="Massive Price Change" >
|
||||||
<group>
|
<group>
|
||||||
<field name="new_price" required="1" />
|
<field name="change_price"/>
|
||||||
|
<field name="new_price" required="1"
|
||||||
|
attrs="{'readonly':[('change_price','=', False)]}" />
|
||||||
|
</group>
|
||||||
|
<group>
|
||||||
|
<field name="change_discount"/>
|
||||||
|
<field name="new_discount" required="1"
|
||||||
|
attrs="{'readonly':[('change_discount','=', False)]}" />
|
||||||
</group>
|
</group>
|
||||||
<footer>
|
<footer>
|
||||||
<button name="massive_price_change_days" string="Massive Change" type="object"
|
<button name="massive_price_change_days" string="Massive Change" type="object"
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ class FolioWizard(models.TransientModel):
|
|||||||
return 'phone'
|
return 'phone'
|
||||||
|
|
||||||
partner_id = fields.Many2one('res.partner',string="Customer")
|
partner_id = fields.Many2one('res.partner',string="Customer")
|
||||||
checkin = fields.Datetime('Check In', required=True,
|
checkin = fields.Date('Check In', required=True,
|
||||||
default=_get_default_checkin)
|
default=_get_default_checkin)
|
||||||
checkout = fields.Datetime('Check Out', required=True,
|
checkout = fields.Date('Check Out', required=True,
|
||||||
default=_get_default_checkout)
|
default=_get_default_checkout)
|
||||||
reservation_wizard_ids = fields.One2many('hotel.reservation.wizard',
|
reservation_wizard_ids = fields.One2many('hotel.reservation.wizard',
|
||||||
'folio_wizard_id',
|
'folio_wizard_id',
|
||||||
@@ -69,7 +69,7 @@ class FolioWizard(models.TransientModel):
|
|||||||
('phone', 'Phone')
|
('phone', 'Phone')
|
||||||
], string='Sales Channel', default=_get_default_channel_type)
|
], string='Sales Channel', default=_get_default_channel_type)
|
||||||
room_type_wizard_ids = fields.Many2many('hotel.room.type.wizard',
|
room_type_wizard_ids = fields.Many2many('hotel.room.type.wizard',
|
||||||
string="Virtual Rooms")
|
string="Room Types")
|
||||||
call_center = fields.Boolean(default=_get_default_center_user)
|
call_center = fields.Boolean(default=_get_default_center_user)
|
||||||
|
|
||||||
def assign_rooms(self):
|
def assign_rooms(self):
|
||||||
@@ -148,24 +148,27 @@ class FolioWizard(models.TransientModel):
|
|||||||
@param self: object pointer
|
@param self: object pointer
|
||||||
'''
|
'''
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
checkin_dt = datetime.now() if not self.checkin else fields.Date.from_string(self.checkin)
|
tz_hotel = self.env['ir.default'].sudo().get(
|
||||||
checkout_dt = datetime.now() if not self.checkout else fields.Date.from_string(self.checkout)
|
'res.config.settings', 'tz_hotel')
|
||||||
|
today = fields.Date.context_today(self.with_context(tz=tz_hotel))
|
||||||
|
checkin_dt = fields.Date.from_string(today) if not self.checkin else fields.Date.from_string(self.checkin)
|
||||||
|
checkout_dt = ields.Date.from_string(today) if not self.checkout else fields.Date.from_string(self.checkout)
|
||||||
if checkin_dt >= checkout_dt:
|
if checkin_dt >= checkout_dt:
|
||||||
checkout_dt = checkin_dt + timedelta(days=1)
|
checkout_dt = checkin_dt + timedelta(days=1)
|
||||||
|
|
||||||
chekin_str = checkin_dt.strftime(DEFAULT_SERVER_DATE_FORMAT)
|
checkin_str = checkin_dt.strftime(DEFAULT_SERVER_DATE_FORMAT)
|
||||||
chekout_str = checkout_dt.strftime(DEFAULT_SERVER_DATE_FORMAT)
|
checkout_str = checkout_dt.strftime(DEFAULT_SERVER_DATE_FORMAT)
|
||||||
|
|
||||||
room_type_ids = self.env['hotel.room.type'].search([])
|
room_type_ids = self.env['hotel.room.type'].search([])
|
||||||
cmds = room_type_ids.mapped(lambda x: (0, False, {
|
cmds = room_type_ids.mapped(lambda x: (0, False, {
|
||||||
'room_type_id': x.id,
|
'room_type_id': x.id,
|
||||||
'checkin': chekin_str,
|
|
||||||
'checkout': chekout_str,
|
|
||||||
'folio_wizard_id': self.id,
|
'folio_wizard_id': self.id,
|
||||||
|
'checkin': checkin_str,
|
||||||
|
'checkout': checkout_str,
|
||||||
}))
|
}))
|
||||||
self.write({
|
self.update({
|
||||||
'checkin': chekin_str,
|
'checkin': checkin_str,
|
||||||
'checkout': chekout_str,
|
'checkout': checkout_str,
|
||||||
'room_type_wizard_ids': cmds,
|
'room_type_wizard_ids': cmds,
|
||||||
})
|
})
|
||||||
for room_type in self.room_type_wizard_ids:
|
for room_type in self.room_type_wizard_ids:
|
||||||
@@ -239,6 +242,7 @@ class HotelRoomTypeWizards(models.TransientModel):
|
|||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
def _get_default_checkin(self):
|
def _get_default_checkin(self):
|
||||||
|
import wdb; wdb.set_trace()
|
||||||
return self.folio_wizard_id.checkin
|
return self.folio_wizard_id.checkin
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
@@ -246,7 +250,7 @@ class HotelRoomTypeWizards(models.TransientModel):
|
|||||||
return self.folio_wizard_id.checkout
|
return self.folio_wizard_id.checkout
|
||||||
|
|
||||||
room_type_id = fields.Many2one('hotel.room.type',
|
room_type_id = fields.Many2one('hotel.room.type',
|
||||||
string="Virtual Rooms")
|
string="Rooms Type")
|
||||||
rooms_num = fields.Integer('Number of Rooms')
|
rooms_num = fields.Integer('Number of Rooms')
|
||||||
max_rooms = fields.Integer('Max', compute="_compute_max")
|
max_rooms = fields.Integer('Max', compute="_compute_max")
|
||||||
price = fields.Float(string='Price by Room')
|
price = fields.Float(string='Price by Room')
|
||||||
@@ -255,9 +259,9 @@ class HotelRoomTypeWizards(models.TransientModel):
|
|||||||
amount_reservation = fields.Float(string='Total', readonly=True)
|
amount_reservation = fields.Float(string='Total', readonly=True)
|
||||||
discount = fields.Float('discount')
|
discount = fields.Float('discount')
|
||||||
min_stay = fields.Integer('Min. Days', compute="_compute_max")
|
min_stay = fields.Integer('Min. Days', compute="_compute_max")
|
||||||
checkin = fields.Datetime('Check In', required=True,
|
checkin = fields.Date('Check In', required=True,
|
||||||
default=_get_default_checkin)
|
default=_get_default_checkin)
|
||||||
checkout = fields.Datetime('Check Out', required=True,
|
checkout = fields.Date('Check Out', required=True,
|
||||||
default=_get_default_checkout)
|
default=_get_default_checkout)
|
||||||
can_confirm = fields.Boolean(compute="_can_confirm")
|
can_confirm = fields.Boolean(compute="_can_confirm")
|
||||||
|
|
||||||
@@ -308,7 +312,7 @@ class HotelRoomTypeWizards(models.TransientModel):
|
|||||||
avail = real_max
|
avail = real_max
|
||||||
|
|
||||||
|
|
||||||
if 100000 < avail > 0:
|
if 100000 > avail > 0:
|
||||||
res.max_rooms = avail
|
res.max_rooms = avail
|
||||||
else:
|
else:
|
||||||
res.max_rooms = 0
|
res.max_rooms = 0
|
||||||
@@ -320,7 +324,6 @@ class HotelRoomTypeWizards(models.TransientModel):
|
|||||||
for record in self:
|
for record in self:
|
||||||
if record.rooms_num > record.max_rooms:
|
if record.rooms_num > record.max_rooms:
|
||||||
raise ValidationError(_("There are not enough rooms!"))
|
raise ValidationError(_("There are not enough rooms!"))
|
||||||
|
|
||||||
checkin = record.checkin or record.folio_wizard_id.checkin
|
checkin = record.checkin or record.folio_wizard_id.checkin
|
||||||
checkout = record.checkout or record.folio_wizard_id.checkout
|
checkout = record.checkout or record.folio_wizard_id.checkout
|
||||||
chkin_utc_dt = fields.Date.from_string(checkin)
|
chkin_utc_dt = fields.Date.from_string(checkin)
|
||||||
@@ -350,7 +353,7 @@ class HotelRoomTypeWizards(models.TransientModel):
|
|||||||
|
|
||||||
price = (res_price * record.discount) * 0.01
|
price = (res_price * record.discount) * 0.01
|
||||||
total_price = record.rooms_num * price
|
total_price = record.rooms_num * price
|
||||||
record.write({
|
record.update({
|
||||||
'checkin': checkin,
|
'checkin': checkin,
|
||||||
'checkout': checkout,
|
'checkout': checkout,
|
||||||
'price': price,
|
'price': price,
|
||||||
@@ -371,10 +374,10 @@ class ReservationWizard(models.TransientModel):
|
|||||||
help='List of adults there in guest list. ')
|
help='List of adults there in guest list. ')
|
||||||
children = fields.Integer('Children',
|
children = fields.Integer('Children',
|
||||||
help='Number of children there in guest list.')
|
help='Number of children there in guest list.')
|
||||||
checkin = fields.Datetime('Check In', required=True)
|
checkin = fields.Date('Check In', required=True)
|
||||||
checkout = fields.Datetime('Check Out', required=True)
|
checkout = fields.Date('Check Out', required=True)
|
||||||
room_type_id = fields.Many2one('hotel.room.type',
|
room_type_id = fields.Many2one('hotel.room.type',
|
||||||
string='Virtual Room Type',
|
string='Room Type',
|
||||||
required=True)
|
required=True)
|
||||||
nights = fields.Integer('Nights', readonly=True)
|
nights = fields.Integer('Nights', readonly=True)
|
||||||
price = fields.Float(string='Total')
|
price = fields.Float(string='Total')
|
||||||
|
|||||||
@@ -75,36 +75,30 @@
|
|||||||
|
|
||||||
.unify-enabled {
|
.unify-enabled {
|
||||||
background-color: #43A200;
|
background-color: #43A200;
|
||||||
box-shadow: 0 0 8px 0px #43A200;
|
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.divide-enabled {
|
.divide-enabled {
|
||||||
background-color: #43A200;
|
background-color: #43A200;
|
||||||
box-shadow: 0 0 8px 0px #43A200;
|
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.overbooking-enabled {
|
.overbooking-enabled {
|
||||||
background-color: #43A200;
|
background-color: #43A200;
|
||||||
box-shadow: 0 0 8px 0px #43A200;
|
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cancelled-enabled {
|
.cancelled-enabled {
|
||||||
background-color: #43A200;
|
background-color: #43A200;
|
||||||
box-shadow: 0 0 8px 0px #43A200;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.swap-from {
|
.swap-from {
|
||||||
background-color: #E7CF1D;
|
background-color: #E7CF1D;
|
||||||
box-shadow: 0 0 8px 0px #E7CF1D;
|
|
||||||
color: #7C7BAD;
|
color: #7C7BAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
.swap-to {
|
.swap-to {
|
||||||
background-color: #43A200;
|
background-color: #43A200;
|
||||||
box-shadow: 0 0 8px 0px #43A200;
|
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,12 +150,7 @@ input#bookings_search {
|
|||||||
background-color: #FFA500;
|
background-color: #FFA500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cancelled-highlight {
|
.overbooking-highlight i {
|
||||||
color: white;
|
|
||||||
background-color: #FFA500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overbooking-highlight i, .cancelled-highlight i {
|
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,4 +377,4 @@ div.pull-right-custom {
|
|||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
color: #777;
|
color: #777;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -461,16 +461,7 @@ var PMSCalendarController = AbstractController.extend({
|
|||||||
method: 'action_checks',
|
method: 'action_checks',
|
||||||
args: [ev.data.reservation_id],
|
args: [ev.data.reservation_id],
|
||||||
}).then(function (result){
|
}).then(function (result){
|
||||||
return self.do_action({
|
return self.do_action(result);
|
||||||
name: result.name,
|
|
||||||
view_type: result.view_type,
|
|
||||||
view_mode: result.view_mode,
|
|
||||||
type: result.type,
|
|
||||||
res_model: result.res_model,
|
|
||||||
views: [[false, 'form']],
|
|
||||||
domain: result.domain,
|
|
||||||
target: result.target,
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$reservationPopover.data('bs.popover').tip().find(".btn_popover_open_invoice").on('click',
|
$reservationPopover.data('bs.popover').tip().find(".btn_popover_open_invoice").on('click',
|
||||||
@@ -833,11 +824,13 @@ var PMSCalendarController = AbstractController.extend({
|
|||||||
|
|
||||||
var domain_checkouts = [
|
var domain_checkouts = [
|
||||||
['checkout', '=', now_fmt],
|
['checkout', '=', now_fmt],
|
||||||
['state', 'not in', ['cancelled']]
|
['state', 'in', ['booking']],
|
||||||
|
['reservation_type', 'not in', ['out']]
|
||||||
];
|
];
|
||||||
var domain_checkins = [
|
var domain_checkins = [
|
||||||
['checkin', '=', now_fmt],
|
['checkin', '=', now_fmt],
|
||||||
['state', 'not in', ['cancelled']]
|
['state', 'in', ['confirm']],
|
||||||
|
['reservation_type', 'not in', ['out']]
|
||||||
];
|
];
|
||||||
var domain_overbookings = [
|
var domain_overbookings = [
|
||||||
['checkin', '>=', dfrom_fmt],
|
['checkin', '>=', dfrom_fmt],
|
||||||
@@ -852,7 +845,7 @@ var PMSCalendarController = AbstractController.extend({
|
|||||||
['state', '=', 'cancelled']
|
['state', '=', 'cancelled']
|
||||||
];
|
];
|
||||||
|
|
||||||
$.when(
|
$.when(
|
||||||
this.model.search_count(domain_checkouts),
|
this.model.search_count(domain_checkouts),
|
||||||
this.model.search_count(domain_checkins),
|
this.model.search_count(domain_checkins),
|
||||||
this.model.search_count(domain_overbookings),
|
this.model.search_count(domain_overbookings),
|
||||||
|
|||||||
@@ -6,7 +6,9 @@
|
|||||||
<field name="res_model">hotel.reservation</field>
|
<field name="res_model">hotel.reservation</field>
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('checkin','=', datetime.datetime.now().strftime('%Y-%m-%d'))]</field>
|
<field name="domain">[('checkin','=', datetime.datetime.now().strftime('%Y-%m-%d'),
|
||||||
|
('state', 'in', ('confirm')),
|
||||||
|
('reservation_type', 'not in', ('out')))]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.actions.act_window" id="hotel_reservation_action_checkout">
|
<record model="ir.actions.act_window" id="hotel_reservation_action_checkout">
|
||||||
@@ -14,7 +16,9 @@
|
|||||||
<field name="res_model">hotel.reservation</field>
|
<field name="res_model">hotel.reservation</field>
|
||||||
<field name="view_type">form</field>
|
<field name="view_type">form</field>
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('checkout','=', datetime.datetime.now().strftime('%Y-%m-%d'))]</field>
|
<field name="domain">[('checkout','=', datetime.datetime.now().strftime('%Y-%m-%d'),
|
||||||
|
('state', 'in', ('booking')),
|
||||||
|
('reservation_type', 'not in', ('out')))]</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="ir.actions.act_window" id="hotel_calendar_action_form_tree">
|
<record model="ir.actions.act_window" id="hotel_calendar_action_form_tree">
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class HotelCheckinPartner(models.Model):
|
|||||||
document_type = fields.Selection(related='partner_id.document_type')
|
document_type = fields.Selection(related='partner_id.document_type')
|
||||||
document_number = fields.Char(related='partner_id.document_number')
|
document_number = fields.Char(related='partner_id.document_number')
|
||||||
document_expedition_date = fields.Date(related='partner_id.document_expedition_date')
|
document_expedition_date = fields.Date(related='partner_id.document_expedition_date')
|
||||||
|
gender = fields.Selection('Gender', related='partner_id.gender')
|
||||||
code_ine_id = fields.Many2one(related="partner_id.code_ine_id")
|
code_ine_id = fields.Many2one(related="partner_id.code_ine_id")
|
||||||
|
|
||||||
#TMP_FIX VAT Validation
|
#TMP_FIX VAT Validation
|
||||||
|
|||||||
@@ -31,9 +31,10 @@
|
|||||||
'hidden_cardex': True, 'edit_cardex': True }"/>
|
'hidden_cardex': True, 'edit_cardex': True }"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='partner_id']" position="after">
|
<xpath expr="//field[@name='partner_id']" position="after">
|
||||||
|
<field name="gender"/>
|
||||||
<field name="document_type"/>
|
<field name="document_type"/>
|
||||||
<field name="document_number"/>
|
<field name="document_number" string="Doc. Number"/>
|
||||||
<field name="document_expedition_date"/>
|
<field name="document_expedition_date" string="Exp. Date"/>
|
||||||
<field name="code_ine_id" />
|
<field name="code_ine_id" />
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
@@ -53,9 +54,10 @@
|
|||||||
'hidden_cardex': True, 'edit_cardex': True }"/>
|
'hidden_cardex': True, 'edit_cardex': True }"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='partner_id']" position="after">
|
<xpath expr="//field[@name='partner_id']" position="after">
|
||||||
|
<field name="gender"/>
|
||||||
<field name="document_type"/>
|
<field name="document_type"/>
|
||||||
<field name="document_number"/>
|
<field name="document_number" string="Doc. Number"/>
|
||||||
<field name="document_expedition_date"/>
|
<field name="document_expedition_date" string="Exp. Date"/>
|
||||||
<field name="code_ine_id" />
|
<field name="code_ine_id" />
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user