Odoo Help
Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM
|
e-Commerce
|
Accounting
|
Inventory
|
PoS
|
Project management
|
MRP
|
etc.
leaves and salary calculation.
hi. Any one please tell me how to reduce the salary of an employee who take leave.
eg: salary=5000
he/she take one leave in a month , then reduce rs.100 from his salary. Ie then remaining salary is 4900.How to configure this in openerp v7.0.
i assigned a salary rule (Deduction Towards Leave Availed) to salary structure.
there is a field for adding python code in this rule. how to implement my need through python code. please help..
Hi
You need to add salary rule to salary structure to deduct (add python code)
result=-(contract.wage/30)*worked_days.Unpaid.number_of_days
then you can deduct from salary depending on number of Unpaid leave taken by employee
and you need to put the condition for this rule (Not Always True )
result=worked_days.Unpaid and worked_days.Unpaid.number_of_days or False
Regards
I have 4 types of leaves(Sick,legal,casual,unpaid). how can i generalize this? Did i want to create 4 separate salary rule?
@Remya you can use unpaid for unpaid leave and put salary rule for it (you can put more than one salary rule as you want)
@charlesaj first you should installed holiday model and have leave (named unpaid )
hi.. that error conditions occured at i calculate the payslip for employee who did n't take leave. The error is like. Error!
Wrong python code defined for salary rule Deduction Towards Leave Availed (DLA).
OK , But when Employee have unpaid leave will work successfully ,you just need condition to the salary rule (Not Always True ) (the condition will check if employee have leave then apply salary rule else don't do anything ) -I have edit my answer vote up and select as correct answer if solved your problem -
ok now the problem is ok.. for employees without have leaves.. inorder to calculate the salary deduction(for leave days) from it i use "result= (contract.wage)*worked_days.Unpaid and worked_days.Unpaid.number_of_days or False". This will return the error. any way to implement it..
sorry i use result= (contract.wage/30)*worked_days.Unpaid and worked_days.Unpaid.number_of_days or False
Same thing can be done for Half Day leaves also. You have to create leave type as half day and use the same code (replace unpaid with half day) and divide by 2
@charlesraj use the code in my answer please and tell me what the problem you need 1- salary rule 2- condition for this salary rule
sir i need to calculate the deduction for the leave days..ie. Now for one unpaid leave 1 is reduced from the net salary . But i want to deduce the total salary of particular leave day from the net salary..
condition for the salary rule.. Deduct the salary(days which employee take leaves) from the net salary .
do not understand , the deduction should be from Basic salary my dear , other deduction you can put it as input (by value or do code for it) hope that help you
i want to put code in the salary rule. now i applied your code. it make the deduction of salary for the number of leave taken. ie: what i say is If He/She take one leave ONE will be deduced from the net salary..
Thank sir it work for me....i will add like this....result=-(worked_days.Unpaid and worked_days.Unpaid.number_of_days*(contract.wage/30)) or False ...
I added same rule and condition but it will not affecting on calculation of payslip amounts and so on....even that rule is not appearing on Payslip form view after clicked on compute sheet
About This Community
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.
RegisterOdoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.
Test it nowQuestion tools
Stats
Asked: 6/14/13, 4:52 AM |
Seen: 14816 times |
Last updated: 2/18/18, 3:55 AM |