diff options
| author | Richard Mathot <rim@odoo.com> | 2020-04-06 14:42:05 +0000 |
|---|---|---|
| committer | Richard Mathot <rim@odoo.com> | 2020-04-06 16:50:56 +0000 |
| commit | a6d38439d590a4a9cfb02309a738f7550b10399b (patch) | |
| tree | c146702c59c9de7898dffcd4c7d4286ffb39236a /addons/payment_sips/models | |
| parent | 5199d457605293946e4e4d799ba1bf5de40c06e2 (diff) | |
[REV] payment_sips: 9372ff3ac010bd3428eb866ddd3ecfaf939127c4
Python 3.7 is required for function datetime.datetime.fromisoformat to
work.
Ref: https://docs.python.org/3.7/library/datetime.html?highlight=fromisoformat#datetime.datetime.fromisoformat
This is a temporary revert, to avoid rejecting perfectly valid
transactions.
Ref: https://github.com/odoo/odoo/pull/48581
opw-2179123
closes odoo/odoo#49091
X-original-commit: dedac4efd0872bab71e06796f5a3158e2cf7bf15
Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
Diffstat (limited to 'addons/payment_sips/models')
| -rw-r--r-- | addons/payment_sips/models/payment.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/addons/payment_sips/models/payment.py b/addons/payment_sips/models/payment.py index ff651a78362..4c49c2a4f33 100644 --- a/addons/payment_sips/models/payment.py +++ b/addons/payment_sips/models/payment.py @@ -2,10 +2,8 @@ # Copyright 2015 Eezee-It -import datetime import json import logging -import pytz import re import time from hashlib import sha256 @@ -184,13 +182,10 @@ class TxSips(models.Model): def _sips_form_validate(self, data): data = self._sips_data_to_object(data.get('Data')) status = data.get('responseCode') - date = data.get('transactionDateTime') - if date: - date = datetime.datetime.fromisoformat(date) - date = date.astimezone(pytz.utc).replace(tzinfo=None) data = { 'acquirer_reference': data.get('transactionReference'), - 'date': date or fields.Datetime.now(), + 'date': data.get('transactionDateTime', + fields.Datetime.now()) } res = False if status in self._sips_valid_tx_status: |
