mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] Pms: Add Customer Preview Button in reservation and folio
This commit is contained in:
@@ -547,6 +547,14 @@ class PmsFolio(models.Model):
|
||||
for folio in self:
|
||||
folio.access_url = "/my/folios/%s" % (folio.id)
|
||||
|
||||
def preview_folio(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
"type": "ir.actions.act_url",
|
||||
"target": "self",
|
||||
"url": self.get_portal_url(),
|
||||
}
|
||||
|
||||
def _search_invoice_ids(self, operator, value):
|
||||
if operator == "in" and value:
|
||||
self.env.cr.execute(
|
||||
|
||||
@@ -845,6 +845,14 @@ class PmsReservation(models.Model):
|
||||
for reservation in self:
|
||||
reservation.access_url = "/my/reservations/%s" % (reservation.id)
|
||||
|
||||
def preview_reservation(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
"type": "ir.actions.act_url",
|
||||
"target": "self",
|
||||
"url": self.get_portal_url(),
|
||||
}
|
||||
|
||||
def _search_left_for_checkin(self, operator, value):
|
||||
if operator not in ("=",):
|
||||
raise UserError(
|
||||
|
||||
@@ -41,6 +41,17 @@
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<button
|
||||
name="preview_folio"
|
||||
type="object"
|
||||
class="oe_stat_button"
|
||||
icon="fa-globe icon"
|
||||
>
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<span class="o_stat_text">Customer</span>
|
||||
<span class="o_stat_text">Preview</span>
|
||||
</div>
|
||||
</button>
|
||||
<button
|
||||
type="object"
|
||||
class="oe_stat_button"
|
||||
|
||||
@@ -88,6 +88,17 @@
|
||||
name="button_box"
|
||||
attrs="{'invisible': [('folio_id','=',False)]}"
|
||||
>
|
||||
<button
|
||||
name="preview_reservation"
|
||||
type="object"
|
||||
class="oe_stat_button"
|
||||
icon="fa-globe icon"
|
||||
>
|
||||
<div class="o_field_widget o_stat_info">
|
||||
<span class="o_stat_text">Customer</span>
|
||||
<span class="o_stat_text">Preview</span>
|
||||
</div>
|
||||
</button>
|
||||
<button
|
||||
type="object"
|
||||
class="oe_stat_button"
|
||||
|
||||
Reference in New Issue
Block a user