日期比较不';在openerp7中无法正常工作

日期比较不';在openerp7中无法正常工作,openerp,Openerp,我手头有两个日期(从日期到日期)。我想知道表中是否有其他记录属于同一范围。我使用openerp搜索功能来实现这一点 下面是我的代码。请查看我的日期搜索是否使用运算符尝试传递起始日期和截止日期的datetime对象,而不是字符串 exist_ids = self.search(cr, uid, [('partner_id','=',customer),('sys_conf_name','ilike',sys_conf_name.strip()),('contract_start_date','&l

我手头有两个日期(从日期到日期)。我想知道表中是否有其他记录属于同一范围。我使用openerp搜索功能来实现这一点


下面是我的代码。请查看我的日期搜索是否使用运算符尝试传递起始日期和截止日期的datetime对象,而不是字符串

exist_ids = self.search(cr, uid, [('partner_id','=',customer),('sys_conf_name','ilike',sys_conf_name.strip()),('contract_start_date','<=',cont_start_date),('contract_end_date','>=',cont_end_date)])
if exist_ids:
      raise osv.except_osv(_('Error!!'), "Already there exist a Contract for the same customer, same product and the same date range!!")