[WIP] refactoring hotel settings hints

This commit is contained in:
Pablo
2019-08-29 18:10:38 +02:00
parent 9fbb431339
commit a2d94c19c5
6 changed files with 6 additions and 63 deletions

View File

@@ -1,63 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Hotel Settings -->
<record id="view_hotel_calendar_config_settings" model="ir.ui.view">
<field name="name">res.config.calendar.settings.view.form.inherit.hotel</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="80"/>
<field name="inherit_id" ref="hotel.view_hotel_config_settings"/>
<field name="arch" type="xml">
<xpath expr="//h2[@id='default_hours']" position="before">
<h2>Calendar Colors</h2>
<div class="row mt16 o_settings_container">
<div class="row mt16 o_settings_container">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="text-muted">
Set Background Colors
</div>
<div class="content-group">
<div class="mt16">
<group>
<field name="color_pre_reservation" widget="color" />
<field name="color_reservation" widget="color" />
<field name="color_reservation_pay" widget="color" />
<field name="color_stay" widget="color" />
<field name="color_stay_pay" widget="color" />
<field name="color_checkout" widget="color" />
<field name="color_dontsell" widget="color" />
<field name="color_staff" widget="color" />
<field name="color_to_assign" widget="color" />
<field name="color_payment_pending" widget="color" />
</group>
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="text-muted">
Set Letter Colors
</div>
<div class="content-group">
<div class="mt16">
<group>
<field name="color_letter_pre_reservation" widget="color" />
<field name="color_letter_reservation" widget="color" />
<field name="color_letter_reservation_pay" widget="color" />
<field name="color_letter_stay" widget="color" />
<field name="color_letter_stay_pay" widget="color" />
<field name="color_letter_checkout" widget="color" />
<field name="color_letter_dontsell" widget="color" />
<field name="color_letter_staff" widget="color" />
<field name="color_letter_to_assign" widget="color" />
<field name="color_letter_payment_pending" widget="color" />
</group>
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

View File

@@ -76,8 +76,10 @@ class HotelFolio(models.Model):
def rm_get_stay(self, code):
# BUSQUEDA POR LOCALIZADOR
checkin_partner = self.search([('id', '=', code)])
# TODO: refactoring 'res.config.settings', 'default_arrival_hour' by the current self.env.user.hotel_id.arrival_hour
default_arrival_hour = self.env['ir.default'].sudo().get(
'res.config.settings', 'default_arrival_hour')
# TODO: refactoring 'res.config.settings', 'default_departure_hour' by the current self.env.user.hotel_id.departure_hour
default_departure_hour = self.env['ir.default'].sudo().get(
'res.config.settings', 'default_departure_hour')
if any(checkin_partner):

View File

@@ -36,10 +36,12 @@ class HotelReservation(models.Model):
reservations = reservations.filtered(
lambda x: x.state in ('draft', 'confirm'))
if any(reservations):
# TODO: refactoring 'res.config.settings', 'default_arrival_hour' by the current self.env.user.hotel_id.arrival_hour
default_arrival_hour = self.env['ir.default'].sudo().get(
'res.config.settings', 'default_arrival_hour')
checkin = "%s %s" % (reservations[0].checkin,
default_arrival_hour)
# TODO: refactoring 'res.config.settings', 'default_departure_hour' by the current self.env.user.hotel_id.departure_hour
default_departure_hour = self.env['ir.default'].sudo().get(
'res.config.settings', 'default_departure_hour')
checkout = "%s %s" % (reservations[0].checkout,

View File

@@ -17,6 +17,7 @@ class HotelRoomType(models.Model):
@api.model
def rm_get_all_room_type_rates(self):
room_types = self.env['hotel.room.type'].search([])
# TODO: refactoring 'res.config.settings', 'default_departure_hour' by the current self.env.user.hotel_id
tz_hotel = self.env['ir.default'].sudo().get(
'res.config.settings', 'tz_hotel')
dfrom = fields.Date.context_today(self.with_context(

View File

@@ -22,6 +22,7 @@ class RoomMatik(models.Model):
@api.model
def rm_get_date(self):
# RoomMatik API Gets the current business date/time. (MANDATORY)
# TODO: refactoring 'res.config.settings', 'default_departure_hour' by the current self.env.user.hotel_id
tz_hotel = self.env['ir.default'].sudo().get(
'res.config.settings', 'tz_hotel')
self_tz = self.with_context(tz=tz_hotel)