X-Git-Url: http://git.cyclocoop.org/?p=burette%2Fvelosenville.git;a=blobdiff_plain;f=res_partner.py;h=0ab680510c083111cac42f455b849cbd100f82eb;hp=db7aa43a616fe7d91246a770ed94ab4d38080c71;hb=HEAD;hpb=5f6e1164222ddfe13f38eb51474a0e5b0118bd8a diff --git a/res_partner.py b/res_partner.py index db7aa43..0ab6805 100644 --- a/res_partner.py +++ b/res_partner.py @@ -2,7 +2,7 @@ ############################################################################## # # velosenville module for OpenERP, Vélos en Ville specificities -# Copyright (C) 2012-2013 Vélos en Ville () +# Copyright (C) 2012-2016 Vélos en Ville () # # This file is a part of velosenville # @@ -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()