@@ -9,17 +9,20 @@
|
||||
'security/ir.model.access.csv',
|
||||
'security/yuthon_holiday_group.xml',
|
||||
'data/yuthon_holiday_data.xml',
|
||||
# 报表文件需先加载,供后续视图/按钮引用
|
||||
'report/hr_leave_batch_report_template.xml',
|
||||
'report/hr_leave_batch_report_action.xml',
|
||||
'views/inherit_hr_type_views.xml',
|
||||
'views/inherit_hr_leave_allocation_views.xml',
|
||||
'views/inherit_hr_leave_accrual_plan_views.xml',
|
||||
'views/hr_leave_accrual_views.xml',
|
||||
'views/yuthon_fixes_approval_views.xml',
|
||||
'views/hr_leave_batch.xml',
|
||||
'views/yuthon_breastfeed_leave_views.xml',
|
||||
'views/yuthon_holiday_setting_views.xml',
|
||||
'wizard/yuthon_fixes_wizard_views.xml',
|
||||
'wizard/leave_allocation_wizard_views.xml',
|
||||
'wizard/yuthon_leave_wizard_views.xml',
|
||||
'views/hr_leave_batch.xml',
|
||||
],
|
||||
'assets': {
|
||||
'web.assets_backend': [
|
||||
|
||||
@@ -485,78 +485,104 @@ class HolidaysRequestBatch(models.Model):
|
||||
return date_ranges
|
||||
|
||||
def _create_overtime_leave_line(self, period_start, leave_data, hours, period, leave_type_name):
|
||||
"""为补休类型创建加班明细行(vacation.over.line),类型为减少,值赋给workday"""
|
||||
"""为补休类型创建加班明细行(vacation.over.line),类型为减少,值赋给workday(增加重复校验)"""
|
||||
# 1. 计算报表月份的起始和结束日期,简化代码结构
|
||||
report_month = date(period_start.year, period_start.month, 1)
|
||||
month_end = date(period_start.year, period_start.month,
|
||||
calendar.monthrange(period_start.year, period_start.month)[1])
|
||||
|
||||
# 2. 查询对应的假期报表记录
|
||||
vacation_report = self.env['yuthon.vacation.reports'].search([
|
||||
('employee_id', '=', self.users_id.employee_ids.id),
|
||||
('vacation_date', '>=', fields.Date.to_string(report_month)),
|
||||
('vacation_date', '<=', fields.Date.to_string(
|
||||
date(period_start.year, period_start.month,
|
||||
calendar.monthrange(period_start.year, period_start.month)[1]))
|
||||
)
|
||||
('vacation_date', '<=', fields.Date.to_string(month_end))
|
||||
], limit=1)
|
||||
self.env['vacation.over.line'].create({
|
||||
'vacation_id': vacation_report.id if vacation_report else False,
|
||||
'employee_id': self.users_id.employee_ids.id,
|
||||
'workflow_record_id': leave_data['workflow_id'],
|
||||
'update_type': 'reduce',
|
||||
'workday': hours,
|
||||
'legal_day': 0,
|
||||
'public_holidays': 0,
|
||||
'meal_number': 0,
|
||||
'update_date': fields.Date.today(),
|
||||
'is_void': False,
|
||||
'text': f"请假审批"
|
||||
})
|
||||
|
||||
existing_overtime_line = self.env['vacation.over.line'].search([
|
||||
('employee_id', '=', self.users_id.employee_ids.id),
|
||||
('workflow_record_id', '=', leave_data.get('workflow_id', False)),
|
||||
('update_type', '=', 'reduce'),
|
||||
('text', '=', '请假审批'),
|
||||
('is_void', '=', False),
|
||||
('workday', '=', hours),
|
||||
], limit=1)
|
||||
if not existing_overtime_line:
|
||||
self.env['vacation.over.line'].create({
|
||||
'vacation_id': vacation_report.id if vacation_report else False,
|
||||
'employee_id': self.users_id.employee_ids.id,
|
||||
'workflow_record_id': leave_data['workflow_id'],
|
||||
'update_type': 'reduce',
|
||||
'workday': hours,
|
||||
'legal_day': 0,
|
||||
'public_holidays': 0,
|
||||
'meal_number': 0,
|
||||
'update_date': fields.Date.today(),
|
||||
'is_void': False,
|
||||
'text': f"请假审批"
|
||||
})
|
||||
|
||||
def _create_annual_leave_line(self, period_start, leave_data, hours, period):
|
||||
"""更新年假记录,使用小时作为单位"""
|
||||
"""更新年假记录,使用小时作为单位(增加重复校验,避免重复创建)"""
|
||||
report_month = date(period_start.year, period_start.month, 1)
|
||||
month_end = date(period_start.year, period_start.month,
|
||||
calendar.monthrange(period_start.year, period_start.month)[1])
|
||||
vacation_report = self.env['yuthon.vacation.reports'].search([
|
||||
('employee_id', '=', self.users_id.employee_ids.id),
|
||||
('vacation_date', '>=', fields.Date.to_string(report_month)),
|
||||
('vacation_date', '<=', fields.Date.to_string(
|
||||
date(period_start.year, period_start.month,
|
||||
calendar.monthrange(period_start.year, period_start.month)[1]))
|
||||
)
|
||||
('vacation_date', '<=', fields.Date.to_string(month_end))
|
||||
], limit=1)
|
||||
|
||||
self.env['vacation.leave.line'].create({
|
||||
'vacation_id': vacation_report.id if vacation_report else False,
|
||||
'employee_id': self.users_id.employee_ids.id,
|
||||
'workflow_record_id': leave_data['workflow_id'],
|
||||
'update_type': 'reduce',
|
||||
'update_date': fields.Date.today(),
|
||||
'update_lines': hours,
|
||||
'is_void': False,
|
||||
'allocation_type': 'vacation',
|
||||
'text': f"请假审批"
|
||||
})
|
||||
existing_annual_leave_line = self.env['vacation.leave.line'].search([
|
||||
('employee_id', '=', self.users_id.employee_ids.id),
|
||||
('workflow_record_id', '=', leave_data.get('workflow_id', False)),
|
||||
('update_type', '=', 'reduce'),
|
||||
('allocation_type', '=', 'vacation'),
|
||||
('update_lines', '=', hours),
|
||||
('text', '=', '请假审批'),
|
||||
('is_void', '=', False),
|
||||
], limit=1)
|
||||
if not existing_annual_leave_line:
|
||||
self.env['vacation.leave.line'].create({
|
||||
'vacation_id': vacation_report.id if vacation_report else False,
|
||||
'employee_id': self.users_id.employee_ids.id,
|
||||
'workflow_record_id': leave_data['workflow_id'],
|
||||
'update_type': 'reduce',
|
||||
'update_date': fields.Date.today(),
|
||||
'update_lines': hours,
|
||||
'is_void': False,
|
||||
'allocation_type': 'vacation',
|
||||
'text': f"请假审批"
|
||||
})
|
||||
|
||||
def _create_other_leave_line(self, period_start, leave_data, days, period, leave_type_name):
|
||||
"""更新其他假期记录,使用小时作为单位"""
|
||||
holiday_type = self.env['hr.leave.type'].search([('name', '=', leave_type_name)], limit=1)
|
||||
report_month = date(period_start.year, period_start.month, 1)
|
||||
month_end = date(period_start.year, period_start.month,
|
||||
calendar.monthrange(period_start.year, period_start.month)[1])
|
||||
vacation_report = self.env['yuthon.vacation.reports'].search([
|
||||
('employee_id', '=', self.users_id.employee_ids.id),
|
||||
('vacation_date', '>=', fields.Date.to_string(report_month)),
|
||||
('vacation_date', '<=', fields.Date.to_string(
|
||||
date(period_start.year, period_start.month,
|
||||
calendar.monthrange(period_start.year, period_start.month)[1]))
|
||||
)
|
||||
('vacation_date', '<=', fields.Date.to_string(month_end))
|
||||
], limit=1)
|
||||
self.env['vacation.other.line'].create({
|
||||
'vacation_id': vacation_report.id if vacation_report else False,
|
||||
'employee_id': self.users_id.employee_ids.id,
|
||||
'workflow_record_id': leave_data['workflow_id'],
|
||||
'update_type': 'reduce',
|
||||
'lines': days,
|
||||
'holiday_type': holiday_type.id,
|
||||
'update_date': fields.Date.today(),
|
||||
'is_void': False,
|
||||
'text': f"请假审批"
|
||||
})
|
||||
existing_leave_line = self.env['vacation.other.line'].search([
|
||||
('employee_id', '=', self.users_id.employee_ids.id),
|
||||
('workflow_record_id', '=', leave_data.get('workflow_id', False)),
|
||||
('holiday_type', '=', holiday_type.id),
|
||||
('lines', '=', days),
|
||||
('update_type', '=', 'reduce'),
|
||||
('text', '=', '请假审批'),
|
||||
('is_void', '=', False),
|
||||
], limit=1)
|
||||
if not existing_leave_line:
|
||||
self.env['vacation.other.line'].create({
|
||||
'vacation_id': vacation_report.id if vacation_report else False,
|
||||
'employee_id': self.users_id.employee_ids.id,
|
||||
'workflow_record_id': leave_data['workflow_id'],
|
||||
'update_type': 'reduce',
|
||||
'lines': days,
|
||||
'holiday_type': holiday_type.id,
|
||||
'update_date': fields.Date.today(),
|
||||
'is_void': False,
|
||||
'text': f"请假审批"
|
||||
})
|
||||
|
||||
def update_attendance(self, employee_id, start_date, end_date, code):
|
||||
"""
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="action_hr_leave_batch_print" model="ir.actions.report">
|
||||
<field name="name">请假单</field>
|
||||
<field name="model">hr.leave.batch</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<!-- 与 QWeb 模板 t-name / template id 对应 -->
|
||||
<field name="report_name">yuthon_holiday.hr_leave_batch_print</field>
|
||||
<field name="report_file">yuthon_holiday.hr_leave_batch_print</field>
|
||||
<!-- 绑定模型,使用系统自动生成的 model external id -->
|
||||
<field name="binding_model_id" ref="model_hr_leave_batch"/>
|
||||
<field name="binding_type">report</field>
|
||||
<field name="print_report_name">'请假单 - %s' % (object.name or '')</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- PDF 打印模板:基于 hr.leave.batch 的 leave_ids/hour_leave_ids 汇总 -->
|
||||
<template id="hr_leave_batch_print">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<t t-call="web.external_layout">
|
||||
|
||||
<style type="text/css">
|
||||
/* 借鉴已正常打印的合同审查单,使用外部布局字体,固定宽度居中 */
|
||||
table { border-collapse: collapse; width: 800px; margin: 0 auto; table-layout: fixed; }
|
||||
td { border: 1px solid #000; padding: 6px; text-align: left; vertical-align: middle; font-size: 14px; }
|
||||
.title { text-align: center; font-weight: bold; font-size: 18px; padding: 8px 0 12px 0; }
|
||||
.header-cell { font-weight: bold; background-color: #d4e6f1; text-align: center; }
|
||||
.section-cell { background-color: #d4e6f1; text-align: center; font-weight: bold; }
|
||||
.center { text-align: center; }
|
||||
.bold { font-weight: bold; }
|
||||
.no-right-border { border-right: none !important; }
|
||||
.no-left-border { border-left: none !important; }
|
||||
/* 新增:审批详情统一居中 */
|
||||
.approval-center { text-align: center !important; }
|
||||
</style>
|
||||
|
||||
<!-- 预计算 -->
|
||||
<t t-set="annual_leaves" t-value="doc.leave_ids.filtered(lambda l: l.holiday_status_id.name == '年假')"/>
|
||||
<t t-set="overtime_leaves" t-value="doc.leave_ids.filtered(lambda l: l.holiday_status_id.name in ['补休','调休','值班调休'])"/>
|
||||
|
||||
<t t-set="annual_start" t-value="annual_leaves and annual_leaves.mapped('request_date_from') and min(annual_leaves.mapped('request_date_from')) or False"/>
|
||||
<t t-set="annual_end" t-value="annual_leaves and annual_leaves.mapped('request_date_to') and max(annual_leaves.mapped('request_date_to')) or False"/>
|
||||
<t t-set="annual_days" t-value="sum(annual_leaves.mapped('number_of_days_display')) if annual_leaves else 0"/>
|
||||
|
||||
<t t-set="ot_start" t-value="overtime_leaves and overtime_leaves.mapped('request_date_from') and min(overtime_leaves.mapped('request_date_from')) or False"/>
|
||||
<t t-set="ot_end" t-value="overtime_leaves and overtime_leaves.mapped('request_date_to') and max(overtime_leaves.mapped('request_date_to')) or False"/>
|
||||
<t t-set="ot_days" t-value="sum(overtime_leaves.mapped('number_of_days_display')) if overtime_leaves else 0"/>
|
||||
|
||||
<t t-set="hour_total" t-value="sum(doc.hour_leave_ids.mapped('leave_hours')) if doc.hour_leave_ids else 0"/>
|
||||
|
||||
<!-- 从可用额度字符串解析年假/补休数值,计算总时长 -->
|
||||
<t t-set="allowance_text" t-value="doc.holiday_allowance or ''"/>
|
||||
<t t-set="allowance_parts" t-value="(allowance_text or '').split(',')"/>
|
||||
<t t-set="allow_annual_raw" t-value="allowance_parts and allowance_parts[0] or ''"/>
|
||||
<t t-set="allow_ot_raw" t-value="len(allowance_parts) > 1 and allowance_parts[1] or ''"/>
|
||||
<t t-set="allow_annual_val" t-value="allow_annual_raw and ''.join([c for c in allow_annual_raw if (c.isdigit() or c=='.')]) or '0'"/>
|
||||
<t t-set="allow_ot_val" t-value="allow_ot_raw and ''.join([c for c in allow_ot_raw if (c.isdigit() or c=='.')]) or '0'"/>
|
||||
<t t-set="allow_total" t-value="(float(allow_annual_val or 0.0) if allow_annual_val else 0.0) + (float(allow_ot_val or 0.0) if allow_ot_val else 0.0)"/>
|
||||
<!-- 预先取按天/按小时的请假行,直接搜索保障拿到数据 -->
|
||||
<t t-set="day_leaves" t-value="doc.env['hr.leave'].sudo().search([('batch_id', '=', doc.id)])"/>
|
||||
<t t-set="hour_leaves" t-value="doc.env['hr.leave'].sudo().search([('hour_batch_id', '=', doc.id)])"/>
|
||||
|
||||
<!-- 标题 -->
|
||||
<div class="title">请假单</div>
|
||||
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width:20%"/>
|
||||
<col style="width:30%"/>
|
||||
<col style="width:20%"/>
|
||||
<col style="width:30%"/>
|
||||
</colgroup>
|
||||
|
||||
<!-- 事由 -->
|
||||
<tr>
|
||||
<td class="header-cell">事由</td>
|
||||
<td colspan="3"><span t-esc="doc.text"/></td>
|
||||
</tr>
|
||||
|
||||
<!-- 可用额度 -->
|
||||
<tr>
|
||||
<td class="header-cell">可用额度</td>
|
||||
<td colspan="3"><span t-esc="doc.holiday_allowance"/></td>
|
||||
</tr>
|
||||
|
||||
<!-- 总时长(= 可用额度中年假+补休) -->
|
||||
<tr>
|
||||
<td class="header-cell">时长</td>
|
||||
<td colspan="3">
|
||||
<span t-esc="allow_total"/> 天
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 按天请假明细:有按天行就显示,优先级高于小时 -->
|
||||
<t t-if="day_leaves">
|
||||
<tr>
|
||||
<td class="section-cell" colspan="4">按天请假</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell">天</td>
|
||||
<td class="header-cell">休假类型</td>
|
||||
<td class="header-cell">开始日期</td>
|
||||
<td class="header-cell">结束日期</td>
|
||||
</tr>
|
||||
<t t-foreach="day_leaves" t-as="l">
|
||||
<tr>
|
||||
<td class="center"><span t-esc="l.number_of_days_display"/></td>
|
||||
<td class="center"><span t-esc="l.holiday_status_id.name"/></td>
|
||||
<td class="center"><span t-esc="l.request_date_from and l.request_date_from.strftime('%Y-%m-%d') or ''"/></td>
|
||||
<td class="center"><span t-esc="l.request_date_to and l.request_date_to.strftime('%Y-%m-%d') or ''"/></td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<!-- 按小时请假明细:仅在存在按小时行且没有按天行时显示 -->
|
||||
<t t-if="(not day_leaves) and hour_leaves">
|
||||
<tr>
|
||||
<td class="section-cell" colspan="4">按小时请假</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell">请假小时</td>
|
||||
<td class="header-cell">休假类型</td>
|
||||
<td class="header-cell">请假日期</td>
|
||||
<td class="header-cell">开始-结束时间</td>
|
||||
</tr>
|
||||
<t t-foreach="hour_leaves" t-as="hl">
|
||||
<tr>
|
||||
<td class="center"><span t-esc="hl.leave_hours"/></td>
|
||||
<td class="center"><span t-esc="hl.holiday_status_id.name"/></td>
|
||||
<td class="center"><span t-esc="hl.request_date_from and hl.request_date_from.strftime('%Y-%m-%d') or ''"/></td>
|
||||
<td class="center">
|
||||
<span t-esc="hl.request_hour_from"/> ~ <span t-esc="hl.request_hour_to"/>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<!-- 审批详情 -->
|
||||
<tr>
|
||||
<td class="section-cell" colspan="4">审批详情</td>
|
||||
</tr>
|
||||
<t t-foreach="doc.log_ids.sorted('sequence')" t-as="log">
|
||||
<tr>
|
||||
<!-- 节点名称:保留center -->
|
||||
<!-- 若节点名称带“(物管)”等后缀,这里只取左侧文字 -->
|
||||
<td class="center" colspan="1">
|
||||
<span t-esc="log.name and log.name.split('(')[0] or ''"/>
|
||||
</td>
|
||||
<!-- 意见:添加approval-center 强制居中 -->
|
||||
<td class="no-right-border approval-center" colspan="2"><span t-esc="log.comment"/></td>
|
||||
<!-- 审批人-操作时间:添加approval-center 强制居中 -->
|
||||
<td class="no-left-border approval-center" colspan="1">
|
||||
<t t-if="log.done_by">
|
||||
<span t-esc="log.done_by.name"/> <span t-esc="log.lase_click_date and log.lase_click_date.strftime('%Y-%m-%d') or ''"/>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</table>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -18,6 +18,13 @@
|
||||
<field name="model">hr.leave.batch</field>
|
||||
<field name="arch" type="xml">
|
||||
<form create="0">
|
||||
<header>
|
||||
<button name="action_print_leave_batch"
|
||||
string="打印"
|
||||
type="object"
|
||||
class="btn-primary"
|
||||
/>
|
||||
</header>
|
||||
<sheet>
|
||||
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
|
||||
invisible="urgency_level != 'normal'"/>
|
||||
|
||||
@@ -177,24 +177,33 @@ class GoApprovals(models.Model):
|
||||
|
||||
def end_approval(self):
|
||||
if self.meal == 'yes':
|
||||
# 创建日志
|
||||
first_day = self.start_date.replace(day=1)
|
||||
reports_id = self.env['yuthon.vacation.reports'].search([
|
||||
('employee_id', '=', self.users_id.employee_id.id),
|
||||
('vacation_date', '=', first_day)
|
||||
])
|
||||
if not reports_id:
|
||||
return
|
||||
workflow_record_id = self.env['soong.workflow.record'].search([
|
||||
('code', '=', self.code)
|
||||
])
|
||||
meal_fee_value = (0, 0, {
|
||||
'vacation_id': reports_id.id,
|
||||
'update_type': 'add',
|
||||
'workflow_record_id': workflow_record_id.id,
|
||||
'update_date': fields.Datetime.now(),
|
||||
'update_lines': 1,
|
||||
'text': '审批'
|
||||
})
|
||||
reports_id.write({'meal_fee_ids': [meal_fee_value]})
|
||||
existing_meal_fee = self.env['yuthon.vacation.reports.meal.fee'].search([
|
||||
('vacation_id', '=', reports_id.id),
|
||||
('workflow_record_id', '=', workflow_record_id.id if workflow_record_id else False),
|
||||
('update_type', '=', 'add'),
|
||||
('text', '=', '审批'),
|
||||
('update_lines', '=', 1)
|
||||
])
|
||||
if not existing_meal_fee:
|
||||
meal_fee_value = (0, 0, {
|
||||
'vacation_id': reports_id.id,
|
||||
'update_type': 'add',
|
||||
'workflow_record_id': workflow_record_id.id if workflow_record_id else False,
|
||||
'update_date': fields.Datetime.now(),
|
||||
'update_lines': 1,
|
||||
'text': '审批'
|
||||
})
|
||||
reports_id.write({'meal_fee_ids': [meal_fee_value]})
|
||||
|
||||
for employee in self.employee_ids:
|
||||
if self.is_day:
|
||||
|
||||
@@ -65,9 +65,12 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="remarks"/>
|
||||
<field name="documents_ids" widget="preview_many2many"/>
|
||||
<!-- <field name="documents_ids" widget="preview_many2many"/>-->
|
||||
<field name="lawyer_opinion_ids" widget="preview_many2many"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="documents_ids" widget="preview_many2many"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -109,13 +109,13 @@
|
||||
<group>
|
||||
<field name="name" required="1" force_save="1" invisible="is_invisible_workflow" readonly="issue_state not in ['draft', 'cancel']"/>
|
||||
<field name="topic_content" invisible="is_invisible_workflow" readonly="issue_state not in ['draft', 'cancel']"/>
|
||||
<field name="handling_situation" string="办理情况(存在问题)" readonly="issue_state not in ['draft', 'cancel']"/>
|
||||
<field name="deliberation_content" readonly="issue_state not in ['draft', 'cancel']"/>
|
||||
<field name="will_based" readonly="issue_state not in ['draft', 'cancel']"/>
|
||||
<field name="is_legal_trial" readonly="issue_state not in ['draft', 'cancel']"/>
|
||||
<field name="department_personnel_ids" widget="many2many_tags" invisible="1"/>
|
||||
<field name="workflow_id" invisible="is_legal_trial == 'no'" domain="[('res_model', '=', 'contract.review.approval'), ('create_uid', 'in', department_personnel_ids)]" readonly="issue_state not in ['draft', 'cancel']"/>
|
||||
<field name="handling_situation" readonly="issue_state not in ['draft', 'cancel']"/>
|
||||
<field name="deliberation_content" readonly="issue_state not in ['draft', 'cancel']"/>
|
||||
<field name="documents_ids" widget="preview_many2many" invisible="is_invisible_workflow" readonly="issue_state not in ['draft', 'cancel']"/>
|
||||
<!--<field name="documents_ids" widget="preview_many2many" invisible="is_invisible_workflow" readonly="issue_state not in ['draft', 'cancel']"/>-->
|
||||
<field name="is_invisible_workflow" invisible="1"/>
|
||||
<field name="name_text" invisible="1"/>
|
||||
<field name="work_end" invisible="1"/>
|
||||
@@ -125,10 +125,12 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="employee_id" invisible="1"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
<field name="users_role_ids" invisible="1" widget="many2many_tags"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="documents_ids" widget="preview_many2many" invisible="is_invisible_workflow" readonly="issue_state not in ['draft', 'cancel']"/>
|
||||
</group>
|
||||
<group col="5" string="决策程序">
|
||||
<group>
|
||||
<field name="is_party" groups="yuthon_salary.group_jtbb_user" string="党总支" readonly="issue_state not in ['draft', 'cancel']"/>
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<style type="text/css">
|
||||
table { border-collapse: collapse; width:100%; margin:0; }
|
||||
/* 核心修改:表格宽度800px居中,合并边框 */
|
||||
table { border-collapse: collapse; width: 800px; margin: 0 auto; table-layout: fixed; }
|
||||
td { border:1px solid #000; padding:6px; text-align:center; }
|
||||
.title {
|
||||
text-align:center;
|
||||
@@ -18,14 +19,23 @@
|
||||
.detail-header { background-color:#fdf3c1; font-weight:bold; }
|
||||
.no-border { border: none !important; }
|
||||
.no-border-row td { border: none !important; }
|
||||
/* 加班单同款审批详情样式 */
|
||||
.no-right-border { border-right: none !important; } /* 隐藏意见列右侧边框 */
|
||||
.no-left-border { border-left: none !important; } /* 隐藏审批人列左侧边框 */
|
||||
.approval-center { text-align: center !important; } /* 内容居中 */
|
||||
.approval-pull-left { padding-left: 0 !important; } /* 减少左侧内边距 */
|
||||
/* 审批列宽(20%+50%+30%,与加班单完全一致) */
|
||||
.approval-col1 { width: 20%; } /* 节点名称列 */
|
||||
.approval-col2 { width: 50%; } /* 意见列 */
|
||||
.approval-col3 { width: 30%; } /* 审批人-操作时间列 */
|
||||
</style>
|
||||
|
||||
|
||||
<div class="title" style="text-align:center; font-weight:bold; font-size:18px; padding:12px 0; margin-bottom:10px;">
|
||||
采购审批单
|
||||
</div>
|
||||
|
||||
<div style="display:table; width:100%; margin-bottom:10px; font-weight:bold;">
|
||||
<!-- 部门+申请日期:宽度匹配800px表格 -->
|
||||
<div style="display:table; width:800px; margin:0 auto 10px auto; font-weight:bold;">
|
||||
<div style="display:table-cell; width:50%; text-align:left;">
|
||||
<strong>部门:</strong><span t-esc="doc.department_id.name or ''"/>
|
||||
</div>
|
||||
@@ -127,34 +137,31 @@
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<!-- 审批详情标题行 -->
|
||||
<!-- 审批详情:完全匹配加班单排版 -->
|
||||
<tr>
|
||||
<td class="header-cell" colspan="9" style="text-align:center;"><strong>审批详情</strong></td>
|
||||
</tr>
|
||||
<!-- 审批详情表头行:隐藏中间边框 + 匹配列宽 -->
|
||||
<tr>
|
||||
<td width="12%" class="header-cell" colspan="1"><strong>节点名称</strong></td>
|
||||
<td width="25%" class="header-cell" colspan="2"><strong>意见</strong></td>
|
||||
<td width="20%" class="header-cell" colspan="2"><strong>审批人 - 操作时间</strong></td>
|
||||
<td width="10%" class="header-cell" colspan="2"><strong>状态</strong></td>
|
||||
<td width="18%" class="header-cell" colspan="2"><strong>附件</strong></td>
|
||||
<td class="header-cell approval-col1" colspan="1" style="text-align:center;"><strong>节点名称</strong></td>
|
||||
<td class="header-cell approval-col2 no-right-border" colspan="2" style="text-align:center;"><strong>意见</strong></td>
|
||||
<td class="header-cell approval-col3 no-left-border" colspan="2" style="text-align:center;"><strong>审批人 - 操作时间</strong></td>
|
||||
<td width="10%" class="header-cell" colspan="2" style="text-align:center;"><strong>状态</strong></td>
|
||||
<td width="18%" class="header-cell" colspan="2" style="text-align:center;"><strong>附件</strong></td>
|
||||
</tr>
|
||||
<!-- 审批记录:匹配加班单样式 -->
|
||||
<t t-if="doc.log_ids">
|
||||
<t t-foreach="doc.log_ids" t-as="log">
|
||||
<tr>
|
||||
<td colspan="1"><span t-esc="log.name"/></td>
|
||||
<td colspan="2"><span t-esc="log.comment"/></td>
|
||||
<td colspan="2">
|
||||
<td class="approval-col1 approval-center" colspan="1"><span t-esc="log.name"/></td>
|
||||
<td class="approval-col2 no-right-border approval-center" colspan="2"><span t-esc="log.comment"/></td>
|
||||
<td class="approval-col3 no-left-border approval-center approval-pull-left" colspan="2">
|
||||
<t t-if="log.done_by">
|
||||
<span t-esc="log.done_by.name"/> - <span t-esc="log.lase_click_date and log.lase_click_date.strftime('%Y%m%d') or ''"/>
|
||||
</t>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<t t-if="log.approval_state == '0'">待办</t>
|
||||
<t t-elif="log.approval_state == '1'">办理中</t>
|
||||
<t t-elif="log.approval_state == '2'">已办结</t>
|
||||
<t t-elif="log.approval_state == '3'">结束</t>
|
||||
</td>
|
||||
<td colspan="2">
|
||||
<td colspan="2" class="approval-center"><span t-esc="log.approval_state == '0' and '待办' or log.approval_state == '1' and '办理中' or log.approval_state == '2' and '已办结' or log.approval_state == '3' and '结束' or ''"/></td>
|
||||
<td colspan="2" class="approval-center">
|
||||
<t t-if="log.document_ids">
|
||||
<t t-foreach="log.document_ids" t-as="doc_att">
|
||||
<div><span t-esc="doc_att.name"/></div>
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
<td class="approval-col2 no-right-border approval-center" colspan="3"><span t-esc="log.comment"/></td>
|
||||
<td class="approval-col3 no-left-border approval-center approval-pull-left" colspan="2">
|
||||
<t t-if="log.done_by">
|
||||
<span t-esc="log.done_by.name"/> - <span t-esc="log.lase_click_date and log.lase_click_date.strftime('%Y%m%d') or ''"/>
|
||||
<span t-esc="log.done_by.name"/> <span t-esc="log.lase_click_date and log.lase_click_date.strftime('%Y%m%d') or ''"/>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -56,11 +56,14 @@
|
||||
<field name="users_id"/>
|
||||
<field name="information_categories_ids" widget="many2many_tags" string="业务类型" options="{'no_create': True}"/>
|
||||
<field name="reason" string="事项说明"/>
|
||||
<field name="document_ids" widget="preview_many2many" string="附件清单"/>
|
||||
<!-- <field name="document_ids" widget="preview_many2many" string="附件清单"/>-->
|
||||
<field name="type_stamp_ids" widget="many2many_tags" options="{'no_create': True, 'no_open': True}" invisible="is_chapter == 'no' or not is_chapter"/>
|
||||
<field name="scope_chapter_ids" widget="many2many_tags" options="{'no_create': True, 'no_open': True}" invisible="is_chapter == 'no' or not is_chapter"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="document_ids" widget="preview_many2many" string="附件清单"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
@@ -787,16 +787,16 @@
|
||||
parent="holiday_manage_menu_root_board"
|
||||
sequence="20"
|
||||
action="yuthon_salary.action_view_my_payslip"/>
|
||||
<menuitem id="yuthon_meal_expenses_my_board"
|
||||
name="餐费"
|
||||
parent="holiday_manage_menu_root_board"
|
||||
sequence="21"
|
||||
action="yuthon_salary.view_my_yuthon_meal_expenses_action"/>
|
||||
<menuitem id="yuthon_salary_party_my_board"
|
||||
name="党费"
|
||||
parent="holiday_manage_menu_root_board"
|
||||
sequence="22"
|
||||
action="yuthon_salary.view_my_yuthon_salary_party_action"/>
|
||||
<!-- <menuitem id="yuthon_meal_expenses_my_board"-->
|
||||
<!-- name="餐费"-->
|
||||
<!-- parent="holiday_manage_menu_root_board"-->
|
||||
<!-- sequence="21"-->
|
||||
<!-- action="yuthon_salary.view_my_yuthon_meal_expenses_action"/>-->
|
||||
<!-- <menuitem id="yuthon_salary_party_my_board"-->
|
||||
<!-- name="党费"-->
|
||||
<!-- parent="holiday_manage_menu_root_board"-->
|
||||
<!-- sequence="22"-->
|
||||
<!-- action="yuthon_salary.view_my_yuthon_salary_party_action"/>-->
|
||||
<menuitem id="basic_information_board"
|
||||
name="基础信息配置"
|
||||
parent="holiday_manage_menu_root_board"
|
||||
|
||||
Reference in New Issue
Block a user