Compare commits
48 Commits
552518cfe1
...
49e7b97e09
| Author | SHA1 | Date |
|---|---|---|
|
|
49e7b97e09 | |
|
|
d22519d53c | |
|
|
7667090b96 | |
|
|
14bb2bc740 | |
|
|
9954df1063 | |
|
|
229947f7e7 | |
|
|
e61817542b | |
|
|
a1e38df43f | |
|
|
fafe56f11e | |
|
|
e99290e923 | |
|
|
0b094d5d91 | |
|
|
bebdf67b85 | |
|
|
b31e1ca05d | |
|
|
f4c7dbca2f | |
|
|
40cf14cfed | |
|
|
d3cb63931f | |
|
|
b5c0db13b3 | |
|
|
5665434c06 | |
|
|
9d2ccd7bf6 | |
|
|
69ff3fc472 | |
|
|
cc099dcf65 | |
|
|
12906c27b7 | |
|
|
18587884d3 | |
|
|
215efe83b0 | |
|
|
7975c10a8d | |
|
|
4cbb45bb35 | |
|
|
5f1279027f | |
|
|
a2fa677510 | |
|
|
72b993938f | |
|
|
5ab7206139 | |
|
|
a1dd936e92 | |
|
|
dc5884b49b | |
|
|
1c34616fe2 | |
|
|
52c2084ca5 | |
|
|
f8ec754f23 | |
|
|
e123ee062a | |
|
|
c138aa19bd | |
|
|
811d7b01e1 | |
|
|
7c8779c01f | |
|
|
3730ea8e2f | |
|
|
ee9434a224 | |
|
|
20a006b714 | |
|
|
cf45af32e9 | |
|
|
a58d0fa863 | |
|
|
1933ea8195 | |
|
|
25d9b0b464 | |
|
|
69b502124f | |
|
|
a6c3bbc3bc |
|
|
@ -309,7 +309,7 @@ attendanceLines.forEach(line => {
|
|||
const dateStr = createDate.toLocaleDateString('en-IN', { timeZone: 'Asia/Kolkata' });
|
||||
|
||||
const workedHours = parseFloat(line.worked_hours);
|
||||
const working_hours = ''
|
||||
|
||||
const checkIn = new Date(line.check_in + 'Z');
|
||||
const checkOut = new Date(line.check_out + 'Z');
|
||||
|
||||
|
|
@ -320,7 +320,6 @@ attendanceLines.forEach(line => {
|
|||
groupedLines[dateStr] = {
|
||||
create_date: dateStr,
|
||||
worked_hours: workedHours,
|
||||
working_hours: `${Math.floor(workedHours)}h ${Math.round((workedHours - Math.floor(workedHours)) * 60)}m`,
|
||||
check_in: checkInStr,
|
||||
check_out: checkOutStr,
|
||||
earliestCheckIn: checkIn,
|
||||
|
|
@ -347,7 +346,6 @@ attendanceLines.forEach(line => {
|
|||
const groupedAttendance = Object.values(groupedLines).map(line => ({
|
||||
create_date: line.create_date,
|
||||
worked_hours: line.worked_hours.toFixed(2),
|
||||
working_hours :line.working_hours,
|
||||
check_in: line.check_in,
|
||||
check_out: line.check_out
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@
|
|||
</td>
|
||||
<td t-esc="line['check_out']">
|
||||
</td>
|
||||
<td t-esc="line['working_hours']">
|
||||
<td t-esc="line['worked_hours']">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
|
|||
|
|
@ -7,10 +7,9 @@ import pytz
|
|||
|
||||
from collections import defaultdict, Counter
|
||||
from datetime import date, datetime, time
|
||||
from datetime import timedelta
|
||||
|
||||
from dateutil.relativedelta import relativedelta
|
||||
from functools import reduce
|
||||
|
||||
from odoo import api, Command, fields, models, _
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
from odoo.tools import float_round, date_utils, convert_file, format_amount
|
||||
|
|
@ -1379,29 +1378,6 @@ class HrPayslip(models.Model):
|
|||
for file_to_update in files_to_update:
|
||||
convert_file(self.env, module_name, file_to_update, idref)
|
||||
|
||||
|
||||
def days_count(self):
|
||||
joining_date = self.contract_id.date_start
|
||||
date_from = min(joining_date, self.date_from)
|
||||
if joining_date > date_from:
|
||||
|
||||
# Define weekend days (Saturday and Sunday)
|
||||
weekend_days = [5, 6] # 5 = Saturday, 6 = Sunday
|
||||
|
||||
# Count weekends between date_from and date_to
|
||||
weekend_count = 0
|
||||
current_date = date_from
|
||||
while current_date <= joining_date:
|
||||
if current_date.weekday() in weekend_days:
|
||||
weekend_count += 1
|
||||
current_date += timedelta(days=1)
|
||||
|
||||
# Output: number of weekly offs since joining
|
||||
weekend_days_count = weekend_count
|
||||
else:
|
||||
weekend_days_count = 0
|
||||
return weekend_days_count
|
||||
|
||||
def action_edit_payslip_lines(self):
|
||||
self.ensure_one()
|
||||
if not self.env.user.has_group('hr_payroll.group_hr_payroll_manager'):
|
||||
|
|
|
|||
Loading…
Reference in New Issue