[FIX] point_of_sale: make tests consistent wrt taxes
After rev d938ba87ae, taxes that are
included in the price are subtracted in case the tax is not applied in
an order (e.g. when the fiscal position remove the tax).
Some of the test orders did not apply any tax, and because the products
used in the test had some tax included, the above revision made the
tests fail (by subtracting the tax amount from the price).
Fixed by making the test orders more consistent wrt to taxes, applying
the taxes as would happen in the UI, then correcting the payment amounts
to include the extra tax amounts.
This commit is contained in:
@@ -142,12 +142,14 @@ class TestPointOfSaleFlow(TestPointOfSaleCommon):
|
||||
'price_unit': 450,
|
||||
'discount': 0.0,
|
||||
'qty': 2.0,
|
||||
'tax_ids': [(6, 0, self.product3.taxes_id.ids)],
|
||||
}), (0, 0, {
|
||||
'name': "OL/0002",
|
||||
'product_id': self.product4.id,
|
||||
'price_unit': 300,
|
||||
'discount': 0.0,
|
||||
'qty': 3.0,
|
||||
'tax_ids': [(6, 0, self.product4.taxes_id.ids)],
|
||||
})]
|
||||
})
|
||||
|
||||
@@ -157,7 +159,7 @@ class TestPointOfSaleFlow(TestPointOfSaleCommon):
|
||||
"active_id": self.pos_order_pos1.id
|
||||
}
|
||||
self.pos_make_payment_2 = self.PosMakePayment.with_context(context_make_payment).create({
|
||||
'amount': 1800
|
||||
'amount': 1845
|
||||
})
|
||||
|
||||
# I click on the validate button to register the payment.
|
||||
@@ -204,12 +206,14 @@ class TestPointOfSaleFlow(TestPointOfSaleCommon):
|
||||
'price_unit': 450,
|
||||
'discount': 0.0,
|
||||
'qty': (-2.0),
|
||||
'tax_ids': [(6, 0, self.product3.taxes_id.ids)],
|
||||
}), (0, 0, {
|
||||
'name': "OL/0004",
|
||||
'product_id': self.product4.id,
|
||||
'price_unit': 300,
|
||||
'discount': 0.0,
|
||||
'qty': (-3.0),
|
||||
'tax_ids': [(6, 0, self.product4.taxes_id.ids)],
|
||||
})]
|
||||
})
|
||||
|
||||
@@ -219,7 +223,7 @@ class TestPointOfSaleFlow(TestPointOfSaleCommon):
|
||||
"active_id": self.pos_order_pos2.id
|
||||
}
|
||||
self.pos_make_payment_3 = self.PosMakePayment.with_context(context_make_payment).create({
|
||||
'amount': (-1800)
|
||||
'amount': (-1845)
|
||||
})
|
||||
|
||||
# I click on the validate button to register the payment.
|
||||
|
||||
Reference in New Issue
Block a user