议题
This commit is contained in:
@@ -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': [
|
||||
|
||||
@@ -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'"/>
|
||||
|
||||
@@ -16,7 +16,7 @@ class IssueLibrary(models.Model):
|
||||
topic_content = fields.Text(string='事项背景')
|
||||
will_based = fields.Text(string='上会依据')
|
||||
deliberation_content = fields.Text(string='请示事项', default='建议同意')
|
||||
handling_situation = fields.Text(string='办理情况')
|
||||
handling_situation = fields.Text(string='办理情况(存在问题)')
|
||||
is_invisible_workflow = fields.Boolean(string="流程隐藏的判断")
|
||||
code = fields.Char(string='编号', required=True, copy=False,
|
||||
default=lambda self: self.env['ir.sequence'].next_by_code('issue_library_code'))
|
||||
|
||||
@@ -109,12 +109,12 @@
|
||||
<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" 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="is_invisible_workflow" invisible="1"/>
|
||||
<field name="name_text" invisible="1"/>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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