mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] Views
This commit is contained in:
@@ -55,6 +55,14 @@ class PmsCheckinPartner(models.Model):
|
|||||||
related="reservation_id.segmentation_ids",
|
related="reservation_id.segmentation_ids",
|
||||||
readonly=True,
|
readonly=True,
|
||||||
)
|
)
|
||||||
|
checkin = fields.Date(
|
||||||
|
related="reservation_id.checkin", store=True, depends=["reservation_id.checkin"]
|
||||||
|
)
|
||||||
|
checkout = fields.Date(
|
||||||
|
related="reservation_id.checkout",
|
||||||
|
store=True,
|
||||||
|
depends=["reservation_id.checkout"],
|
||||||
|
)
|
||||||
arrival = fields.Datetime("Enter")
|
arrival = fields.Datetime("Enter")
|
||||||
departure = fields.Datetime("Exit")
|
departure = fields.Datetime("Exit")
|
||||||
state = fields.Selection(
|
state = fields.Selection(
|
||||||
@@ -110,11 +118,18 @@ class PmsCheckinPartner(models.Model):
|
|||||||
else:
|
else:
|
||||||
record.state = "precheckin"
|
record.state = "precheckin"
|
||||||
|
|
||||||
@api.depends("partner_id", "partner_id.name")
|
@api.depends(
|
||||||
|
"partner_id",
|
||||||
|
"partner_id.name",
|
||||||
|
"reservation_id",
|
||||||
|
"reservation_id.preferred_room_id",
|
||||||
|
)
|
||||||
def _compute_name(self):
|
def _compute_name(self):
|
||||||
for record in self:
|
self.name = False
|
||||||
if not record.name:
|
for record in self.filtered("reservation_id.rooms"):
|
||||||
record.name = record.partner_id.name
|
record.name = record.reservation_id.rooms
|
||||||
|
if record.partner_id:
|
||||||
|
record.name = record.name + " (" + record.partner_id.name + ")"
|
||||||
|
|
||||||
@api.depends("partner_id", "partner_id.email")
|
@api.depends("partner_id", "partner_id.email")
|
||||||
def _compute_email(self):
|
def _compute_email(self):
|
||||||
@@ -132,8 +147,8 @@ class PmsCheckinPartner(models.Model):
|
|||||||
def _checkin_mandatory_fields(self, depends=False):
|
def _checkin_mandatory_fields(self, depends=False):
|
||||||
# api.depends need "reservation_id.state" in the lambda function
|
# api.depends need "reservation_id.state" in the lambda function
|
||||||
if depends:
|
if depends:
|
||||||
return ["reservation_id.state", "name"]
|
return ["reservation_id.state", "partner_id"]
|
||||||
return ["name"]
|
return ["partner_id"]
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _checkin_partner_fields(self):
|
def _checkin_partner_fields(self):
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ class PmsFolio(models.Model):
|
|||||||
compute="_compute_amount",
|
compute="_compute_amount",
|
||||||
store=True,
|
store=True,
|
||||||
tracking=True,
|
tracking=True,
|
||||||
string="Payments",
|
string="Paid Out",
|
||||||
)
|
)
|
||||||
amount_untaxed = fields.Monetary(
|
amount_untaxed = fields.Monetary(
|
||||||
string="Untaxed Amount",
|
string="Untaxed Amount",
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class PmsServiceLine(models.Model):
|
|||||||
_name = "pms.service.line"
|
_name = "pms.service.line"
|
||||||
_description = "Service by day"
|
_description = "Service by day"
|
||||||
_order = "date"
|
_order = "date"
|
||||||
|
_rec_name = "service_id"
|
||||||
|
|
||||||
# Fields declaration
|
# Fields declaration
|
||||||
service_id = fields.Many2one(
|
service_id = fields.Many2one(
|
||||||
@@ -18,6 +19,7 @@ class PmsServiceLine(models.Model):
|
|||||||
required=True,
|
required=True,
|
||||||
copy=False,
|
copy=False,
|
||||||
)
|
)
|
||||||
|
is_board_service = fields.Boolean(related="service_id.is_board_service", store=True)
|
||||||
product_id = fields.Many2one(related="service_id.product_id", store=True)
|
product_id = fields.Many2one(related="service_id.product_id", store=True)
|
||||||
tax_ids = fields.Many2many(
|
tax_ids = fields.Many2many(
|
||||||
"account.tax", string="Taxes", related="service_id.tax_ids", readonly="True"
|
"account.tax", string="Taxes", related="service_id.tax_ids", readonly="True"
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ class ResPartner(models.Model):
|
|||||||
"|",
|
"|",
|
||||||
("phone", operator, name),
|
("phone", operator, name),
|
||||||
("mobile", operator, name),
|
("mobile", operator, name),
|
||||||
("email", operator, name),
|
|
||||||
]
|
]
|
||||||
partners = self.search(
|
partners = self.search(
|
||||||
domain + args,
|
domain + args,
|
||||||
|
|||||||
@@ -4,8 +4,10 @@
|
|||||||
id="action_checkin_partner"
|
id="action_checkin_partner"
|
||||||
name="Action checkin"
|
name="Action checkin"
|
||||||
res_model="pms.checkin.partner"
|
res_model="pms.checkin.partner"
|
||||||
view_mode="kanban,tree,form"
|
view_mode="kanban,tree,form,calendar,graph,pivot"
|
||||||
domain="[('state', '!=', 'draft')]"
|
context="{
|
||||||
|
'search_default_future':1,
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_pms_checkin_partner"
|
id="menu_pms_checkin_partner"
|
||||||
@@ -154,6 +156,10 @@
|
|||||||
class="o_res_partner_kanban"
|
class="o_res_partner_kanban"
|
||||||
sample="1"
|
sample="1"
|
||||||
create="false"
|
create="false"
|
||||||
|
group_create="false"
|
||||||
|
group_delete="false"
|
||||||
|
group_edit="false"
|
||||||
|
records_draggable="false"
|
||||||
>
|
>
|
||||||
<field name="id" />
|
<field name="id" />
|
||||||
<field name="identifier" />
|
<field name="identifier" />
|
||||||
@@ -287,79 +293,72 @@
|
|||||||
<filter
|
<filter
|
||||||
string="To enter"
|
string="To enter"
|
||||||
name="to_enter"
|
name="to_enter"
|
||||||
domain="[('state', '=', 'draft')]"
|
domain="[('state', '=', 'precheckin')]"
|
||||||
|
/>
|
||||||
|
<separator />
|
||||||
|
<filter
|
||||||
|
string="Hide Strangers"
|
||||||
|
name="hide_strangers"
|
||||||
|
domain="[('state', '!=', 'draft')]"
|
||||||
/>
|
/>
|
||||||
<filter string="Out" name="out" domain="[('state', '=', 'done')]" />
|
<filter string="Out" name="out" domain="[('state', '=', 'done')]" />
|
||||||
|
<separator />
|
||||||
|
<filter
|
||||||
|
string="Checkins Today"
|
||||||
|
name="enter_tomorrow"
|
||||||
|
domain="[('checkin', '=', context_today().strftime('%Y-%m-%d'))]"
|
||||||
|
help="Show all checkins for enter tomorrow"
|
||||||
|
/>
|
||||||
<filter
|
<filter
|
||||||
string="Checkins Tomorrow"
|
string="Checkins Tomorrow"
|
||||||
name="enter_tomorrow"
|
name="enter_tomorrow"
|
||||||
domain="[('arrival', '=', (context_today()+datetime.timedelta(days=1)).strftime('%Y-%m-%d')),
|
domain="[('checkin', '=', (context_today()+datetime.timedelta(days=1)).strftime('%Y-%m-%d'))]"
|
||||||
('state', '=', 'confirm')]"
|
|
||||||
help="Show all checkins for enter tomorrow"
|
help="Show all checkins for enter tomorrow"
|
||||||
/>
|
/>
|
||||||
<filter
|
<filter
|
||||||
string="Checkins to 7 days"
|
string="Checkins to 7 days"
|
||||||
name="next_res_week"
|
name="next_res_week"
|
||||||
domain="[('arrival', '<', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d')),
|
domain="[
|
||||||
('state', '=', 'confirm')]"
|
('checkin', '<', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d')),
|
||||||
|
('checkin', '>=', context_today().strftime('%Y-%m-%d'))
|
||||||
|
]"
|
||||||
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"
|
||||||
/>
|
/>
|
||||||
|
<separator />
|
||||||
<filter
|
<filter
|
||||||
string="On Board Tomorrow"
|
string="Future"
|
||||||
name="next_res_2week"
|
name="future"
|
||||||
domain="[('arrival', '<', (context_today()+datetime.timedelta(days=14)).strftime('%Y-%m-%d')),
|
domain="[('checkin', '>=', context_today().strftime('%Y-%m-%d')),
|
||||||
('state', 'in', ['confirm','onboard'])]"
|
('state', 'not in', ['cancelled'])]"
|
||||||
help="Show all checkins for Tomorrow"
|
help="Show all future checkins"
|
||||||
/>
|
/>
|
||||||
<group expand="0" string="Group By">
|
<group expand="0" string="Group By">
|
||||||
<filter
|
<filter
|
||||||
string="Create by Month"
|
string="Folio"
|
||||||
name="create_date_by_month"
|
name="folio_group"
|
||||||
|
context="{'group_by':'folio_id', 'default_order': 'checkin asc'}"
|
||||||
|
/>
|
||||||
|
<filter
|
||||||
|
string="Room"
|
||||||
|
name="reservation_group"
|
||||||
|
context="{'group_by':'reservation_id', 'default_order': 'checkin asc'}"
|
||||||
|
/>
|
||||||
|
<separator />
|
||||||
|
<filter
|
||||||
|
string="Create by"
|
||||||
|
name="create_date_group"
|
||||||
context="{'group_by':'create_date', 'default_order': 'create_date asc'}"
|
context="{'group_by':'create_date', 'default_order': 'create_date asc'}"
|
||||||
/>
|
/>
|
||||||
<filter
|
<filter
|
||||||
string="Create by Week"
|
string="Checkin by"
|
||||||
name="create_date_by_week"
|
name="checkin_group"
|
||||||
context="{'group_by':'create_date:week', 'default_order': 'create_date'}"
|
context="{'group_by':'checkin', 'default_order': 'checkin asc'}"
|
||||||
/>
|
/>
|
||||||
<filter
|
<filter
|
||||||
string="Create by Day"
|
string="Checkout by"
|
||||||
name="create_date_by_week"
|
name="checkout_group"
|
||||||
context="{'group_by':'create_date:day', 'default_order': 'create_date'}"
|
context="{'group_by':'checkout', 'default_order': 'checkout asc'}"
|
||||||
/>
|
/>
|
||||||
<separator />
|
|
||||||
<filter
|
|
||||||
string="Checkin by Month"
|
|
||||||
name="checkin_by_month"
|
|
||||||
context="{'group_by':'arrival', 'default_order': 'arrival asc'}"
|
|
||||||
/>
|
|
||||||
<filter
|
|
||||||
string="Checkin by Week"
|
|
||||||
name="checkin_by_week"
|
|
||||||
context="{'group_by':'arrival:week', 'default_order': 'arrival'}"
|
|
||||||
/>
|
|
||||||
<filter
|
|
||||||
string="Checkin by Day"
|
|
||||||
name="checkin_by_week"
|
|
||||||
context="{'group_by':'arrival:day', 'default_order': 'arrival'}"
|
|
||||||
/>
|
|
||||||
<separator />
|
|
||||||
<filter
|
|
||||||
string="Checkout by Month"
|
|
||||||
name="checkout_by_month"
|
|
||||||
context="{'group_by':'departure', 'default_order': 'departure asc'}"
|
|
||||||
/>
|
|
||||||
<filter
|
|
||||||
string="Checkout by Week"
|
|
||||||
name="checkout_by_week"
|
|
||||||
context="{'group_by':'departure:week', 'default_order': 'departure'}"
|
|
||||||
/>
|
|
||||||
<filter
|
|
||||||
string="Checkout by Day"
|
|
||||||
name="checkout_by_week"
|
|
||||||
context="{'group_by':'departure:day', 'default_order': 'departure'}"
|
|
||||||
/>
|
|
||||||
<separator />
|
|
||||||
</group>
|
</group>
|
||||||
<searchpanel>
|
<searchpanel>
|
||||||
<field
|
<field
|
||||||
@@ -466,4 +465,46 @@
|
|||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="pms_checkin_partner_view_calendar" model="ir.ui.view">
|
||||||
|
<field name="name">pms.checkin.partner.view.calendar</field>
|
||||||
|
<field name="model">pms.checkin.partner</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<calendar
|
||||||
|
date_start="checkin"
|
||||||
|
date_stop="checkout"
|
||||||
|
string="Hosts"
|
||||||
|
quick_add="False"
|
||||||
|
mode="month"
|
||||||
|
color="folio_id"
|
||||||
|
scales="week,month,year"
|
||||||
|
>
|
||||||
|
<field name="partner_id" />
|
||||||
|
<field name="name" />
|
||||||
|
<field name="reservation_id" />
|
||||||
|
<field name="folio_id" />
|
||||||
|
<field name="state" filters="1" />
|
||||||
|
</calendar>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="pms_checkin_partner_pivot" model="ir.ui.view">
|
||||||
|
<field name="name">pms.checkin.partner.pivot</field>
|
||||||
|
<field name="model">pms.checkin.partner</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<pivot string="Hosts">
|
||||||
|
<field name="checkin" type="row" interval="day" />
|
||||||
|
</pivot>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="pms_checkin_partner_graph" model="ir.ui.view">
|
||||||
|
<field name="name">pms.checkin.partner.graph</field>
|
||||||
|
<field name="model">pms.checkin.partner</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<graph string="Hosts">
|
||||||
|
<field name="checkin" type="row" interval="day" />
|
||||||
|
</graph>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -41,6 +41,19 @@
|
|||||||
</header>
|
</header>
|
||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_button_box" name="button_box">
|
<div class="oe_button_box" name="button_box">
|
||||||
|
<button
|
||||||
|
type="action"
|
||||||
|
class="oe_stat_button"
|
||||||
|
name="%(open_pms_reservation_form_tree_all)d"
|
||||||
|
icon="fa-cubes"
|
||||||
|
context="{'search_default_folio_id': active_id, 'default_folio_id': active_id}"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="number_of_rooms"
|
||||||
|
widget="statinfo"
|
||||||
|
string="Rooms"
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
<button
|
<button
|
||||||
type="object"
|
type="object"
|
||||||
class="oe_stat_button"
|
class="oe_stat_button"
|
||||||
@@ -227,7 +240,6 @@
|
|||||||
<field name="currency_id" invisible="1" />
|
<field name="currency_id" invisible="1" />
|
||||||
<!--<field name="refund_amount" invisible="1" />-->
|
<!--<field name="refund_amount" invisible="1" />-->
|
||||||
<field name="invoices_paid" invisible="1" />
|
<field name="invoices_paid" invisible="1" />
|
||||||
<field name="number_of_rooms" invisible="1" />
|
|
||||||
</group>
|
</group>
|
||||||
<notebook colspan="4" col="1">
|
<notebook colspan="4" col="1">
|
||||||
<page string="Sale Lines">
|
<page string="Sale Lines">
|
||||||
@@ -422,20 +434,68 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree
|
<tree
|
||||||
string="Folio"
|
string="Folio"
|
||||||
|
class="o_sale_order"
|
||||||
decoration-info="state == 'draft'"
|
decoration-info="state == 'draft'"
|
||||||
decoration-muted="state == 'cancel'"
|
decoration-muted="state == 'cancel'"
|
||||||
default_order="create_date desc"
|
default_order="create_date desc"
|
||||||
>
|
>
|
||||||
<field name="state" />
|
|
||||||
<field name="name" />
|
<field name="name" />
|
||||||
<field name="partner_id" select="1" />
|
<field name="partner_id" select="1" />
|
||||||
<field name="date_order" select="1" />
|
<field name="date_order" select="1" />
|
||||||
<field name="user_id" optional="show" widget="many2one_avatar_user" />
|
<field name="user_id" widget="many2one_avatar_user" optional="show" />
|
||||||
<field name="reservation_ids" widget="many2many_tags" />
|
<field name="reservation_ids" widget="many2many_tags" optional="show" />
|
||||||
<field name="amount_total" sum="Total amount" />
|
<field
|
||||||
<field name="pending_amount" sum="Total debt" />
|
name="amount_total"
|
||||||
<field name="invoice_status" />
|
sum="Total amount"
|
||||||
<field name="pms_property_id" invisible="0" />
|
widget="monetary"
|
||||||
|
decoration-bf="1"
|
||||||
|
optional="show"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="pending_amount"
|
||||||
|
sum="Total debt"
|
||||||
|
widget="monetary"
|
||||||
|
decoration-bf="1"
|
||||||
|
optional="show"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="state"
|
||||||
|
decoration-success="state == 'done'"
|
||||||
|
decoration-info="state == 'confirm'"
|
||||||
|
decoration-primary="state == 'sent'"
|
||||||
|
decoration-danger="state == 'cancel'"
|
||||||
|
decoration-bf="state == 'draft'"
|
||||||
|
widget="badge"
|
||||||
|
optional="show"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="invoice_status"
|
||||||
|
widget="badge"
|
||||||
|
decoration-success="invoice_status == 'invoiced'"
|
||||||
|
decoration-info="invoice_status == 'to invoice'"
|
||||||
|
optional="show"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="payment_state"
|
||||||
|
decoration-success="payment_state == 'paid'"
|
||||||
|
decoration-danger="payment_state == 'not_paid' and state in ['cancelled','onboard','done','no_show','no_checkout']"
|
||||||
|
decoration-info="payment_state == 'not_paid' and state in ['draft','confirm',]"
|
||||||
|
decoration-warning="payment_state == 'partial'"
|
||||||
|
widget="badge"
|
||||||
|
optional="show"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="company_id"
|
||||||
|
groups="base.group_multi_company"
|
||||||
|
optional="show"
|
||||||
|
readonly="1"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="pms_property_id"
|
||||||
|
groups="base.group_multi_company"
|
||||||
|
optional="show"
|
||||||
|
readonly="1"
|
||||||
|
/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -584,7 +584,7 @@
|
|||||||
quick_add="False"
|
quick_add="False"
|
||||||
mode="month"
|
mode="month"
|
||||||
color="room_type_id"
|
color="room_type_id"
|
||||||
scales="week,month,year"
|
scales="month,year"
|
||||||
>
|
>
|
||||||
<field name="room_type_id" filters="1" />
|
<field name="room_type_id" filters="1" />
|
||||||
<field name="preferred_room_id" filters="1" />
|
<field name="preferred_room_id" filters="1" />
|
||||||
@@ -758,21 +758,21 @@
|
|||||||
string="Reservations to 7 days"
|
string="Reservations to 7 days"
|
||||||
name="next_res_week"
|
name="next_res_week"
|
||||||
domain="[('checkin', '<', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d')),
|
domain="[('checkin', '<', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d')),
|
||||||
('state', '=', 'confirm')]"
|
('state', 'in', ['confirm','onboard'])]"
|
||||||
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
|
<filter
|
||||||
string="Reservations to 14 days"
|
string="Reservations to 14 days"
|
||||||
name="next_res_2week"
|
name="next_res_2week"
|
||||||
domain="[('checkin', '<', (context_today()+datetime.timedelta(days=14)).strftime('%Y-%m-%d')),
|
domain="[('checkin', '<', (context_today()+datetime.timedelta(days=14)).strftime('%Y-%m-%d')),
|
||||||
('state', '=', 'confirm')]"
|
('state', 'in', ['confirm','onboard'])]"
|
||||||
help="Show all reservations for which date enter is before than 14 days"
|
help="Show all reservations for which date enter is before than 14 days"
|
||||||
/>
|
/>
|
||||||
<filter
|
<filter
|
||||||
string="Reservations to 1 month"
|
string="Reservations to 1 month"
|
||||||
name="next_res_week"
|
name="next_res_week"
|
||||||
domain="[('checkin', '<', (context_today()+datetime.timedelta(days=30)).strftime('%Y-%m-%d')),
|
domain="[('checkin', '<', (context_today()+datetime.timedelta(days=30)).strftime('%Y-%m-%d')),
|
||||||
('state', '=', 'confirm')]"
|
('state', 'in', ['confirm','onboard'])]"
|
||||||
help="Show all reservations for which date enter is before than aprox. 1 month"
|
help="Show all reservations for which date enter is before than aprox. 1 month"
|
||||||
/>
|
/>
|
||||||
<filter
|
<filter
|
||||||
@@ -857,14 +857,6 @@
|
|||||||
/>
|
/>
|
||||||
</group>
|
</group>
|
||||||
<searchpanel>
|
<searchpanel>
|
||||||
<field name="room_type_id" string="Room Type" enable_counters="1" />
|
|
||||||
<field name="pricelist_id" string="Pricelist" enable_counters="1" />
|
|
||||||
<field
|
|
||||||
name="channel_type_id"
|
|
||||||
string="Channel"
|
|
||||||
enable_counters="1"
|
|
||||||
/>
|
|
||||||
<field name="agency_id" string="Channel" enable_counters="1" />
|
|
||||||
<field
|
<field
|
||||||
name="state"
|
name="state"
|
||||||
string="State"
|
string="State"
|
||||||
@@ -877,10 +869,56 @@
|
|||||||
enable_counters="1"
|
enable_counters="1"
|
||||||
select="multi"
|
select="multi"
|
||||||
/>
|
/>
|
||||||
|
<field
|
||||||
|
name="room_type_id"
|
||||||
|
string="Room Type"
|
||||||
|
enable_counters="1"
|
||||||
|
icon="fa-hotel"
|
||||||
|
color="#784f73"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="pricelist_id"
|
||||||
|
string="Pricelist"
|
||||||
|
enable_counters="1"
|
||||||
|
icon="fa-bookmark"
|
||||||
|
color="#875A7B"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="channel_type_id"
|
||||||
|
string="Channel"
|
||||||
|
enable_counters="1"
|
||||||
|
icon="fa-sitemap"
|
||||||
|
expand="1"
|
||||||
|
/>
|
||||||
</searchpanel>
|
</searchpanel>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="pms_reservation_pivot" model="ir.ui.view">
|
||||||
|
<field name="name">pms.reservation.pivot</field>
|
||||||
|
<field name="model">pms.reservation</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<pivot string="Reservations">
|
||||||
|
<field name="checkout" type="row" interval="month" />
|
||||||
|
<field name="room_type_id" type="col" />
|
||||||
|
<field name="price_total" type="measure" />
|
||||||
|
</pivot>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="pms_reservation_graph" model="ir.ui.view">
|
||||||
|
<field name="name">pms.reservation.graph</field>
|
||||||
|
<field name="model">pms.reservation</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<graph string="Reservations">
|
||||||
|
<field name="checkout" type="row" interval="day" />
|
||||||
|
<field name="room_type_id" type="col" />
|
||||||
|
<field name="price_total" type="measure" />
|
||||||
|
</graph>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<menuitem
|
<menuitem
|
||||||
name="Reservation Rooms"
|
name="Reservation Rooms"
|
||||||
id="menu_reservation_rooms"
|
id="menu_reservation_rooms"
|
||||||
|
|||||||
@@ -32,15 +32,34 @@
|
|||||||
<field name="model">pms.service.line</field>
|
<field name="model">pms.service.line</field>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<tree string="Service By Day">
|
<tree string="Service By Day">
|
||||||
|
<button
|
||||||
|
class="oe_stat_button"
|
||||||
|
icon="fa-1x fa-bed"
|
||||||
|
name="open_service_ids"
|
||||||
|
attrs="{'invisible':[('is_board_service','=', False)]}"
|
||||||
|
title="Board Service"
|
||||||
|
/>
|
||||||
|
<field name="is_board_service" invisible="1" />
|
||||||
<field name="product_id" />
|
<field name="product_id" />
|
||||||
<field name="date" />
|
<field name="date" />
|
||||||
<field name="day_qty" />
|
<field name="day_qty" />
|
||||||
<field name="price_unit" />
|
<field
|
||||||
<field name="service_id" />
|
name="price_unit"
|
||||||
|
attrs="{'invisible':[('is_board_service','=', True)]}"
|
||||||
|
/>
|
||||||
|
<field name="service_id" optional="show" />
|
||||||
<field name="room_id" />
|
<field name="room_id" />
|
||||||
<field name="tax_ids" invisible="1" />
|
<field name="tax_ids" optional="show" />
|
||||||
<field name="discount" />
|
<field
|
||||||
<field name="price_total" />
|
name="discount"
|
||||||
|
optional="show"
|
||||||
|
attrs="{'invisible':[('is_board_service','=', True)]}"
|
||||||
|
/>
|
||||||
|
<field
|
||||||
|
name="price_total"
|
||||||
|
optional="show"
|
||||||
|
attrs="{'invisible':[('is_board_service','=', True)]}"
|
||||||
|
/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -51,6 +70,22 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="Services By Day">
|
<search string="Services By Day">
|
||||||
<field name="service_id" />
|
<field name="service_id" />
|
||||||
|
<separator />
|
||||||
|
<field name="pms_property_id" />
|
||||||
|
<separator />
|
||||||
|
<filter
|
||||||
|
string="Board Services"
|
||||||
|
name="board_services"
|
||||||
|
domain="[('is_board_service', '=', True)]"
|
||||||
|
help="Services included in the room reservation price"
|
||||||
|
/>
|
||||||
|
<filter
|
||||||
|
string="Extra Services"
|
||||||
|
name="no_board_services"
|
||||||
|
domain="[('is_board_service', '=', False)]"
|
||||||
|
help="Services NOT included in the room reservation price"
|
||||||
|
/>
|
||||||
|
<separator />
|
||||||
<filter
|
<filter
|
||||||
string="Today"
|
string="Today"
|
||||||
name="today"
|
name="today"
|
||||||
@@ -66,7 +101,7 @@
|
|||||||
string="Next 7 days"
|
string="Next 7 days"
|
||||||
name="next_7_days"
|
name="next_7_days"
|
||||||
domain="[('date', '>', context_today().strftime('%Y-%m-%d')),
|
domain="[('date', '>', context_today().strftime('%Y-%m-%d')),
|
||||||
('date', '<', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]"
|
('date', '<', (context_today()+datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]"
|
||||||
/>
|
/>
|
||||||
<group expand="0" string="Group By">
|
<group expand="0" string="Group By">
|
||||||
<filter
|
<filter
|
||||||
@@ -81,18 +116,68 @@
|
|||||||
/>
|
/>
|
||||||
<filter
|
<filter
|
||||||
string="By Day"
|
string="By Day"
|
||||||
name="date_by_week"
|
name="date_by_day"
|
||||||
context="{'group_by':'date:day', 'default_order': 'date'}"
|
context="{'group_by':'date:day', 'default_order': 'date'}"
|
||||||
/>
|
/>
|
||||||
|
<filter
|
||||||
|
string="Property"
|
||||||
|
name="group_property_id"
|
||||||
|
context="{'group_by':'pms_property_id', 'default_order': 'product_id'}"
|
||||||
|
/>
|
||||||
<filter
|
<filter
|
||||||
string="Product"
|
string="Product"
|
||||||
name="product_id"
|
name="group_product_id"
|
||||||
context="{'group_by':'product_id', 'default_order': 'product_id'}"
|
context="{'group_by':'product_id', 'default_order': 'product_id'}"
|
||||||
/>
|
/>
|
||||||
</group>
|
</group>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="pms_service_line_view_calendar" model="ir.ui.view">
|
||||||
|
<field name="name">pms.service.line.view.calendar</field>
|
||||||
|
<field name="model">pms.service.line</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<calendar
|
||||||
|
date_start="date"
|
||||||
|
date_stop="date"
|
||||||
|
string="Services"
|
||||||
|
quick_add="False"
|
||||||
|
mode="month"
|
||||||
|
color="product_id"
|
||||||
|
scales="week,month,year"
|
||||||
|
>
|
||||||
|
<field name="service_id" />
|
||||||
|
<field name="product_id" filters="1" />
|
||||||
|
<field name="room_id" filters="1" />
|
||||||
|
</calendar>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="pms_service_line_pivot" model="ir.ui.view">
|
||||||
|
<field name="name">pms.service.line.pivot</field>
|
||||||
|
<field name="model">pms.service.line</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<pivot string="Services">
|
||||||
|
<field name="date" type="row" interval="day" />
|
||||||
|
<field name="product_id" type="col" />
|
||||||
|
<field name="day_qty" type="measure" />
|
||||||
|
</pivot>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="pms_service_line_graph" model="ir.ui.view">
|
||||||
|
<field name="name">pms.service.line.graph</field>
|
||||||
|
<field name="model">pms.service.line</field>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<graph string="Services">
|
||||||
|
<field name="date" type="row" interval="day" />
|
||||||
|
<field name="product_id" type="col" />
|
||||||
|
<field name="day_qty" type="measure" />
|
||||||
|
</graph>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<!-- Action for service line from Form Folio/Reservation-->
|
<!-- Action for service line from Form Folio/Reservation-->
|
||||||
<record model="ir.actions.act_window" id="action_pms_service_line_form">
|
<record model="ir.actions.act_window" id="action_pms_service_line_form">
|
||||||
<field name="name">Services</field>
|
<field name="name">Services</field>
|
||||||
@@ -108,8 +193,13 @@
|
|||||||
id="action_service_line"
|
id="action_service_line"
|
||||||
name="Services By Day"
|
name="Services By Day"
|
||||||
res_model="pms.service.line"
|
res_model="pms.service.line"
|
||||||
view_mode="tree,form"
|
view_mode="tree,form,calendar,pivot,graph"
|
||||||
view_id="pms.pms_service_line_report_view_tree"
|
view_id="pms.pms_service_line_report_view_tree"
|
||||||
|
context="{
|
||||||
|
'search_default_next_7_days': 1,
|
||||||
|
'search_default_date_by_day': 1,
|
||||||
|
'search_default_group_product_id': 1,
|
||||||
|
}"
|
||||||
/>
|
/>
|
||||||
<menuitem
|
<menuitem
|
||||||
id="menu_pms_service_line"
|
id="menu_pms_service_line"
|
||||||
|
|||||||
@@ -4,16 +4,15 @@ from odoo import api, fields, models
|
|||||||
class PmsCheckinPartner(models.Model):
|
class PmsCheckinPartner(models.Model):
|
||||||
_inherit = "pms.checkin.partner"
|
_inherit = "pms.checkin.partner"
|
||||||
|
|
||||||
lastname = fields.Char(
|
firstname = fields.Char(
|
||||||
"Last Name",
|
"First Name",
|
||||||
compute="_compute_lastname",
|
compute="_compute_firstname",
|
||||||
store=True,
|
store=True,
|
||||||
readonly=False,
|
readonly=False,
|
||||||
)
|
)
|
||||||
|
lastname = fields.Char(
|
||||||
firstname = fields.Char(
|
|
||||||
"Last Name",
|
"Last Name",
|
||||||
compute="_compute_firstname",
|
compute="_compute_lastname",
|
||||||
store=True,
|
store=True,
|
||||||
readonly=False,
|
readonly=False,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user