[FIX] payment_authorize: Credit cards expiration date

- Fixes the validation for credit cards expiration date.

In the courtesy of @SodexisTeam
This commit is contained in:
Atchuthan, Sodexis
2018-01-18 15:21:18 +01:00
committed by tbe-odoo
parent ea700016dd
commit 171ce8fb2a
+1 -1
View File
@@ -126,7 +126,7 @@ class PaymentAcquirerAuthorize(models.Model):
for field_name in mandatory_fields:
if not data.get(field_name):
error[field_name] = 'missing'
if data['cc_expiry'] and datetime.now().strftime('%y%M') > datetime.strptime(data['cc_expiry'], '%M / %y').strftime('%y%M'):
if data['cc_expiry'] and datetime.now().strftime('%y%m') > datetime.strptime(data['cc_expiry'], '%m / %y').strftime('%y%m'):
return False
return False if error else True