elif to_date:
date_str = "date<=%s"
date_values = [to_date]
+ if date_values:
+ where.append(tuple(date_values))
prodlot_id = context.get('prodlot_id', False)
+ prodlot_clause = ''
+ if prodlot_id:
+ prodlot_clause = ' and prodlot_id = %s '
+ where += [prodlot_id]
++ elif 'prodlot_id' in context and not prodlot_id:
++ prodlot_clause = 'and prodlot_id is null '
- # TODO: perhaps merge in one query.
- if date_values:
- where.append(tuple(date_values))
+ # TODO: perhaps merge in one query.
if 'in' in what:
# all moves from a location out of the set to a location in the set
cr.execute(