Merge lp:~openerp-dev/openobject-addons/7.0-bug-1172257-avo into lp:openobject-addons/7.0

Proposed by Amit Vora(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-bug-1172257-avo
Merge into: lp:openobject-addons/7.0
Diff against target: 86 lines (+19/-8)
4 files modified
hr_timesheet_sheet/hr_timesheet_sheet_demo.xml (+9/-0)
hr_timesheet_sheet/report/hr_timesheet_report.py (+6/-5)
hr_timesheet_sheet/report/hr_timesheet_report_view.xml (+2/-2)
hr_timesheet_sheet/report/timesheet_report.py (+2/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-bug-1172257-avo
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+207428@code.launchpad.net

Description of the change

Hello,

        I have fixed Reporting / Human Resources / Timesheet Analysis and group by user display wrong.
        I have also fixed Reporting / Human Resources / Timesheet sheet Analysis and group by user display undefine

Thanks.
avo

To post a comment you must log in.
9850. By Amit Vora(OpenERP)

[MERGE] merge with main branch

9851. By Amit Vora(OpenERP)

[MRG] merge with main branch

9852. By Amit Vora(OpenERP)

[MRG] merge with main branch

9853. By Amit Vora(OpenERP)

[IMP] add demo data for hr_timesheet_sheet module

9854. By Amit Vora(OpenERP)

[IMP] default group by user_id and account_id

9855. By Amit Vora(OpenERP)

[MRG] merge with main branch

9856. By Amit Vora(OpenERP)

[IMP] improve code

9857. By Amit Vora(OpenERP)

[IMP] set proper indentation

Unmerged revisions

9857. By Amit Vora(OpenERP)

[IMP] set proper indentation

9856. By Amit Vora(OpenERP)

[IMP] improve code

9855. By Amit Vora(OpenERP)

[MRG] merge with main branch

9854. By Amit Vora(OpenERP)

[IMP] default group by user_id and account_id

9853. By Amit Vora(OpenERP)

[IMP] add demo data for hr_timesheet_sheet module

9852. By Amit Vora(OpenERP)

[MRG] merge with main branch

9851. By Amit Vora(OpenERP)

[MRG] merge with main branch

9850. By Amit Vora(OpenERP)

[MERGE] merge with main branch

9849. By Amit Vora(OpenERP)

[FIX] improve query for hr_timesheet report

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet_demo.xml'
2--- hr_timesheet_sheet/hr_timesheet_sheet_demo.xml 2012-11-29 22:26:45 +0000
3+++ hr_timesheet_sheet/hr_timesheet_sheet_demo.xml 2014-05-08 12:52:12 +0000
4@@ -8,5 +8,14 @@
5 <field name="employee_id" ref="hr.employee_fp" />
6 </record>
7 -->
8+ <record id="sheet1" model="hr_timesheet_sheet.sheet">
9+ <field name="name">Sheet 1</field>
10+ <field name="user_id" ref="base.user_root"/>
11+ <field eval="time.strftime('%Y-%m-%d')" name="date_from"/>
12+ <field eval="time.strftime('%Y-%m-%d')" name="date_to"/>
13+ <field name="employee_id" ref="hr.employee"/>
14+ <field name="company_id" ref="base.main_company"/>
15+ <field name="state">draft</field>
16+ </record>
17 </data>
18 </openerp>
19
20=== modified file 'hr_timesheet_sheet/report/hr_timesheet_report.py'
21--- hr_timesheet_sheet/report/hr_timesheet_report.py 2012-12-17 15:23:03 +0000
22+++ hr_timesheet_sheet/report/hr_timesheet_report.py 2014-05-08 12:52:12 +0000
23@@ -52,12 +52,11 @@
24 create or replace view hr_timesheet_report as (
25 select
26 min(t.id) as id,
27- l.date as date,
28- to_char(l.date, 'YYYY-MM-DD') as day,
29- to_char(l.date,'YYYY') as year,
30- to_char(l.date,'MM') as month,
31 sum(l.amount) as cost,
32 sum(l.unit_amount) as quantity,
33+ to_char(htss.date_from, 'YYYY-MM-DD') as day,
34+ to_char(htss.date_from, 'YYYY') as year,
35+ to_char(htss.date_from, 'MM') as month,
36 l.account_id as account_id,
37 l.journal_id as journal_id,
38 l.product_id as product_id,
39@@ -68,8 +67,10 @@
40 from
41 hr_analytic_timesheet as t
42 left join account_analytic_line as l ON (t.line_id=l.id)
43+ left join hr_timesheet_sheet_sheet as htss ON (t.sheet_id=htss.id)
44+ where t.sheet_id IS NOT NULL
45 group by
46- l.date,
47+ htss.id,
48 l.account_id,
49 l.product_id,
50 l.general_account_id,
51
52=== modified file 'hr_timesheet_sheet/report/hr_timesheet_report_view.xml'
53--- hr_timesheet_sheet/report/hr_timesheet_report_view.xml 2012-11-29 22:26:45 +0000
54+++ hr_timesheet_sheet/report/hr_timesheet_report_view.xml 2014-05-08 12:52:12 +0000
55@@ -48,7 +48,7 @@
56 <group expand="1" string="Group By...">
57 <filter string="User" name="group_user_id" icon="terp-personal" context="{'group_by':'user_id'}"/>
58 <filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
59- <filter string="Analytic Account" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/>
60+ <filter string="Analytic Account" name="group_account_id" icon="terp-folder-green" context="{'group_by':'account_id'}" groups="analytic.group_analytic_accounting"/>
61 <filter string="General Account" icon="terp-folder-orange" context="{'group_by':'general_account_id'}"/>
62 <filter string="Company" icon="terp-go-home" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
63 <filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Group by day of date"/>
64@@ -64,7 +64,7 @@
65 <field name="res_model">hr.timesheet.report</field>
66 <field name="view_type">form</field>
67 <field name="view_mode">tree,graph</field>
68- <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>
69+ <field name="context">{'search_default_year':1,'search_default_month':1,'search_default_group_user_id':1,'search_default_group_account_id':1,'group_by_no_leaf':1,'group_by':[]}</field>
70 <field name="help" type="html">
71 <p>
72 This report performs analysis on timesheets created by your
73
74=== modified file 'hr_timesheet_sheet/report/timesheet_report.py'
75--- hr_timesheet_sheet/report/timesheet_report.py 2013-11-25 14:26:24 +0000
76+++ hr_timesheet_sheet/report/timesheet_report.py 2014-05-08 12:52:12 +0000
77@@ -111,7 +111,8 @@
78 htss.state,
79 htss.id,
80 htss.department_id,
81- htss.user_id
82+ htss.user_id,
83+ aal.id
84 )
85 """)
86 timesheet_report()