Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
pengyuthon
2026-02-09 08:57:43 +08:00
3 changed files with 19 additions and 1 deletions
@@ -50,12 +50,18 @@ class XLSXReportController(http.Controller):
report_obj.get_xlsx_salary_report(options, response)
elif report_name == '请假情况报表':
report_obj.get_xlsx_leave_report(options, response)
elif report_name == '归档请假情况报表':
report_obj.get_xlsx_leave_report(options, response)
elif report_name == '加班明细报表':
report_obj.get_xlsx_overtime_report(options, response)
elif report_name == '加班详情报表':
report_obj.get_xlsx_overtime_detail_report(options, response)
elif report_name == '加班归档明细报表':
report_obj.get_xlsx_overtime_active_report(options, response)
elif report_name == '误餐明细报表':
report_obj.get_xlsx_meal_report(options, response)
elif report_name == '误餐归档明细报表':
report_obj.get_xlsx_meal_active_report(options, response)
else:
report_obj.get_xlsx_report(options, response)
response.set_cookie('fileToken', token)
@@ -1390,7 +1390,19 @@ class ReportExcel(models.Model):
for rec in records:
col = 0
for field_name in data['fields_name']:
# 特殊处理:vacation.meal.active 没有 department_id,通过 employee_id 获取
if field_name == 'department_id' and 'department_id' not in rec._fields:
value = rec.employee_id.department_id.display_name if rec.employee_id and rec.employee_id.department_id else ''
sheet.write(row, col, value, data_format)
col += 1
continue
field = rec._fields.get(field_name)
if not field:
sheet.write(row, col, '', data_format)
col += 1
continue
value = rec[field_name]
if isinstance(value, datetime.datetime):
if value:
@@ -6,7 +6,7 @@
<field name="arch" type="xml">
<form string="打印薪资">
<group>
<field name="year"/>
<field name="year" widget="integer" options="{'type': 'number'}"/>
<field name="month"/>
<field name="export_type" invisible="1"/>
<field name="model_name" invisible="1"/>