Merge branch 'master' into dev_zhou
# Conflicts: # yuthon_hr_employee/views/yuthon_hr_employee_views.xml
This commit is contained in:
@@ -8,8 +8,7 @@ class YuthonHrEmployee(models.Model):
|
||||
user_role_id = fields.Many2one('soong.user.role', string="主角色")
|
||||
user_role_ids = fields.Many2many('soong.user.role', string="辅助角色")
|
||||
department_ids = fields.Many2many('hr.department', string="辅助部门")
|
||||
user_role_group_id = fields.Many2many('soong.user.role.group', string='角色组', related='user_role_id.user_role_group_ids')
|
||||
users_role_group_ids = fields.Many2many('soong.user.role.group', string='角色组')
|
||||
user_role_group_id = fields.Many2many('soong.user.role.group', string='角色组')
|
||||
bank_account = fields.Char()
|
||||
|
||||
@api.onchange('user_role_id')
|
||||
|
||||
@@ -70,4 +70,11 @@ class SoongWorkflowRecordRevokeWizard(models.TransientModel):
|
||||
'soong_state': 'to_do',
|
||||
'employee_ids': [(6, 0, [self.record_id.create_uid.employee_ids.id])],
|
||||
'users_ids': [(6, 0, [self.record_id.create_uid.id])]
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
# 测试,是否能调用前端刷新
|
||||
return {
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'flush_badge',
|
||||
}
|
||||
@@ -12,13 +12,19 @@ import {Component, markup, onMounted, xml} from "@odoo/owl";
|
||||
/**
|
||||
* Client action to go back home.
|
||||
*/
|
||||
async function flush_badge(env, action) {
|
||||
async function flushBadge(env, action) {
|
||||
// menuservice.reload()
|
||||
const menuService = useService("menu");
|
||||
await menuService.reload();
|
||||
if (action.params.menu_id) {
|
||||
menuService.setCurrentMenu(action.params.menu_id);
|
||||
console.log(env.services)
|
||||
await env.services.menu.reload();
|
||||
if (action && action.params && 'menu_id' in action.params) {
|
||||
env.services.menu.setCurrentMenu(action.params.menu_id);
|
||||
}
|
||||
// 刷新一下
|
||||
const controller = env.services.action.currentController;
|
||||
if (controller) {
|
||||
await env.services.action.restore(controller.jsId);
|
||||
}
|
||||
}
|
||||
|
||||
registry.category("actions").add("flush_badge", flush_badge);
|
||||
|
||||
registry.category("actions").add("flush_badge", flushBadge);
|
||||
|
||||
@@ -597,7 +597,6 @@
|
||||
<xpath expr="//field[@name='job_id']" position="after">
|
||||
<field name="pinyin_name"/>
|
||||
<field name="pinyin_min"/>
|
||||
<field name="users_role_group_ids"/>
|
||||
</xpath>
|
||||
<xpath expr="//filter[@name='group_manager']" position="after">
|
||||
<filter name="group_is_membership" string="工会会员" context="{'group_by': 'is_membership'}"/>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<!-- 采购审批单打印报表 -->
|
||||
<record id="paperformat_label_sheet_a44" model="report.paperformat">
|
||||
<field name="name">Dymo Label Sheet2</field>
|
||||
<field name="default" eval="True"/>
|
||||
<field name="format">A4</field>
|
||||
<field name="margin_top">5</field>
|
||||
</record>
|
||||
|
||||
<record id="action_purchase_order_print_report" model="ir.actions.report">
|
||||
|
||||
@@ -1,191 +1,155 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<!-- 采购审批单打印报表 -->
|
||||
<record id="paperformat_label_sheet_a44" model="report.paperformat">
|
||||
<field name="name">Dymo Label Sheet2</field>
|
||||
<field name="default" eval="True"/>
|
||||
<field name="format">A4</field>
|
||||
</record>
|
||||
|
||||
<record id="action_purchase_order_print_report" model="ir.actions.report">
|
||||
<field name="name">采购审批单</field>
|
||||
<field name="paperformat_id" ref="yuthon_purchase.paperformat_label_sheet_a44"/>
|
||||
<field name="model">purchase.order</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">yuthon_purchase.purchase_order_print_template</field>
|
||||
<field name="report_file">yuthon_purchase.purchase_order_print_template</field>
|
||||
<field name="print_report_name">'采购审批单-%s' % (object.name or '')</field>
|
||||
<field name="binding_model_id" ref="purchase.model_purchase_order"/>
|
||||
<field name="binding_type">report</field>
|
||||
</record>
|
||||
|
||||
<!-- 合并template到同一个odoo根节点下,移除重复的XML声明 -->
|
||||
<template id="purchase_order_print_template">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<style type="text/css">
|
||||
/* 核心修改:表格宽度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;
|
||||
font-weight:bold;
|
||||
font-size:18px;
|
||||
padding:12px 0;
|
||||
}
|
||||
.header-cell { font-weight:bold; }
|
||||
.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; } /* 减少左侧内边距 */
|
||||
/* 审批列宽(基于9列总结构分配) */
|
||||
.approval-col1 { width: 18%; } /* 节点名称列(原20%适配9列) */
|
||||
.approval-col2 { width: 45%; } /* 意见列(原50%适配9列) */
|
||||
.approval-col3 { width: 27%; } /* 审批人-操作时间列(原30%适配9列) */
|
||||
.po-wrap { max-width: 800px; width: auto; margin: 0 auto; font-size: 13px; }
|
||||
.po-title { text-align: center; font-weight: bold; font-size: 20px; padding: 10px 0 14px; }
|
||||
table.po { max-width: 800px; width: 100%; border-collapse: collapse; table-layout: auto; margin: 0 auto; }
|
||||
table.po td { border: 1px solid #000; padding: 6px; vertical-align: top; }
|
||||
.label { background: #f2f2f2; font-weight: bold; text-align: center; width: 120px; }
|
||||
.section { text-align: center; font-weight: bold; background: #fdf3c1; border: 1px solid #000; padding: 6px 0; }
|
||||
.subhead { background: #fdf3c1; font-weight: bold; text-align: center; }
|
||||
</style>
|
||||
|
||||
<div class="title" style="text-align:center; font-weight:bold; font-size:18px; padding:12px 0; margin-bottom:10px;">
|
||||
采购审批单
|
||||
</div>
|
||||
<div class="po-wrap">
|
||||
<div class="po-title">采购审批单</div>
|
||||
|
||||
<!-- 部门+申请日期:宽度匹配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>
|
||||
<div style="display:table-cell; width:50%; text-align:right;">
|
||||
<strong>申请日期:</strong><span t-esc="doc.start_date and doc.start_date.strftime('%Y-%m-%d') or ''"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<!-- 基础信息行:统一9列结构 -->
|
||||
<tr>
|
||||
<td class="header-cell"><strong>事项标题</strong></td>
|
||||
<td colspan="8"><span t-esc="doc.name or ''"/></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="header-cell"><strong>供应商</strong></td>
|
||||
<td colspan="8"><span t-esc="doc.partner_id.name or ''"/></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="header-cell"><strong>采购标的类型</strong></td>
|
||||
<td colspan="8"><span t-esc="doc.category_id.name or ''"/></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="header-cell"><strong>付款方式</strong></td>
|
||||
<td colspan="3">
|
||||
<t t-if="doc.pay_way == 'onetime'">一次性</t>
|
||||
<t t-elif="doc.pay_way == 'installment'">分期</t>
|
||||
</td>
|
||||
<td class="header-cell" colspan="2"><strong>总金额</strong></td>
|
||||
<td colspan="4"><span t-esc="'%.2f' % (doc.amount_total or 0)"/>元</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="header-cell"><strong>申请事由</strong></td>
|
||||
<td colspan="8"><span t-esc="doc.reason_text or ''"/></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="header-cell"><strong>附件</strong></td>
|
||||
<td colspan="8">
|
||||
<t t-if="doc.document_ids">
|
||||
<t t-foreach="doc.document_ids" t-as="att">
|
||||
<div><span t-esc="att.name"/></div>
|
||||
</t>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 采购明细标题行 -->
|
||||
<tr>
|
||||
<td colspan="9" style="text-align:center; font-weight:bold;">采购明细</td>
|
||||
</tr>
|
||||
<!-- 采购明细表头:适配9列 -->
|
||||
<tr>
|
||||
<td width="25%" class="detail-header" colspan="2"><strong>产品</strong></td>
|
||||
<td width="15%" class="detail-header" colspan="2"><strong>数量</strong></td>
|
||||
<td width="15%" class="detail-header" colspan="1"><strong>单位</strong></td>
|
||||
<td width="15%" class="detail-header" colspan="2"><strong>单价</strong></td>
|
||||
<td width="15%" class="detail-header" colspan="2"><strong>金额</strong></td>
|
||||
</tr>
|
||||
|
||||
<!-- 订单行明细:适配9列 -->
|
||||
<t t-if="doc.order_line">
|
||||
<t t-foreach="doc.order_line" t-as="line">
|
||||
<tr>
|
||||
<td colspan="2"><span t-esc="line.product_id.name"/></td>
|
||||
<td colspan="2"><span t-esc="line.product_qty"/></td>
|
||||
<td colspan="1"><span t-esc="line.product_uom.name"/></td>
|
||||
<td colspan="2"><span t-esc="line.price_unit"/></td>
|
||||
<td colspan="2"><span t-esc="line.price_subtotal"/></td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<!-- 分期付款明细(仅在付款方式为"分期"时显示) -->
|
||||
<t t-if="doc.pay_way == 'installment'">
|
||||
<table class="po">
|
||||
<tr>
|
||||
<td colspan="9" style="text-align:center; background-color:#fdf3c1; font-weight:bold; border:1px solid #000;">
|
||||
分期付款明细
|
||||
<span style="float:right; font-size:12px; font-weight:normal;">付款方式 "一次性" 隐藏</span>
|
||||
<td class="label">部门</td>
|
||||
<td colspan="5"><span t-esc="doc.department_id.name or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">事项标题</td>
|
||||
<td colspan="5"><span t-esc="doc.name or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">供应商</td>
|
||||
<td colspan="5"><span t-esc="doc.partner_id.name or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">采购标的类型</td>
|
||||
<td colspan="5"><span t-esc="doc.category_id.name or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">付款方式</td>
|
||||
<td>
|
||||
<t t-if="doc.pay_way == 'onetime'">一次性</t>
|
||||
<t t-else="">分期</t>
|
||||
</td>
|
||||
<td class="label">总金额</td>
|
||||
<td colspan="3"><span t-esc="'%.2f' % (doc.amount_total or 0.0)"/> 元</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">申请事由</td>
|
||||
<td colspan="5"><span t-esc="doc.reason_text or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">附件</td>
|
||||
<td colspan="5">
|
||||
<t t-if="doc.document_ids">
|
||||
<t t-foreach="doc.document_ids" t-as="att">
|
||||
<div><span t-esc="att.name"/></div>
|
||||
</t>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- 分期付款表头:适配9列 -->
|
||||
<tr>
|
||||
<td class="detail-header" colspan="2"><strong>付款阶段</strong></td>
|
||||
<td class="detail-header" colspan="2"><strong>比例/金额</strong></td>
|
||||
<td class="detail-header" colspan="2"><strong>付款日期</strong></td>
|
||||
<td class="detail-header" colspan="3"><strong>条件</strong></td>
|
||||
</table>
|
||||
|
||||
<div class="section">采购明细</div>
|
||||
<table class="po">
|
||||
<tr class="subhead">
|
||||
<td width="25%">产品</td>
|
||||
<td width="20%">规格</td>
|
||||
<td width="12%">数量</td>
|
||||
<td width="12%">单位</td>
|
||||
<td width="16%">单价</td>
|
||||
<td width="15%">金额</td>
|
||||
</tr>
|
||||
<t t-if="doc.pay_line_ids">
|
||||
<t t-foreach="doc.pay_line_ids" t-as="pay_line">
|
||||
<t t-if="doc.order_line">
|
||||
<t t-foreach="doc.order_line" t-as="line">
|
||||
<tr>
|
||||
<td colspan="2"><span t-esc="pay_line.payment_stage or ''"/></td>
|
||||
<td colspan="2"><span t-esc="pay_line.amount or ''"/></td>
|
||||
<td colspan="2"><span t-esc="pay_line.payment_date and pay_line.payment_date.strftime('%Y-%m-%d') or ''"/></td>
|
||||
<td colspan="3"><span t-esc="pay_line.remake or ''"/></td>
|
||||
<td><span t-esc="line.product_id.name or ''"/></td>
|
||||
<td><span t-esc="line.name or ''"/></td>
|
||||
<td><span t-esc="line.product_qty"/></td>
|
||||
<td><span t-esc="line.product_uom.name"/></td>
|
||||
<td><span t-esc="'%.2f' % (line.price_unit or 0.0)"/></td>
|
||||
<td><span t-esc="'%.2f' % (line.price_subtotal or 0.0)"/></td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<tr><td colspan="6" style="text-align:center;">无明细</td></tr>
|
||||
</t>
|
||||
</table>
|
||||
|
||||
<t t-if="doc.pay_way == 'installment'">
|
||||
<div class="section">分期付款明细</div>
|
||||
<table class="po">
|
||||
<tr class="subhead">
|
||||
<td width="25%">付款阶段</td>
|
||||
<td width="20%">比例/金额</td>
|
||||
<td width="20%">付款日期</td>
|
||||
<td width="35%">条件</td>
|
||||
</tr>
|
||||
<t t-if="doc.pay_line_ids">
|
||||
<t t-foreach="doc.pay_line_ids" t-as="pay">
|
||||
<tr>
|
||||
<td><span t-esc="pay.payment_stage or ''"/></td>
|
||||
<td><span t-esc="pay.amount or ''"/></td>
|
||||
<td><span t-esc="pay.payment_date and pay.payment_date.strftime('%Y-%m-%d') or ''"/></td>
|
||||
<td><span t-esc="pay.remake or ''"/></td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<tr><td colspan="4" style="text-align:center;">无分期记录</td></tr>
|
||||
</t>
|
||||
</table>
|
||||
</t>
|
||||
|
||||
<!-- 审批详情:适配9列 -->
|
||||
<tr>
|
||||
<td class="header-cell" colspan="9" 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 class="approval-col1 approval-center"><span t-esc="log.name"/></td>
|
||||
<td class="approval-col2 no-right-border approval-center" colspan="4"><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 class="approval-center" colspan="1"><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 class="approval-center" colspan="1">
|
||||
<t t-if="log.document_ids">
|
||||
<t t-foreach="log.document_ids" t-as="doc_att">
|
||||
<div><span t-esc="doc_att.name"/></div>
|
||||
<div class="section">审批详情</div>
|
||||
<table class="po">
|
||||
<tr class="subhead">
|
||||
<td width="20%">节点名称</td>
|
||||
<td width="30%">意见</td>
|
||||
<td width="25%">审批人 - 操作时间</td>
|
||||
<td width="10%">状态</td>
|
||||
<td width="15%">附件</td>
|
||||
</tr>
|
||||
<t t-if="doc.log_ids">
|
||||
<t t-foreach="doc.log_ids" t-as="log">
|
||||
<tr>
|
||||
<td><span t-esc="log.name or ''"/></td>
|
||||
<td><span t-esc="log.comment or ''"/></td>
|
||||
<td>
|
||||
<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>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</td>
|
||||
<td>
|
||||
<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>
|
||||
<t t-if="log.document_ids">
|
||||
<t t-foreach="log.document_ids" t-as="doc_att">
|
||||
<div><span t-esc="doc_att.name"/></div>
|
||||
</t>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</table>
|
||||
<t t-else="">
|
||||
<tr><td colspan="5" style="text-align:center;">无审批记录</td></tr>
|
||||
</t>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
td {
|
||||
border: 1px solid #000000;
|
||||
padding: 8px;
|
||||
/* 仅保留自动换行核心样式 */
|
||||
word-wrap: break-word;
|
||||
word-break: normal;
|
||||
}
|
||||
.main-title {
|
||||
font-weight: bold;
|
||||
@@ -23,8 +26,8 @@
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
/* 移除.reason-content的多余样式,恢复默认换行 */
|
||||
.reason-content {
|
||||
white-space: pre-wrap;
|
||||
line-height: 1.5;
|
||||
}
|
||||
</style>
|
||||
@@ -57,12 +60,12 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- 正文 -->
|
||||
<!-- 正文:用span标签简化结构,仅保留内容 -->
|
||||
<table>
|
||||
<tr>
|
||||
<td width="15%" class="section-title" style="vertical-align: top;"><strong>正文:</strong></td>
|
||||
<td width="85%" class="reason-content">
|
||||
<span t-if="o.reason"><pre t-field="o.reason"/></span>
|
||||
<span t-if="o.reason"><span t-field="o.reason"/></span>
|
||||
<span t-if="not o.reason">无正文内容</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user