diff --git a/tianhe_approvals/models/__init__.py b/tianhe_approvals/models/__init__.py index c8a779511..af497c9e9 100644 --- a/tianhe_approvals/models/__init__.py +++ b/tianhe_approvals/models/__init__.py @@ -2,9 +2,9 @@ from . import inherit_approval_category from . import inherit_approval_request from . import overtime_approval -from . import tianhe_construction_business_approval -from . import tianhe_process_change_approval -from . import tianhe_contentious_matter_approval +# from . import tianhe_construction_business_approval +# from . import tianhe_process_change_approval +# from . import tianhe_contentious_matter_approval # from . import tianhe_document_processing_approval # from . import tianhe_property_submission_approval # from . import tianhe_rental_receipt_approval diff --git a/tianhe_approvals/models/inherit_approval_request.py b/tianhe_approvals/models/inherit_approval_request.py index 4e1e4e282..277696156 100644 --- a/tianhe_approvals/models/inherit_approval_request.py +++ b/tianhe_approvals/models/inherit_approval_request.py @@ -52,6 +52,7 @@ class ApprovalRequest(models.Model): creation_time = fields.Datetime(string='创建时间', default=lambda self: fields.Datetime.now()) department_id = fields.Many2one('hr.department', related="request_owner_id.employee_id.department_id", string="申请人部门") approval_request_ids = fields.One2many('approval.request.line', 'approval_request_id', string="审批明细行") + partner_id = fields.Many2one('res.partner', string="来文单位") diff --git a/yuthon_notice/__manifest__.py b/yuthon_notice/__manifest__.py index 6b7410d78..4b4a18786 100644 --- a/yuthon_notice/__manifest__.py +++ b/yuthon_notice/__manifest__.py @@ -13,9 +13,9 @@ 'depends': ['approvals', 'yuthon_approval', 'mail'], 'data': [ 'security/ir.model.access.csv', - 'data/approval_category_type_data.xml', + # 'data/approval_category_type_data.xml', 'views/yuthon_ntice_views.xml', - 'views/notice_category.xml', + # 'views/notice_category.xml', ], 'installable': True, 'application': True, diff --git a/yuthon_notice/models/__init__.py b/yuthon_notice/models/__init__.py index dd597526f..dcc36ec20 100644 --- a/yuthon_notice/models/__init__.py +++ b/yuthon_notice/models/__init__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- -from . import notice_category +# from . import notice_category from . import yuthon_notice diff --git a/yuthon_official/__manifest__.py b/yuthon_official/__manifest__.py index 4d61e741a..b21f4e895 100644 --- a/yuthon_official/__manifest__.py +++ b/yuthon_official/__manifest__.py @@ -12,7 +12,7 @@ 'license': 'LGPL-3', 'depends': ['approvals', 'yuthon_approval', 'mail'], 'data': [ - 'data/approval_category_type_data.xml', + # 'data/approval_category_type_data.xml', 'security/ir.model.access.csv', # 'views/tianhe_official_issues.xml', # 'views/tianhe_official_receipt.xml', diff --git a/yuthon_official/models/__init__.py b/yuthon_official/models/__init__.py index 8a629c440..36d91d3ef 100644 --- a/yuthon_official/models/__init__.py +++ b/yuthon_official/models/__init__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- from . import yuthon_official -from . import official_category +# from . import official_category diff --git a/yuthon_official/models/official_category.py b/yuthon_official/models/official_category.py index 4d04f4c4b..4470ef340 100644 --- a/yuthon_official/models/official_category.py +++ b/yuthon_official/models/official_category.py @@ -14,3 +14,25 @@ class ApprovalRequest(models.Model): _inherit = "approval.request" _description = '公文管理' + official_ids = fields.Many2one('approval.request') + send_type = fields.Selection([ + ('official_issues', '公文发文'), + ('general_party_branch_post', '党总支发文'), + ('party_branch_committee_post', '党支委发文'), + ('official_issues_for_son', '公文发文(子企业)'), + ('financing_post', '投融资发文'), + ('official_account_cloud_sms_post_submission', '公众号/云短信发文呈批'), + ('post_submission', '发文呈批'), + ], default='official_issues', string="发文类型") + official_type = fields.Selection([('receipt', '收文'), ('post', '发文')], string="公文类型") + reference_cold = fields.Integer(string="公文字号") + major_event_category = fields.Integer(string="重大事项所属类别") + document_number = fields.Char(string="单据编号") + remarks = fields.Char(string="备注事项") + main_text = fields.Text(string='正文') + come_file_id = fields.Char(string="来文编号") + main_flats = fields.Char(string="主送") + urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度") + secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')], string="密级") + date = fields.Datetime(string="日期") + diff --git a/yuthon_official/models/yuthon_official.py b/yuthon_official/models/yuthon_official.py index 8b9319438..e025105ea 100644 --- a/yuthon_official/models/yuthon_official.py +++ b/yuthon_official/models/yuthon_official.py @@ -6,9 +6,11 @@ from odoo.exceptions import ValidationError, UserError class YuthonOfficial(models.Model): _name = 'yuthon.official' _description = '收发文管理' + _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin'] + _rec_name = 'name' - name = fields.Char(string="审批单") - official_ids = fields.Many2one('approval.request') + name = fields.Char(string="名称") + official_ids = fields.Many2one('approval.request', string="关联审批单") send_type = fields.Selection([ ('official_issues', '公文发文'), ('general_party_branch_post', '党总支发文'), @@ -18,23 +20,21 @@ class YuthonOfficial(models.Model): ('official_account_cloud_sms_post_submission', '公众号/云短信发文呈批'), ('post_submission', '发文呈批'), ], default='official_issues', string="发文类型") - - reference_cold = fields.Integer(string="发文字号") + official_type = fields.Selection([('receipt', '收文'), ('post', '发文')], string="公文类型") + reference_cold = fields.Integer(string="公文字号") major_event_category = fields.Integer(string="重大事项所属类别") - document_number = fields.Char(string="单据编号") - come_company_id = fields.Char(string="来文单位") + partner_id = fields.Many2one('res.partner', string="来文单位") remarks = fields.Char(string="备注事项") main_text = fields.Text(string='正文') come_file_id = fields.Char(string="来文编号") main_flats = fields.Char(string="主送") servings_number = fields.Integer(string="份数") - urgency = fields.Selection([('normal', '一般'), - ('urgent', '紧急'), - ('extra_urgent', '特急')], - string="紧急程度") - secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), - ('secret', '机密'), ('so_secret', '绝密')], string="密级") + urgency = fields.Selection([('normal', '一般'), ('urgent', '紧急'), ('extra_urgent', '特急')], string="紧急程度") + secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'), ('secret', '机密'), ('so_secret', '绝密')], string="密级") date = fields.Datetime(string="日期") - department_id = fields.Many2one('hr.department', - string="申请人部门") + department_id = fields.Many2one('hr.department', string="申请人部门") + statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态") + + def go_official_approval(self): + pass diff --git a/yuthon_official/views/menu_all.xml b/yuthon_official/views/menu_all.xml index 32e7c461a..a229c4e5c 100644 --- a/yuthon_official/views/menu_all.xml +++ b/yuthon_official/views/menu_all.xml @@ -1,5 +1,12 @@ + + + - + - + diff --git a/yuthon_official/views/yuthon_official_views.xml b/yuthon_official/views/yuthon_official_views.xml index 7613882c1..b0ac299ba 100644 --- a/yuthon_official/views/yuthon_official_views.xml +++ b/yuthon_official/views/yuthon_official_views.xml @@ -13,6 +13,9 @@ + + + @@ -22,33 +25,39 @@ yuthon.official
+
+ +
-
- - - - - - - - - + + + + + + + + + - + +
+
+ + + +
- - yuthon.official.search - yuthon.official - - - - - - - - \ No newline at end of file