From c64efd2320236706e60e58e806a028a89b118aed Mon Sep 17 00:00:00 2001 From: houssine Date: Wed, 24 Jan 2018 12:03:42 +0100 Subject: [PATCH] [FIX] fix birthdate convertion --- easy_my_coop/controllers/main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/easy_my_coop/controllers/main.py b/easy_my_coop/controllers/main.py index 00db303..ccd0ab0 100644 --- a/easy_my_coop/controllers/main.py +++ b/easy_my_coop/controllers/main.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- import base64 -import datetime +from datetime import datetime import re import werkzeug @@ -68,7 +68,8 @@ class WebsiteSubscription(http.Controller): values['country_id'] = partner.country_id.id values['gender'] = partner.gender values['no_registre'] = partner.national_register_number - values['birthdate'] = partner.birthdate + birthdate = datetime.strptime(partner.birthdate,"%Y-%m-%d") + values['birthdate'] = datetime.strftime(birthdate,"%d/%m/%Y") if partner.bank_ids: values['iban'] = partner.bank_ids[0].acc_number values['lang'] = partner.lang @@ -186,7 +187,7 @@ class WebsiteSubscription(http.Controller): values["name"] = firstname + " " + lastname values["lastname"] = lastname values["firstname"] = firstname - values["birthdate"] = datetime.datetime.strptime(kwargs.get("birthdate"), "%d/%m/%Y").date() + values["birthdate"] = datetime.strptime(kwargs.get("birthdate"), "%d/%m/%Y").date() values["source"] = "website" if kwargs.get("share_product_id"):