From 76ee3187677c9e2e11311a0a0f559620f7d3209b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Sat, 21 Feb 2026 15:54:03 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A=E6=89=93?= =?UTF-8?q?=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yuthon_notice/__manifest__.py | 2 + yuthon_notice/models/yuthon_notice.py | 6 + yuthon_notice/report/notice_print_report.xml | 23 +++ .../report/notice_print_template.xml | 144 ++++++++++++++++++ yuthon_notice/views/yuthon_notice_views.xml | 3 + 5 files changed, 178 insertions(+) create mode 100644 yuthon_notice/report/notice_print_report.xml create mode 100644 yuthon_notice/report/notice_print_template.xml diff --git a/yuthon_notice/__manifest__.py b/yuthon_notice/__manifest__.py index 4effe9597..34478b919 100644 --- a/yuthon_notice/__manifest__.py +++ b/yuthon_notice/__manifest__.py @@ -16,6 +16,8 @@ 'data/notice_code_data.xml', 'data/notice_cron_data.xml', 'data/notice_type_data.xml', + 'report/notice_print_report.xml', + 'report/notice_print_template.xml', 'views/yuthon_notice_views.xml', 'views/yuthon_notice_type_views.xml', 'views/yuthon_cs_tree_views.xml', diff --git a/yuthon_notice/models/yuthon_notice.py b/yuthon_notice/models/yuthon_notice.py index 16f830e25..53363314c 100644 --- a/yuthon_notice/models/yuthon_notice.py +++ b/yuthon_notice/models/yuthon_notice.py @@ -272,6 +272,12 @@ class YuthonNotice(models.Model): 'end_date': fields.Date.today(), }) + def action_print_notice(self): + """打印通知公告""" + self.ensure_one() + report = self.env.ref('yuthon_notice.action_notice_print_report') + return report.report_action(self) + class YuthonCsTree(models.Model): _name = 'yuthon.cs.tree' diff --git a/yuthon_notice/report/notice_print_report.xml b/yuthon_notice/report/notice_print_report.xml new file mode 100644 index 000000000..8753674bd --- /dev/null +++ b/yuthon_notice/report/notice_print_report.xml @@ -0,0 +1,23 @@ + + + + + Notice Small Top Margin + A4 + 5 + Portrait + + + + 通知公告 + + yuthon.notice + qweb-pdf + yuthon_notice.notice_print_template + yuthon_notice.notice_print_template + + report + '通知公告_%s_%s' % (object.name or '', object.code or '') + + + diff --git a/yuthon_notice/report/notice_print_template.xml b/yuthon_notice/report/notice_print_template.xml new file mode 100644 index 000000000..75cce6aca --- /dev/null +++ b/yuthon_notice/report/notice_print_template.xml @@ -0,0 +1,144 @@ + + + + diff --git a/yuthon_notice/views/yuthon_notice_views.xml b/yuthon_notice/views/yuthon_notice_views.xml index 7cc12f4d7..41d1eedfc 100644 --- a/yuthon_notice/views/yuthon_notice_views.xml +++ b/yuthon_notice/views/yuthon_notice_views.xml @@ -29,6 +29,9 @@ yuthon.notice
+
+