0

我手头有 2 个日期(从日期到现在)。我想知道表中是否有另一条记录在同一范围内。我使用 openerp 搜索功能来做到这一点

下面是我的代码。请查看我使用运算符 <= 进行的日期搜索是否正确,是否有任何我错误理解的内容。

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!!")

谢谢你的时间。

4

1 回答 1

0

尝试传递从和到日期的日期时间对象而不是字符串

于 2013-09-27T07:44:18.497 回答