[FIX]pms: change unlink checkins partner autocreate by write

This commit is contained in:
Darío Lodeiros
2021-01-31 10:12:51 +01:00
parent c808170bc8
commit 6cd01fb0d2
2 changed files with 7 additions and 7 deletions

View File

@@ -208,7 +208,8 @@ class PmsCheckinPartner(models.Model):
lambda c: c.state == "draft"
)
if len(draft_checkins) > 0 and vals.get("partner_id"):
draft_checkins[0].sudo().unlink()
draft_checkins[0].write(vals)
return draft_checkins[0]
if vals.get("identifier", _("New")) == _("New") or "identifier" not in vals:
pms_property_id = (
self.env.user.get_active_property_ids()[0]