Merge lp:~openerp-dev/openobject-addons/trunk-bug-1089600-dhr into lp:openobject-addons

Proposed by Dharti Ratani(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1089600-dhr
Merge into: lp:openobject-addons
Diff against target: 11 lines (+1/-0)
1 file modified
hr_payroll/hr_payroll.py (+1/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1089600-dhr
Reviewer Review Type Date Requested Status
Ajay Patel (OpenERP) (community) Disapprove
OpenERP Core Team Pending
Review via email: mp+141713@code.launchpad.net

Description of the change

Hello,

     Changed the code for leave types in salary rule to be able to calculate worked days without error.

Thanks.
dhr

To post a comment you must log in.
8490. By Dharti Ratani(OpenERP)

[MERGE]merged with trunk

8491. By Dharti Ratani(OpenERP)

[IMP]Converted leave type to lower case

Revision history for this message
Ajay Patel (OpenERP) (ajay-openerp) wrote :

Hello,

Can't adopt the proposed fix as it forces user to perform pythonic operation (like you did in code .replace) in **Leave Types** names if user leave calculation on Salary Slip. When we define salary rules and we choose python code and put some python code this solution make user force to converstation and create some rule and afterwards if leave rule name get change or Even if installtion other language and leave type get translated the Salary Slip calculation stop wroking :( not good.

For now current code which is keeping smiller names will keep easier to configure for end user(not sure good).
Rather we need more concrete and user friendly solution for this some code based calculation.

For now rejecting the MP.
--
Thank You
Amit Patel

review: Disapprove

Unmerged revisions

8491. By Dharti Ratani(OpenERP)

[IMP]Converted leave type to lower case

8490. By Dharti Ratani(OpenERP)

[MERGE]merged with trunk

8489. By Dharti Ratani(OpenERP)

[FIX]By default taking code in worked days in payslip with '_' by replacing with ' ' as salary rules are not working if there is any space in code

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_payroll/hr_payroll.py'
2--- hr_payroll/hr_payroll.py 2012-12-17 15:23:03 +0000
3+++ hr_payroll/hr_payroll.py 2013-01-18 09:09:23 +0000
4@@ -441,6 +441,7 @@
5 #the employee had to work
6 leave_type = was_on_leave(contract.employee_id.id, day_from + timedelta(days=day), context=context)
7 if leave_type:
8+ leave_type = leave_type.replace(' ','_').lower()
9 #if he was on leave, fill the leaves dict
10 if leave_type in leaves:
11 leaves[leave_type]['number_of_days'] += 1.0

Subscribers

People subscribed via source and target branches

to all changes: