[14.0][FIX] pms: minor fixes (#51)

* [FIX] pms: constraint raised when there's no other room type with the same alternate key

* [FIX] pms: required default_pricelist_id field readded in property view

* [FIX] pms: pre-commit black error
This commit is contained in:
Eric Antones
2021-02-16 17:23:51 +01:00
committed by GitHub
parent 3eefc9a9ad
commit f3d4b7545b
3 changed files with 15 additions and 10 deletions

View File

@@ -144,10 +144,10 @@ class PmsRoomType(models.Model):
raise ValidationError(msg)
else:
for pms_property in rec.pms_property_ids:
if (
rec.get_unique_by_property_code(pms_property.id, rec.code_type)
!= rec
):
other = rec.get_unique_by_property_code(
pms_property.id, rec.code_type
)
if other and other != rec:
raise ValidationError(msg)
# ORM Overrides

View File

@@ -722,9 +722,7 @@ class TestPmsReservations(TestHotel):
# ACT
res.action_cancel()
# ASSERT
self.assertEqual(res.state,
'cancelled',
"The reservation should be cancelled")
self.assertEqual(res.state, "cancelled", "The reservation should be cancelled")
@freeze_time("1981-11-01")
def test_reservation_action_checkout(self):
@@ -761,6 +759,6 @@ class TestPmsReservations(TestHotel):
r1.action_reservation_checkout()
# ASSERT
self.assertEqual(r1.state,
"done",
"The reservation status should be done after checkout.")
self.assertEqual(
r1.state, "done", "The reservation status should be done after checkout."
)

View File

@@ -18,6 +18,13 @@
</group>
</page>
<page string="Settings" name="property_settings">
<group
colspan="4"
col="4"
string="Price and Availability Plans"
>
<field name="default_pricelist_id" required="True" />
</group>
<group string="Timezone">
<field name="tz" widget="timezone_mismatch" />
</group>