diff --git a/approvals/data/mail_activity_type_data.xml b/approvals/data/mail_activity_type_data.xml index b145a9567..d35662273 100644 --- a/approvals/data/mail_activity_type_data.xml +++ b/approvals/data/mail_activity_type_data.xml @@ -1,6 +1,6 @@ - + Approval fa-check-circle diff --git a/tianhe_approvals/__manifest__.py b/tianhe_approvals/__manifest__.py index be2058db2..685b592f3 100644 --- a/tianhe_approvals/__manifest__.py +++ b/tianhe_approvals/__manifest__.py @@ -13,6 +13,12 @@ 'security/ir.model.access.csv', 'data/approval_category_type_data.xml', 'views/tianhe_purchase_work_approval.xml', + 'views/tianhe_general_party_branch_post.xml', + 'views/tianhe_dsh_issues_declarations.xml', + 'views/tianhe_official_issues_for_son.xml', + 'views/tianhe_official_issues.xml', + 'views/tianhe_official_receipt.xml', + 'views/tianhe_meeting_file.xml', ], 'application': True, diff --git a/tianhe_approvals/data/approval_category_type_data.xml b/tianhe_approvals/data/approval_category_type_data.xml index 7fce8e0a6..29b4170a4 100644 --- a/tianhe_approvals/data/approval_category_type_data.xml +++ b/tianhe_approvals/data/approval_category_type_data.xml @@ -19,5 +19,113 @@ 1 approver + + + 党总支发文 + general_party_branch_post + 1 + no + no + no + no + no + no + no + no + no + optional + 1 + approver + + + + 董事会议题申报表 + tianhe_dsh_issues_declarations + 1 + no + no + no + no + no + no + no + no + no + optional + 1 + approver + + + + 公文发文(子企业) + official_issues_for_son + 1 + no + no + required + no + no + no + no + no + no + optional + 1 + approver + + + + 公文发文 + official_issues + 1 + no + no + no + no + no + no + no + no + no + optional + 1 + approver + + + + 公文收文 + official_receipt + 1 + no + no + no + no + no + no + no + no + no + optional + 1 + approver + + + + 会议文档 + meeting_file + 1 + no + no + no + no + no + no + no + no + no + optional + 1 + approver + diff --git a/tianhe_approvals/models/__init__.py b/tianhe_approvals/models/__init__.py index fb9c266be..380c19bc6 100644 --- a/tianhe_approvals/models/__init__.py +++ b/tianhe_approvals/models/__init__.py @@ -3,3 +3,9 @@ from . import tianhe_purchase_work_approval from . import inherit_approval_category +from . import tianhe_general_party_branch_post +from . import tianhe_dsh_issues_declarations +from . import tianhe_official_issues_for_son +from . import tianhe_official_issues +from . import tianhe_official_receipt +from . import tianhe_meeting_file \ No newline at end of file diff --git a/tianhe_approvals/models/inherit_approval_category.py b/tianhe_approvals/models/inherit_approval_category.py index eb31e5a2b..26f8f8479 100644 --- a/tianhe_approvals/models/inherit_approval_category.py +++ b/tianhe_approvals/models/inherit_approval_category.py @@ -9,4 +9,10 @@ class ApprovalCategory(models.Model): approval_category_type = fields.Selection([ ('demo', 'demo测试'), ('purchase_work', '采购审批单'), + ('general_party_branch_post', '党总支发文'), + ('tianhe_dsh_issues_declarations', '董事会议题申报表'), + ('official_issues_for_son', '公文发文(子企业)'), + ('official_issues', '公文发文'), + ('official_receipt', '公文收文'), + ('meeting_file', '会议文档'), ]) \ No newline at end of file diff --git a/tianhe_approvals/models/tianhe_dsh_issues_declarations.py b/tianhe_approvals/models/tianhe_dsh_issues_declarations.py new file mode 100644 index 000000000..c77731ee2 --- /dev/null +++ b/tianhe_approvals/models/tianhe_dsh_issues_declarations.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, tools +from odoo.exceptions import ValidationError + + +class TianHeDshIssuesDeclarations(models.Model): + _inherit = "approval.request" + _description = '天河投资办公室——董事会议题申报表' + + dsh_issues_declarations_ids = fields.One2many('tianhe.dsh.issues.declarations','approval_request_dsh_id',string="正文") + +class TianHeDshIssuesDeclarationsMianText(models.Model): + _name="tianhe.dsh.issues.declarations" + _description = '天河投资办公室——董事会议题申报表正文' + + approval_request_dsh_id = fields.Many2one('approval.request') + text = fields.Char(string="议题") + + + + diff --git a/tianhe_approvals/models/tianhe_general_party_branch_post.py b/tianhe_approvals/models/tianhe_general_party_branch_post.py new file mode 100644 index 000000000..c92ab0236 --- /dev/null +++ b/tianhe_approvals/models/tianhe_general_party_branch_post.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, tools +from odoo.exceptions import ValidationError + + +class TianHeGeneralPartyBranchPost(models.Model): + _inherit = "approval.request" + _description = '天河投资办公室——党总支发文' + + # approvals_department_id 部门 + # date_confirm 确认日期 + # 份数,发文编号,紧急度,密级,主送,抄送,正文,经办人意见 + # header = fields.Char(string="标题") + file_number = fields.Char(string="份数") + file_id = fields.Char(string="发文编号") + approvals_urgent_dz = fields.Selection([('normal', '一般'), ('urgent', '紧急'),('extra_urgent', '特急')], string="紧急程度") + secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'),('secret', '机密'),('so_secret', '绝密')], string="密级") + main_flats = fields.Char(string="主送") + cp_flats = fields.Char(string="抄送") + dz_main_text = fields.Text(string="正文") + # approval_line = fields.One2Many('approval.request.line', string="") +# +# class TianHeGeneralPartyBranchPostLine(models.Model): +# _inherit = "approval.request.line" +# +# fields1 = fields.Char(string="fields1") +# fields1 = fields.Char(string="fields1") +# fields1 = fields.Char(string="fields1") \ No newline at end of file diff --git a/tianhe_approvals/models/tianhe_meeting_file.py b/tianhe_approvals/models/tianhe_meeting_file.py new file mode 100644 index 000000000..ca39975af --- /dev/null +++ b/tianhe_approvals/models/tianhe_meeting_file.py @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, tools +from odoo.exceptions import ValidationError + + +class TianheMeetingFile(models.Model): + _inherit = "approval.request" + _description = '天河投资办公室——会议文档' + + + official_main_text = fields.Text(string="正文") \ No newline at end of file diff --git a/tianhe_approvals/models/tianhe_official_issues.py b/tianhe_approvals/models/tianhe_official_issues.py new file mode 100644 index 000000000..d4c48117a --- /dev/null +++ b/tianhe_approvals/models/tianhe_official_issues.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, tools +from odoo.exceptions import ValidationError + + +class TianheOfficialIssues(models.Model): + _inherit = "approval.request" + _description = '天河投资办公室——公文发文' + + file_number = fields.Char(string="份数") + go_file_id = fields.Char(string="来文编号") + approvals_urgent_company = fields.Selection([('normal', '一般'), ('urgent', '紧急'),('extra_urgent', '特急')], string="紧急程度") + secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'),('secret', '机密'),('so_secret', '绝密')], string="密级") + main_flats = fields.Char(string="主送") + cp_flats = fields.Char(string="抄送") + official_main_text = fields.Text(string="正文") \ No newline at end of file diff --git a/tianhe_approvals/models/tianhe_official_issues_for_son.py b/tianhe_approvals/models/tianhe_official_issues_for_son.py new file mode 100644 index 000000000..7b3f24f10 --- /dev/null +++ b/tianhe_approvals/models/tianhe_official_issues_for_son.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, tools +from odoo.exceptions import ValidationError + + +class TianheOfficialIssuesForSon(models.Model): + _inherit = "approval.request" + _description = '天河投资办公室——公司发文(子企业)' + + #来问编号,来文单位 + # header = fields.Char(string="标题") + come_file_id = fields.Char(string="来文编号") + come_company_id = fields.Char(string="来文单位") + approvals_urgent_company = fields.Selection([('normal', '一般'), ('urgent', '紧急'),('extra_urgent', '特急')], string="紧急程度") + secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'),('secret', '机密'),('so_secret', '绝密')], string="密级") + official_main_text = fields.Text(string="正文") \ No newline at end of file diff --git a/tianhe_approvals/models/tianhe_official_receipt.py b/tianhe_approvals/models/tianhe_official_receipt.py new file mode 100644 index 000000000..b8cbb01ba --- /dev/null +++ b/tianhe_approvals/models/tianhe_official_receipt.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +from odoo import api, fields, models, tools +from odoo.exceptions import ValidationError + + +class TianheOfficialCompanyIssues(models.Model): + _inherit = "approval.request" + _description = '天河投资办公室——公文收文' + + + come_file_id = fields.Char(string="来文编号") + approvals_urgent_company = fields.Selection([('normal', '一般'), ('urgent', '紧急'),('extra_urgent', '特急')], string="紧急程度") + secret_level = fields.Selection([('normal', '一般'), ('urgent', '秘密'),('secret', '机密'),('so_secret', '绝密')], string="密级") + come_company_id = fields.Char(string="来问单位") + official_main_text = fields.Text(string="正文") \ No newline at end of file diff --git a/tianhe_approvals/views/tianhe_dsh_issues_declarations.xml b/tianhe_approvals/views/tianhe_dsh_issues_declarations.xml new file mode 100644 index 000000000..cdf8386ac --- /dev/null +++ b/tianhe_approvals/views/tianhe_dsh_issues_declarations.xml @@ -0,0 +1,22 @@ + + + + approvals.category.type.code.dsh.issues.declarations + approval.request + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tianhe_approvals/views/tianhe_general_party_branch_post.xml b/tianhe_approvals/views/tianhe_general_party_branch_post.xml new file mode 100644 index 000000000..4d55eedf8 --- /dev/null +++ b/tianhe_approvals/views/tianhe_general_party_branch_post.xml @@ -0,0 +1,27 @@ + + + + approvals.category.type.code.purchase.work.approval + approval.request + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tianhe_approvals/views/tianhe_meeting_file.xml b/tianhe_approvals/views/tianhe_meeting_file.xml new file mode 100644 index 000000000..f3e0d27d7 --- /dev/null +++ b/tianhe_approvals/views/tianhe_meeting_file.xml @@ -0,0 +1,15 @@ + + + + approvals.category.type.code.meeting.file + approval.request + + + + + + + + + + \ No newline at end of file diff --git a/tianhe_approvals/views/tianhe_official_issues.xml b/tianhe_approvals/views/tianhe_official_issues.xml new file mode 100644 index 000000000..35a3c7ce9 --- /dev/null +++ b/tianhe_approvals/views/tianhe_official_issues.xml @@ -0,0 +1,25 @@ + + + + approvals.category.type.code.official.issues + approval.request + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tianhe_approvals/views/tianhe_official_issues_for_son.xml b/tianhe_approvals/views/tianhe_official_issues_for_son.xml new file mode 100644 index 000000000..dd5229747 --- /dev/null +++ b/tianhe_approvals/views/tianhe_official_issues_for_son.xml @@ -0,0 +1,23 @@ + + + + approvals.category.type.code.official.issues.for.son + approval.request + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tianhe_approvals/views/tianhe_official_receipt.xml b/tianhe_approvals/views/tianhe_official_receipt.xml new file mode 100644 index 000000000..022ce4069 --- /dev/null +++ b/tianhe_approvals/views/tianhe_official_receipt.xml @@ -0,0 +1,23 @@ + + + + approvals.category.type.code.tianhe.official.receipt + approval.request + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/yuthon_approval/views/demo_approval_request.xml b/yuthon_approval/views/demo_approval_request.xml index 11ff55e2c..269ae2f7c 100644 --- a/yuthon_approval/views/demo_approval_request.xml +++ b/yuthon_approval/views/demo_approval_request.xml @@ -6,9 +6,9 @@ - - - + + + diff --git a/yuthon_hr_employee/models/yuthon_hr_department.py b/yuthon_hr_employee/models/yuthon_hr_department.py index 49e40e4fc..cb6b1e21a 100644 --- a/yuthon_hr_employee/models/yuthon_hr_department.py +++ b/yuthon_hr_employee/models/yuthon_hr_department.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from odoo import api, fields, models, _ +from odoo import api, fields, models class YuthonHrDepartment(models.Model): diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py index 08567b346..1e7c5a40c 100644 --- a/yuthon_hr_employee/models/yuthon_hr_employee.py +++ b/yuthon_hr_employee/models/yuthon_hr_employee.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from odoo import api, fields, models, _ +from odoo import api, fields, models nation_list = [('a', '汉族'), ('b', '壮族'), ('v', '满族'), ('d', '回族'), ('e', '苗族'), ('f', '维吾尔族'), ('g', '土家族'), ('h', '彝族'), ('i', '蒙古族'), ('j', '藏族'), ('k', '布依族'), ('l', '侗族'), diff --git a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml index 6f7da077c..d06adbf9f 100644 --- a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml +++ b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml @@ -100,9 +100,9 @@ 1 - - - + + + @@ -154,6 +154,14 @@ + + + + + + + + diff --git a/yuthon_hr_employee/wizard/hr_employee_wizard.py b/yuthon_hr_employee/wizard/hr_employee_wizard.py index 6d3502b70..ee078b23e 100644 --- a/yuthon_hr_employee/wizard/hr_employee_wizard.py +++ b/yuthon_hr_employee/wizard/hr_employee_wizard.py @@ -33,7 +33,7 @@ class YuthonHrEmployeeWizard(models.Model): } def employee_user_data(self, row): - employee_id = self.env['hr.employee'].search([('name', '=', row[0].value)]) + employee_name = self.env['hr.employee'].search([('name', '=', row[0].value)]) department_id = self.env['hr.department'].search([('name', '=', row[1].value.split('\\')[-1])]) role_data = row[4].value role_list_ids = [] @@ -50,25 +50,21 @@ class YuthonHrEmployeeWizard(models.Model): else: role_list_ids.append(user_role.search([('name', '=', role_data.split(',')[i])])) employee_data = { - 'name': employee_id.name, + 'name': employee_name.name, 'department_id': department_id.id, 'user_sex': 'boy' if row[2].value == '男' else 'girl', 'birthday': datetime.strptime(row[3].value, '%Y-%m-%d').date(), - 'user_role_ids': role_list_ids, + 'main_user_role': role_list_ids, 'mobile_phone': row[5].value, 'work_phone': row[6].value, 'work_email': row[7].value, } - if len(employee_id) > 1: - raise UserError('重名请手动更新%s' % employee_id.name) - elif employee_id: - employee_id.write(employee_data) + if len(employee_name) != 1: + raise UserError('重名请手动更新') + elif employee_name: + employee_name.write(employee_data) else: - employee_id.create(employee_data) - - - - + employee_name.create(employee_data)