I create a method when I change a date I received a product and qty to the date of stock.move, I declare start_date = fields.Datetime()
in my class
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)
it works fine this method but I want to compare "date of stock" between the start_date date >= start_date AND date <= start_date. I want also to format the date like the method on hr_timesheet
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
Thanks
You May try something like this
I hope this should helpful for you :)