mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[RFC] testing group reservation lines in folio sale line
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
from odoo import fields
|
||||||
|
|
||||||
from .common import TestPms
|
from .common import TestPms
|
||||||
|
|
||||||
|
|
||||||
@@ -32,11 +34,13 @@ class TestPmsFolioSaleLine(TestPms):
|
|||||||
|
|
||||||
# RESERVATION LINES
|
# RESERVATION LINES
|
||||||
def test_comp_fsl_rooms_all_same_group(self):
|
def test_comp_fsl_rooms_all_same_group(self):
|
||||||
# TEST CASE
|
"""
|
||||||
# 2-night reservation and same price, discount & cancel_discount for
|
check the grouping of the reservation lines on the sale line folio
|
||||||
# all nights
|
when the price, discount match-
|
||||||
# should generate just 1 reservation sale line
|
------------
|
||||||
|
reservation with 3 nights with the same price,
|
||||||
|
should generate just 1 reservation sale line
|
||||||
|
"""
|
||||||
# ARRANGE
|
# ARRANGE
|
||||||
expected_sale_lines = 1
|
expected_sale_lines = 1
|
||||||
|
|
||||||
@@ -44,8 +48,35 @@ class TestPmsFolioSaleLine(TestPms):
|
|||||||
r_test = self.env["pms.reservation"].create(
|
r_test = self.env["pms.reservation"].create(
|
||||||
{
|
{
|
||||||
"pms_property_id": self.pms_property1.id,
|
"pms_property_id": self.pms_property1.id,
|
||||||
"checkin": datetime.datetime.now(),
|
"reservation_line_ids": [
|
||||||
"checkout": datetime.datetime.now() + datetime.timedelta(days=3),
|
(
|
||||||
|
0,
|
||||||
|
False,
|
||||||
|
{
|
||||||
|
"date": fields.date.today(),
|
||||||
|
"price": 20,
|
||||||
|
"discount": 10,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
(
|
||||||
|
0,
|
||||||
|
False,
|
||||||
|
{
|
||||||
|
"date": fields.date.today() + datetime.timedelta(days=1),
|
||||||
|
"price": 20,
|
||||||
|
"discount": 10,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
(
|
||||||
|
0,
|
||||||
|
False,
|
||||||
|
{
|
||||||
|
"date": fields.date.today() + datetime.timedelta(days=2),
|
||||||
|
"price": 20,
|
||||||
|
"discount": 10,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
"adults": 2,
|
"adults": 2,
|
||||||
"room_type_id": self.room_type_double.id,
|
"room_type_id": self.room_type_double.id,
|
||||||
"partner_id": self.env.ref("base.res_partner_12").id,
|
"partner_id": self.env.ref("base.res_partner_12").id,
|
||||||
|
|||||||
Reference in New Issue
Block a user