【发布时间】:2023-03-29 19:07:01
【问题描述】:
当我将收到产品的日期和数量更改为 stock.move 的日期时,我创建了一个方法,我在课堂上声明 start_date = fields.Datetime()
def onchange_project(self, cr, uid,start_date):
"""
onchange handler of start date.
"""
pool_stockmove =self.pool.get('stock.move')
domain =[('date','>=',start_date)]
ids = pool_stockmove.search(cr, uid, domain)
这种方法效果很好,但我想比较 start_date date >= start_date AND date
cr.execute('SELECT id \
FROM hr_timesheet_sheet_sheet \
WHERE (date_from <= %s and %s <= date_to) \
AND user_id=%s \
AND id <> %s',(sheet.date_to, sheet.date_from, new_user_id, sheet.id))
if cr.fetchall():
return False
谢谢
【问题讨论】:
标签: openerp odoo openerp-7 openerp-8 odoo-8