Fix minor
This commit is contained in:
parent
b6c9f18bb1
commit
2035f387a2
2
INSTALL
2
INSTALL
|
@ -4,7 +4,7 @@ Installing trytond_hotel
|
|||
Prerequisites
|
||||
-------------
|
||||
|
||||
* Python 2.7 or later (http://www.python.org/)
|
||||
* Python 3.10 or later (http://www.python.org/)
|
||||
* trytond (http://www.tryton.org/)
|
||||
* trytond_company (http://www.tryton.org/)
|
||||
* trytond_party (http://www.tryton.org/)
|
||||
|
|
11
booking.xml
11
booking.xml
|
@ -15,17 +15,6 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="name">view_select_rooms</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="folio_guest_view_tree">
|
||||
<field name="model">hotel.folio.guest</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="name">guest_tree</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="folio_guest_view_form">
|
||||
<field name="model">hotel.folio.guest</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">guest_form</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.action.report" id="report_booking">
|
||||
<field name="name">Booking</field>
|
||||
<field name="model">hotel.booking</field>
|
||||
|
|
|
@ -10,16 +10,16 @@ from trytond.i18n import gettext
|
|||
class Configuration(ModelSQL, ModelView):
|
||||
'Hotel Configuration'
|
||||
__name__ = 'hotel.configuration'
|
||||
booking_sequence = fields.Many2One('ir.sequence',
|
||||
'Hotel Booking Sequence', domain=[
|
||||
booking_sequence = fields.Many2One('ir.sequence', 'Hotel Booking Sequence',
|
||||
domain=[
|
||||
('company', 'in',
|
||||
[Eval('context', {}).get('company', 0), None]),
|
||||
('sequence_type', '=',
|
||||
Id('hotel',
|
||||
'sequence_type_hotel')),
|
||||
], required=True)
|
||||
hotel_service_sequence = fields.Many2One('ir.sequence',
|
||||
'Hotel Service Sequence', domain=[
|
||||
hotel_service_sequence = fields.Many2One('ir.sequence', 'Service Sequence',
|
||||
domain=[
|
||||
('company', 'in',
|
||||
[Eval('context', {}).get('company', 0), None]),
|
||||
('sequence_type', '=',
|
||||
|
@ -38,7 +38,8 @@ class Configuration(ModelSQL, ModelView):
|
|||
'configuration', 'product', 'Default Charges')
|
||||
check_in_time = fields.Time('Check In Time', required=True)
|
||||
check_out_time = fields.Time('Check Out Time', required=True)
|
||||
taxes_exception_rule = fields.Many2One('account.tax.rule', 'Taxes Exception Rule')
|
||||
taxes_exception_rule = fields.Many2One('account.tax.rule',
|
||||
'Taxes Exception Rule')
|
||||
default_channel_seller = fields.Many2One('hotel.channel', 'Default Channel')
|
||||
company = fields.Many2One('company.company', 'Company', required=True,
|
||||
domain=[
|
||||
|
@ -58,7 +59,8 @@ class Configuration(ModelSQL, ModelView):
|
|||
'Cleaning Check In')
|
||||
cleaning_occupied = fields.Many2One('hotel.room.cleaning_type',
|
||||
'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 = fields.Many2One('email.template', 'Booking Email')
|
||||
check_in_email = fields.Many2One('email.template', 'Check-In Email')
|
||||
customer_experience_email = fields.Many2One('email.template',
|
||||
|
@ -84,7 +86,8 @@ class Configuration(ModelSQL, ModelView):
|
|||
('company', '=', company_id)
|
||||
])
|
||||
if not config or not config.booking_sequence:
|
||||
raise AccessError(gettext('hotel.missing_default_configuration'))
|
||||
raise AccessError(
|
||||
gettext('hotel.missing_default_configuration'))
|
||||
return config
|
||||
|
||||
|
||||
|
@ -93,15 +96,15 @@ class ConfigurationProduct(ModelSQL):
|
|||
__name__ = 'hotel.configuration-product.product'
|
||||
_table = 'hotel_configuration_product_rel'
|
||||
configuration = fields.Many2One('hotel.configuration', 'Configuration',
|
||||
ondelete='CASCADE', select=True, required=True)
|
||||
ondelete='CASCADE', select=True, required=True)
|
||||
product = fields.Many2One('product.product', 'Product',
|
||||
ondelete='RESTRICT', select=True, required=True)
|
||||
ondelete='RESTRICT', select=True, required=True)
|
||||
|
||||
|
||||
class ChildrenPolicy(ModelSQL, ModelView):
|
||||
'Children Policy'
|
||||
__name__ = 'hotel.children_policy'
|
||||
configuration = fields.Many2One('hotel.configuration', 'Configuration',
|
||||
ondelete='CASCADE', select=True, required=True)
|
||||
ondelete='CASCADE', required=True)
|
||||
limit_age = fields.Integer('Limit Age', help='In years')
|
||||
amount = fields.Numeric('Amount')
|
||||
|
|
16
folio.py
16
folio.py
|
@ -56,7 +56,7 @@ class Folio(ModelSQL, ModelView):
|
|||
registration_card = fields.Char('Registration Card', readonly=True,
|
||||
select=True, help="Unique sequence for card guest registration.")
|
||||
room = fields.Many2One('hotel.room', 'Room', select=True,
|
||||
states=STATES_CHECKIN)
|
||||
states=STATES_CHECKOUT)
|
||||
arrival_date = fields.Date('Arrival Date', required=True,
|
||||
states=STATES_CHECKOUT)
|
||||
departure_date = fields.Date('Departure Date', required=True,
|
||||
|
@ -84,8 +84,10 @@ class Folio(ModelSQL, ModelView):
|
|||
nights_quantity = fields.Integer('Nights', states={'readonly': True},
|
||||
depends=['arrival_date', 'departure_date'])
|
||||
host_quantity = fields.Integer('Host', states=STATES_CHECKIN)
|
||||
estimated_arrival_time = fields.Time('Estimated Arrival Time',
|
||||
states=STATES_CHECKIN)
|
||||
estimated_arrival_time = fields.Time('Estimated Arrival Time', states={
|
||||
'readonly': Eval('registration_state').in_(
|
||||
['check_out', 'no_show', 'cancelled']
|
||||
)})
|
||||
unit_digits = fields.Function(fields.Integer('Unit Digits'), 'get_unit_digits')
|
||||
notes = fields.Text('Notes')
|
||||
total_amount = fields.Function(fields.Numeric('Total Amount',
|
||||
|
@ -313,21 +315,23 @@ class Folio(ModelSQL, ModelView):
|
|||
bk = self.booking
|
||||
|
||||
def _check_accommodation(folio):
|
||||
if folio.payment_status == 'pending':
|
||||
if folio.payment_status != 'paid':
|
||||
raise UserError(gettext('hotel.msg_accommodation_not_paid'))
|
||||
|
||||
def _check_charges(folio):
|
||||
for charge in folio.charges:
|
||||
if charge.status == 'pending':
|
||||
if charge.status != 'paid':
|
||||
raise UserError(gettext('hotel.msg_charges_not_paid'))
|
||||
break
|
||||
|
||||
if bk.responsible_payment == 'guest':
|
||||
_check_charges(self)
|
||||
_check_accommodation(self)
|
||||
elif bk.responsible_payment == 'holder':
|
||||
print('yeaaaaaa')
|
||||
if self.main_guest == bk.party:
|
||||
print('yeaaaaaa1')
|
||||
for folio in bk.lines:
|
||||
print('yeaaaaaa2')
|
||||
_check_charges(folio)
|
||||
_check_accommodation(folio)
|
||||
else:
|
||||
|
|
27
folio.xml
27
folio.xml
|
@ -141,33 +141,6 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="action" ref="act_folio_reverse_checkout"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="board_folio_guest_view_tree">
|
||||
<field name="model">hotel.folio.guest</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="name">board_folio_guest_tree</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="board_folio_guest_view_form">
|
||||
<field name="model">hotel.folio.guest</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">board_folio_guest_form</field>
|
||||
</record>
|
||||
<record model="ir.action.act_window" id="act_board_folio_guest_view">
|
||||
<field name="name">Guests</field>
|
||||
<field name="res_model">hotel.folio.guest</field>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_hotel_board_folio_guest_tree_view">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view" ref="board_folio_guest_view_tree"/>
|
||||
<field name="act_window" ref="act_board_folio_guest_view"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_hotel_board_folio_guest_form_view">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view" ref="board_folio_guest_view_form"/>
|
||||
<field name="act_window" ref="act_board_folio_guest_view"/>
|
||||
</record>
|
||||
<menuitem parent="menu_hotel" sequence="20" icon="hotel-guests"
|
||||
action="act_board_folio_guest_view" id="menu_hotel_board_guest_folio"/>
|
||||
|
||||
<record model="ir.model.access" id="access_hotel_folio">
|
||||
<field name="model" search="[('model', '=', 'hotel.folio')]"/>
|
||||
<field name="perm_read" eval="False"/>
|
||||
|
|
38
guest.xml
38
guest.xml
|
@ -4,6 +4,44 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<tryton>
|
||||
<data>
|
||||
|
||||
<record model="ir.ui.view" id="folio_guest_view_tree">
|
||||
<field name="model">hotel.folio.guest</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="name">guest_tree</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="folio_guest_view_form">
|
||||
<field name="model">hotel.folio.guest</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">guest_form</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="board_folio_guest_view_tree">
|
||||
<field name="model">hotel.folio.guest</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="name">board_folio_guest_tree</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="board_folio_guest_view_form">
|
||||
<field name="model">hotel.folio.guest</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">board_folio_guest_form</field>
|
||||
</record>
|
||||
<record model="ir.action.act_window" id="act_board_folio_guest_view">
|
||||
<field name="name">Guests</field>
|
||||
<field name="res_model">hotel.folio.guest</field>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_hotel_board_folio_guest_tree_view">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view" ref="board_folio_guest_view_tree"/>
|
||||
<field name="act_window" ref="act_board_folio_guest_view"/>
|
||||
</record>
|
||||
<record model="ir.action.act_window.view" id="act_hotel_board_folio_guest_form_view">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view" ref="board_folio_guest_view_form"/>
|
||||
<field name="act_window" ref="act_board_folio_guest_view"/>
|
||||
</record>
|
||||
<menuitem parent="menu_hotel" sequence="80" icon="hotel-guests"
|
||||
action="act_board_folio_guest_view" id="menu_hotel_board_guest_folio"/>
|
||||
|
||||
<record model="ir.ui.view" id="hotel_tag_view_tree">
|
||||
<field name="model">hotel.tag</field>
|
||||
<field name="type">tree</field>
|
||||
|
|
|
@ -93,11 +93,11 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<record model="ir.message" id="msg_accommodation_not_paid">
|
||||
<field name="text">The accommodation isn't paid!</field>
|
||||
</record>
|
||||
<record model="ir.message" id="msg_charges_not_paid">
|
||||
<field name="text">There is charges without payment!"</field>
|
||||
</record>
|
||||
<!-- <record model="ir.message" id="msg_charges_not_paid">
|
||||
<field name="text">There is charges without payment!</field>
|
||||
</record> -->
|
||||
<record model="ir.message" id="msg_cannot_check_in_future">
|
||||
<field name="text">It can not check-in of future dates! "%(product)s"</field>
|
||||
<field name="text">It can not check-in of future dates!"</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
|
||||
DROP TABLE hotel_service_line CASCADE;
|
||||
DROP TABLE hotel_service CASCADE;
|
||||
DROP TABLE hotel_operation_maintenance CASCADE;
|
||||
|
||||
ALTER TABLE hotel_booking_line RENAME TO hotel_folio;
|
||||
trytond-admin -c .trytond/trytond.conf -v -d TAYLOR -u account
|
||||
|
||||
UPDATE hotel_folio
|
||||
SET registration_card=b.registration_card
|
||||
FROM hotel_booking AS b
|
||||
WHERE hotel_folio.booking=b.id;
|
||||
|
||||
INSERT INTO booking_vouchers_rel (voucher, booking)
|
||||
SELECT ov.voucher, hf.booking FROM operation_vouchers_rel AS ov
|
||||
JOIN hotel_folio AS hf
|
||||
ON hf.operation = ov.operation
|
||||
WHERE ov.voucher NOT IN (SELECT voucher FROM booking_vouchers_rel);
|
||||
|
||||
DROP TABLE hotel_folio_guest;
|
||||
ALTER TABLE hotel_booking_guest RENAME TO hotel_folio_guest;
|
||||
ALTER TABLE hotel_folio_guest RENAME COLUMN folio TO folio_old;
|
||||
ALTER TABLE hotel_folio_guest RENAME COLUMN booking_line TO folio;
|
||||
|
||||
|
||||
INSERT INTO hotel_folio_guest (
|
||||
birthday, doc_number, email, first_family_name, first_name,
|
||||
folio, mobile, name, nationality, origin_country, party,
|
||||
second_family_name, second_name, sex, target_country, type_document,
|
||||
type_guest, type_person
|
||||
)
|
||||
SELECT
|
||||
birthday, doc_number, email, first_family_name, first_name,
|
||||
folio, mobile, name, nationality, origin_country, party,
|
||||
second_family_name, second_name, sex, target_country, type_document,
|
||||
type_guest, type_person
|
||||
FROM dup_hotel_folio_guest WHERE id IN (3, 4, 5);
|
||||
|
||||
|
||||
-- INSERT INTO hotel_folio_guest (folio, party)
|
||||
-- SELECT fo.id AS folio, og.party AS party
|
||||
-- FROM hotel_operation_guest AS og
|
||||
-- JOIN hotel_folio AS fo ON fo.operation = og.operation
|
||||
-- WHERE og.party NOT IN (SELECT party FROM hotel_folio_guest)
|
||||
-- GROUP BY og.party, fo.id ORDER BY fo.id;
|
||||
|
||||
|
||||
-- ALTER TABLE hotel_operation_guest RENAME TO hotel_folio;
|
||||
-- DROP TABLE operation_vouchers_rel;
|
||||
-- DROP TABLE hotel_folio_charge CASCADE;
|
||||
-- DROP TABLE hotel_folio CASCADE;
|
||||
-- DROP TABLE hotel_operation_guest CASCADE;
|
||||
-- DROP TABLE hotel_operation CASCADE;
|
||||
-- DROP TABLE hotel_operation_line CASCADE;
|
|
@ -28,12 +28,12 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="channel" widget="selection"/>
|
||||
<label name="ota_booking_code"/>
|
||||
<field name="ota_booking_code"/>
|
||||
<group col="5" id="actions" colspan="5">
|
||||
<group col="5" id="actions" colspan="4">
|
||||
<button name="do_payment" string="Pay / Advance" icon="tryton-currency"/>
|
||||
<button name="select_rooms" string="Rooms" icon="tryton-board"/>
|
||||
<button name="send_email_booking" string="Send Email" icon="tryton-email"/>
|
||||
</group>
|
||||
<group col="4" id="add_info_group_taxes" colspan="1">
|
||||
<group col="4" id="add_info_group_taxes" colspan="2">
|
||||
<label name="group"/>
|
||||
<field name="group"/>
|
||||
<label name="taxes_exception"/>
|
||||
|
@ -102,7 +102,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="emails" colspan="4"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<group col="7" colspan="4" id="buttons">
|
||||
<group col="4" colspan="3" id="buttons">
|
||||
<button name="cancel" string="Cancel" icon="tryton-cancel"/>
|
||||
<button name="not_show" string="Not Show" icon="tryton-cancel"/>
|
||||
<button name="offer" string="Offer" icon="tryton-clear"/>
|
||||
|
@ -111,7 +111,7 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="state"/>
|
||||
<button name="bill" string="Bill"/>
|
||||
</group>
|
||||
<group col="6" colspan="2" xfill="1" id="amounts">
|
||||
<group col="6" colspan="3" xfill="1" id="amounts">
|
||||
<label name="untaxed_amount"/>
|
||||
<field name="untaxed_amount"/>
|
||||
<label name="tax_amount"/>
|
||||
|
|
Loading…
Reference in New Issue