Minor fixes

This commit is contained in:
Oscar Alvarez 2021-01-23 10:56:32 -05:00
parent 14cdf42424
commit 7cef1d02a1
12 changed files with 86 additions and 7 deletions

View File

@ -250,7 +250,7 @@ class Booking(Workflow, ModelSQL, ModelView):
'offer': { 'offer': {
'invisible': ~Eval('state').in_([ 'invisible': ~Eval('state').in_([
'confirmed', 'cancelled', 'not_confirmed' 'confirmed', 'cancelled', 'not_confirmed'
]), ]) and Eval('registration_state').in_(['check_in', 'check_out']),
}, },
'confirm': { 'confirm': {
'invisible': ~Eval('state').in_(['offer', 'not_confirmed']) 'invisible': ~Eval('state').in_(['offer', 'not_confirmed'])
@ -260,11 +260,11 @@ class Booking(Workflow, ModelSQL, ModelView):
}, },
'check_in': { 'check_in': {
'invisible': Eval('state') != 'confirmed' and 'invisible': Eval('state') != 'confirmed' and
Eval('registration_state') == 'check_in', Eval('registration_state').in_(['check_in', 'check_out']),
}, },
'no_show': { 'no_show': {
'invisible': Eval('state') != 'confirmed' and 'invisible': Eval('state') != 'confirmed' and
Eval('registration_state') == 'no_show', Eval('registration_state').in_(['check_in', 'check_out']),
}, },
'check_out': { 'check_out': {
'invisible': Eval('state') != 'confirmed' and 'invisible': Eval('state') != 'confirmed' and

View File

@ -195,13 +195,21 @@ this repository contains the full copyright notices and license terms. -->
<field name="perm_delete" eval="True"/> <field name="perm_delete" eval="True"/>
</record> </record>
<record model="ir.ui.view" id="booking_line_guest_view_tree">
<field name="model">hotel.booking.line</field>
<field name="type">tree</field>
<field name="name">booking_line_guest_tree</field>
</record>
<record model="ir.action.act_window" id="act_booking_board_form"> <record model="ir.action.act_window" id="act_booking_board_form">
<field name="name">Board Guest Moves</field> <field name="name">Board Guest Moves</field>
<field name="res_model">hotel.booking.line</field> <field name="res_model">hotel.booking.line</field>
<field name="search_value"
eval="[('create_date', '>=', DateTime(hour=0, minute=0, second=0, microsecond=0, delta_years=-1))]"
pyson="1"/>
</record> </record>
<record model="ir.action.act_window.view" id="act_booking_board_form_view1"> <record model="ir.action.act_window.view" id="act_booking_board_form_view1">
<field name="sequence" eval="1"/> <field name="sequence" eval="1"/>
<field name="view" ref="booking_line_view_tree"/> <field name="view" ref="booking_line_guest_view_tree"/>
<field name="act_window" ref="act_booking_board_form"/> <field name="act_window" ref="act_booking_board_form"/>
</record> </record>
<menuitem parent="menu_booking_form" sequence="30" <menuitem parent="menu_booking_form" sequence="30"
@ -232,6 +240,14 @@ this repository contains the full copyright notices and license terms. -->
]" pyson="1"/> ]" pyson="1"/>
<field name="act_window" ref="act_booking_board_form"/> <field name="act_window" ref="act_booking_board_form"/>
</record> </record>
<record model="ir.action.act_window.domain" id="act_guest_moves_form_domain_all">
<field name="name">All</field>
<field name="sequence" eval="90"/>
<field name="domain" eval="[
('arrival_date', '>=', Date()),
]" pyson="1"/>
<field name="act_window" ref="act_booking_board_form"/>
</record>
<!-- <record model="ir.action.act_window" id="act_open_booking_sales_form"> <!-- <record model="ir.action.act_window" id="act_open_booking_sales_form">
<field name="name">Sales</field> <field name="name">Sales</field>

View File

@ -1,4 +1,4 @@
#This file is part of Presik. The COPYRIGHT file at the top level of # This file is part of Presik. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms. # this repository contains the full copyright notices and license terms.
from trytond.model import ModelView, ModelSQL, fields from trytond.model import ModelView, ModelSQL, fields
from trytond.pyson import Eval, If from trytond.pyson import Eval, If
@ -43,6 +43,7 @@ class SaleChannel(ModelSQL, ModelView):
]) ])
currency = fields.Many2One('currency.currency', 'Currency', currency = fields.Many2One('currency.currency', 'Currency',
required=True) required=True)
price_list = fields.Many2One('product.price_list', 'Price List')
payment_method = fields.Selection([ payment_method = fields.Selection([
('', ''), ('', ''),
('on_booking', 'On Booking'), ('on_booking', 'On Booking'),

View File

@ -55,6 +55,8 @@ class Configuration(ModelSQL, ModelView):
cleaning_occupied = fields.Many2One('hotel.housekeeping.cleaning_type', cleaning_occupied = fields.Many2One('hotel.housekeeping.cleaning_type',
'Cleaning Occupied') 'Cleaning Occupied')
quarantine_rooms = fields.Numeric('Quarantine Rooms', digits=(2, 0), help='In days') quarantine_rooms = fields.Numeric('Quarantine Rooms', digits=(2, 0), help='In days')
booking_email_template = fields.Many2One('email.template',
'Booking Template Email')
@classmethod @classmethod
def __setup__(cls): def __setup__(cls):

View File

@ -77,7 +77,7 @@ this repository contains the full copyright notices and license terms. -->
</record> </record>
<record model="ir.action.act_window.view" id="act_housekeeping_cleaning_type_form_view2"> <record model="ir.action.act_window.view" id="act_housekeeping_cleaning_type_form_view2">
<field name="sequence" eval="20"/> <field name="sequence" eval="20"/>
<field name="view" ref="task_view_form"/> <field name="view" ref="housekeeping_cleaning_type_view_form"/>
<field name="act_window" ref="act_housekeeping_cleaning_type_form"/> <field name="act_window" ref="act_housekeeping_cleaning_type_form"/>
</record> </record>
<menuitem name="Cleaning Type" parent="hotel.menu_configuration" sequence="50" <menuitem name="Cleaning Type" parent="hotel.menu_configuration" sequence="50"

Binary file not shown.

16
template_demo.html Normal file
View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<body>
<p>Dear customer, {{ record.approved_by.name }}</p>
<p>Your booking has been confirmed No. <b> {{record.number }}<b>:</p>
Room: <b>{{ record.room }}</b><br>
Check-In: <b>{{ record.check_in }}</b><br>
Check-Out: <b>{{ record.check_out }}</b><br>
</b><br>
<p>-------------------------<br>
{{ record.company and record.company.party.name }}<br>
</p>
</body>
</html>

View File

@ -1,5 +1,5 @@
[tryton] [tryton]
version=5.0.3 version=5.0.4
depends: depends:
party party
company company
@ -11,6 +11,7 @@ depends:
account_voucher account_voucher
party_personal party_personal
company_timezone company_timezone
email
xml: xml:
hotel.xml hotel.xml
configuration.xml configuration.xml

View File

@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree>
<field name="booking"/>
<field name="product"/>
<field name="main_guest"/>
<field name="room"/>
<field name="nights_quantity"/>
<field name="arrival_date"/>
<field name="departure_date"/>
<field name="unit_price"/>
<field name="total_amount"/>
<field name="host_quantity"/>
<field name="state"/>
</tree>

View File

@ -20,5 +20,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="credit_account"/> <field name="credit_account"/>
<label name="payment_method"/> <label name="payment_method"/>
<field name="payment_method"/> <field name="payment_method"/>
<label name="price_list"/>
<field name="price_list"/>
<field name="taxes" colspan="4"/> <field name="taxes" colspan="4"/>
</form> </form>

View File

@ -30,5 +30,7 @@ this repository contains the full copyright notices and license terms. -->
<field name="age_children_policy"/> <field name="age_children_policy"/>
<label name="quarantine_rooms"/> <label name="quarantine_rooms"/>
<field name="quarantine_rooms"/> <field name="quarantine_rooms"/>
<label name="booking_email_template"/>
<field name="booking_email_template"/>
<field name="default_charges" colspan="4"/> <field name="default_charges" colspan="4"/>
</form> </form>

View File

@ -0,0 +1,23 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form col="6">
<label name="name"/>
<field name="name" xexpand="1"/>
<label name="type_document"/>
<field name="type_document" xexpand="0"/>
<label name="id_number"/>
<field name="id_number"/>
<label name="check_digit"/>
<field name="check_digit"/>
<label name="visa_category"/>
<field name="visa_category"/>
<label name="visa_number"/>
<field name="visa_number"/>
<label name="visa_date"/>
<field name="visa_date"/>
<field name="addresses" mode="form,tree" colspan="4"
view_ids="party.address_view_form,party.address_view_tree_sequence"/>
<field name="contact_mechanisms" colspan="2"
view_ids="party.contact_mechanism_view_tree_sequence"/>
</form>