[FIX] fix useless and invalid casts in domain fields
The ORM will automatically append 00:00:00 to a date literal that is being compared with a timestamp field with operators '>' or '>=', and 23:59:59 if compared with operators '<' or '<='. So a trivial domain for 'Today' is: [('tstamp_field','>=',current_date),('tstamp_field','<=',current_date)] taking advantage of the current_date helper that is defined as the current date in YYYY-MM-DD format. bzr revid: odo@openerp.com-20110924005547-pvgblte6r14so7mw
This commit is contained in:
parent
ccc56996dd
commit
253eaa462d
|
@ -248,13 +248,13 @@
|
|||
/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-go-today" string="Today"
|
||||
domain="[('date::date','=',time.strftime('%%Y-%%m-%%d'))]"
|
||||
domain="[('date','>=',current_date), ('date','<=',current_date)]"
|
||||
help="Todays's Helpdesk Requests"
|
||||
/>
|
||||
<filter icon="terp-go-week"
|
||||
string="7 Days"
|
||||
help="Helpdesk requests during last 7 days"
|
||||
domain="[('date','<', time.strftime('%%Y-%%m-%%d')), ('date','>=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
domain="[('date','<',current_date), ('date','>=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name" string="Query"/>
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<search string="Hr Attendance Search">
|
||||
<filter icon="terp-stock_align_left_24" string="My Attendances" domain="[('employee_id.user_id.id', '=', uid)]" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-go-today" string="Today" name="today" domain="[('name::date','=',current_date)]" />
|
||||
<filter icon="terp-go-today" string="Today" name="today" domain="[('name','>=',current_date),('name','<=',current_date)]" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="employee_id"/>
|
||||
<field name="name"/>
|
||||
|
|
|
@ -808,7 +808,7 @@
|
|||
help="Manufacturing Orders which are currently in production."/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
|
||||
domain="['&', ('date_planned::date','<', current_date), ('state', 'in', ('draft', 'confirmed', 'ready'))]"
|
||||
domain="['&', ('date_planned','<', current_date), ('state', 'in', ('draft', 'confirmed', 'ready'))]"
|
||||
help="Production started late" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
domain="[('state','=','pause')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
|
||||
domain="['&', ('date_planned::date','<', current_date), ('state', 'in', ('draft', 'confirmed', 'ready'))]"
|
||||
domain="['&', ('date_planned','<', current_date), ('state', 'in', ('draft', 'confirmed', 'ready'))]"
|
||||
help="Production started late" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
<filter icon="terp-emblem-important" string="Temporary" name="temp_exceptions" domain="[('state','=','exception'),('message', '=', '')]" help="Temporary Procurement Exceptions"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-gnome-cpu-frequency-applet+" string="Late"
|
||||
domain="['&', ('date_planned::date','<', current_date), ('state', 'in', ('draft', 'confirmed'))]"
|
||||
domain="['&', ('date_planned','<', current_date), ('state', 'in', ('draft', 'confirmed'))]"
|
||||
help="Procurement started late" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="origin"/>
|
||||
|
|
Loading…
Reference in New Issue