Merge lp:~openerp-dev/openobject-addons/7.0-OPW-605016-dhs into lp:openobject-addons/7.0

Proposed by Dhruti Shastri(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-OPW-605016-dhs
Merge into: lp:openobject-addons/7.0
Diff against target: 37 lines (+7/-2)
2 files modified
hr_holidays/hr_holidays.py (+5/-0)
hr_holidays/hr_holidays_view.xml (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-OPW-605016-dhs
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+218076@code.launchpad.net

Description of the change

Install hr_holidays :

Create Employee A, having related user different from 'admin'.

Create Allocation Request with Leave Type : Legal Leaves, for Employee A, approve it.

Generate 2-3 different Leave Request for this employee.

Issue Leave counter doesn't work properly.

To post a comment you must log in.

Unmerged revisions

10030. By Dhruti Shastri(OpenERP)

[FIX][hr_holidays] : Leave counter doesn't display correct number of leaves(case : 605016)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_holidays/hr_holidays.py'
2--- hr_holidays/hr_holidays.py 2013-04-15 15:06:55 +0000
3+++ hr_holidays/hr_holidays.py 2014-05-02 13:30:37 +0000
4@@ -96,6 +96,11 @@
5 if not ids:
6 return []
7 res = []
8+ emp_id = context.get('employee_id',False)
9+ if not emp_id:
10+ res = super(hr_holidays_status, self).name_get(cr, uid, ids, context=context)
11+ return res
12+
13 for record in self.browse(cr, uid, ids, context=context):
14 name = record.name
15 if not record.limit:
16
17=== modified file 'hr_holidays/hr_holidays_view.xml'
18--- hr_holidays/hr_holidays_view.xml 2013-06-11 11:57:00 +0000
19+++ hr_holidays/hr_holidays_view.xml 2014-05-02 13:30:37 +0000
20@@ -64,7 +64,7 @@
21 <group>
22 <group>
23 <field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
24- <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
25+ <field name="holiday_status_id" context="{'employee_id':employee_id}" options='{"always_reload": True}'/>
26 <label for="number_of_days_temp" string="Duration" help="The default duration interval between the start date and the end date is 8 hours. Feel free to adapt it to your needs."/>
27 <div>
28 <group col="3">
29@@ -109,7 +109,7 @@
30 <group>
31 <group>
32 <field name="name" required="1" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
33- <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
34+ <field name="holiday_status_id" context="{'employee_id':employee_id}" options='{"always_reload": True}' />
35 <label for="number_of_days_temp"/>
36 <div>
37 <field name="number_of_days_temp" class="oe_inline"/> days