mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[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:
@@ -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
|
||||
|
||||
@@ -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."
|
||||
)
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user