Hi,

i need to compare a datetime to the system datetime so i tried the function 
_get_system_date to get the system datetime :

class rentcar_contrat(osv.osv):
   _name='rentcar.contrat'
   _columns= {
      
      'contrat_id': 
fields.float('contrat_id',required=True),
      'date_to_compare':fields.datetime('date to 
compare '),
      'system_date':fields.datetime('la_date'),
   }

   def _get_system_date(self, cr, uid, 
context={}):
      return time.strftime('%d/%m/%Y 
%H:%M:%S')


   _defaults={
      'system_date': _get_system_date,
   }

rentcar_contrat()



on my view, to print just the lines with matched datetimes, i tried :


       
<field>&#91;&#40;'date_heure_arrivee','=','system_date''&#41;&#93;</field>



but i got the following error:

 invalid input syntax for type timestamp:"system_date"

and when i put an other datetime on the same format of the system_date as 
05/05/2009 16:29:00 it works


&nbsp; &nbsp;&nbsp; &nbsp; 
<field>&#91;&#40;'date_heure_arrivee','=','05/05/2009 
16&#58;29&#58;00'&#41;&#93;</field>



Please can somebody help me to find the correct code.

Thank you [Crying or Very sad]




-------------------- m2f --------------------

--
http://www.openobject.com/forum/viewtopic.php?p=35930#35930

-------------------- m2f --------------------


_______________________________________________
Tinyerp-users mailing list
http://tiny.be/mailman/listinfo/tinyerp-users

Reply via email to