[IMP] pms: add tests for multi channel in reservations and folio, solve their problems and precommit

This commit is contained in:
Sara Lago
2022-03-23 18:21:00 +01:00
committed by Darío Lodeiros
parent 4be7a309a5
commit 95eb5bc7e0
10 changed files with 813 additions and 90 deletions

View File

@@ -2009,6 +2009,8 @@ class PmsReservation(models.Model):
default_vals["email"] = folio.email
elif vals.get("reservation_type") != "out":
raise ValidationError(_("Partner contact name is required"))
if folio.sale_channel_origin_id and "sale_channel_origin_id" not in vals:
default_vals["sale_channel_origin_id"] = folio.sale_channel_origin_id.id
vals.update(default_vals)
elif (
"pms_property_id" in vals