mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
14.0 pms account flow (#36)
* [WIP] Basic tests definition * [DEL] Default diff invoicing * [WIP] Reservation refact invoice fields * [FIX] test price without taxes * [FIX] Security csv merge * [WIP]pms: Wizard adv inv views * [ADD] Wizard Filter Invoice Days * [WIP] Payment WorkFlow
This commit is contained in:
@@ -118,7 +118,6 @@ class TestPmsCheckinPartner(TestHotel):
|
||||
"checkin": "2012-01-15",
|
||||
}
|
||||
)
|
||||
|
||||
# ACT & ASSERT
|
||||
with self.assertRaises(ValidationError), self.cr.savepoint():
|
||||
self.checkin1.action_on_board()
|
||||
|
||||
43
pms/tests/test_pms_folio_invoice.py
Normal file
43
pms/tests/test_pms_folio_invoice.py
Normal file
@@ -0,0 +1,43 @@
|
||||
from odoo.tests.common import SavepointCase
|
||||
|
||||
|
||||
class TestPmsFolioInvoice(SavepointCase):
|
||||
def setUp(self):
|
||||
super(TestPmsFolioInvoice, self).setUp()
|
||||
|
||||
def test_invoice_folio(self):
|
||||
"""Test create and invoice from the Folio, and check qty invoice/to invoice,
|
||||
and the related amounts"""
|
||||
|
||||
def test_invoice_by_days_folio(self):
|
||||
"""Test create and invoice from the Folio, and check qty invoice/to invoice,
|
||||
and the related amounts in a specific segment of days (reservation lines)"""
|
||||
|
||||
def test_invoice_by_services_folio(self):
|
||||
"""Test create and invoice from the Folio, and check qty invoice/to invoice,
|
||||
and the related amounts in a specific segment of services (qtys)"""
|
||||
|
||||
def test_invoice_board_service(self):
|
||||
"""Test create and invoice from the Folio, and check qty invoice/to invoice,
|
||||
and the related amounts with board service linked"""
|
||||
|
||||
def test_invoice_line_group_by_room_type_sections(self):
|
||||
"""Test create and invoice from the Folio, and check qty invoice/to invoice,
|
||||
and the grouped invoice lines by room type, by one
|
||||
line by unit prices/qty with nights"""
|
||||
|
||||
def test_autoinvoice_folio(self):
|
||||
""" Test create and invoice the cron by partner preconfig automation """
|
||||
|
||||
def test_downpayment(self):
|
||||
"""Test invoice qith a way of downpaument and check dowpayment's
|
||||
folio line is created and also check a total amount of invoice is
|
||||
equal to a respective folio's total amount"""
|
||||
|
||||
def test_invoice_with_discount(self):
|
||||
"""Test create with a discount and check discount applied
|
||||
on both Folio lines and an inovoice lines"""
|
||||
|
||||
def test_reinvoice(self):
|
||||
"""Test the compute reinvoice folio take into account
|
||||
nights and services qty invoiced"""
|
||||
10
pms/tests/test_pms_folio_prices.py
Normal file
10
pms/tests/test_pms_folio_prices.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from odoo.tests.common import SavepointCase
|
||||
|
||||
|
||||
class TestPmsFolioPrice(SavepointCase):
|
||||
def setUp(self):
|
||||
super(TestPmsFolioPrice, self).setUp()
|
||||
|
||||
def test_price_folio(self):
|
||||
"""Test create reservation and services, and check price
|
||||
tax and discounts"""
|
||||
10
pms/tests/test_pms_invoice_refund.py
Normal file
10
pms/tests/test_pms_invoice_refund.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from freezegun import freeze_time
|
||||
|
||||
from odoo.tests.common import SavepointCase
|
||||
|
||||
freeze_time("2000-02-02")
|
||||
|
||||
|
||||
class TestPmsInvoiceRefund(SavepointCase):
|
||||
def setUp(self):
|
||||
super(TestPmsInvoiceRefund, self).setUp()
|
||||
10
pms/tests/test_pms_payment.py
Normal file
10
pms/tests/test_pms_payment.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from freezegun import freeze_time
|
||||
|
||||
from odoo.tests.common import SavepointCase
|
||||
|
||||
freeze_time("2000-02-02")
|
||||
|
||||
|
||||
class TestPmsPayment(SavepointCase):
|
||||
def setUp(self):
|
||||
super(TestPmsPayment, self).setUp()
|
||||
@@ -126,7 +126,7 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-01-16 00:00:00")
|
||||
@@ -179,7 +179,7 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
expected_price = self.item1.fixed_price * n_days
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-01-05 00:00:00")
|
||||
@@ -233,7 +233,7 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
expected_price = self.item2.fixed_price * n_days
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-01-20 00:00:00")
|
||||
@@ -301,7 +301,7 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
expected_price = self.item1.fixed_price
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-01-25 00:00:00")
|
||||
@@ -369,7 +369,7 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
expected_price = self.item3.fixed_price
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-02-01 00:00:00")
|
||||
@@ -437,7 +437,7 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
expected_price = self.item3.fixed_price * n_days
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-02-01 00:00:00")
|
||||
@@ -492,7 +492,7 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
expected_price = self.item1.fixed_price * n_days
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-02-10 00:00:00")
|
||||
@@ -547,7 +547,7 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-01-01 00:00:00")
|
||||
@@ -571,7 +571,7 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-01-01 00:00:00")
|
||||
@@ -603,10 +603,9 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
)
|
||||
n_days = (reservation.checkout - reservation.checkin).days
|
||||
expected_price = self.item1.fixed_price * n_days
|
||||
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-01-01 00:00:00")
|
||||
@@ -641,7 +640,7 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-01-01 00:00:00")
|
||||
@@ -689,7 +688,7 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
expected_price = self.item2.fixed_price * n_days
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-01-01 00:00:00")
|
||||
@@ -738,7 +737,7 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-01-01 00:00:00")
|
||||
@@ -790,7 +789,7 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
@freeze_time("2000-01-01 00:00:00")
|
||||
@@ -856,5 +855,5 @@ class TestPmsPricelistRules(common.TransactionCase):
|
||||
|
||||
# ASSERT
|
||||
self.assertEqual(
|
||||
expected_price, reservation.price_total, "The price is not as expected"
|
||||
expected_price, reservation.price_subtotal, "The price is not as expected"
|
||||
)
|
||||
|
||||
12
pms/tests/test_pms_reservation_prices.py
Normal file
12
pms/tests/test_pms_reservation_prices.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from odoo.tests.common import SavepointCase
|
||||
|
||||
|
||||
class TestPmsFolioInvoice(SavepointCase):
|
||||
def setUp(self):
|
||||
super(TestPmsFolioInvoice, self).setUp()
|
||||
|
||||
def test_price_reservation(self):
|
||||
"""Test create a reservation, and check price and discounts"""
|
||||
|
||||
def test_general_discount_reservation(self):
|
||||
"""Test a discount in reservation head, and check lines"""
|
||||
10
pms/tests/test_pms_simple_invoice.py
Normal file
10
pms/tests/test_pms_simple_invoice.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from freezegun import freeze_time
|
||||
|
||||
from odoo.tests.common import SavepointCase
|
||||
|
||||
freeze_time("2000-02-02")
|
||||
|
||||
|
||||
class TestPmsInvoiceSimpleInvoice(SavepointCase):
|
||||
def setUp(self):
|
||||
super(TestPmsInvoiceSimpleInvoice, self).setUp()
|
||||
Reference in New Issue
Block a user