diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2020-03-20 15:17:01 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-03-23 10:11:08 +0000 |
| commit | c2cd71f576303bb68d0c76f683c490ba2fe10ea1 (patch) | |
| tree | 3439cddf62409640a29a9d6975be396090802afa /addons/payment_sips | |
| parent | d418bff698f1601d7d3b2d1579d785e47f4f47d1 (diff) | |
[FIX] payment_sips: rounding error
- Activate SIPS
- Make a payment of 263.90 on the eCommerce
The SO is not confirmed because there is 0.01 of difference.
This is due to the fact that 263.90 * 100 = 26389.9999...
Using `round` instead of `int` prevents truncating the value.
opw-2179123
closes odoo/odoo#48169
X-original-commit: 60f9cea444df37e685b7f4312c9ff28c395822b3
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/payment_sips')
| -rw-r--r-- | addons/payment_sips/models/payment.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/payment_sips/models/payment.py b/addons/payment_sips/models/payment.py index 34078fdcb36..186c82363fd 100644 --- a/addons/payment_sips/models/payment.py +++ b/addons/payment_sips/models/payment.py @@ -73,7 +73,7 @@ class AcquirerSips(models.Model): currency_code = CURRENCY_CODES.get(currency.name, False) if not currency_code: raise ValidationError(_('Currency not supported by Wordline')) - amount = int(values['amount'] * 100) + amount = round(values['amount'] * 100) if self.state == 'enabled': # For production environment, key version 2 is required merchant_id = getattr(self, 'sips_merchant_id') |
