mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[WIP] refactoring hotel settings hints
This commit is contained in:
@@ -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>
|
||||
@@ -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):
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user