diff --git a/yuthon_official/__manifest__.py b/yuthon_official/__manifest__.py index 818560339..99e933796 100644 --- a/yuthon_official/__manifest__.py +++ b/yuthon_official/__manifest__.py @@ -10,13 +10,16 @@ 'category': 'Human Resources/Attendances', 'version': '0.1', 'license': 'LGPL-3', - 'depends': ['mail', 'soong_workflow'], + 'depends': ['mail','hr'], 'data': [ 'data/official_type_data.xml', 'security/ir.model.access.csv', 'views/yuthon_official_views.xml', 'views/official_partner_views.xml', 'views/official_type_views.xml', + 'views/yuthon_official_labor_views.xml', + 'views/yuthon_offficial_party_views.xml', + 'views/yuthon_official_normal_views.xml', ], 'installable': True, 'application': True, diff --git a/yuthon_official/models/__init__.py b/yuthon_official/models/__init__.py index 27349138c..0eefff2ea 100644 --- a/yuthon_official/models/__init__.py +++ b/yuthon_official/models/__init__.py @@ -3,3 +3,6 @@ from . import yuthon_official from . import official_partner from . import officical_type +from . import yuthon_official_labor +from . import yuthon_offficial_party +from . import yuthon_official_normal diff --git a/yuthon_official/models/yuthon_offficial_party.py b/yuthon_official/models/yuthon_offficial_party.py new file mode 100644 index 000000000..f6cef357d --- /dev/null +++ b/yuthon_official/models/yuthon_offficial_party.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, tools +from odoo.exceptions import ValidationError, UserError + + +class YuthonOfficialParty(models.Model): + _name = 'yuthon.official.party' + _description = '党总支发文' + _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin'] + _rec_name = 'name' + + name = fields.Char(string="名称") + code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('official_code')) + official_type_id = fields.Many2one('official.type', string="公文种类") + official_type = fields.Selection([('go', '发文'), ('come', '收文')], string="公文类型") + reference_cold = fields.Integer(string="公文字号") + major_event_category = fields.Integer(string="重大事项所属类别") + # official_partner_id = fields.Many2one('official.partner', string="来文单位") + remarks = fields.Char(string="备注事项") + main_text = fields.Html(string='正文') + # come_file_id = fields.Char(string="来文编号") + # incoming_file_id = fields.Char(string="收文编号") + main_flats = fields.Char(string="主送") + copy_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="密级") + date = fields.Datetime(string="日期", default=fields.Datetime.now) + department_id = fields.Many2one('hr.department', string="申请人部门") + statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], + string="状态", default='drft') + deadline = fields.Date(string="办理期限") + red_suit = fields.Char(string="套红") diff --git a/yuthon_official/models/yuthon_official.py b/yuthon_official/models/yuthon_official.py index 95667f288..39d32d580 100644 --- a/yuthon_official/models/yuthon_official.py +++ b/yuthon_official/models/yuthon_official.py @@ -6,7 +6,7 @@ from odoo.exceptions import ValidationError, UserError class YuthonOfficial(models.Model): _name = 'yuthon.official' _description = '收发文管理' - _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin'] + _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin'] _rec_name = 'name' name = fields.Char(string="名称") @@ -20,10 +20,14 @@ class YuthonOfficial(models.Model): remarks = fields.Char(string="备注事项") main_text = fields.Html(string='正文') come_file_id = fields.Char(string="来文编号") + incoming_file_id = fields.Char(string="收文编号") main_flats = fields.Char(string="主送") + copy_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="密级") date = fields.Datetime(string="日期", default=fields.Datetime.now) department_id = fields.Many2one('hr.department', string="申请人部门") statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], string="状态", default='drft') + deadline = fields.Date(string="办理期限") + red_suit = fields.Char(string="套红") diff --git a/yuthon_official/models/yuthon_official_labor.py b/yuthon_official/models/yuthon_official_labor.py new file mode 100644 index 000000000..b951a5468 --- /dev/null +++ b/yuthon_official/models/yuthon_official_labor.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, tools +from odoo.exceptions import ValidationError, UserError + + +class YuthonOfficialLabor(models.Model): + _name = 'yuthon.official.labor' + _description = '工会发文' + _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin'] + _rec_name = 'name' + + name = fields.Char(string="名称") + code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('official_code')) + official_type_id = fields.Many2one('official.type', string="公文种类") + official_type = fields.Selection([('go', '发文'), ('come', '收文')], string="公文类型") + reference_cold = fields.Integer(string="公文字号") + major_event_category = fields.Integer(string="重大事项所属类别") + # official_partner_id = fields.Many2one('official.partner', string="来文单位") + remarks = fields.Char(string="备注事项") + main_text = fields.Html(string='正文') + # come_file_id = fields.Char(string="来文编号") + # incoming_file_id = fields.Char(string="收文编号") + main_flats = fields.Char(string="主送") + copy_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="密级") + date = fields.Datetime(string="日期", default=fields.Datetime.now) + department_id = fields.Many2one('hr.department', string="申请人部门") + statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], + string="状态", default='drft') + deadline = fields.Date(string="办理期限") + red_suit = fields.Char(string="套红") diff --git a/yuthon_official/models/yuthon_official_normal.py b/yuthon_official/models/yuthon_official_normal.py new file mode 100644 index 000000000..a9beb7e6b --- /dev/null +++ b/yuthon_official/models/yuthon_official_normal.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, tools +from odoo.exceptions import ValidationError, UserError + + +class YuthonOfficialNormal(models.Model): + _name = 'yuthon.official.normal' + _description = '行政发文' + _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin'] + _rec_name = 'name' + + name = fields.Char(string="名称") + code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('official_code')) + official_type_id = fields.Many2one('official.type', string="公文种类") + official_type = fields.Selection([('go', '发文'), ('come', '收文')], string="公文类型") + reference_cold = fields.Integer(string="公文字号") + major_event_category = fields.Integer(string="重大事项所属类别") + remarks = fields.Char(string="备注事项") + main_text = fields.Html(string='正文') + main_flats = fields.Char(string="主送") + copy_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="密级") + date = fields.Datetime(string="日期", default=fields.Datetime.now) + department_id = fields.Many2one('hr.department', string="申请人部门") + statu = fields.Selection([('drft', '草稿'), ('going', '执行中'), ('cancel', '已取消'), ('done', '已完成')], + string="状态", default='drft') + deadline = fields.Date(string="办理期限") + red_suit = fields.Char(string="套红") diff --git a/yuthon_official/security/ir.model.access.csv b/yuthon_official/security/ir.model.access.csv index 9e2d556cc..62c0a2b0d 100644 --- a/yuthon_official/security/ir.model.access.csv +++ b/yuthon_official/security/ir.model.access.csv @@ -1,4 +1,7 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_yuthon_official,yuthon_official,model_yuthon_official,base.group_user,1,1,1,1 access_official_partner,official_partner,model_official_partner,base.group_user,1,1,1,1 -access_official_type,official_type,model_official_type,base.group_user,1,1,1,1 \ No newline at end of file +access_official_type,official_type,model_official_type,base.group_user,1,1,1,1 +access_yuthon_official_labor,yuthon_official_labor,model_yuthon_official_labor,base.group_user,1,1,1,1 +access_yuthon_offficial_party,yuthon_offficial_party,model_yuthon_official_party,base.group_user,1,1,1,1 +access_yuthon_official_normal,yuthon_official_normal,model_yuthon_official_normal,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/yuthon_official/views/yuthon_offficial_party_views.xml b/yuthon_official/views/yuthon_offficial_party_views.xml new file mode 100644 index 000000000..0c9b5bdd4 --- /dev/null +++ b/yuthon_official/views/yuthon_offficial_party_views.xml @@ -0,0 +1,91 @@ + + + + yuthon.official.party.tree + yuthon.official.party + + + + + + + + + + + + yuthon.official.party.form + yuthon.official.party + +
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + +
+ + + + + + send.receive.messages.management.search + yuthon.official + + + + + + + + + + + + 党总支发文 + yuthon.official.party + tree,form + + + + + + \ No newline at end of file diff --git a/yuthon_official/views/yuthon_official_labor_views.xml b/yuthon_official/views/yuthon_official_labor_views.xml new file mode 100644 index 000000000..2830f058d --- /dev/null +++ b/yuthon_official/views/yuthon_official_labor_views.xml @@ -0,0 +1,89 @@ + + + + yuthon.official.labor.tree + yuthon.official.labor + + + + + + + + + + + + yuthon.official.labor.form + yuthon.official.labor + +
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + +
+
+
+ + + + +
+ + + + + + send.receive.messages.management.search + yuthon.official + + + + + + + + + + + + 工会发文 + yuthon.official.labor + tree,form + + + + + + \ No newline at end of file diff --git a/yuthon_official/views/yuthon_official_normal_views.xml b/yuthon_official/views/yuthon_official_normal_views.xml new file mode 100644 index 000000000..4b0368e65 --- /dev/null +++ b/yuthon_official/views/yuthon_official_normal_views.xml @@ -0,0 +1,91 @@ + + + + yuthon.official.normal.tree + yuthon.official.normal + + + + + + + + + + + + yuthon.official.normal.form + yuthon.official.normal + +
+
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + +
+ + + + + + send.receive.messages.management.search + yuthon.official + + + + + + + + + + + + 行政发文 + yuthon.official.normal + tree,form + + + + + + \ No newline at end of file diff --git a/yuthon_official/views/yuthon_official_views.xml b/yuthon_official/views/yuthon_official_views.xml index 62ff6d36e..caaa92329 100644 --- a/yuthon_official/views/yuthon_official_views.xml +++ b/yuthon_official/views/yuthon_official_views.xml @@ -39,11 +39,14 @@ + + + @@ -57,6 +60,7 @@ +