[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>
This commit is contained in:
Nicolas Martinelli
2020-03-23 10:11:08 +00:00
parent d418bff698
commit c2cd71f576
+1 -1
View File
@@ -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')