From 3fd39989a368fb937a413bf4df0684b5426bdf64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Sat, 3 Aug 2024 18:41:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E5=8F=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/src/field_tinymce/field_tinymce.js | 1 + yuthon_issue/__manifest__.py | 4 +- .../data/approval_category_type_data.xml | 9 --- yuthon_issue/models/issue_library.py | 36 +++++------ yuthon_issue/models/notice_category.py | 17 ----- yuthon_issue/security/issue_security.xml | 10 --- yuthon_issue/views/issue_library_views.xml | 50 +++++++-------- yuthon_notice/views/yuthon_ntice_views.xml | 2 +- .../models/yuthon_offficial_incoming_party.py | 1 + yuthon_official/models/yuthon_official.py | 4 ++ .../models/yuthon_official_incoming_labor.py | 1 + .../models/yuthon_official_incoming_normal.py | 1 + .../models/yuthon_official_labor.py | 1 + .../models/yuthon_official_party.py | 1 + yuthon_official/views/official_menus.xml | 63 ++++++++++--------- .../yuthon_official_incoming_labor_views.xml | 5 ++ .../yuthon_official_incoming_normal_views.xml | 5 ++ .../yuthon_official_incoming_party_views.xml | 5 ++ .../views/yuthon_official_labor_views.xml | 10 +++ .../views/yuthon_official_party_views.xml | 10 +++ .../views/yuthon_official_views.xml | 12 ++++ 21 files changed, 130 insertions(+), 118 deletions(-) delete mode 100644 yuthon_issue/data/approval_category_type_data.xml delete mode 100644 yuthon_issue/models/notice_category.py delete mode 100644 yuthon_issue/security/issue_security.xml diff --git a/web_editor_tinymce/static/src/field_tinymce/field_tinymce.js b/web_editor_tinymce/static/src/field_tinymce/field_tinymce.js index 946769557..4acef7c2f 100644 --- a/web_editor_tinymce/static/src/field_tinymce/field_tinymce.js +++ b/web_editor_tinymce/static/src/field_tinymce/field_tinymce.js @@ -32,6 +32,7 @@ export class FieldTinyMCE extends Component { plugins: 'autoresize preview importcss searchreplace autolink directionality code visualblocks visualchars fullscreen image link media codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons accordion', editimage_cors_hosts: ['picsum.photos'], image_advtab: true, + language:"zh_CN", importcss_append: true, height: 'auto', image_caption: true, diff --git a/yuthon_issue/__manifest__.py b/yuthon_issue/__manifest__.py index 44754b41c..e68c58055 100644 --- a/yuthon_issue/__manifest__.py +++ b/yuthon_issue/__manifest__.py @@ -10,11 +10,9 @@ 'category': 'Human Resources/Attendances', 'version': '0.1', 'license': 'LGPL-3', - 'depends': ['approvals', 'yuthon_approval', 'mail'], + 'depends': ['mail', 'documents'], 'data': [ 'security/ir.model.access.csv', - 'security/issue_security.xml', - 'data/approval_category_type_data.xml', 'data/issue_library_code_data.xml', 'views/issue_library_views.xml', ], diff --git a/yuthon_issue/data/approval_category_type_data.xml b/yuthon_issue/data/approval_category_type_data.xml deleted file mode 100644 index 1e84e4c1b..000000000 --- a/yuthon_issue/data/approval_category_type_data.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - 议题管理 - issue_library - - - \ No newline at end of file diff --git a/yuthon_issue/models/issue_library.py b/yuthon_issue/models/issue_library.py index 961a188bb..a5a0423a3 100644 --- a/yuthon_issue/models/issue_library.py +++ b/yuthon_issue/models/issue_library.py @@ -9,27 +9,19 @@ class IssueLibrary(models.Model): _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin'] _rec_name = 'name' - name = fields.Char(string='议题名称') - code = fields.Char(string='编号', required=True, copy=False, - default=lambda self: self.env['ir.sequence'].next_by_code('issue_library_code')) - type_issue = fields.Selection([('business_report', '业务汇报'), ('project_progress', '项目进展'), - ('hr', '人力资源'), ('account_report', '财务报告')], string="议题类别") - objective = fields.Char(string='目的') - employee_ids = fields.Many2many('hr.employee', string='参与人员') - meeting_et = fields.Datetime(string='会议预计时间') - issue_creation_time = fields.Datetime(string='议题创建时间', default=lambda self: fields.Datetime.now()) - degree_importance = fields.Selection([('normal', '正常'), ('important', '紧急'), ('very_important', '加急')], - string="重要程度", default='normal') - issue_status = fields.Selection([('will_meeting', '待上会'), ('done_meeting', '已上会'), - ('reject', '驳回'), ('cancel', '取消')], string="状态", default="will_meeting") - issue_approval_type = fields.Selection([('ready_meeting', '党总支'), ('party_branch_committee', '党支委'), - ('management_team', '经营班子'), ('board_directors', '董事会')], - string="议题审批类型") - company_id = fields.Many2one('res.company', string='公司', index=True, default=lambda self: self.env.company) - - def go_meeting_approval(self): - # 将议题生成审批并且跳转。 - self.write({"issue_status": "done_meeting"}) + name = fields.Char(string='议题事项') + issue_id = fields.Many2one('issue.library', string="上级议题", ondelete='cascade') + issue_ids = fields.One2many('issue.library', 'issue_id', string='子议题') + code = fields.Char(string='编号', required=True, copy=False, default=lambda self: self.env['ir.sequence'].next_by_code('issue_library_code')) + statu = fields.Selection([('will', '待上会'), ('done', '已上会'), ('cancel', '已取消')], default='will', string="议题状态") + is_party = fields.Boolean(string="党之委会") + is_class = fields.Boolean(string="班子会") + is_boss = fields.Boolean(string="董事会") + is_note = fields.Boolean(string="备案、核准") + creart_datetime = fields.Datetime(string="创建时间", default=fields.Datetime.now) def issue_cancel(self): - self.write({"issue_status": "cancel"}) + self.write({"statu": "cancel"}) + + def on_meeting(self): + self.write({"statu": "done"}) diff --git a/yuthon_issue/models/notice_category.py b/yuthon_issue/models/notice_category.py deleted file mode 100644 index 201da7d67..000000000 --- a/yuthon_issue/models/notice_category.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -from odoo import api, fields, models, tools -from odoo.exceptions import ValidationError, UserError - - -class ApprovalCategory(models.Model): - _inherit = 'approval.category' - _description = '议题管理' - - approval_type = fields.Selection(selection_add=[('issue_library', '议题管理')]) - - -class ApprovalRequest(models.Model): - _inherit = "approval.request" - _description = '议题管理' - - diff --git a/yuthon_issue/security/issue_security.xml b/yuthon_issue/security/issue_security.xml deleted file mode 100644 index f3fc9c3e2..000000000 --- a/yuthon_issue/security/issue_security.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - 议题多公司权限 - - [('company_id', 'in', company_ids + [False])] - - - \ No newline at end of file diff --git a/yuthon_issue/views/issue_library_views.xml b/yuthon_issue/views/issue_library_views.xml index 5c7adb699..83bdc802b 100644 --- a/yuthon_issue/views/issue_library_views.xml +++ b/yuthon_issue/views/issue_library_views.xml @@ -5,19 +5,18 @@ issue.library + decoration-info="statu == 'will'" + decoration-success="statu == 'done'" + decoration-muted="statu == 'cancel'"> - - - - - - - - + + + + + + + @@ -28,10 +27,9 @@
- -
@@ -43,16 +41,15 @@ - - - - + + - - - - + + + + + @@ -71,11 +68,14 @@ issue.library - - + + - + + + + diff --git a/yuthon_notice/views/yuthon_ntice_views.xml b/yuthon_notice/views/yuthon_ntice_views.xml index ac4ee5edf..e46dcb3c5 100644 --- a/yuthon_notice/views/yuthon_ntice_views.xml +++ b/yuthon_notice/views/yuthon_ntice_views.xml @@ -155,7 +155,7 @@ - + diff --git a/yuthon_official/models/yuthon_offficial_incoming_party.py b/yuthon_official/models/yuthon_offficial_incoming_party.py index 8c2f646c9..fe4f92e1a 100644 --- a/yuthon_official/models/yuthon_offficial_incoming_party.py +++ b/yuthon_official/models/yuthon_offficial_incoming_party.py @@ -32,3 +32,4 @@ class YuthonOfficialIncomingParty(models.Model): string="状态", default='drft') deadline = fields.Date(string="办理期限") red_suit = fields.Char(string="套红") + official_documents_ids = fields.Many2many('documents.document', string="公文相关文件") diff --git a/yuthon_official/models/yuthon_official.py b/yuthon_official/models/yuthon_official.py index c14814907..1e88867f6 100644 --- a/yuthon_official/models/yuthon_official.py +++ b/yuthon_official/models/yuthon_official.py @@ -34,6 +34,7 @@ class YuthonOfficial(models.Model): statu = fields.Selection([('drft', '草稿'), ('going', '审批中'), ('cancel', '已取消'), ('no', '未发布'), ('done', '已发布')], string="状态", default='drft') deadline = fields.Date(string="办理期限") red_suit = fields.Char(string="套红") + official_documents_ids = fields.Many2many('documents.document', string="公文相关文件") def cancel_official(self): self.write({'statu': '已取消'}) @@ -51,3 +52,6 @@ class YuthonOfficial(models.Model): partner_ids = self.sudo().env['res.users'].search([('id', 'in', publish_user_list)]).mapped('partner_id').ids self.sudo().with_context(lang=self.env.lang)._message_auto_subscribe_notify(partner_ids, 'yuthon_official.message_yuthon_official_confirm_users_data') self.write({"statu": 'done'}) + + def supervising_official(self): + pass diff --git a/yuthon_official/models/yuthon_official_incoming_labor.py b/yuthon_official/models/yuthon_official_incoming_labor.py index 246dd3233..3f4ffd82c 100644 --- a/yuthon_official/models/yuthon_official_incoming_labor.py +++ b/yuthon_official/models/yuthon_official_incoming_labor.py @@ -32,3 +32,4 @@ class YuthonOfficialIncomingLabor(models.Model): string="状态", default='drft') deadline = fields.Date(string="办理期限") red_suit = fields.Char(string="套红") + official_documents_ids = fields.Many2many('documents.document', string="公文相关文件") diff --git a/yuthon_official/models/yuthon_official_incoming_normal.py b/yuthon_official/models/yuthon_official_incoming_normal.py index 4758e2366..d033a7d43 100644 --- a/yuthon_official/models/yuthon_official_incoming_normal.py +++ b/yuthon_official/models/yuthon_official_incoming_normal.py @@ -31,3 +31,4 @@ class YuthonOfficialIncomingNormal(models.Model): string="状态", default='drft') deadline = fields.Date(string="办理期限") red_suit = fields.Char(string="套红") + official_documents_ids = fields.Many2many('documents.document', string="公文相关文件") diff --git a/yuthon_official/models/yuthon_official_labor.py b/yuthon_official/models/yuthon_official_labor.py index 47405976c..009b77f97 100644 --- a/yuthon_official/models/yuthon_official_labor.py +++ b/yuthon_official/models/yuthon_official_labor.py @@ -32,3 +32,4 @@ class YuthonOfficialLabor(models.Model): string="状态", default='drft') deadline = fields.Date(string="办理期限") red_suit = fields.Char(string="套红") + official_documents_ids = fields.Many2many('documents.document', string="公文相关文件") diff --git a/yuthon_official/models/yuthon_official_party.py b/yuthon_official/models/yuthon_official_party.py index 403e46d7a..ae3c388af 100644 --- a/yuthon_official/models/yuthon_official_party.py +++ b/yuthon_official/models/yuthon_official_party.py @@ -32,3 +32,4 @@ class YuthonOfficialParty(models.Model): string="状态", default='drft') deadline = fields.Date(string="办理期限") red_suit = fields.Char(string="套红") + official_documents_ids = fields.Many2many('documents.document', string="公文相关文件") diff --git a/yuthon_official/views/official_menus.xml b/yuthon_official/views/official_menus.xml index e14a1fd0a..88e7f5b95 100644 --- a/yuthon_official/views/official_menus.xml +++ b/yuthon_official/views/official_menus.xml @@ -12,6 +12,38 @@ name="我的公文" sequence="2"/> + + + + + + + + + + - - - - - - - - - \ No newline at end of file diff --git a/yuthon_official/views/yuthon_official_incoming_labor_views.xml b/yuthon_official/views/yuthon_official_incoming_labor_views.xml index cdc51c4ad..fac6b2fdc 100644 --- a/yuthon_official/views/yuthon_official_incoming_labor_views.xml +++ b/yuthon_official/views/yuthon_official_incoming_labor_views.xml @@ -43,6 +43,11 @@ + + + + + diff --git a/yuthon_official/views/yuthon_official_incoming_normal_views.xml b/yuthon_official/views/yuthon_official_incoming_normal_views.xml index ada646e22..3e4797b4f 100644 --- a/yuthon_official/views/yuthon_official_incoming_normal_views.xml +++ b/yuthon_official/views/yuthon_official_incoming_normal_views.xml @@ -43,6 +43,11 @@ + + + + + diff --git a/yuthon_official/views/yuthon_official_incoming_party_views.xml b/yuthon_official/views/yuthon_official_incoming_party_views.xml index 8700ede4d..7fd22f76e 100644 --- a/yuthon_official/views/yuthon_official_incoming_party_views.xml +++ b/yuthon_official/views/yuthon_official_incoming_party_views.xml @@ -43,6 +43,11 @@ + + + + + diff --git a/yuthon_official/views/yuthon_official_labor_views.xml b/yuthon_official/views/yuthon_official_labor_views.xml index 4dbf464eb..cdecf769c 100644 --- a/yuthon_official/views/yuthon_official_labor_views.xml +++ b/yuthon_official/views/yuthon_official_labor_views.xml @@ -35,6 +35,11 @@ + + + + + @@ -109,6 +114,11 @@ + + + + + diff --git a/yuthon_official/views/yuthon_official_party_views.xml b/yuthon_official/views/yuthon_official_party_views.xml index 090df5e70..eda50899b 100644 --- a/yuthon_official/views/yuthon_official_party_views.xml +++ b/yuthon_official/views/yuthon_official_party_views.xml @@ -43,6 +43,11 @@ + + + + + @@ -120,6 +125,11 @@ + + + + + diff --git a/yuthon_official/views/yuthon_official_views.xml b/yuthon_official/views/yuthon_official_views.xml index fc8ebb125..dfbaf0615 100644 --- a/yuthon_official/views/yuthon_official_views.xml +++ b/yuthon_official/views/yuthon_official_views.xml @@ -24,6 +24,8 @@ class="btn-primary"/>