合同续签打印
This commit is contained in:
@@ -59,6 +59,8 @@
|
||||
'report/leaving_approval_report_templates.xml',
|
||||
'report/onboard_approval_report.xml',
|
||||
'report/onboard_approval_template.xml',
|
||||
'report/renewal_approval_report.xml',
|
||||
'report/renewal_approval_template.xml',
|
||||
|
||||
'wizard/yuthon_website_employee_wizard.xml',
|
||||
'wizard/interview_approval_wizard.xml',
|
||||
|
||||
@@ -44,6 +44,12 @@ class YuthonRenewalApproval(models.Model):
|
||||
name_title = fields.Char(default=_get_default_name_title)
|
||||
self_users_ids = fields.Many2many('res.users', string="当前经办人", default=lambda self: [(6, 0, [self.env.user.id])])
|
||||
|
||||
def action_print_renewal_approval(self):
|
||||
"""打印合同续签申请"""
|
||||
self.ensure_one()
|
||||
report = self.env.ref('yuthon_hr_employee_approval.action_renewal_approval_report')
|
||||
return report.report_action(self)
|
||||
|
||||
def end_approval(self):
|
||||
self.ensure_one()
|
||||
original_contract = self.employee_id.contract_id
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="paperformat_renewal_approval_small" model="report.paperformat">
|
||||
<field name="name">Renewal Approval Small Top Margin</field>
|
||||
<field name="format">A4</field>
|
||||
<field name="margin_top">5</field>
|
||||
<field name="orientation">Portrait</field>
|
||||
</record>
|
||||
|
||||
<record id="action_renewal_approval_report" model="ir.actions.report">
|
||||
<field name="name">合同续签申请</field>
|
||||
<field name="paperformat_id" ref="yuthon_hr_employee_approval.paperformat_renewal_approval_small"/>
|
||||
<field name="model">yuthon.renewal.approval</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">yuthon_hr_employee_approval.renewal_approval_template</field>
|
||||
<field name="report_file">yuthon_hr_employee_approval.renewal_approval_template</field>
|
||||
<field name="binding_model_id" ref="model_yuthon_renewal_approval"/>
|
||||
<field name="binding_type">report</field>
|
||||
<field name="print_report_name">'合同续签申请_%s_%s' % (object.name or '', object.code or '')</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -0,0 +1,152 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="renewal_approval_template">
|
||||
<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: 100%; max-width: 800px; margin: 0 auto; table-layout: fixed; }
|
||||
td { border: 1px solid #000; padding: 6px; text-align: center; vertical-align: middle; }
|
||||
.title {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
padding: 8px 0;
|
||||
}
|
||||
.header-cell { font-weight: bold; background-color: #d4e6f1; }
|
||||
.section-header { background-color: #d4e6f1; text-align: center; }
|
||||
.text-left { text-align: left; }
|
||||
.no-right-border { border-right: none !important; }
|
||||
.no-left-border { border-left: none !important; }
|
||||
</style>
|
||||
|
||||
<!-- 流水号 -->
|
||||
<div style="margin-bottom:8px; text-align:left; color:#999999;">
|
||||
流水号:<span t-esc="doc.code or ''"/>
|
||||
</div>
|
||||
|
||||
<!-- 标题 -->
|
||||
<div class="title">合同续签申请</div>
|
||||
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width:15%"/>
|
||||
<col style="width:35%"/>
|
||||
<col style="width:15%"/>
|
||||
<col style="width:35%"/>
|
||||
</colgroup>
|
||||
|
||||
<!-- 基本信息 -->
|
||||
<tr>
|
||||
<td class="header-cell"><strong>标题</strong></td>
|
||||
<td colspan="3"><span t-esc="doc.name or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>发起人</strong></td>
|
||||
<td><span t-esc="doc.users_id.name or ''"/></td>
|
||||
<td class="header-cell"><strong>紧急程度</strong></td>
|
||||
<td>
|
||||
<t t-if="doc.urgency_level == 'normal'">普件</t>
|
||||
<t t-elif="doc.urgency_level == 'urgent'">急件</t>
|
||||
<t t-elif="doc.urgency_level == 'emergency'">特急件</t>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>事由</strong></td>
|
||||
<td colspan="3" class="text-left"><span t-esc="doc.reason_application or ''"/></td>
|
||||
</tr>
|
||||
|
||||
<!-- 附件 -->
|
||||
<t t-if="doc.documents_ids">
|
||||
<tr>
|
||||
<td class="header-cell"><strong>附件</strong></td>
|
||||
<td colspan="3" class="text-left">
|
||||
<t t-foreach="doc.documents_ids" t-as="att">
|
||||
<div style="padding-left:1em;"><span t-esc="att.name"/></div>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
|
||||
<!-- 续签员工信息 -->
|
||||
<tr>
|
||||
<td colspan="4" class="section-header"><strong>续签员工</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>合同签约主体</strong></td>
|
||||
<td><span t-esc="doc.contract_signing_entity.party or ''"/></td>
|
||||
<td class="header-cell"><strong>续签员工</strong></td>
|
||||
<td><span t-esc="doc.employee_id.name or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>性别</strong></td>
|
||||
<td>
|
||||
<t t-if="doc.user_sex == 'boy'">男</t>
|
||||
<t t-elif="doc.user_sex == 'girl'">女</t>
|
||||
</td>
|
||||
<td class="header-cell"><strong>身份证号</strong></td>
|
||||
<td><span t-esc="doc.card or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>续签部门</strong></td>
|
||||
<td><span t-esc="doc.department1_id.name or ''"/></td>
|
||||
<td class="header-cell"><strong>学历</strong></td>
|
||||
<td><span t-esc="doc.degree or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>入职时间</strong></td>
|
||||
<td><span t-esc="doc.onboard_time and doc.onboard_time.strftime('%Y-%m-%d') or ''"/></td>
|
||||
<td class="header-cell"><strong>合同到期日</strong></td>
|
||||
<td><span t-esc="doc.current_status and doc.current_status.strftime('%Y-%m-%d') or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>续签开始日期</strong></td>
|
||||
<td><span t-esc="doc.renewal_date and doc.renewal_date.strftime('%Y-%m-%d') or ''"/></td>
|
||||
<td class="header-cell"><strong>续签结束日期</strong></td>
|
||||
<td><span t-esc="doc.renewal_term and doc.renewal_term.strftime('%Y-%m-%d') or ''"/></td>
|
||||
</tr>
|
||||
|
||||
<!-- 合同信息 -->
|
||||
<tr>
|
||||
<td colspan="4" class="section-header"><strong>合同信息</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>劳动合同签订情况</strong></td>
|
||||
<td colspan="3"><span t-esc="doc.contract or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>续期条件审核</strong></td>
|
||||
<td colspan="3" class="text-left"><span t-esc="doc.condition_review or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>续签劳动合同岗位</strong></td>
|
||||
<td><span t-esc="doc.job_id.name or ''"/></td>
|
||||
<td class="header-cell"><strong>续签劳动合同职级</strong></td>
|
||||
<td><span t-esc="doc.payroll_structure_id.name or ''"/></td>
|
||||
</tr>
|
||||
|
||||
<!-- 审批详情 -->
|
||||
<tr>
|
||||
<td colspan="4" class="section-header"><strong>审批详情</strong></td>
|
||||
</tr>
|
||||
<t t-if="doc.log_ids">
|
||||
<t t-set="logs_ordered" t-value="doc.get_logs_for_print()"/>
|
||||
<t t-foreach="logs_ordered" t-as="log">
|
||||
<tr>
|
||||
<td colspan="1"><span t-esc="log.name or '节点'"/></td>
|
||||
<td class="no-right-border" colspan="2"><span t-esc="log.comment or ''"/></td>
|
||||
<td class="no-left-border" 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>
|
||||
</t>
|
||||
</table>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
</odoo>
|
||||
@@ -16,6 +16,9 @@
|
||||
<field name="model">yuthon.renewal.approval</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="合同续签申请">
|
||||
<header>
|
||||
<button name="action_print_renewal_approval" string="打印" type="object" class="btn-primary"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
|
||||
invisible="urgency_level != 'normal'"/>
|
||||
|
||||
Reference in New Issue
Block a user