From 31b8151736b3382cca5601cd652b1d5482790af9 Mon Sep 17 00:00:00 2001 From: roen-odoo Date: Tue, 30 May 2023 13:19:15 +0000 Subject: [PATCH] [FIX] pos_stripe: fix stripe rounding issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Current behavior: When you setup a stripe payment terminal, there was a rounding issue. If you sold a product for 1.10€ with a tax of 7%, the total amount was 1.18€, but the amount sent to the stripe terminal was 1.17€. Steps to reproduce: - Setup the stripe payment terminal - Create a product with a price of 1.10€ and a tax of 7% - Create a POS order with this product, the total is 1.18€ - Pay the order with the stripe payment terminal, the amount sent to the terminal is 1.17€ opw-3298277 closes odoo/odoo#124372 X-original-commit: 356a6b089c020a9a83c8c7b65b588a50491c13a8 Signed-off-by: Joseph Caburnay (jcb) Signed-off-by: Engels Robin (roen) --- addons/pos_stripe/models/pos_payment_method.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/pos_stripe/models/pos_payment_method.py b/addons/pos_stripe/models/pos_payment_method.py index 45b0f886e8d..929bc4eeb22 100644 --- a/addons/pos_stripe/models/pos_payment_method.py +++ b/addons/pos_stripe/models/pos_payment_method.py @@ -65,7 +65,7 @@ class PosPaymentMethod(models.Model): def _stripe_calculate_amount(self, amount): currency = self.journal_id.currency_id or self.company_id.currency_id - return int(amount/currency.rounding) + return round(amount/currency.rounding) def stripe_payment_intent(self, amount): if not self.env.user.has_group('point_of_sale.group_pos_user'):