Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
2231 Vizualizări

Odoo16 attendance app total work hours are connected to payroll in payslip area


I want to know in which file they are connected so I can change the column value. I want that instead of value of  Work hours from attendance app I want to take the value of  Daily hours column in attendance line in in payroll pay slip and add the line called as overtime where I can take the value of  Extra Hours . daily and extra hours are custom made.

 

 


Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

The work hours is calculated using a compute function defined in the hr_payslip.py file in the hr_payroll module.

this is the function,

@api.depends('worked_days_line_ids.number_of_hours', 'worked_days_line_ids.is_paid')
def _compute_worked_hours(self):
for payslip in self:
payslip.sum_worked_hours = sum([line.number_of_hours for line in payslip.worked_days_line_ids])

You can try applying your logic here using your custom module

Thanks

Imagine profil
Abandonează
Autor

here it only use all the line which are present in the Worked Days & Inputs to sum them
here i can not work. my main problem is i want to compute salary on the basis of attendance but in attendance there are always two things 1 daily actual working hours 2 over time hours . right now i can compute the salary with the code logic but in that logic i got a problem for example if the employee is present for 21 out of 23 working days and in those working days employee have 25 extra hours
now assume monthly salary of employee is 5000
total working hours in month =23*8 =184
employee worked = 21*8 =168
extra hours =25
monthly wage in hours=5000/184 =27.1739
employee wage for month =168*27.1739 =4,565.2173
employee wage for extra hours =25*27.1739*2= 1,358.6956
total should be paid to employee =4,565.2173 +1,358.6956 =5,923.9129

but my code is doing that it will first minus the from extra hours to complete the
monthly hours target 184 means
total required monthly hours=168+16=184
now remaining extra hours =25-16=9
the the calculation become like this
basic salary=184*27.1739=5000
extra hours salary=9*27.1739*2=489.1302
now total salary =5,489.1302

thats my real problem

Related Posts Răspunsuri Vizualizări Activitate
3
dec. 24
4396
1
mai 24
1471
2
iun. 17
5725
0
ian. 25
1534
1
mar. 25
1512