[DATA] -automatically add group stock user for point of sale managers
[burette/velosenville.git] / res_partner.py
index db7aa43..0ab6805 100644 (file)
@@ -2,7 +2,7 @@
 ##############################################################################
 #
 #    velosenville module for OpenERP, Vélos en Ville specificities
-#    Copyright (C) 2012-2013 Vélos en Ville (<http://www.velosenville.org>)
+#    Copyright (C) 2012-2016 Vélos en Ville (<http://www.velosenville.org>)
 #
 #    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()