From e4def54dfb41f471abb4337add75769ad8f28440 Mon Sep 17 00:00:00 2001 From: Ludovic CHEVALIER Date: Tue, 14 Jan 2014 16:00:33 +0100 Subject: [PATCH] [Partner] +birthdate_date field to fix birthdade conflict beetween date format and orginal char format of this field --- i18n/fr.po | 10 +++++++--- i18n/velosenville.pot | 9 +++++++-- res_partner.py | 10 +++++----- view/bikecoop.xml | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/i18n/fr.po b/i18n/fr.po index 8d8b4a8..00ded43 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0alpha-20121206-000102\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-01-14 14:24+0000\n" -"PO-Revision-Date: 2014-01-14 15:26+0100\n" +"POT-Creation-Date: 2014-01-14 15:01+0000\n" +"PO-Revision-Date: 2014-01-14 16:02+0100\n" "Last-Translator: Ludovic CHEVALIER \n" "Language-Team: \n" "Language: fr_FR\n" @@ -92,7 +92,6 @@ msgstr "Étudiant" #. module: velosenville #: view:res.partner:0 -#, fuzzy msgid "Join membership" msgstr "Facturer une adhésion" @@ -126,6 +125,11 @@ msgstr "Adhésion réduite" msgid "Partners control user" msgstr "Utilisateur de contrôle des Partenaires" +#. module: velosenville +#: field:res.partner,birthdate_date:0 +msgid "Birthdate" +msgstr "Date de naissance" + #. module: velosenville #: model:product.template,name:velosenville.product_standard_membership_product_template msgid "Standard membership" diff --git a/i18n/velosenville.pot b/i18n/velosenville.pot index 3e7d802..90a91fb 100644 --- a/i18n/velosenville.pot +++ b/i18n/velosenville.pot @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: OpenERP Server 7.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-01-14 14:24+0000\n" -"PO-Revision-Date: 2014-01-14 14:24+0000\n" +"POT-Creation-Date: 2014-01-14 15:01+0000\n" +"PO-Revision-Date: 2014-01-14 15:01+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -120,6 +120,11 @@ msgstr "" msgid "Partners control user" msgstr "" +#. module: velosenville +#: field:res.partner,birthdate_date:0 +msgid "Birthdate" +msgstr "" + #. module: velosenville #: model:product.template,name:velosenville.product_standard_membership_product_template msgid "Standard membership" diff --git a/res_partner.py b/res_partner.py index db7aa43..63ab834 100644 --- a/res_partner.py +++ b/res_partner.py @@ -30,18 +30,18 @@ class res_partner(osv.osv): _columns = { #Overload birthdate field to have date format. Don't know why it's char type in mainstream version - 'birthdate': fields.date('Birthdate'), + 'birthdate_date': fields.date('Birthdate'), } - def _check_birthdate(self, cr, uid, ids, context=None): + def _check_birthdate_date(self, cr, uid, ids, context=None): obj = self.browse(cr, uid, ids[0], context=context) - if obj.birthdate: - if obj.birthdate < '1900-01-01' or obj.birthdate > str(date.today()): + if obj.birthdate_date: + if obj.birthdate_date < '1900-01-01' or obj.birthdate_date > str(date.today()): return False return True _constraints = [ - (_check_birthdate, 'Error: this birthdate is not valid.', ['birthdate']), + (_check_birthdate_date, 'Error: this birthdate is not valid.', ['birthdate']), ] res_partner() diff --git a/view/bikecoop.xml b/view/bikecoop.xml index 2b346d0..1c554da 100644 --- a/view/bikecoop.xml +++ b/view/bikecoop.xml @@ -7,7 +7,7 @@ - + -- 2.20.1