# Need Unpaid Leave Salary Calculation

By
sridhar
on 3/26/13, 3:02 AM 8,645 views

How to calculate Unpaid Leave, it is not reducing in the Net salary, i also tried in the salary rule for the following formula

``````result=(contract.wage/31)*worked_days.Unpaid.number_of_days
``````

I put this calculation but I get server error. anybody help me.

Thanks & Regards Sridharan G Chennai

#### Hilar AK

--Hilar AK--
5160
| 5 4 8
India
--Hilar AK--
##### http://stackoverflow.com/users/7561347/burmese-pythisQoura:                https://www.quora.com/profile/Hilar-Ak-1
Hilar AK
On 6/29/17, 4:41 AM

Hi, You can check this blog by Cybrosys  about Unpaid leaves and its payslip calculations here

Maath
On 5/11/13, 5:56 AM

In additional to '@Mustufa Rangwala' solution you need to add condition to avoid error when employee do not have any unpaid leave I was explain that at this link:

How can we calculate Overtime in openerp

Atul Kumar jain
on 11/26/14, 2:04 AM
sridhar
On 3/26/13, 6:15 AM

I Got a Answer for this problem but not updating in the gross amount. "result=-(contract.wage/31)*worked_days.Unpaid.number_of_days"

Sridharan Chennai

How can we calculate Overtime in openerp

Atul Kumar jain
on 11/26/14, 2:06 AM
sengottuvel
On 11/13/13, 3:25 AM

Hi...My requirement is result = total wage will be divided into total working days of month * total present days of employee of this month..I have a own modules and it contains total working day and total present of month for each employee..Kindly tell me the solution to achieve my result

#### Mustufa Rangwala (mra)

--Mustufa Rangwala (mra)--
873
| 2 1 4
--Mustufa Rangwala (mra)--

- Around 7+ years of strong experience in Odoo (Formerly OpenERP) which is world's largest Open Source Business Applications driven by CEO Fabien Pinckaers. - Played key role in developing and maintaining various Odoo Product modules and integrating them on Open Source ERP Environment. - Experience on Scrum methodology for project management - Experience in Team Building - Quick Start Implementations. - Worked on almost all versions (4.0, 5.0, 6.0, 6.1, 7.0, SAAS, Trunk(8.0)...) of Odoo (Formerly OpenERP) . Specialities: Odoo Business Process And OpenERP Implementation. Odoo Application Support and Maintenance. Odoo Technical & Functional Training. Business Process Mapping & Gap Analysis (Functional and Technical Analysis)

Mustufa Rangwala (mra)
On 3/26/13, 3:48 AM

First of all you have to create Leave type called "Unpaid" and then create Leave request for employee and approve it.

After creating leave type and leave request you have to create salary rule and add that rule on employee salary structure..

Now create Payslip it will come overthere.

Regards, Mustufa Rangwala

Thanks For Reply Same procedure i already i followed but yet i didn't get result "result=(contract.wage/31)*worked_days.Unpaid.number_of_days" this code is correct or not i'm using OpenERP 7 , help me. Thanks & Regards Sridharan G Chennai

sridhar
on 3/26/13, 3:58 AM

@Mustufa Rangwala the code result=(contract.wage/31)*worked_days.Unpaid.number_of_days calculate the total of Unpaid leaves but we need total at that month and there is error when employee do not have an Unpaid leave , how to solve this problems , Or if we can build new module to calculate that , Please help ....

Maath
on 5/6/13, 5:52 AM

@Maath I am also having the same issue.. i think we can have a python condition check because it will be always "TRUE" so it wont allow if they doesnt have unpaid leaves.. i tried that condition also but it failed because of having "Unpaid" object

Ajmal
on 5/6/13, 9:22 AM

@Ajmal , Oky , and what about the total leaves for each month I try with payslip Bach and every thing is Oky and there is no error

Maath
on 5/6/13, 10:20 AM

@Maath Unpaid rules added in Salary Structure for an employee means, it didn't accept batch concept same error Python code Error Plese check it my DB

sridhar
on 5/6/13, 10:28 AM

@all : How to deduct the salary of the employee if he is absent without taking any leaves.?? Plz Help

Raminder Pal Singh
on 5/9/13, 7:27 AM

@all: Error when using this python code if employee dont have any leave. Is there a method to solve this.??

Raminder Pal Singh
on 5/9/13, 9:00 AM

@Raminder Pal Singh I think there is may be error in the system , But when I create a Bach for salary then there is no error , I am also need for deduct the salary of the employee if he is absent without taking any leaves , I think we should create new module .. if you want to share our work and contact on skype I think there is other developer want to do the same .

Maath
on 5/9/13, 9:27 AM

@maath the error remains when we creates salary batch.

Raminder Pal Singh
on 5/9/13, 10:25 AM

@Raminder Pal Singh I think there is may be error in the system , I think we should create new module .. if you want to share the work then will contact on skype

Maath
on 5/9/13, 7:04 PM

@maath I am not a python programmer. but we can contact to discuss this issue. You can mail me ur skype id on rps023@gmail.com

Raminder Pal Singh
on 5/10/13, 2:41 AM

Maath
on 5/11/13, 5:52 AM

@Ajmal the problem finally solved I am adding new answer for this question .. vote up if helped you

Maath
on 5/11/13, 7:51 AM

@maath thanks a lot. this works FINALLY

Raminder Pal Singh
on 5/11/13, 4:54 PM

@maath Thank you .. It Works !!

Ajmal
on 5/13/13, 5:46 AM

@Ajmal Can U Vote up may question and answer too , it is take more time to solve and if you search in all sites will not founded ! I found it in French Site

Maath
on 5/13/13, 6:06 AM

for Basic LWP I have set condition "result=worked_days.Unpaid and worked_days.Unpaid.number_of_days or False" and computation "result = -(contract.wage *.4)/((worked_days.Unpaid.number_of_days+worked_days.WORK100.number_of_days) * worked_days.Unpaid.number_of_days)"...its works fine in Payslip...but through Batch its reflect nothing...any suggestion ?

BBindaslife, Debashis Das
on 7/20/13, 2:42 PM
Debashis Das
On 7/21/13, 4:03 AM

for Basic LWP I have set condition "result=worked_days.Unpaid and worked_days.Unpaid.number_of_days or False" and computation "result = -(contract.wage *.4)/((worked_days.Unpaid.number_of_days+worked_days.WORK100.number_of_days) * worked_days.Unpaid.number_of_days)"...its works fine in Payslip...but through Batch its reflect nothing...any suggestion ?

Hi...My requirement is result = total wage will be divided into total working days of month * total present days of employee of this month..I have a own modules and it contains total working day and total present of month for each employee..Kindly tell me the solution to achieve my result

sengottuvel
on 11/13/13, 3:23 AM

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

### Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

3 follower(s)

### Stats

 Asked: 3/26/13, 3:02 AM Seen: 8645 times Last updated: 6/29/17, 4:41 AM