[IMP] Search panel view

This commit is contained in:
Darío Lodeiros
2020-11-30 09:41:42 +01:00
parent 93cd2936bb
commit e01a5a585a
2 changed files with 15 additions and 18 deletions

View File

@@ -160,29 +160,12 @@ class PmsCheckinPartner(models.Model):
record.update(vals)
if record.reservation_id.state == "confirm":
record.reservation_id.state = "onboard"
# keep the checkin reservations popup open to checkin reservation hosts
if self._context.get("popup"):
self.ensure_one()
kanban_id = self.env.ref("pms.pms_checkin_partner_kanban_view").id
return {
"name": _("Register Checkins"),
"views": [[kanban_id, "tree"]],
"res_model": "pms.checkin.partner",
"type": "ir.actions.act_window",
"context": {
"create": False,
"edit": True,
"popup": True,
},
"domain": [("reservation_id", "=", self.reservation_id.id)],
"target": "new",
}
def action_done(self):
for record in self.filtered(lambda c: c.state == "onboard"):
vals = {
"state": "done",
"arrival": fields.Datetime.now(),
"departure": fields.Datetime.now(),
}
record.update(vals)
return True

View File

@@ -230,6 +230,12 @@
</div>
</a>
</div>
<div class="oe_kanban_bottom_right">
<field
name="partner_id"
widget="many2one_avatar_user"
/>
</div>
</div>
</div>
</t>
@@ -327,6 +333,14 @@
/>
<separator />
</group>
<searchpanel>
<field
name="state"
string="State"
enable_counters="1"
select="multi"
/>
</searchpanel>
</search>
</field>
</record>