mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[ADD] user_id reservation
This commit is contained in:
@@ -492,7 +492,8 @@ class PmsFolio(models.Model):
|
||||
@api.depends("partner_id")
|
||||
def _compute_user_id(self):
|
||||
for folio in self:
|
||||
folio.user_id = (folio.partner_id.user_id.id or self.env.uid,)
|
||||
if not folio.user_id:
|
||||
folio.user_id = (folio.partner_id.user_id.id or self.env.uid,)
|
||||
|
||||
@api.depends("partner_id")
|
||||
def _compute_partner_invoice_ids(self):
|
||||
|
||||
@@ -182,6 +182,12 @@ class PmsReservation(models.Model):
|
||||
"('pms_property_ids', 'in', pms_property_id),"
|
||||
"('pms_property_ids', '=', False)]",
|
||||
)
|
||||
user_id = fields.Many2one(
|
||||
related="folio_id.user_id",
|
||||
depends=["folio_id"],
|
||||
readonly=False,
|
||||
store=True,
|
||||
)
|
||||
show_update_pricelist = fields.Boolean(
|
||||
string="Has Pricelist Changed",
|
||||
help="Technical Field, True if the pricelist was changed;\n"
|
||||
|
||||
@@ -541,6 +541,7 @@
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<group>
|
||||
<field name="user_id" />
|
||||
<field name="pms_property_id" />
|
||||
<field name="localizator" />
|
||||
<field name="overbooking" />
|
||||
@@ -570,6 +571,7 @@
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Calendar -->
|
||||
<record id="pms_reservation_view_calendar" model="ir.ui.view">
|
||||
<field name="name">pms.reservation.view.calendar</field>
|
||||
@@ -581,10 +583,12 @@
|
||||
string="Reservations"
|
||||
quick_add="False"
|
||||
mode="month"
|
||||
color="room_type_id"
|
||||
scales="week,month,year"
|
||||
>
|
||||
<field name="room_type_id" filters="1" />
|
||||
<field name="preferred_room_id" filters="1" />
|
||||
<field name="partner_id" avatar_field="image_128" />
|
||||
<field name="room_type_id" />
|
||||
<field name="rooms" />
|
||||
</calendar>
|
||||
</field>
|
||||
@@ -625,11 +629,7 @@
|
||||
<field name="ratio_checkin_data" widget="progressbar" optional="show" />
|
||||
<field name="overbooking" invisible="1" />
|
||||
<field name="activity_ids" widget="list_activity" optional="show" />
|
||||
<field
|
||||
name="create_uid"
|
||||
optional="show"
|
||||
widget="many2one_avatar_user"
|
||||
/>
|
||||
<field name="user_id" optional="show" widget="many2one_avatar_user" />
|
||||
<!-- <field name="origin" /> -->
|
||||
<field name="checkin_partner_ids" invisible="1" />
|
||||
<field name="to_assign" invisible="1" />
|
||||
@@ -715,7 +715,7 @@
|
||||
<xpath expr="//field[@name='folio_pending_amount']" position="attributes">
|
||||
<attribute name="invisible">True</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='create_uid']" position="attributes">
|
||||
<xpath expr="//field[@name='user_id']" position="attributes">
|
||||
<attribute name="invisible">True</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
@@ -731,7 +731,7 @@
|
||||
<filter
|
||||
string="My Reservations"
|
||||
name="my_reservations"
|
||||
domain="[('create_uid', '=', uid)]"
|
||||
domain="[('user_id', '=', uid)]"
|
||||
/>
|
||||
<filter
|
||||
string="Cancelled"
|
||||
@@ -853,7 +853,7 @@
|
||||
string="Created By"
|
||||
domain="[]"
|
||||
name="created_by"
|
||||
context="{'group_by':'create_uid'}"
|
||||
context="{'group_by':'user_id'}"
|
||||
/>
|
||||
</group>
|
||||
<searchpanel>
|
||||
|
||||
Reference in New Issue
Block a user