mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[FIX]pms: add test data pricelists configuration
This commit is contained in:
@@ -31,3 +31,7 @@ class TestPms(common.SavepointCase):
|
||||
"default_code": "RTC1",
|
||||
}
|
||||
)
|
||||
for pricelist in self.env["product.pricelist"].search([]):
|
||||
if not pricelist.availability_plan_id:
|
||||
pricelist.availability_plan_id = self.availability_plan1.id
|
||||
pricelist.is_pms_available = True
|
||||
|
||||
@@ -24,6 +24,7 @@ class TestPmsRoomTypeAvailabilityRules(TestPms):
|
||||
(4, self.pms_property2.id),
|
||||
],
|
||||
"availability_plan_id": self.availability_plan1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
# pms.sale.channel
|
||||
@@ -48,6 +49,13 @@ class TestPmsRoomTypeAvailabilityRules(TestPms):
|
||||
"default_pricelist_id": self.pricelist2.id,
|
||||
}
|
||||
)
|
||||
self.pricelist2.write(
|
||||
{
|
||||
"pms_property_ids": [
|
||||
(4, self.pms_property3.id),
|
||||
],
|
||||
}
|
||||
)
|
||||
|
||||
# pms.room.type
|
||||
self.test_room_type_single = self.env["pms.room.type"].create(
|
||||
|
||||
@@ -42,6 +42,7 @@ class TestPmsMultiproperty(TestPms):
|
||||
(4, self.pms_property2.id),
|
||||
],
|
||||
"availability_plan_id": self.availability_plan1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
self.availability_plan1 = self.env["pms.availability.plan"].create(
|
||||
@@ -202,6 +203,7 @@ class TestPmsMultiproperty(TestPms):
|
||||
(4, self.pms_property2.id),
|
||||
],
|
||||
"availability_plan_id": self.availability_plan1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
# create new room_type
|
||||
@@ -735,6 +737,7 @@ class TestPmsMultiproperty(TestPms):
|
||||
(4, self.pms_property2.id),
|
||||
],
|
||||
"availability_plan_id": self.availability_plan1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
self.room_type1 = self.env["pms.room.type"].create(
|
||||
@@ -783,6 +786,7 @@ class TestPmsMultiproperty(TestPms):
|
||||
"name": "Pricelist Test",
|
||||
"pms_property_ids": [self.pms_property1.id, self.pms_property2.id],
|
||||
"cancelation_rule_id": self.cancelation_rule1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -801,6 +805,7 @@ class TestPmsMultiproperty(TestPms):
|
||||
"name": "Pricelist",
|
||||
"pms_property_ids": [self.pms_property2.id],
|
||||
"availability_plan_id": self.availability_plan1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -876,6 +881,7 @@ class TestPmsMultiproperty(TestPms):
|
||||
(4, self.pms_property3.id),
|
||||
],
|
||||
"availability_plan_id": self.availability_plan1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ class TestPmsPricelist(TestPms):
|
||||
"name": "pricelist_2",
|
||||
"pms_property_ids": [self.pms_property1.id, self.pms_property2.id],
|
||||
"availability_plan_id": self.availability_plan1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
# product.product 1
|
||||
@@ -742,6 +743,7 @@ class TestPmsPricelist(TestPms):
|
||||
"pms_property_ids": tc["pms_property_ids"],
|
||||
"item_ids": [item.id],
|
||||
"availability_plan_id": self.availability_plan1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -770,6 +772,7 @@ class TestPmsPricelist(TestPms):
|
||||
"pms_property_ids": [self.pms_property1.id],
|
||||
"item_ids": [item.id],
|
||||
"availability_plan_id": self.availability_plan1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
self.assertTrue(self.pricelist_test, "Pricelist not created.")
|
||||
|
||||
@@ -2261,6 +2261,7 @@ class TestPmsReservations(TestPms):
|
||||
"pms_property_ids": [self.pms_property1.id],
|
||||
"cancelation_rule_id": self.cancelation_rule.id,
|
||||
"availability_plan_id": self.availability_plan1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
self.host1 = self.env["res.partner"].create(
|
||||
@@ -2316,6 +2317,7 @@ class TestPmsReservations(TestPms):
|
||||
"pms_property_ids": [self.pms_property1.id],
|
||||
"cancelation_rule_id": self.cancelation_rule.id,
|
||||
"availability_plan_id": self.availability_plan1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
self.host1 = self.env["res.partner"].create(
|
||||
@@ -2369,6 +2371,7 @@ class TestPmsReservations(TestPms):
|
||||
"pms_property_ids": [self.pms_property1.id],
|
||||
"cancelation_rule_id": self.cancelation_rule.id,
|
||||
"availability_plan_id": self.availability_plan1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
self.host1 = self.env["res.partner"].create(
|
||||
|
||||
@@ -682,6 +682,7 @@ class TestPmsWizardMassiveChanges(TestPms):
|
||||
{
|
||||
"name": "test pricelist 2",
|
||||
"availability_plan_id": self.availability_plan1.id,
|
||||
"is_pms_available": True,
|
||||
}
|
||||
)
|
||||
expected_pricelists = [self.pricelist1.id, pricelist2.id]
|
||||
|
||||
Reference in New Issue
Block a user