Merge lp:~openerp-dev/openobject-addons/trunk-timesheet-analysis-reports-tpa into lp:openobject-addons
- trunk-timesheet-analysis-reports-tpa
- Merge into trunk
Status: | Needs review |
---|---|
Proposed branch: | lp:~openerp-dev/openobject-addons/trunk-timesheet-analysis-reports-tpa |
Merge into: | lp:openobject-addons |
Diff against target: |
574 lines (+197/-96) 9 files modified
hr_timesheet/__openerp__.py (+1/-0) hr_timesheet/report/__init__.py (+1/-1) hr_timesheet/report/hr_timesheet_report.py (+97/-0) hr_timesheet/report/hr_timesheet_report_view.xml (+58/-0) hr_timesheet_sheet/__openerp__.py (+0/-1) hr_timesheet_sheet/report/__init__.py (+1/-1) hr_timesheet_sheet/report/hr_timesheet_report.py (+13/-49) hr_timesheet_sheet/report/hr_timesheet_report_view.xml (+26/-43) hr_timesheet_sheet/security/ir.model.access.csv (+0/-1) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-addons/trunk-timesheet-analysis-reports-tpa |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Richard Mathot (Odoo, formerly OpenERP) | Pending | ||
Review via email: mp+200093@code.launchpad.net |
Commit message
Description of the change
--> move hr timesheet analysis report in to hr_timesheet
--> replace timesheet analysis report by hr timesheet sheet analysis repost in hr_timesheet_sheet
- 9027. By Turkesh Patel (openERP)
-
[IMP] improved code
- 9028. By Turkesh Patel (openERP)
-
[MRG] merge with lp:openobject-addons
- 9029. By Turkesh Patel (openERP)
-
[IMP] improved code as per new graph view deployed.
- 9030. By Turkesh Patel (openERP)
-
[MRG] merge with lp:openobject-addons
- 9031. By Turkesh Patel (openERP)
-
[IMP] remove analytic account group in search view and added filter this month.
- 9032. By Turkesh Patel (openERP)
-
[MRG] merge with lp:openobject-addons
- 9033. By Turkesh Patel (openERP)
-
[MRG] merge with lp:openobject-addons
- 9034. By Turkesh Patel (openERP)
-
[IMP] improved seq of groupby filters in search view
Unmerged revisions
- 9034. By Turkesh Patel (openERP)
-
[IMP] improved seq of groupby filters in search view
- 9033. By Turkesh Patel (openERP)
-
[MRG] merge with lp:openobject-addons
- 9032. By Turkesh Patel (openERP)
-
[MRG] merge with lp:openobject-addons
- 9031. By Turkesh Patel (openERP)
-
[IMP] remove analytic account group in search view and added filter this month.
- 9030. By Turkesh Patel (openERP)
-
[MRG] merge with lp:openobject-addons
- 9029. By Turkesh Patel (openERP)
-
[IMP] improved code as per new graph view deployed.
- 9028. By Turkesh Patel (openERP)
-
[MRG] merge with lp:openobject-addons
- 9027. By Turkesh Patel (openERP)
-
[IMP] improved code
- 9026. By Turkesh Patel (openERP)
-
[IMP] instead of replacing quary inherit it, rename files.
- 9025. By Turkesh Patel (openERP)
-
[IMP] move report from hr_timesheet_sheet to hr_timesheet
Preview Diff
1 | === modified file 'hr_timesheet/__openerp__.py' |
2 | --- hr_timesheet/__openerp__.py 2014-01-27 14:04:30 +0000 |
3 | +++ hr_timesheet/__openerp__.py 2014-04-24 10:40:00 +0000 |
4 | @@ -50,6 +50,7 @@ |
5 | 'hr_timesheet_wizard.xml', |
6 | 'process/hr_timesheet_process.xml', |
7 | 'wizard/hr_timesheet_sign_in_out_view.xml', |
8 | + 'report/hr_timesheet_report_view.xml', |
9 | 'hr_timesheet_installer.xml', |
10 | 'hr_timesheet_data.xml' |
11 | ], |
12 | |
13 | === modified file 'hr_timesheet/report/__init__.py' |
14 | --- hr_timesheet/report/__init__.py 2011-12-19 16:54:40 +0000 |
15 | +++ hr_timesheet/report/__init__.py 2014-04-24 10:40:00 +0000 |
16 | @@ -21,6 +21,6 @@ |
17 | |
18 | import user_timesheet |
19 | import users_timesheet |
20 | - |
21 | +import hr_timesheet_report |
22 | |
23 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
24 | |
25 | === added file 'hr_timesheet/report/hr_timesheet_report.py' |
26 | --- hr_timesheet/report/hr_timesheet_report.py 1970-01-01 00:00:00 +0000 |
27 | +++ hr_timesheet/report/hr_timesheet_report.py 2014-04-24 10:40:00 +0000 |
28 | @@ -0,0 +1,97 @@ |
29 | +# -*- coding: utf-8 -*- |
30 | +############################################################################## |
31 | +# |
32 | +# OpenERP, Open Source Management Solution |
33 | +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
34 | +# |
35 | +# This program is free software: you can redistribute it and/or modify |
36 | +# it under the terms of the GNU Affero General Public License as |
37 | +# published by the Free Software Foundation, either version 3 of the |
38 | +# License, or (at your option) any later version. |
39 | +# |
40 | +# This program is distributed in the hope that it will be useful, |
41 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
42 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
43 | +# GNU Affero General Public License for more details. |
44 | +# |
45 | +# You should have received a copy of the GNU Affero General Public License |
46 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
47 | +# |
48 | +############################################################################## |
49 | + |
50 | +from openerp import tools |
51 | +from openerp.osv import fields,osv |
52 | +from openerp.addons.decimal_precision import decimal_precision as dp |
53 | + |
54 | + |
55 | +class hr_timesheet_report(osv.osv): |
56 | + _name = "hr.timesheet.report" |
57 | + _description = "Timesheet" |
58 | + _auto = False |
59 | + _columns = { |
60 | + 'year': fields.char('Year',size=64,required=False, readonly=True), |
61 | + 'day': fields.char('Day', size=128, readonly=True), |
62 | + 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), |
63 | + ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), |
64 | + ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True), |
65 | + 'date': fields.date('Date', readonly=True), |
66 | + 'name': fields.char('Description', size=64,readonly=True), |
67 | + 'product_id' : fields.many2one('product.product', 'Product',readonly=True), |
68 | + 'journal_id' : fields.many2one('account.analytic.journal', 'Journal',readonly=True), |
69 | + 'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True), |
70 | + 'user_id': fields.many2one('res.users', 'User',readonly=True), |
71 | + 'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True), |
72 | + 'company_id': fields.many2one('res.company', 'Company',readonly=True), |
73 | + 'cost': fields.float('#Cost',readonly=True, digits_compute=dp.get_precision('Account')), |
74 | + 'quantity': fields.float('Time',readonly=True), |
75 | + } |
76 | + |
77 | + def _select(self): |
78 | + select_str = """ |
79 | + SELECT min(hat.id) as id, |
80 | + aal.date as date, |
81 | + to_char(aal.date, 'YYYY-MM-DD') as day, |
82 | + to_char(aal.date,'YYYY') as year, |
83 | + to_char(aal.date,'MM') as month, |
84 | + sum(aal.amount) as cost, |
85 | + sum(aal.unit_amount) as quantity, |
86 | + aal.account_id as account_id, |
87 | + aal.journal_id as journal_id, |
88 | + aal.product_id as product_id, |
89 | + aal.general_account_id as general_account_id, |
90 | + aal.user_id as user_id, |
91 | + aal.company_id as company_id, |
92 | + aal.currency_id as currency_id |
93 | + """ |
94 | + return select_str |
95 | + |
96 | + def _from(self): |
97 | + from_str = """ |
98 | + account_analytic_line as aal |
99 | + left join hr_analytic_timesheet as hat ON (hat.line_id=aal.id) |
100 | + """ |
101 | + return from_str |
102 | + |
103 | + def _group_by(self): |
104 | + group_by_str = """ |
105 | + GROUP BY aal.date, |
106 | + aal.account_id, |
107 | + aal.product_id, |
108 | + aal.general_account_id, |
109 | + aal.journal_id, |
110 | + aal.user_id, |
111 | + aal.company_id, |
112 | + aal.currency_id |
113 | + """ |
114 | + return group_by_str |
115 | + |
116 | + def init(self, cr): |
117 | + # self._table = hr_timesheet_report |
118 | + tools.drop_view_if_exists(cr, self._table) |
119 | + cr.execute("""CREATE or REPLACE VIEW %s as ( |
120 | + %s |
121 | + FROM ( %s ) |
122 | + %s |
123 | + )""" % (self._table, self._select(), self._from(), self._group_by())) |
124 | + |
125 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
126 | |
127 | === added file 'hr_timesheet/report/hr_timesheet_report_view.xml' |
128 | --- hr_timesheet/report/hr_timesheet_report_view.xml 1970-01-01 00:00:00 +0000 |
129 | +++ hr_timesheet/report/hr_timesheet_report_view.xml 2014-04-24 10:40:00 +0000 |
130 | @@ -0,0 +1,58 @@ |
131 | +<?xml version="1.0" encoding="utf-8"?> |
132 | +<openerp> |
133 | + <data> |
134 | + <record id="view_hr_timesheet_report_graph" model="ir.ui.view"> |
135 | + <field name="name">hr.timesheet.report.graph</field> |
136 | + <field name="model">hr.timesheet.report</field> |
137 | + <field name="arch" type="xml"> |
138 | + <graph string="Timesheet" type="pivot"> |
139 | + <field name="user_id" type="row"/> |
140 | + <field name="date" interval="day" type="col"/> |
141 | + <field name="quantity" type="measure"/> |
142 | + <field name="cost" type="measure"/> |
143 | + </graph> |
144 | + </field> |
145 | + </record> |
146 | + |
147 | + <record id="view_hr_timesheet_report_search" model="ir.ui.view"> |
148 | + <field name="name">hr.timesheet.report.search</field> |
149 | + <field name="model">hr.timesheet.report</field> |
150 | + <field name="arch" type="xml"> |
151 | + <search string="Timesheet"> |
152 | + <field name="account_id"/> |
153 | + <field name="user_id"/> |
154 | + <filter string="This Month" name="month" icon="terp-go-year" domain="[('date','<=', time.strftime('%Y-%m-%d')),('date','>=',time.strftime('%Y-%m-01'))]" help="month"/> |
155 | + <group expand="0" string="Extended Filters..."> |
156 | + <field name="general_account_id"/> |
157 | + <field name="product_id"/> |
158 | + <field name="journal_id"/> |
159 | + <field name="company_id" groups="base.group_multi_company"/> |
160 | + <field name="date"/> |
161 | + </group> |
162 | + <group expand="1" string="Group By..."> |
163 | + <filter string="User" name="group_user_id" icon="terp-personal" context="{'group_by':'user_id'}"/> |
164 | + <filter string="Product" name="product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/> |
165 | + <filter string="Analytic Account" name="analytic_account" icon="terp-folder-green" context="{'group_by':'account_id'}"/> |
166 | + <filter string="General Account" name="general_account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/> |
167 | + <filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/> |
168 | + <filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by day of date"/> |
169 | + <filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of date"/> |
170 | + <filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of date"/> |
171 | + </group> |
172 | + </search> |
173 | + </field> |
174 | + </record> |
175 | + |
176 | + <record id="action_hr_timesheet_report_stat_all" model="ir.actions.act_window"> |
177 | + <field name="name">Timesheet Analysis</field> |
178 | + <field name="res_model">hr.timesheet.report</field> |
179 | + <field name="view_type">form</field> |
180 | + <field name="view_mode">graph</field> |
181 | + <field name="context">{'search_default_year':1,'search_default_month':1,'search_default_group_user_id':1,'group_by_no_leaf':1,'group_by':[]}</field> |
182 | + </record> |
183 | + |
184 | + <menuitem action="action_hr_timesheet_report_stat_all" id="menu_hr_timesheet_report_all" |
185 | + parent="hr.menu_hr_reporting" groups="base.group_hr_manager" sequence="3"/> |
186 | + |
187 | + </data> |
188 | +</openerp> |
189 | |
190 | === modified file 'hr_timesheet_sheet/__openerp__.py' |
191 | --- hr_timesheet_sheet/__openerp__.py 2013-01-31 18:41:41 +0000 |
192 | +++ hr_timesheet_sheet/__openerp__.py 2014-04-24 10:40:00 +0000 |
193 | @@ -55,7 +55,6 @@ |
194 | 'process/hr_timesheet_sheet_process.xml', |
195 | 'board_hr_timesheet_view.xml', |
196 | 'report/hr_timesheet_report_view.xml', |
197 | - 'report/timesheet_report_view.xml', |
198 | 'wizard/hr_timesheet_current_view.xml', |
199 | 'hr_timesheet_sheet_data.xml', |
200 | 'res_config_view.xml', |
201 | |
202 | === modified file 'hr_timesheet_sheet/report/__init__.py' |
203 | --- hr_timesheet_sheet/report/__init__.py 2011-01-14 00:11:01 +0000 |
204 | +++ hr_timesheet_sheet/report/__init__.py 2014-04-24 10:40:00 +0000 |
205 | @@ -19,7 +19,7 @@ |
206 | # |
207 | ############################################################################## |
208 | |
209 | -import timesheet_report |
210 | import hr_timesheet_report |
211 | + |
212 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
213 | |
214 | |
215 | === removed file 'hr_timesheet_sheet/report/hr_timesheet_report.py' |
216 | --- hr_timesheet_sheet/report/hr_timesheet_report.py 2014-01-27 13:03:51 +0000 |
217 | +++ hr_timesheet_sheet/report/hr_timesheet_report.py 1970-01-01 00:00:00 +0000 |
218 | @@ -1,75 +0,0 @@ |
219 | -# -*- coding: utf-8 -*- |
220 | -############################################################################## |
221 | -# |
222 | -# OpenERP, Open Source Management Solution |
223 | -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
224 | -# |
225 | -# This program is free software: you can redistribute it and/or modify |
226 | -# it under the terms of the GNU Affero General Public License as |
227 | -# published by the Free Software Foundation, either version 3 of the |
228 | -# License, or (at your option) any later version. |
229 | -# |
230 | -# This program is distributed in the hope that it will be useful, |
231 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
232 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
233 | -# GNU Affero General Public License for more details. |
234 | -# |
235 | -# You should have received a copy of the GNU Affero General Public License |
236 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
237 | -# |
238 | -############################################################################## |
239 | - |
240 | -from openerp import tools |
241 | -from openerp.osv import fields,osv |
242 | -from openerp.addons.decimal_precision import decimal_precision as dp |
243 | - |
244 | - |
245 | -class hr_timesheet_report(osv.osv): |
246 | - _name = "hr.timesheet.report" |
247 | - _description = "Timesheet" |
248 | - _auto = False |
249 | - _columns = { |
250 | - 'date': fields.date('Date', readonly=True), |
251 | - 'name': fields.char('Description', size=64,readonly=True), |
252 | - 'product_id' : fields.many2one('product.product', 'Product',readonly=True), |
253 | - 'journal_id' : fields.many2one('account.analytic.journal', 'Journal',readonly=True), |
254 | - 'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True), |
255 | - 'user_id': fields.many2one('res.users', 'User',readonly=True), |
256 | - 'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True), |
257 | - 'company_id': fields.many2one('res.company', 'Company',readonly=True), |
258 | - 'cost': fields.float('Cost',readonly=True, digits_compute=dp.get_precision('Account')), |
259 | - 'quantity': fields.float('Time',readonly=True), |
260 | - } |
261 | - |
262 | - def init(self, cr): |
263 | - tools.drop_view_if_exists(cr, 'hr_timesheet_report') |
264 | - cr.execute(""" |
265 | - create or replace view hr_timesheet_report as ( |
266 | - select |
267 | - min(t.id) as id, |
268 | - l.date as date, |
269 | - sum(l.amount) as cost, |
270 | - sum(l.unit_amount) as quantity, |
271 | - l.account_id as account_id, |
272 | - l.journal_id as journal_id, |
273 | - l.product_id as product_id, |
274 | - l.general_account_id as general_account_id, |
275 | - l.user_id as user_id, |
276 | - l.company_id as company_id, |
277 | - l.currency_id as currency_id |
278 | - from |
279 | - hr_analytic_timesheet as t |
280 | - left join account_analytic_line as l ON (t.line_id=l.id) |
281 | - group by |
282 | - l.date, |
283 | - l.account_id, |
284 | - l.product_id, |
285 | - l.general_account_id, |
286 | - l.journal_id, |
287 | - l.user_id, |
288 | - l.company_id, |
289 | - l.currency_id |
290 | - ) |
291 | - """) |
292 | - |
293 | -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
294 | |
295 | === renamed file 'hr_timesheet_sheet/report/timesheet_report.py' => 'hr_timesheet_sheet/report/hr_timesheet_report.py' |
296 | --- hr_timesheet_sheet/report/timesheet_report.py 2013-11-27 15:32:57 +0000 |
297 | +++ hr_timesheet_sheet/report/hr_timesheet_report.py 2014-04-24 10:40:00 +0000 |
298 | @@ -22,28 +22,14 @@ |
299 | from openerp import tools |
300 | from openerp.osv import fields,osv |
301 | |
302 | -class timesheet_report(osv.osv): |
303 | - _name = "timesheet.report" |
304 | - _description = "Timesheet" |
305 | - _auto = False |
306 | +class hr_timesheet_report(osv.osv): |
307 | + _inherit = "hr.timesheet.report" |
308 | _columns = { |
309 | - 'year': fields.char('Year',size=64,required=False, readonly=True), |
310 | - 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'), |
311 | - ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'), |
312 | - ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True), |
313 | - 'day': fields.char('Day', size=128, readonly=True), |
314 | - 'date': fields.date('Date', readonly=True), |
315 | - 'name': fields.char('Description', size=64,readonly=True), |
316 | - 'product_id' : fields.many2one('product.product', 'Product'), |
317 | - 'general_account_id' : fields.many2one('account.account', 'General Account', readonly=True), |
318 | - 'user_id': fields.many2one('res.users', 'User',readonly=True), |
319 | 'to_invoice': fields.many2one('hr_timesheet_invoice.factor', 'Type of Invoicing',readonly=True), |
320 | - 'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True), |
321 | 'nbr': fields.integer('#Nbr',readonly=True), |
322 | 'total_diff': fields.float('#Total Diff',readonly=True), |
323 | 'total_timesheet': fields.float('#Total Timesheet',readonly=True), |
324 | 'total_attendance': fields.float('#Total Attendance',readonly=True), |
325 | - 'company_id': fields.many2one('res.company', 'Company',readonly=True), |
326 | 'department_id':fields.many2one('hr.department','Department',readonly=True), |
327 | 'date_from': fields.date('Date from',readonly=True,), |
328 | 'date_to': fields.date('Date to',readonly=True), |
329 | @@ -53,28 +39,14 @@ |
330 | ('draft','Draft'), |
331 | ('confirm','Confirmed'), |
332 | ('done','Done')], 'Status', readonly=True), |
333 | - 'quantity': fields.float('Time',readonly=True), |
334 | - 'cost': fields.float('#Cost',readonly=True), |
335 | } |
336 | |
337 | - def init(self, cr): |
338 | - tools.drop_view_if_exists(cr, 'timesheet_report') |
339 | - cr.execute(""" |
340 | - create or replace view timesheet_report as ( |
341 | - select |
342 | - min(aal.id) as id, |
343 | + def _select(self): |
344 | + return super(hr_timesheet_report, self)._select() + """, |
345 | htss.name, |
346 | - aal.date as date, |
347 | htss.date_from, |
348 | htss.date_to, |
349 | - to_char(htss.date_from, 'YYYY-MM-DD') as day, |
350 | - to_char(htss.date_from, 'YYYY') as year, |
351 | - to_char(htss.date_from, 'MM') as month, |
352 | count(*) as nbr, |
353 | - aal.unit_amount as quantity, |
354 | - aal.amount as cost, |
355 | - aal.account_id, |
356 | - aal.product_id, |
357 | (SELECT sum(day.total_difference) |
358 | FROM hr_timesheet_sheet_sheet AS sheet |
359 | LEFT JOIN hr_timesheet_sheet_sheet_day AS day |
360 | @@ -88,31 +60,23 @@ |
361 | LEFT JOIN hr_timesheet_sheet_sheet_day AS day |
362 | ON (sheet.id = day.sheet_id) where sheet.id=htss.id) as total_attendance, |
363 | aal.to_invoice, |
364 | - aal.general_account_id, |
365 | - htss.user_id, |
366 | - htss.company_id, |
367 | htss.department_id, |
368 | - htss.state |
369 | - from account_analytic_line as aal |
370 | - left join hr_analytic_timesheet as hat ON (hat.line_id=aal.id) |
371 | - left join hr_timesheet_sheet_sheet as htss ON (hat.sheet_id=htss.id) |
372 | - group by |
373 | - aal.account_id, |
374 | - aal.date, |
375 | + htss.state""" |
376 | + |
377 | + def _from(self): |
378 | + return super(hr_timesheet_report, self)._from() + "left join hr_timesheet_sheet_sheet as htss ON (hat.sheet_id=htss.id)" |
379 | + |
380 | + def _group_by(self): |
381 | + return super(hr_timesheet_report, self)._group_by() + """, |
382 | htss.date_from, |
383 | htss.date_to, |
384 | aal.unit_amount, |
385 | aal.amount, |
386 | aal.to_invoice, |
387 | - aal.product_id, |
388 | - aal.general_account_id, |
389 | htss.name, |
390 | - htss.company_id, |
391 | htss.state, |
392 | htss.id, |
393 | - htss.department_id, |
394 | - htss.user_id |
395 | - ) |
396 | - """) |
397 | + htss.department_id""" |
398 | + |
399 | |
400 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
401 | |
402 | === removed file 'hr_timesheet_sheet/report/hr_timesheet_report_view.xml' |
403 | --- hr_timesheet_sheet/report/hr_timesheet_report_view.xml 2014-01-30 13:17:37 +0000 |
404 | +++ hr_timesheet_sheet/report/hr_timesheet_report_view.xml 1970-01-01 00:00:00 +0000 |
405 | @@ -1,65 +0,0 @@ |
406 | -<?xml version="1.0" encoding="utf-8"?> |
407 | -<openerp> |
408 | - <data> |
409 | - <record id="view_hr_timesheet_report_graph" model="ir.ui.view"> |
410 | - <field name="name">hr.timesheet.report.graph</field> |
411 | - <field name="model">hr.timesheet.report</field> |
412 | - <field name="arch" type="xml"> |
413 | - <graph string="Timesheet" type="pivot"> |
414 | - <field name="user_id" type="row"/> |
415 | - <field name="date" interval="day" type="col"/> |
416 | - <field name="quantity" type="measure"/> |
417 | - <field name="cost" type="measure"/> |
418 | - </graph> |
419 | - </field> |
420 | - </record> |
421 | - <record id="view_hr_timesheet_report_search" model="ir.ui.view"> |
422 | - <field name="name">hr.timesheet.report.search</field> |
423 | - <field name="model">hr.timesheet.report</field> |
424 | - <field name="arch" type="xml"> |
425 | - <search string="Timesheet"> |
426 | - <filter icon="terp-go-year" string="This Month" name="month" domain="[('date','<=', time.strftime('%Y-%m-%d')),('date','>=',time.strftime('%Y-%m-01'))]" help="month"/> |
427 | - <field name="account_id" groups="analytic.group_analytic_accounting"/> |
428 | - <field name="user_id"/> |
429 | - <group expand="0" string="Extended Filters..."> |
430 | - <field name="general_account_id"/> |
431 | - <field name="product_id"/> |
432 | - <field name="journal_id"/> |
433 | - <field name="company_id" groups="base.group_multi_company"/> |
434 | - <field name="date" /> |
435 | - </group> |
436 | - <group expand="1" string="Group By..."> |
437 | - <filter string="User" name="group_user_id" icon="terp-personal" context="{'group_by':'user_id'}"/> |
438 | - <filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/> |
439 | - <filter string="Analytic Account" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/> |
440 | - <filter string="General Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/> |
441 | - <filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/> |
442 | - <filter string="Date (day)" context="{'group_by':'date:day'}" help="Group by day of date"/> |
443 | - <filter string="Date (month)" context="{'group_by':'date:month'}" help="Group by month of date"/> |
444 | - <filter string="Date (year)" context="{'group_by':'date:year'}" help="Group by year of date"/> |
445 | - </group> |
446 | - </search> |
447 | - </field> |
448 | - </record> |
449 | - |
450 | - <record id="action_hr_timesheet_report_stat_all" model="ir.actions.act_window"> |
451 | - <field name="name">Timesheet Analysis</field> |
452 | - <field name="res_model">hr.timesheet.report</field> |
453 | - <field name="view_type">form</field> |
454 | - <field name="view_mode">graph</field> |
455 | - <field name="context">{'search_default_month':1,'search_default_group_user_id':1,'group_by_no_leaf':1,'group_by':[]}</field> |
456 | - <field name="help" type="html"> |
457 | - <p> |
458 | - This report performs analysis on timesheets created by your |
459 | - human resources in the system. It allows you to have a full |
460 | - overview of entries done by your employees. You can group them |
461 | - by specific selection criteria thanks to the search tool. |
462 | - </p> |
463 | - </field> |
464 | - </record> |
465 | - <menuitem |
466 | - action="action_hr_timesheet_report_stat_all" |
467 | - id="menu_hr_timesheet_report_all" |
468 | - parent="hr.menu_hr_reporting" sequence="3"/> |
469 | - </data> |
470 | -</openerp> |
471 | |
472 | === renamed file 'hr_timesheet_sheet/report/timesheet_report_view.xml' => 'hr_timesheet_sheet/report/hr_timesheet_report_view.xml' |
473 | --- hr_timesheet_sheet/report/timesheet_report_view.xml 2014-01-30 13:20:07 +0000 |
474 | +++ hr_timesheet_sheet/report/hr_timesheet_report_view.xml 2014-04-24 10:40:00 +0000 |
475 | @@ -3,64 +3,47 @@ |
476 | <data> |
477 | <record id="view_timesheet_report_graph" model="ir.ui.view"> |
478 | <field name="name">timesheet.report.graph</field> |
479 | - <field name="model">timesheet.report</field> |
480 | + <field name="model">hr.timesheet.report</field> |
481 | + <field name="inherit_id" ref="hr_timesheet.view_hr_timesheet_report_graph"/> |
482 | <field name="arch" type="xml"> |
483 | - <graph string="Timesheet" type="pivot" stacked="True"> |
484 | - <field name="user_id" type="row"/> |
485 | + <field name="user_id" position="after"> |
486 | <field name="state" type="row"/> |
487 | - <field name="quantity" type="measure"/> |
488 | - <field name="cost" type="measure"/> |
489 | + </field> |
490 | + <field name="cost" position="after"> |
491 | <field name="total_diff" type="measure"/> |
492 | <field name="total_timesheet" type="measure"/> |
493 | <field name="total_attendance" type="measure"/> |
494 | - </graph> |
495 | + </field> |
496 | </field> |
497 | </record> |
498 | + |
499 | <record id="view_timesheet_report_search" model="ir.ui.view"> |
500 | <field name="name">timesheet.report.search</field> |
501 | - <field name="model">timesheet.report</field> |
502 | + <field name="model">hr.timesheet.report</field> |
503 | + <field name="inherit_id" ref="hr_timesheet.view_hr_timesheet_report_search"/> |
504 | <field name="arch" type="xml"> |
505 | - <search string="Timesheet"> |
506 | + <field name="account_id" position="before"> |
507 | <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]"/> |
508 | <filter icon="terp-camera_test" string="Confirmed" domain="[('state','=','confirm')]"/> |
509 | <filter icon="terp-dialog-close" string="Done" domain="[('state','=','done')]"/> |
510 | - <field name="account_id"/> |
511 | - <field name="user_id" /> |
512 | - <group expand="0" string="Extended Filters..."> |
513 | - <field name="general_account_id"/> |
514 | - <field name="to_invoice"/> |
515 | - <field name="product_id"/> |
516 | - <field name="department_id"/> |
517 | - <field name="company_id" groups="base.group_multi_company"/> |
518 | - <field name="date_to"/> |
519 | - <field name="date_from"/> |
520 | - </group> |
521 | - <group expand="1" string="Group By..."> |
522 | - <filter string="User" name="User_id" icon="terp-personal" context="{'group_by':'user_id'}"/> |
523 | - <filter string="Department" icon="terp-personal+" context="{'group_by':'department_id'}"/> |
524 | - <filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/> |
525 | - <filter string="Type of Invoicing" icon="terp-stock_symbol-selection" context="{'group_by':'to_invoice'}"/> |
526 | - <filter string="Analytic Account" icon="terp-folder-green" context="{'group_by':'account_id'}"/> |
527 | - <filter string="General Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/> |
528 | - <filter string="Status" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/> |
529 | - <filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/> |
530 | - <filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by day of date"/> |
531 | - <filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Group by month of date"/> |
532 | - <filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Group by year of date"/> |
533 | - </group> |
534 | - </search> |
535 | + </field> |
536 | + <field name="general_account_id" position="after"> |
537 | + <field name="to_invoice"/> |
538 | + <field name="department_id"/> |
539 | + <field name="date_to"/> |
540 | + <field name="date_from"/> |
541 | + </field> |
542 | + <filter name="product" position="before"> |
543 | + <filter string="Department" icon="terp-personal+" context="{'group_by':'department_id'}"/> |
544 | + </filter> |
545 | + <filter name="analytic_account" position="before"> |
546 | + <filter string="Type of Invoicing" icon="terp-stock_symbol-selection" context="{'group_by':'to_invoice'}"/> |
547 | + </filter> |
548 | + <filter name="general_account" position="after"> |
549 | + <filter string="Status" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/> |
550 | + </filter> |
551 | </field> |
552 | </record> |
553 | |
554 | - <record id="action_timesheet_report_stat_all" model="ir.actions.act_window"> |
555 | - <field name="name">Timesheet Sheet Analysis</field> |
556 | - <field name="res_model">timesheet.report</field> |
557 | - <field name="view_type">form</field> |
558 | - <field name="view_mode">graph</field> |
559 | - <field name="context">{'search_default_year':1,'search_default_month':1,'search_default_User_id':1,'group_by_no_leaf':1,'group_by':[]}</field> |
560 | - <field name="search_view_id" ref="view_timesheet_report_search"/> |
561 | - </record> |
562 | - <menuitem action="action_timesheet_report_stat_all" id="menu_timesheet_report_all" |
563 | - parent="hr.menu_hr_reporting" sequence="4" groups="base.group_hr_manager"/> |
564 | </data> |
565 | </openerp> |
566 | |
567 | === modified file 'hr_timesheet_sheet/security/ir.model.access.csv' |
568 | --- hr_timesheet_sheet/security/ir.model.access.csv 2013-10-27 12:31:04 +0000 |
569 | +++ hr_timesheet_sheet/security/ir.model.access.csv 2014-04-24 10:40:00 +0000 |
570 | @@ -6,4 +6,3 @@ |
571 | access_hr_timesheet_report,hr.timesheet.report,model_hr_timesheet_report,base.group_hr_manager,1,1,0,0 |
572 | access_hr_analytic_timesheet_system_user,hr.analytic.timesheet.system.user,model_hr_analytic_timesheet,base.group_user,1,0,0,0 |
573 | access_hr_timesheet_sheet_sheet_day,hr.timesheet.sheet.sheet.day.user,model_hr_timesheet_sheet_sheet_day,base.group_user,1,1,1,0 |
574 | -access_timesheet_report,timesheet.report,model_timesheet_report,base.group_hr_manager,1,1,0,0 |