Merge pull request #4055 from expsa/samir-aladawi-improve-leave-reports

[UPD] hr_holidays_public
This commit is contained in:
SamirLADOUI-sa 2025-07-30 11:02:17 +01:00 committed by GitHub
commit e72b64e511
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 73 additions and 49 deletions

View File

@ -918,6 +918,14 @@ msgstr "اجازات الموظف"
msgid "Employee NO"
msgstr "رقم الموظف"
#. module: hr_holidays_public
#: code:addons/hr_holidays_public/wizards/holiday_public_leave_report_wiz.py:0
#: model_terms:ir.ui.view,arch_db:hr_holidays_public.all_leave_report_template
#: model_terms:ir.ui.view,arch_db:hr_holidays_public.specified_leave_report_template
#, python-format
msgid "Employee Number"
msgstr "الرقم الوظيفي"
#. module: hr_holidays_public
#: code:addons/hr_holidays_public/report/public_leave_cost.py:0
#: code:addons/hr_holidays_public/report/public_leave_cost.py:0
@ -1454,7 +1462,7 @@ msgstr "إصدار تذكرة؟"
#: model_terms:ir.ui.view,arch_db:hr_holidays_public.specified_leave_report_template
#, python-format
msgid "Job"
msgstr "العمل"
msgstr "المسمى الوظيفي"
#. module: hr_holidays_public
#: model:ir.model.fields,field_description:hr_holidays_public.field_buy_vacation__job_id
@ -1925,14 +1933,14 @@ msgstr "مولود جديد"
#: code:addons/hr_holidays_public/wizards/holiday_public_leave_report_wiz.py:0
#: code:addons/hr_holidays_public/wizards/holiday_public_leave_report_wiz.py:0
#, python-format
msgid "New Leave Balance"
msgstr " الرصيد الجديد"
msgid "Remaining Leave Balance"
msgstr "الرصيد المتبقي"
#. module: hr_holidays_public
#: model_terms:ir.ui.view,arch_db:hr_holidays_public.all_leave_report_template
#: model_terms:ir.ui.view,arch_db:hr_holidays_public.specified_leave_report_template
msgid "New Leave balance"
msgstr "الرصيد الجديد"
msgid "Remaining Leave balance"
msgstr "الرصيد المتبقي"
#. module: hr_holidays_public
#: model:ir.model.fields,field_description:hr_holidays_public.field_buy_vacation__activity_date_deadline
@ -3404,7 +3412,7 @@ msgstr "محتوى الملف"
#. module: hr_holidays_public
#: model_terms:ir.ui.view,arch_db:hr_holidays_public.specified_leave_report_template
msgid "from"
msgstr ""
msgstr "من"
#. module: hr_holidays_public
#: model:ir.model,name:hr_holidays_public.model_holiday_status_duration

View File

@ -19,17 +19,18 @@
<tr>
<th>Sequence</th>
<th>Iqama</th>
<th>Employee Number</th>
<th>Name</th>
<th>Nationality</th>
<th>Job</th>
<th>Department</th>
<th>Leave Type</th>
<th>Working begin Start Date</th>
<!-- <th>Working begin Start Date</th> -->
<th>Leave Start Date</th>
<th>Leave end Date</th>
<th>Leave Balance</th>
<th>Leave days</th>
<th>New Leave balance</th>
<th>Remaining Leave balance</th>
</tr>
</thead>
<tbody>
@ -41,6 +42,9 @@
<td>
<t t-esc="line['iqama_number']"/>
</td>
<td>
<t t-esc="line['employee_number']"/>
</td>
<td style="width: 1.5in;">
<t t-esc="line['employee_id']"/>
</td>
@ -56,9 +60,9 @@
<td>
<t t-esc="line['leave_type_name']"/>
</td>
<td>
<!-- <td>
<t t-esc="line['start_day_work']"/>
</td>
</td> -->
<td>
<t t-esc="line['leave_start_date'].date() if line['leave_start_date'] else ''"/>
</td>
@ -131,17 +135,18 @@
<thead>
<tr>
<th>Iqama</th>
<th>Employee Number</th>
<th>Name</th>
<th>Nationality</th>
<th>Job</th>
<th>Department</th>
<th>Leave Type</th>
<th>Working begin Start Date</th>
<!-- <th>Working begin Start Date</th> -->
<th>Leave Start Date</th>
<th>Leave end Date</th>
<th>Leave Balance</th>
<th>Leave days</th>
<th>New Leave balance</th>
<th>Remaining Leave balance</th>
</tr>
</thead>
<tbody>
@ -150,6 +155,9 @@
<td>
<t t-esc="line['iqama_number']"/>
</td>
<td>
<t t-esc="line['employee_number']"/>
</td>
<td style="width: 1.5in;">
<t t-esc="line['employee_id']"/>
</td>
@ -165,9 +173,9 @@
<td>
<t t-esc="line['leave_type_name']"/>
</td>
<td>
<!-- <td>
<t t-esc="line['start_day_work']"/>
</td>
</td> -->
<td>
<t t-esc="line['leave_start_date']" t-options="{'widget': 'date'}"/>

View File

@ -114,6 +114,7 @@ class ReportHolidayPublic(models.AbstractModel):
else:
iqama_number = holiday.employee_id.iqama_number.iqama_id
data.append({
'employee_number': holiday.employee_id.emp_no,
'employee_id': holiday.employee_id.name,
'iqama_number': iqama_number,
'nationality': holiday.employee_id.country_id.name,
@ -211,45 +212,48 @@ class HolidayReportXls(models.AbstractModel):
format2.set_align('vcenter')
if type == 'all':
sheet.merge_range('D3:G3', _("Leave Report"), format2)
sheet.write(6, 2, _('Name'), format2)
sheet.write(6, 2, _('Iqama'), format2)
sheet.set_column('C:C', 20)
sheet.write(6, 3, _('Iqama'), format2)
sheet.write(6, 3, _('Name'), format2)
sheet.set_column('D:D', 20)
sheet.write(6, 4, _('Nationality'), format2)
sheet.write(6, 3, _('Name'), format2)
sheet.set_column('E:E', 20)
sheet.write(6, 5, _('Job'), format2)
sheet.write(6, 4, _('Nationality'), format2)
sheet.set_column('F:F', 20)
sheet.write(6, 6, _("Department"), format2)
sheet.write(6, 5, _('Job'), format2)
sheet.set_column('G:G', 20)
sheet.write(6, 7, _("Working begin Start Date"), format2)
sheet.write(6, 6, _("Department"), format2)
sheet.set_column('H:H', 20)
sheet.write(6, 8, _("Holiday Type"), format2)
# sheet.write(6, 7, _("Working begin Start Date"), format2)
# sheet.set_column('H:H', 20)
sheet.write(6, 7, _("Holiday Type"), format2)
sheet.set_column('I:I', 20)
sheet.write(6, 9, _("Holiday Start"), format2)
sheet.write(6, 8, _("Holiday Start"), format2)
sheet.set_column('J:J', 20)
sheet.write(6, 10, _("Holiday End"), format2)
sheet.write(6, 9, _("Holiday End"), format2)
sheet.set_column('K:K', 20)
sheet.write(6, 11, _("Number of Days"), format2)
sheet.write(6, 10, _("Leave count"), format2)
sheet.set_column('L:L', 10)
# sheet.write(6, 12, _("Leave count"), format2)
# sheet.set_column('M:M', 10)
sheet.write(6, 12, _("New Leave Balance"), format2)
sheet.set_column('M:M', 20)
sheet.write(6, 11, _("Number of Days"), format2)
sheet.set_column('M:M', 10)
sheet.write(6, 12, _("Remaining Leave Balance"), format2)
sheet.set_column('N:N', 20)
row = 6
for line in final_dic:
row += 1
sheet.write(row, 2, line['employee_id'], format2)
sheet.write(row, 3, line['iqama_number'], format2)
sheet.write(row, 4, line['nationality'], format2)
sheet.write(row, 5, line['job'], format2)
sheet.write(row, 6, line['department'], format2)
sheet.write(row, 7, line['start_day_work'].strftime('%d/%m/%Y'), format2)
sheet.write(row, 2, line['iqama_number'], format2)
sheet.write(row, 3, line['employee_number'], format2)
sheet.write(row, 4, line['employee_id'], format2)
sheet.write(row, 5, line['nationality'], format2)
sheet.write(row, 6, line['job'], format2)
sheet.write(row, 7, line['department'], format2)
# sheet.write(row, 7, line['start_day_work'].strftime('%d/%m/%Y'), format2)
sheet.write(row, 8, line['leave_type_name'], format2)
sheet.write(row, 9, line['leave_start_date'].strftime('%d/%m/%Y'), format2)
sheet.write(row, 10, line['leave_end_date'].strftime('%d/%m/%Y'), format2)
sheet.write(row, 11, line['number_of_days'], format2)
# sheet.write(row, 12, line['leave_count'], format2)
sheet.write(row, 12, line['remaining_leave'], format2)
sheet.write(row, 11, line['leave_count'], format2)
sheet.write(row, 12, line['number_of_days'], format2)
sheet.write(row, 13, line['remaining_leave'], format2)
#
tot_row = row + 3
x = tot_row
@ -280,12 +284,13 @@ class HolidayReportXls(models.AbstractModel):
sheet.merge_range('F4:G4', _("To date"), format2)
sheet.write(3, 3, str(start_date)[0:10], format2)
sheet.write(3, 7, str(end_date)[0:10], format2)
sheet.write(row - 2, n, _('Name'), format2)
sheet.write(row - 2, n, _('Iqama'), format2)
sheet.set_column('B:B', 16)
sheet.set_column('C:C', 16)
sheet.set_column('D:D', 16)
sheet.write(row - 2, n + 2, _('Iqama'), format2)
sheet.write(row - 2, n + 4, _('Nationality'), format2)
sheet.write(row - 2, n + 2, _('Employee Number'), format2)
sheet.write(row - 2, n + 4, _('Name'), format2)
sheet.write(row - 2, n + 6, _('Nationality'), format2)
sheet.set_column('E:E', 10)
sheet.set_column('F:F', 10)
sheet.set_column('G:G', 10)
@ -301,23 +306,26 @@ class HolidayReportXls(models.AbstractModel):
sheet.set_column('Q:Q', 16)
sheet.write(row - 2, n + 6, _('Job'), format2)
sheet.write(row - 2, n + 8, _('Department'), format2)
sheet.write(row - 2, n + 10, _('Working begin Start Date'), format2)
# sheet.write(row - 2, n + 10, _('Working begin Start Date'), format2)
# sheet.write(row-2, n + 12, _('End work day'), format2)
sheet.write(row - 2, n + 12, _('New Leave Balance'), format2)
sheet.write(row - 2, n + 10, _('Leave Count'), format2)
sheet.write(row - 2, n + 12, _('Remaining Leave Balance'), format2)
sheet.write(row, n, _('Holiday Type'), format2)
sheet.write(row, n + 1, _('Holiday Start'), format2)
sheet.write(row, n + 2, _('Holiday End'), format2)
sheet.write(row, n + 3, _('Number of Days'), format2)
data_row = row + 1
for line in final_dic[key]:
sheet.write(row - 2, n + 1, line['employee_id'], format2)
sheet.write(row - 2, n + 3, line['iqama_number'], format2)
sheet.write(row - 2, n + 5, line['nationality'], format2)
sheet.write(row - 2, n + 7, line['job'], format2)
sheet.write(row - 2, n + 9, line['department'], format2)
sheet.write(row - 2, n + 11, line['start_day_work'], format2)
sheet.write(row - 2, n + 1, line['iqama_number'], format2)
sheet.write(row - 2, n + 3, line['employee_number'], format2)
sheet.write(row - 2, n + 5, line['employee_id'], format2)
sheet.write(row - 2, n + 7, line['nationality'], format2)
sheet.write(row - 2, n + 9, line['job'], format2)
sheet.write(row - 2, n + 11, line['department'], format2)
# sheet.write(row - 2, n + 11, line['start_day_work'], format2)
# sheet.write(row - 2, n + 13, line['end_day_work'], format2)
sheet.write(row - 2, n + 13, line['remaining_leave'], format2)
sheet.write(row - 2, n + 13, line['leave_count'], format2)
sheet.write(row - 2, n + 15, line['remaining_leave'], format2)
sheet.write(data_row, n, line['leave_type_name'], format2)
sheet.write(data_row, n + 1, line['leave_start_date'].strftime('%d/%m/%Y'), format2)
sheet.write(data_row, n + 2, line['leave_end_date'].strftime('%d/%m/%Y'), format2)