Merge lp:~openerp-dev/openobject-addons/7.0-today-filter-mat into lp:openobject-addons/7.0

Proposed by Martin Trigaux (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-today-filter-mat
Merge into: lp:openobject-addons/7.0
Diff against target: 117 lines (+10/-10)
7 files modified
event/event_view.xml (+1/-1)
hr_attendance/hr_attendance_view.xml (+1/-1)
lunch/lunch_view.xml (+1/-1)
point_of_sale/point_of_sale_view.xml (+1/-1)
point_of_sale/report/pos_order_report.py (+3/-3)
point_of_sale/report/pos_order_report_view.xml (+2/-2)
stock/stock_view.xml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-today-filter-mat
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+203591@code.launchpad.net

Description of the change

Not to be merged in 7.0, info only

requires web branch https://code.launchpad.net/~openerp-dev/openerp-web/7.0-today-filter-mat/+merge/203589

fix filters to get correct today

To post a comment you must log in.
9799. By Martin Trigaux (OpenERP)

[FIX] point_of_sale: group by day uses timezone

9800. By Martin Trigaux (OpenERP)

[MERGE] sync with 7.0 up to rev 9900

Unmerged revisions

9800. By Martin Trigaux (OpenERP)

[MERGE] sync with 7.0 up to rev 9900

9799. By Martin Trigaux (OpenERP)

[FIX] point_of_sale: group by day uses timezone

9798. By Martin Trigaux (OpenERP)

[FIX] filters to get valid today bounds

9797. By Martin Trigaux (OpenERP)

[FIX] point_of_sale: correct model and domain to have a valid today filter

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'event/event_view.xml'
2--- event/event_view.xml 2013-03-04 12:55:34 +0000
3+++ event/event_view.xml 2014-03-13 15:56:20 +0000
4@@ -293,7 +293,7 @@
5 <separator/>
6 <filter icon="terp-personal" string="My Events" help="My Events" domain="[('user_id','=',uid)]"/>
7 <separator/>
8- <filter icon="terp-go-today" string="Upcoming" name="upcoming" domain="[('date_begin','&gt;=', time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Upcoming events from today" />
9+ <filter icon="terp-go-today" string="Upcoming" name="upcoming" domain="[('date_begin','&gt;=', datetime.datetime.now().replace(hour=0, minute=0, second=0))]" help="Upcoming events from today" />
10 <field name="type"/>
11 <field name="user_id"/>
12 <group expand="0" string="Group By...">
13
14=== modified file 'hr_attendance/hr_attendance_view.xml'
15--- hr_attendance/hr_attendance_view.xml 2012-11-29 22:26:45 +0000
16+++ hr_attendance/hr_attendance_view.xml 2014-03-13 15:56:20 +0000
17@@ -52,7 +52,7 @@
18 <search string="Hr Attendance Search">
19 <field name="name" string="Attendance"/>
20 <field name="action"/>
21- <filter icon="terp-go-today" string="Today" name="today" domain="[('name','&gt;=',current_date),('name','&lt;=',current_date)]" />
22+ <filter icon="terp-go-today" string="Today" name="today" domain="[('name','&gt;=',datetime.datetime.now().replace(hour=0, minute=0, second=0)),('name','&lt;=',datetime.datetime.now().replace(hour=23, minute=59, second=59))]" />
23 <separator/>
24 <filter icon="terp-stock_align_left_24" string="My Attendance" domain="[('employee_id.user_id.id', '=', uid)]" />
25 <field name="employee_id"/>
26
27=== modified file 'lunch/lunch_view.xml'
28--- lunch/lunch_view.xml 2013-08-21 14:49:00 +0000
29+++ lunch/lunch_view.xml 2014-03-13 15:56:20 +0000
30@@ -19,7 +19,7 @@
31 <filter name="comfirmed" string="Received" domain="[('state','=','confirmed')]"/>
32 <filter name="cancelled" string="Cancelled" domain="[('state','=','cancelled')]"/>
33 <separator/>
34- <filter name="today" string="Today" domain="[('date','=',time.strftime('%%Y-%%m-%%d'))]"/>
35+ <filter name="today" string="Today" domain="[('date','=',context_today().strftime('%%Y-%%m-%%d'))]"/>
36 <field name="user_id"/>
37 <group expand="0" string="Group By...">
38 <filter name="group_by_supplier" string="By Supplier" context="{'group_by':'supplier'}"/>
39
40=== modified file 'point_of_sale/point_of_sale_view.xml'
41--- point_of_sale/point_of_sale_view.xml 2013-11-07 11:02:56 +0000
42+++ point_of_sale/point_of_sale_view.xml 2014-03-13 15:56:20 +0000
43@@ -985,7 +985,7 @@
44 <field name="name" />
45 <filter string="Open" domain="[('state', '=', 'opened')]" />
46 <separator/>
47- <filter string="Today" domain="[('start_at', '>=', time.strftime('%%Y-%%m-%%d 00:00:00'))]" />
48+ <filter string="Today" domain="[('start_at', '>=', datetime.datetime.now().replace(hour=0, minute=0, second=0))]" />
49 <field name="config_id" />
50 <field name="user_id" />
51 <group expand="0" string="Group By...">
52
53=== modified file 'point_of_sale/report/pos_order_report.py'
54--- point_of_sale/report/pos_order_report.py 2012-12-06 14:56:32 +0000
55+++ point_of_sale/report/pos_order_report.py 2014-03-13 15:56:20 +0000
56@@ -27,7 +27,7 @@
57 _description = "Point of Sale Orders Statistics"
58 _auto = False
59 _columns = {
60- 'date': fields.date('Date Order', readonly=True),
61+ 'date': fields.datetime('Date Order', readonly=True),
62 'year': fields.char('Year', size=4, readonly=True),
63 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
64 ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
65@@ -57,7 +57,7 @@
66 select
67 min(l.id) as id,
68 count(*) as nbr,
69- to_date(to_char(s.date_order, 'dd-MM-YYYY'),'dd-MM-YYYY') as date,
70+ s.date_order as date,
71 sum(l.qty * u.factor) as product_qty,
72 sum(l.qty * l.price_unit) as price_total,
73 sum((l.qty * l.price_unit) * (l.discount / 100)) as total_discount,
74@@ -78,7 +78,7 @@
75 left join product_template pt on (pt.id=l.product_id)
76 left join product_uom u on (u.id=pt.uom_id)
77 group by
78- to_char(s.date_order, 'dd-MM-YYYY'),to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),
79+ s.date_order,to_char(s.date_order, 'YYYY'),to_char(s.date_order, 'MM'),
80 to_char(s.date_order, 'YYYY-MM-DD'), s.partner_id,s.state,
81 s.user_id,s.shop_id,s.company_id,s.sale_journal,l.product_id,s.create_date
82 having
83
84=== modified file 'point_of_sale/report/pos_order_report_view.xml'
85--- point_of_sale/report/pos_order_report_view.xml 2012-11-29 22:26:45 +0000
86+++ point_of_sale/report/pos_order_report_view.xml 2014-03-13 15:56:20 +0000
87@@ -38,7 +38,7 @@
88 <separator/>
89 <filter icon="terp-go-year" string="Year" name="year" domain="[('year','=',time.strftime('%%Y'))]" help="POS ordered created during current year"/>
90 <separator/>
91- <filter icon="terp-go-today" string="Today" name="today" domain="[('date','=', time.strftime('%%Y-%%m-%%d'))]"
92+ <filter icon="terp-go-today" string="Today" name="today" domain="[('date','&gt;=', datetime.datetime.now().replace(hour=0, minute=0, second=0)), ('date','&lt;=', datetime.datetime.now().replace(hour=23, minute=59, second=59))]"
93 help="POS ordered created by today"/>
94 <separator/>
95 <filter icon="terp-personal" string="My Sales" help="My Sales" domain="[('user_id','=',uid)]"/>
96@@ -50,7 +50,7 @@
97 <filter string="Salesperson" icon="terp-personal" name="User" context="{'group_by':'user_id'}"/>
98 <filter string="Customer" icon="terp-personal" context="{'group_by':'partner_id'}"/>
99 <filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
100- <filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Day of order date"/>
101+ <filter string="Day" icon="terp-go-today" context="{'group_by':'date:day'}" help="Day of order date"/>
102 <filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Month of order date"/>
103 <filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Year of order date"/>
104 </group>
105
106=== modified file 'stock/stock_view.xml'
107--- stock/stock_view.xml 2014-03-13 13:44:38 +0000
108+++ stock/stock_view.xml 2014-03-13 15:56:20 +0000
109@@ -1368,7 +1368,7 @@
110 <filter icon="terp-stock" string="To Do" name="future" domain="[('state','in',('assigned','confirmed','waiting'))]" help="Stock moves that are Confirmed, Available or Waiting"/>
111 <filter icon="terp-dialog-close" string="Done" name="done" domain="[('state','=','done')]" help="Stock moves that have been processed"/>
112 <separator/>
113- <filter icon="terp-go-today" string="Today" domain="[('date','&lt;=',time.strftime('%%Y-%%m-%%d 23:59:59')),('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Orders processed Today or planned for Today"/>
114+ <filter icon="terp-go-today" string="Today" domain="[('date','&lt;=',datetime.datetime.now().replace(hour=23, minute=59, second=59)),('date','&gt;=',datetime.datetime.now().replace(hour=0, minute=0, second=0))]" help="Orders processed Today or planned for Today"/>
115 <field name="product_id"/>
116 <field name="name" string="Location" filter_domain="['|',('location_id','ilike',self),('location_dest_id','ilike',self)]"/>
117 <field name="partner_id" string="Partner" filter_domain="[('picking_id.partner_id','child_of',self)]"/>