[IMP] PoS: test create_ui_order_data add discount
This commit gives the possibility to create pos_order_line with discount This is needed in order to reproduce real usecase. X-original-commit: 49bfb576a76e2ad4449326c4b12ebf57bece7069 Part-of: odoo/odoo#85461
This commit is contained in:
@@ -384,7 +384,7 @@ class TestPoSCommon(ValuationReconciliationTestCommon):
|
||||
def create_random_uid(self):
|
||||
return ('%05d-%03d-%04d' % (randint(1, 99999), randint(1, 999), randint(1, 9999)))
|
||||
|
||||
def create_ui_order_data(self, product_quantity_pairs, customer=False, is_invoiced=False, payments=None, uid=None):
|
||||
def create_ui_order_data(self, pos_order_lines_ui_args, customer=False, is_invoiced=False, payments=None, uid=None):
|
||||
""" Mocks the order_data generated by the pos ui.
|
||||
|
||||
This is useful in making orders in an open pos session without making tours.
|
||||
@@ -399,17 +399,19 @@ class TestPoSCommon(ValuationReconciliationTestCommon):
|
||||
|
||||
The above values should be set when `self.open_new_session` is called.
|
||||
|
||||
:param list(tuple) product_quantity_pairs: pair of `ordered product` and `quantity`
|
||||
:param list(tuple) pos_order_lines_ui_args: pairs of `ordered product` and `quantity`
|
||||
or triplet of `ordered product`, `quantity` and discount
|
||||
:param list(tuple) payments: pair of `payment_method` and `amount`
|
||||
"""
|
||||
default_fiscal_position = self.config.default_fiscal_position_id
|
||||
fiscal_position = customer.property_account_position_id if customer else default_fiscal_position
|
||||
|
||||
def create_order_line(product, quantity):
|
||||
def create_order_line(product, quantity, discount=0.0):
|
||||
price_unit = self.pricelist._get_product_price(product, quantity)
|
||||
tax_ids = fiscal_position.map_tax(product.taxes_id)
|
||||
price_unit_after_discount = price_unit * (1 - discount / 100.0)
|
||||
tax_values = (
|
||||
tax_ids.compute_all(price_unit, self.currency, quantity)
|
||||
tax_ids.compute_all(price_unit_after_discount, self.currency, quantity)
|
||||
if tax_ids
|
||||
else {
|
||||
'total_excluded': price_unit * quantity,
|
||||
@@ -417,7 +419,7 @@ class TestPoSCommon(ValuationReconciliationTestCommon):
|
||||
}
|
||||
)
|
||||
return (0, 0, {
|
||||
'discount': 0,
|
||||
'discount': discount,
|
||||
'id': randint(1, 1000000),
|
||||
'pack_lot_ids': [],
|
||||
'price_unit': price_unit,
|
||||
@@ -438,7 +440,11 @@ class TestPoSCommon(ValuationReconciliationTestCommon):
|
||||
uid = uid or self.create_random_uid()
|
||||
|
||||
# 1. generate the order lines
|
||||
order_lines = [create_order_line(product, quantity) for product, quantity in product_quantity_pairs]
|
||||
order_lines = [
|
||||
create_order_line(product, quantity, discount and discount[0] or 0.0)
|
||||
for product, quantity, *discount
|
||||
in pos_order_lines_ui_args
|
||||
]
|
||||
|
||||
# 2. generate the payments
|
||||
total_amount_incl = sum(line[2]['price_subtotal_incl'] for line in order_lines)
|
||||
|
||||
@@ -104,9 +104,9 @@ class TestPoSBasicConfig(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product2, 5)], 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product2, 7), (self.product3, 1)], 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product1, 1), (self.product3, 5), (self.product2, 3)], 'payments': [(self.bank_pm1, 220)], 'uid': '00100-010-0003'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product2, 5)], 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product2, 7), (self.product3, 1)], 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 1), (self.product3, 5), (self.product2, 3)], 'payments': [(self.bank_pm1, 220)], 'uid': '00100-010-0003'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {},
|
||||
@@ -238,9 +238,9 @@ class TestPoSBasicConfig(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 6), (self.product2, 3), (self.product3, 1), ], 'payments': [(self.cash_pm1, 150)], 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product1, 1), (self.product2, 20), ], 'payments': [(self.bank_pm1, 410)], 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product3, 1), ], 'payments': [(self.bank_pm1, 130)], 'is_invoiced': True, 'customer': self.customer, 'uid': '00100-010-0003'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 6), (self.product2, 3), (self.product3, 1), ], 'payments': [(self.cash_pm1, 150)], 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 1), (self.product2, 20), ], 'payments': [(self.bank_pm1, 410)], 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product3, 1), ], 'payments': [(self.bank_pm1, 130)], 'is_invoiced': True, 'customer': self.customer, 'uid': '00100-010-0003'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {
|
||||
@@ -296,7 +296,7 @@ class TestPoSBasicConfig(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product0, 1)], 'payments': [(self.bank_pm1, 0)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product0, 1)], 'payments': [(self.bank_pm1, 0)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -415,8 +415,8 @@ class TestPoSBasicConfig(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 1), (self.product2, 5)], 'payments': [(self.bank_pm1, 110)], 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product1, 3), (self.product2, 2), (self.product3, 1)], 'payments': [(self.cash_pm1, 100)], 'uid': '12345-123-1234'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 1), (self.product2, 5)], 'payments': [(self.bank_pm1, 110)], 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 3), (self.product2, 2), (self.product3, 1)], 'payments': [(self.cash_pm1, 100)], 'uid': '12345-123-1234'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {},
|
||||
@@ -444,9 +444,9 @@ class TestPoSBasicConfig(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_split_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product2, 5)], 'payments': [(self.cash_split_pm1, 100), (self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product2, 7), (self.product3, 1)], 'payments': [(self.cash_split_pm1, 70), (self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product1, 1), (self.product3, 5), (self.product2, 3)], 'payments': [(self.cash_split_pm1, 120), (self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0003'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product2, 5)], 'payments': [(self.cash_split_pm1, 100), (self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product2, 7), (self.product3, 1)], 'payments': [(self.cash_split_pm1, 70), (self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 1), (self.product3, 5), (self.product2, 3)], 'payments': [(self.cash_split_pm1, 120), (self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0003'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -570,17 +570,17 @@ class TestPoSBasicConfig(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.cash_split_pm1 | self.bank_pm1 | self.bank_split_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 10)], 'payments':[(self.cash_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product1, 10)], 'payments':[(self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product1, 10)], 'payments':[(self.cash_split_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0003'},
|
||||
{'product_quantity_pairs': [(self.product1, 10)], 'payments':[(self.bank_split_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0004'},
|
||||
{'product_quantity_pairs': [(self.product1, 10)], 'payments':[(self.cash_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0005'},
|
||||
{'product_quantity_pairs': [(self.product1, 10)], 'payments':[(self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0006'},
|
||||
{'product_quantity_pairs': [(self.product99, 1)], 'payments':[(self.cash_split_pm1, 99)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0007'},
|
||||
{'product_quantity_pairs': [(self.product99, 1)], 'payments':[(self.bank_split_pm1, 99)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0008'},
|
||||
{'product_quantity_pairs': [(self.product1, 10)], 'payments':[(self.bank_pm1, 100)], 'customer': self.other_customer, 'is_invoiced': True, 'uid': '00100-010-0009'},
|
||||
{'product_quantity_pairs': [(self.product1, 10)], 'payments':[(self.bank_pm1, 100)], 'customer': self.other_customer, 'is_invoiced': True, 'uid': '00100-010-0010'},
|
||||
{'product_quantity_pairs': [(self.product1, 10)], 'payments':[(self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0011'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10)], 'payments':[(self.cash_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10)], 'payments':[(self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10)], 'payments':[(self.cash_split_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0003'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10)], 'payments':[(self.bank_split_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0004'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10)], 'payments':[(self.cash_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0005'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10)], 'payments':[(self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0006'},
|
||||
{'pos_order_lines_ui_args': [(self.product99, 1)], 'payments':[(self.cash_split_pm1, 99)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0007'},
|
||||
{'pos_order_lines_ui_args': [(self.product99, 1)], 'payments':[(self.bank_split_pm1, 99)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0008'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10)], 'payments':[(self.bank_pm1, 100)], 'customer': self.other_customer, 'is_invoiced': True, 'uid': '00100-010-0009'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10)], 'payments':[(self.bank_pm1, 100)], 'customer': self.other_customer, 'is_invoiced': True, 'uid': '00100-010-0010'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10)], 'payments':[(self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0011'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
|
||||
@@ -95,9 +95,9 @@ class TestPoSMultipleReceivableAccounts(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product1, 5), (self.product2, 5)], 'payments': [(self.bank_pm1, 158.75)], 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product2, 5), (self.product3, 5)], 'payments': [(self.bank_pm1, 264.76)], 'is_invoiced': True, 'customer': self.other_customer, 'uid': '09876-098-0987'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 5), (self.product2, 5)], 'payments': [(self.bank_pm1, 158.75)], 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product2, 5), (self.product3, 5)], 'payments': [(self.bank_pm1, 264.76)], 'is_invoiced': True, 'customer': self.other_customer, 'uid': '09876-098-0987'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {
|
||||
@@ -197,9 +197,9 @@ class TestPoSMultipleReceivableAccounts(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'is_invoiced': True, 'customer': self.other_customer, 'uid': '09876-098-0987'},
|
||||
{'product_quantity_pairs': [(self.product1, 5), (self.product2, 5)], 'payments': [(self.bank_pm1, 158.75)], 'is_invoiced': True, 'customer': self.customer, 'uid': '09876-098-0988'},
|
||||
{'product_quantity_pairs': [(self.product2, 5), (self.product3, 5)], 'payments': [(self.bank_pm1, 264.76)], 'is_invoiced': True, 'customer': self.other_customer, 'uid': '09876-098-0989'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'is_invoiced': True, 'customer': self.other_customer, 'uid': '09876-098-0987'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 5), (self.product2, 5)], 'payments': [(self.bank_pm1, 158.75)], 'is_invoiced': True, 'customer': self.customer, 'uid': '09876-098-0988'},
|
||||
{'pos_order_lines_ui_args': [(self.product2, 5), (self.product3, 5)], 'payments': [(self.bank_pm1, 264.76)], 'is_invoiced': True, 'customer': self.other_customer, 'uid': '09876-098-0989'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {
|
||||
|
||||
@@ -91,9 +91,9 @@ class TestPoSOtherCurrencyConfig(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm2 | self.bank_pm2,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product1, 5), (self.product2, 5)], 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product2, 5), (self.product3, 5)], 'payments': [(self.bank_pm2, 139.95)], 'uid': '00100-010-0003'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 5), (self.product2, 5)], 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product2, 5), (self.product3, 5)], 'payments': [(self.bank_pm2, 139.95)], 'uid': '00100-010-0003'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {},
|
||||
@@ -167,9 +167,9 @@ class TestPoSOtherCurrencyConfig(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm2 | self.bank_pm2,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product1, 5), (self.product2, 5)], 'is_invoiced': True, 'customer': self.customer, 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product2, 5), (self.product3, 5)], 'payments': [(self.bank_pm2, 139.95)], 'is_invoiced': True, 'customer': self.customer, 'uid': '00100-010-0003'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 5), (self.product2, 5)], 'is_invoiced': True, 'customer': self.customer, 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product2, 5), (self.product3, 5)], 'payments': [(self.bank_pm2, 139.95)], 'is_invoiced': True, 'customer': self.customer, 'uid': '00100-010-0003'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {
|
||||
@@ -263,10 +263,10 @@ class TestPoSOtherCurrencyConfig(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm2,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product4, 7), (self.product5, 7)], 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product5, 6), (self.product4, 6), (self.product6, 49)], 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product5, 2), (self.product6, 13)], 'uid': '00100-010-0003'},
|
||||
{'product_quantity_pairs': [(self.product6, 1)], 'uid': '00100-010-0004'},
|
||||
{'pos_order_lines_ui_args': [(self.product4, 7), (self.product5, 7)], 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product5, 6), (self.product4, 6), (self.product6, 49)], 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product5, 2), (self.product6, 13)], 'uid': '00100-010-0003'},
|
||||
{'pos_order_lines_ui_args': [(self.product6, 1)], 'uid': '00100-010-0004'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -294,7 +294,7 @@ class TestPoSOtherCurrencyConfig(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm2,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product7, 7)], 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product7, 7)], 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
|
||||
@@ -76,9 +76,9 @@ class TestPoSProductsWithTax(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product2, 5)], 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product2, 7), (self.product3, 4)], 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product1, 1), (self.product3, 5), (self.product2, 3)], 'payments': [(self.bank_pm1, 230.25)], 'uid': '00100-010-0003'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product2, 5)], 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product2, 7), (self.product3, 4)], 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 1), (self.product3, 5), (self.product2, 3)], 'payments': [(self.bank_pm1, 230.25)], 'uid': '00100-010-0003'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {},
|
||||
@@ -169,9 +169,9 @@ class TestPoSProductsWithTax(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product3, 1), (self.product1, 6), (self.product2, 3)], 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product2, 20), (self.product1, 1)], 'payments': [(self.bank_pm1, 410.7)], 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product3, 10)], 'payments': [(self.bank_pm1, 426.09)], 'customer': self.customer, 'is_invoiced': True, 'uid': '09876-098-0987'},
|
||||
{'pos_order_lines_ui_args': [(self.product3, 1), (self.product1, 6), (self.product2, 3)], 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product2, 20), (self.product1, 1)], 'payments': [(self.bank_pm1, 410.7)], 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product3, 10)], 'payments': [(self.bank_pm1, 426.09)], 'customer': self.customer, 'is_invoiced': True, 'uid': '09876-098-0987'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {
|
||||
@@ -269,7 +269,7 @@ class TestPoSProductsWithTax(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 3), (self.product2, 2), (self.product3, 1)], 'payments': [(self.cash_pm1, 104.01)], 'customer': self.customer, 'is_invoiced': True, 'uid': '12345-123-1234'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 3), (self.product2, 2), (self.product3, 1)], 'payments': [(self.cash_pm1, 104.01)], 'customer': self.customer, 'is_invoiced': True, 'uid': '12345-123-1234'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {
|
||||
|
||||
@@ -22,7 +22,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -65,7 +65,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -112,7 +112,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.pay_later_pm, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.pay_later_pm, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -137,7 +137,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_split_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -184,7 +184,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_split_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -227,7 +227,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -271,7 +271,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -315,7 +315,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_split_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -359,7 +359,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_split_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -403,7 +403,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_pm1, 200), (self.cash_pm1, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_pm1, 200), (self.cash_pm1, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -452,7 +452,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_pm1, 200), (self.cash_pm1, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_pm1, 200), (self.cash_pm1, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -510,7 +510,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_split_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 200), (self.cash_pm1, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 200), (self.cash_pm1, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -568,7 +568,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_split_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 200), (self.cash_split_pm1, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 200), (self.cash_split_pm1, -100)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -625,7 +625,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -669,7 +669,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -713,7 +713,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_split_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
@@ -757,7 +757,7 @@ class TestPosSimpleInvoicedOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_split_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {
|
||||
'00100-010-0001': {
|
||||
|
||||
@@ -22,7 +22,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -48,7 +48,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -74,7 +74,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.pay_later_pm, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.pay_later_pm, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -93,7 +93,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_split_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -119,7 +119,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_split_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -145,7 +145,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [], 'payments': [(self.cash_pm1, 100), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [], 'payments': [(self.cash_pm1, 100), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -171,7 +171,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [], 'payments': [(self.bank_pm1, 100), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [], 'payments': [(self.bank_pm1, 100), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -197,7 +197,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_split_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [], 'payments': [(self.bank_split_pm1, 100), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [], 'payments': [(self.bank_split_pm1, 100), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -223,7 +223,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_split_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [], 'payments': [(self.cash_split_pm1, 100), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [], 'payments': [(self.cash_split_pm1, 100), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -249,7 +249,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -276,7 +276,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -303,7 +303,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_split_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -330,7 +330,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_split_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 200), (self.pay_later_pm, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -357,7 +357,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_pm1, 200), (self.cash_pm1, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_pm1, 200), (self.cash_pm1, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -383,7 +383,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_pm1, 200), (self.cash_pm1, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_pm1, 200), (self.cash_pm1, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -417,7 +417,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_split_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 200), (self.cash_pm1, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 200), (self.cash_pm1, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -451,7 +451,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_split_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 200), (self.cash_split_pm1, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 200), (self.cash_split_pm1, -100)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -484,7 +484,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -511,7 +511,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -538,7 +538,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_split_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.bank_split_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
@@ -565,7 +565,7 @@ class TestPosSimpleOrders(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_split_pm1 | self.pay_later_pm,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product100, 1)], 'payments': [(self.cash_split_pm1, 50), (self.pay_later_pm, 50)], 'customer': self.customer, 'is_invoiced': False, 'uid': '00100-010-0001'},
|
||||
],
|
||||
'journal_entries_before_closing': {},
|
||||
'journal_entries_after_closing': {
|
||||
|
||||
@@ -88,9 +88,9 @@ class TestPoSStock(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product2, 10)], 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product2, 7), (self.product3, 7)], 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product1, 6), (self.product2, 6), (self.product3, 6)], 'uid': '00100-010-0003'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product2, 10)], 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product2, 7), (self.product3, 7)], 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 6), (self.product2, 6), (self.product3, 6)], 'uid': '00100-010-0003'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {},
|
||||
@@ -157,9 +157,9 @@ class TestPoSStock(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product2, 10)], 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product2, 7), (self.product3, 7)], 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product1, 6), (self.product2, 6), (self.product3, 6)], 'is_invoiced': True, 'customer': self.customer, 'uid': '00100-010-0003'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product2, 10)], 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product2, 7), (self.product3, 7)], 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 6), (self.product2, 6), (self.product3, 6)], 'is_invoiced': True, 'customer': self.customer, 'uid': '00100-010-0003'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {
|
||||
|
||||
@@ -134,9 +134,9 @@ class TestPoSWithFiscalPosition(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'customer': self.customer, 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product1, 5), (self.product2, 5)], 'customer': self.customer, 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product2, 5), (self.product3, 5)], 'payments': [(self.bank_pm1, 265.75)], 'uid': '00100-010-0003'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'customer': self.customer, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 5), (self.product2, 5)], 'customer': self.customer, 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product2, 5), (self.product3, 5)], 'payments': [(self.bank_pm1, 265.75)], 'uid': '00100-010-0003'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {},
|
||||
@@ -221,9 +221,9 @@ class TestPoSWithFiscalPosition(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'payments': [(self.bank_pm1, 619.7)], 'customer': self.customer, 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product1, 5), (self.product2, 5)], 'customer': self.customer, 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product2, 5), (self.product3, 5)], 'payments': [(self.bank_pm1, 265.75)], 'uid': '00100-010-0003'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'payments': [(self.bank_pm1, 619.7)], 'customer': self.customer, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 5), (self.product2, 5)], 'customer': self.customer, 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product2, 5), (self.product3, 5)], 'payments': [(self.bank_pm1, 265.75)], 'uid': '00100-010-0003'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {},
|
||||
@@ -315,9 +315,9 @@ class TestPoSWithFiscalPosition(TestPoSCommon):
|
||||
self._run_test({
|
||||
'payment_methods': self.cash_pm1 | self.bank_pm1,
|
||||
'orders': [
|
||||
{'product_quantity_pairs': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'payments': [(self.bank_pm1, 691.06)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'product_quantity_pairs': [(self.product1, 5), (self.product2, 5)], 'customer': self.customer, 'uid': '00100-010-0002'},
|
||||
{'product_quantity_pairs': [(self.product2, 5), (self.product3, 5)], 'customer': self.other_customer, 'is_invoiced': True, 'uid': '00100-010-0003'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 10), (self.product2, 10), (self.product3, 10)], 'payments': [(self.bank_pm1, 691.06)], 'customer': self.customer, 'is_invoiced': True, 'uid': '00100-010-0001'},
|
||||
{'pos_order_lines_ui_args': [(self.product1, 5), (self.product2, 5)], 'customer': self.customer, 'uid': '00100-010-0002'},
|
||||
{'pos_order_lines_ui_args': [(self.product2, 5), (self.product3, 5)], 'customer': self.other_customer, 'is_invoiced': True, 'uid': '00100-010-0003'},
|
||||
],
|
||||
'before_closing_cb': _before_closing_cb,
|
||||
'journal_entries_before_closing': {
|
||||
|
||||
Reference in New Issue
Block a user