打印,菜单
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
'views/inherit_calendar_event_views.xml',
|
||||
'views/other_meet_employee_views.xml',
|
||||
'report/meet_check_report.xml',
|
||||
'report/room_booking_agenda_report.xml',
|
||||
'report/room_booking_agenda_template.xml',
|
||||
'wizard/room_booking_sign_wizard.xml',
|
||||
'wizard/room_booking_partner_create_wizard.xml',
|
||||
],
|
||||
|
||||
@@ -21,6 +21,7 @@ class RoomBooking(models.Model):
|
||||
room_id = fields.Many2one("room.room", string="Room", required=True, ondelete="cascade",
|
||||
group_expand="_read_group_room_id", tracking=4)
|
||||
start_datetime = fields.Datetime(string="Start Datetime", required=True, tracking=2)
|
||||
start_datetime_local = fields.Datetime(string="本地开始时间", compute="_compute_start_datetime_local", store=False)
|
||||
stop_datetime = fields.Datetime(string="End Datetime", required=True, tracking=3)
|
||||
organizer_id = fields.Many2one("res.users", string="Organizer",
|
||||
default=lambda self: self.env.user.id if not self.env.user._is_public() else False,
|
||||
@@ -378,3 +379,18 @@ class RoomBooking(models.Model):
|
||||
room_ids = rooms._search([], order="office_id," + order)
|
||||
return rooms.browse(room_ids)
|
||||
return rooms
|
||||
|
||||
def action_print_room_booking_agenda(self):
|
||||
"""打印会议议程安排表"""
|
||||
self.ensure_one()
|
||||
report = self.env.ref('room.action_room_booking_agenda_report')
|
||||
return report.report_action(self)
|
||||
|
||||
@api.depends('start_datetime')
|
||||
def _compute_start_datetime_local(self):
|
||||
"""计算本地时区时间(UTC+8)"""
|
||||
for record in self:
|
||||
if record.start_datetime:
|
||||
record.start_datetime_local = record.start_datetime + timedelta(hours=8)
|
||||
else:
|
||||
record.start_datetime_local = False
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="paperformat_room_booking_agenda" model="report.paperformat">
|
||||
<field name="name">Room Booking Agenda Small Top Margin</field>
|
||||
<field name="format">A4</field>
|
||||
<field name="margin_top">5</field>
|
||||
<field name="orientation">Portrait</field>
|
||||
</record>
|
||||
|
||||
<record id="action_room_booking_agenda_report" model="ir.actions.report">
|
||||
<field name="name">会议议程安排表</field>
|
||||
<field name="paperformat_id" ref="room.paperformat_room_booking_agenda"/>
|
||||
<field name="model">room.booking</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">room.room_booking_agenda_template</field>
|
||||
<field name="report_file">room.room_booking_agenda_template</field>
|
||||
<field name="binding_model_id" ref="model_room_booking"/>
|
||||
<field name="binding_type">report</field>
|
||||
<field name="print_report_name">'会议议程安排表_%s_%s' % (object.meeting_type_id.name or '', (object.start_datetime and object.start_datetime.strftime('%Y-%m-%d') or ''))</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="room_booking_agenda_template">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<t t-call="web.external_layout">
|
||||
<style type="text/css">
|
||||
/* 表格纵向版式:自适应,最大800px 居中 */
|
||||
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: 20px;
|
||||
padding: 12px 0;
|
||||
}
|
||||
.info-line {
|
||||
text-align: left;
|
||||
padding: 4px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
.header-cell { font-weight: bold; background-color: #d4e6f1; width: 8%;}
|
||||
.content-cell { text-align: left; padding: 8px;}
|
||||
.checkbox { display: inline-block; width: 16px; height: 16px; border: 1px solid #000; margin-right: 4px; vertical-align: middle;}
|
||||
.checkbox-checked { background-color: #4472C4;}
|
||||
/* 隐藏意见和审批人之间的竖边框 */
|
||||
.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>
|
||||
|
||||
<!-- 会议基本信息 -->
|
||||
<div class="info-line">
|
||||
会议时间:
|
||||
<span t-if="doc.start_datetime_local">
|
||||
<t t-esc="doc.start_datetime_local.strftime('%Y')"/>年<t t-esc="doc.start_datetime_local.strftime('%m')"/>月<t t-esc="doc.start_datetime_local.strftime('%d')"/>日星期<t t-esc="['一', '二', '三', '四', '五', '六', '日'][doc.start_datetime_local.weekday()]"/> <t t-if="doc.start_datetime_local.hour < 12">上午</t><t t-else="">下午</t><t t-esc="doc.start_datetime_local.strftime('%H')"/>时<t t-esc="doc.start_datetime_local.strftime('%M')"/>分
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="info-line">
|
||||
会议地点:<span t-esc="doc.room_id.name or ''"/>
|
||||
</div>
|
||||
|
||||
<div class="info-line">
|
||||
主持人:<span t-esc="doc.host.name or ''"/>
|
||||
</div>
|
||||
|
||||
<div class="info-line">
|
||||
出席人员:
|
||||
<t t-foreach="doc.room_users_ids" t-as="user">
|
||||
<span t-esc="user.name"/>
|
||||
<t t-if="not user_last">、</t>
|
||||
</t>
|
||||
<t t-if="doc.stationed_group">
|
||||
<span>(邀请派驻组参会)</span>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
<div class="info-line">
|
||||
记录员:
|
||||
<t t-foreach="doc.recorder_ids" t-as="recorder">
|
||||
<span t-esc="recorder.name"/>
|
||||
<t t-if="not recorder_last">、</t>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
<!-- 议题表格 -->
|
||||
<table style="margin-top: 10px;">
|
||||
<colgroup>
|
||||
<col style="width:8%"/>
|
||||
<col style="width:40%"/>
|
||||
<col style="width:15%"/>
|
||||
<col style="width:22%"/>
|
||||
<col style="width:15%"/>
|
||||
</colgroup>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>序号</strong></td>
|
||||
<td class="header-cell"><strong>议题</strong></td>
|
||||
<td class="header-cell"><strong>传达(汇报)人</strong></td>
|
||||
<td class="header-cell"><strong>列席人员</strong></td>
|
||||
<td class="header-cell"><strong>是否属于"三重一大"</strong></td>
|
||||
</tr>
|
||||
<t t-set="sequence_number" t-value="1"/>
|
||||
<t t-foreach="doc.issue_meeting_line_ids" t-as="line">
|
||||
<tr>
|
||||
<td><span t-esc="sequence_number"/></td>
|
||||
<td class="content-cell">
|
||||
<span t-esc="line.issue_library_id.name or ''"/>
|
||||
</td>
|
||||
<td>
|
||||
<span t-esc="line.employee_id.name or ''"/>
|
||||
</td>
|
||||
<td class="content-cell">
|
||||
<t t-foreach="line.attendees_ids" t-as="attendee">
|
||||
<span t-esc="attendee.name"/>
|
||||
<t t-if="not attendee_last">、</t>
|
||||
</t>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<span class="checkbox" t-att-class="'checkbox-checked' if not line.is_sanda else ''"></span>
|
||||
<span>否</span>
|
||||
</div>
|
||||
<div style="margin-top: 4px;">
|
||||
<span class="checkbox" t-att-class="'checkbox-checked' if line.is_sanda else ''"></span>
|
||||
<span>是</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<t t-set="sequence_number" t-value="sequence_number + 1"/>
|
||||
</t>
|
||||
</table>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
</odoo>
|
||||
@@ -136,6 +136,7 @@
|
||||
<button name="meeting_partner_create" string="录入" invisible="meeting_type != 'down' or not work_end"
|
||||
type="object" class="oe_highlight"/>
|
||||
<button name="sync_wechat_room" string="同步企业微信" type="object" class="oe_highlight" invisible="not work_end"/>
|
||||
<button name="action_print_room_booking_agenda" string="打印" type="object" class="btn-primary"/>
|
||||
</header>
|
||||
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
|
||||
invisible="urgency_level != 'normal'"/>
|
||||
|
||||
@@ -104,6 +104,25 @@
|
||||
parent="union_root_board"
|
||||
action="yuthon_trade.view_mutual_approval_action"
|
||||
sequence="50"/>
|
||||
<menuitem id="union_medical_manage_root_board"
|
||||
name="体检费管理"
|
||||
parent="union_root_board"
|
||||
sequence="60"/>
|
||||
<menuitem id="union_medical_manage_board"
|
||||
name="体检费管理"
|
||||
parent="union_medical_manage_root_board"
|
||||
action="yuthon_hr_employee.view_yuthon_medical_manage_action"
|
||||
sequence="1"/>
|
||||
<menuitem id="union_medical_rule_board"
|
||||
name="体检费规则"
|
||||
parent="union_medical_manage_root_board"
|
||||
action="yuthon_hr_employee.view_yuthon_medical_rule_action"
|
||||
sequence="5"/>
|
||||
<menuitem id="union_medical_line_board"
|
||||
name="体检报销费"
|
||||
parent="union_medical_manage_root_board"
|
||||
action="yuthon_hr_employee.yuthon_medical_line_action"
|
||||
sequence="10"/>
|
||||
<menuitem id="union_setting_root_board"
|
||||
name="配置"
|
||||
parent="union_root_board"
|
||||
|
||||
@@ -525,21 +525,21 @@
|
||||
action="soong_workflow.view_soong_user_role_group_action"
|
||||
parent="hr_menu_root_board"
|
||||
sequence="8"/>
|
||||
<menuitem id="hr_employee_medical_message_menu_root_board"
|
||||
<!-- <menuitem id="hr_employee_medical_message_menu_root_board"
|
||||
name="体检费管理"
|
||||
parent="hr_menu_root_board"
|
||||
action="yuthon_hr_employee.view_yuthon_medical_manage_action"
|
||||
sequence="13"/>
|
||||
<menuitem id="hr_employee_medical_rule_menu_root_board"
|
||||
sequence="13"/>-->
|
||||
<!-- <menuitem id="hr_employee_medical_rule_menu_root_board"
|
||||
name="体检费规则"
|
||||
parent="hr_menu_root_board"
|
||||
action="yuthon_hr_employee.view_yuthon_medical_rule_action"
|
||||
sequence="15"/>
|
||||
<menuitem id="yuthon_medical_line_menu_root_board"
|
||||
sequence="15"/>-->
|
||||
<!-- <menuitem id="yuthon_medical_line_menu_root_board"
|
||||
name="体检报销费"
|
||||
parent="hr_menu_root_board"
|
||||
action="yuthon_hr_employee.yuthon_medical_line_action"
|
||||
sequence="15"/>
|
||||
sequence="15"/>-->
|
||||
<!-- <menuitem id="hr_set_process_menu_root_board"-->
|
||||
<!-- name="流程"-->
|
||||
<!-- parent="hr_menu_root_board"-->
|
||||
|
||||
Reference in New Issue
Block a user