Skip to content

Commit

Permalink
[FIX]pms_l10n_es: test onboard data required
Browse files Browse the repository at this point in the history
  • Loading branch information
DarioLodeiros committed Dec 17, 2024
1 parent b4ba753 commit b56724a
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 51 deletions.
4 changes: 1 addition & 3 deletions pms/models/pms_checkin_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,9 +837,7 @@ def _get_depends_state_fields(self):
def _checkin_mandatory_fields(
self, residence_country=False, document_type=False, birthdate_date=False
):
mandatory_fields = [
"firstname",
]
mandatory_fields = []
return mandatory_fields

@api.model
Expand Down
70 changes: 35 additions & 35 deletions pms/tests/test_pms_reservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def setUpClass(cls):
)
cls.agency1 = cls.env["res.partner"].create(
{
"name": "partner1",
"firstname": "partner1",
"is_agency": True,
"invoice_to_agency": "always",
"default_commission": 15,
Expand Down Expand Up @@ -1666,7 +1666,7 @@ def test_reservation_action_checkout(self):
# ARRANGE
host = self.env["res.partner"].create(
{
"name": "Miguel",
"firstname": "Miguel",
"mobile": "654667733",
"email": "miguel@example.com",
"birthdate_date": "1995-12-10",
Expand All @@ -1679,7 +1679,7 @@ def test_reservation_action_checkout(self):
"name": "30065089H",
"valid_from": datetime.date.today(),
"partner_id": host.id,
"document_country_id": self.env.ref("base.es").id,
"country_id": self.env.ref("base.es").id,
}
)
r1 = self.env["pms.reservation"].create(
Expand Down Expand Up @@ -1822,7 +1822,7 @@ def test_partner_is_agency(self):
)
agency = self.env["res.partner"].create(
{
"name": "partner1",
"firstname": "partner1",
"is_agency": True,
"sale_channel_id": sale_channel1.id,
"invoice_to_agency": "always",
Expand Down Expand Up @@ -1868,7 +1868,7 @@ def test_agency_pricelist(self):
)
agency = self.env["res.partner"].create(
{
"name": "partner1",
"firstname": "partner1",
"is_agency": True,
"sale_channel_id": sale_channel1.id,
"apply_pricelist": True,
Expand Down Expand Up @@ -1925,7 +1925,7 @@ def test_compute_ready_for_checkin(self):
"""
self.host1 = self.env["res.partner"].create(
{
"name": "Miguel",
"firstname": "Miguel",
"mobile": "654667733",
"email": "miguel@example.com",
"birthdate_date": "1995-12-10",
Expand All @@ -1938,12 +1938,12 @@ def test_compute_ready_for_checkin(self):
"name": "30065000H",
"valid_from": datetime.date.today(),
"partner_id": self.host1.id,
"document_country_id": self.env.ref("base.es").id,
"country_id": self.env.ref("base.es").id,
}
)
self.host2 = self.env["res.partner"].create(
{
"name": "Brais",
"firstname": "Brais",
"mobile": "654437733",
"email": "brais@example.com",
"birthdate_date": "1995-12-10",
Expand All @@ -1956,7 +1956,7 @@ def test_compute_ready_for_checkin(self):
"name": "30065089H",
"valid_from": datetime.date.today(),
"partner_id": self.host2.id,
"document_country_id": self.env.ref("base.es").id,
"country_id": self.env.ref("base.es").id,
}
)
self.reservation = self.env["pms.reservation"].create(
Expand Down Expand Up @@ -2002,7 +2002,7 @@ def test_check_checkout_less_checkin(self):
"""
self.host1 = self.env["res.partner"].create(
{
"name": "Host1",
"firstname": "Host1",
}
)
with self.assertRaises(UserError):
Expand All @@ -2028,7 +2028,7 @@ def test_check_more_adults_than_beds(self):
"""
self.host1 = self.env["res.partner"].create(
{
"name": "Host1",
"firstname": "Host1",
}
)
with self.assertRaises(ValidationError):
Expand All @@ -2054,7 +2054,7 @@ def test_check_format_arrival_hour(self):
"""
self.host1 = self.env["res.partner"].create(
{
"name": "Host1",
"firstname": "Host1",
}
)
with self.assertRaises(ValidationError):
Expand All @@ -2078,7 +2078,7 @@ def test_check_format_departure_hour(self):
"""
self.host1 = self.env["res.partner"].create(
{
"name": "Host1",
"firstname": "Host1",
}
)
with self.assertRaises(ValidationError):
Expand Down Expand Up @@ -2111,7 +2111,7 @@ def test_check_property_integrity_room(self):
)
self.host1 = self.env["res.partner"].create(
{
"name": "Host1",
"firstname": "Host1",
}
)
self.room_type_double.pms_property_ids = [
Expand Down Expand Up @@ -2141,7 +2141,7 @@ def test_shared_folio_true(self):
"""
self.host1 = self.env["res.partner"].create(
{
"name": "Host1",
"firstname": "Host1",
}
)
self.reservation = self.env["pms.reservation"].create(
Expand Down Expand Up @@ -2176,7 +2176,7 @@ def test_shared_folio_false(self):
"""
self.host1 = self.env["res.partner"].create(
{
"name": "Host1",
"firstname": "Host1",
}
)
self.reservation = self.env["pms.reservation"].create(
Expand Down Expand Up @@ -2206,7 +2206,7 @@ def test_reservation_action_cancel_fail(self):
"""
self.host1 = self.env["res.partner"].create(
{
"name": "Host1",
"firstname": "Host1",
}
)
reservation = self.env["pms.reservation"].create(
Expand Down Expand Up @@ -2253,7 +2253,7 @@ def test_cancelation_reason_noshow(self):
)
self.host1 = self.env["res.partner"].create(
{
"name": "Host1",
"firstname": "Host1",
}
)

Expand Down Expand Up @@ -2308,7 +2308,7 @@ def test_cancelation_reason_intime(self):
)
self.host1 = self.env["res.partner"].create(
{
"name": "Host1",
"firstname": "Host1",
}
)

Expand Down Expand Up @@ -2362,7 +2362,7 @@ def test_cancelation_reason_late(self):
)
self.host1 = self.env["res.partner"].create(
{
"name": "Host1",
"firstname": "Host1",
}
)

Expand Down Expand Up @@ -2393,14 +2393,14 @@ def test_compute_checkin_partner_count(self):
"""
self.host1 = self.env["res.partner"].create(
{
"name": "Miguel",
"firstname": "Miguel",
"mobile": "654667733",
"email": "miguel@example.com",
}
)
self.host2 = self.env["res.partner"].create(
{
"name": "Brais",
"firstname": "Brais",
"mobile": "654437733",
"email": "brais@example.com",
}
Expand Down Expand Up @@ -2454,14 +2454,14 @@ def test_compute_checkin_partner_pending_count(self):
"""
self.host1 = self.env["res.partner"].create(
{
"name": "Miguel",
"firstname": "Miguel",
"mobile": "654667733",
"email": "miguel@example.com",
}
)
self.host2 = self.env["res.partner"].create(
{
"name": "Brais",
"firstname": "Brais",
"mobile": "654437733",
"email": "brais@example.com",
}
Expand Down Expand Up @@ -2516,7 +2516,7 @@ def test_reservation_action_checkout_fail(self):
"""
host = self.env["res.partner"].create(
{
"name": "Miguel",
"firstname": "Miguel",
"mobile": "654667733",
"email": "miguel@example.com",
}
Expand Down Expand Up @@ -2590,7 +2590,7 @@ def test_partner_is_agency_not_invoice_to_agency(self):
)
agency = self.env["res.partner"].create(
{
"name": "partner1",
"firstname": "partner1",
"is_agency": True,
"sale_channel_id": sale_channel1.id,
}
Expand Down Expand Up @@ -3056,7 +3056,7 @@ def test_default_normal_reservation_type(self):
# ARRANGE
checkin = fields.date.today()
checkout = fields.date.today() + datetime.timedelta(days=3)
self.partner1 = self.env["res.partner"].create({"name": "Ana"})
self.partner1 = self.env["res.partner"].create({"firstname": "Ana"})
folio1 = self.env["pms.folio"].create(
{
"pms_property_id": self.pms_property1.id,
Expand Down Expand Up @@ -3272,7 +3272,7 @@ def test_reservation_type_by_folio(self):
'staff'.
"""
# ARRANGE AND ACT
self.partner1 = self.env["res.partner"].create({"name": "Ana"})
self.partner1 = self.env["res.partner"].create({"firstname": "Ana"})
folio1 = self.env["pms.folio"].create(
{
"pms_property_id": self.pms_property1.id,
Expand Down Expand Up @@ -3382,7 +3382,7 @@ def test_auto_complete_partner_mobile(self):
# ARRANGE
partner = self.env["res.partner"].create(
{
"name": "Enrique",
"firstname": "Enrique",
"mobile": "654667733",
"email": "enrique@example.com",
}
Expand Down Expand Up @@ -3433,7 +3433,7 @@ def test_auto_complete_partner_email(self):
# ARRANGE
partner = self.env["res.partner"].create(
{
"name": "Simon",
"firstname": "Simon",
"mobile": "654667733",
"email": "simon@example.com",
}
Expand Down Expand Up @@ -3482,7 +3482,7 @@ def test_is_possible_customer_by_email(self):
# ARRANGE
partner = self.env["res.partner"].create(
{
"name": "Courtney Campbell",
"firstname": "Courtney Campbell",
"email": "courtney@example.com",
}
)
Expand Down Expand Up @@ -3520,7 +3520,7 @@ def test_is_possible_customer_by_mobile(self):
# ARRANGE
partner = self.env["res.partner"].create(
{
"name": "Ledicia Sandoval",
"firstname": "Ledicia Sandoval",
"mobile": "615369231",
}
)
Expand Down Expand Up @@ -3560,7 +3560,7 @@ def test_add_possible_customer(self):
# ARRANGE
partner = self.env["res.partner"].create(
{
"name": "Serafín Rivas",
"firstname": "Serafín Rivas",
"email": "serafin@example.com",
"mobile": "60595595",
}
Expand Down Expand Up @@ -3610,14 +3610,14 @@ def test_not_add_several_possibles_customers(self):
# ARRANGE
partner1 = self.env["res.partner"].create(
{
"name": "Serafín Rivas",
"firstname": "Serafín Rivas",
"email": "serafin@example.com",
"mobile": "60595595",
}
)
partner2 = self.env["res.partner"].create(
{
"name": "Simon",
"firstname": "Simon",
"mobile": "654667733",
"email": "simon@example.com",
}
Expand Down
Loading

0 comments on commit b56724a

Please sign in to comment.