diff --git a/soong_workflow/models/soong_workflow_node.py b/soong_workflow/models/soong_workflow_node.py index aef18abfc..6a923149f 100644 --- a/soong_workflow/models/soong_workflow_node.py +++ b/soong_workflow/models/soong_workflow_node.py @@ -113,6 +113,13 @@ class SoongWorkflowNode(models.Model): },)] else: val["button_ids"] = [ + (0, 0, { + "name": _("上议题"), + "workflow_id": val['workflow_id'], + "sequence":-1, + "action_type": "code", + "code": "obj.action_meeting()" + }), (0, 0, { "name": _("转交"), "workflow_id": val['workflow_id'], @@ -151,6 +158,7 @@ class SoongWorkflowNode(models.Model): "action_type": "code", "has_comment": True, },)] + return super().create(values) @api.depends("bg_color", "label_color", "use_custom_colors", "flow_start", "flow_end") diff --git a/yuthon_hr_attendance/__manifest__.py b/yuthon_hr_attendance/__manifest__.py index badddeb7e..a8c8ef95c 100644 --- a/yuthon_hr_attendance/__manifest__.py +++ b/yuthon_hr_attendance/__manifest__.py @@ -17,7 +17,6 @@ 'security/ir.model.access.csv', # 'security/approval_attendance.xml', 'data/attendance_code_data.xml', - 'data/attendance_data.xml', 'views/inherit_hr_employee_views.xml', 'views/hr_attendance_views.xml', 'views/resource_calendar_leaves_views.xml', @@ -30,8 +29,6 @@ 'views/leave_approval.xml', 'views/remove_holiday_approval.xml', 'views/card_approval.xml', - 'views/holiday_manage.xml', - 'views/holiday_manage_balance.xml', 'views/attendance_scheme.xml', 'views/attendance_iot_datas.xml', 'views/all_attendance_menu.xml', diff --git a/yuthon_hr_attendance/data/attendance_data.xml b/yuthon_hr_attendance/data/attendance_data.xml deleted file mode 100644 index 638d617c8..000000000 --- a/yuthon_hr_attendance/data/attendance_data.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - 加班申请 - - - - - 外出申请 - - - - - - - - - - 请假申请 - - - - - 销假申请 - - - - - 补卡申请 - - - \ No newline at end of file diff --git a/yuthon_hr_attendance/models/__init__.py b/yuthon_hr_attendance/models/__init__.py index 70b02613f..419f07e07 100644 --- a/yuthon_hr_attendance/models/__init__.py +++ b/yuthon_hr_attendance/models/__init__.py @@ -10,9 +10,8 @@ from . import duty_approval from . import leave_approval from . import remove_holiday_approval from . import card_approval -from . import holiday_manage -from . import holiday_manage_balance from . import attendance_iot_manager from . import attendance_iot_datas from . import attendance_scheme + diff --git a/yuthon_hr_attendance/models/holiday_manage.py b/yuthon_hr_attendance/models/holiday_manage.py deleted file mode 100644 index 9632f9233..000000000 --- a/yuthon_hr_attendance/models/holiday_manage.py +++ /dev/null @@ -1,86 +0,0 @@ -# -*- coding: utf-8 -*- - -from odoo import api, fields, models, tools -from odoo.exceptions import ValidationError -from datetime import datetime - - -class HolidayManage(models.Model): - _name = "holiday.manage" - _description = '假期管理' - _rec_name = 'name' - - # 基础信息设置 - name = fields.Char(string="假期名称") - # 范围,角色,部门,人员 - department_ids = fields.Many2many('hr.department', string='部门范围') - employee_ids = fields.Many2many('hr.employee', string='人员范围') - users_role_ids = fields.Many2many('soong.user.role', string='角色范围') - holiday_users_ids = fields.Many2many('res.users', string="申请假期人员", compute="compute_holiday_users_ids", store=True) - - is_limit = fields.Boolean(string="新员工请假是否限制", help='入职即可请假') - leave_time = fields.Selection(selection=[(str(i), str(i)) for i in range(1, 13)], string="入职月份", help='入职时长小于此月份时,不可申请此假期') - start_time = fields.Datetime(string="生效日期", default=fields.Datetime.now) - end_time = fields.Datetime(string="失效日期",) - is_enable = fields.Boolean(string="是否启用", default="False", compute="compute_is_enable", store=True) - # 请假时长核算规则 - leave_unit = fields.Selection([('day', '按天'), ('hours', '按小时')], string="请假单位") - unit_conversion = fields.Float(string="单位换算", help='将按此规则对天与小时进行转换,有打卡规则按工作时长计算') - time_long = fields.Selection([('nature', '自然日'), ('work', '工作日')], string="时长计算") - # 假期余额发放规则 - - is_quota = fields.Boolean(string="是否限额") - issuance_method = fields.Selection([('moth', '按月自动发放'), ('year', '按年自动发放'), ('manual', '手动导入余额')], string='发放方式') - # 按月自动发放 - - # 按年自动发放 - - # valid = fields.Selection([('forever', '永久有效'), ('no', '每年固定日期生效')], string="假期有效期") - # release_time = fields.Selection([('calendar', '自然年'), ('onboard', '员工入职日期发放')], string="发放时间") - # credit_rules = fields.Selection([('fixed', '固定额度'), ('division', '按司龄发放'),('seniority','按工龄发放')], string="额度计算规则") - # person_year = fields.Float(string="每人每年发放") - # is_balance= fields.Boolean(string="按实际工作时长发放余额") - # valid_holidays = fields.Integer(string="假期有效期") - # is_time = fields.Boolean(string="允许有效时长") - - - @api.depends('department_ids', 'employee_ids', 'users_role_ids') - def compute_holiday_users_ids(self): - department_users_list = users_role_list = [] - for users in self: - if users.department_ids: - # 查看是否下级部门 - for depart in users.department_ids: - department_users_data = users.env['hr.employee'].search([('department_id', '=', depart.id.origin)]) - department_users_list = [de.user_id.id for de in department_users_data] - if depart.child_ids: - for child in depart.child_ids: - department_child_users_data = users.env['hr.employee'].search( - [('department_id', '=', child.id.origin)]) - department_users_list += [de.user_id.id for de in department_child_users_data] - employee_users_list = users.employee_ids.user_id.ids - if users.users_role_ids: - for user_id in users.users_role_ids: - user_role_data = users.env['hr.employee'].search( - ['|', ('user_role_id', '=', user_id.id.origin), ('user_role_ids', '=', user_id.id.origin)]) - users_role_list = [ro.user_id.id for ro in user_role_data] - publish_user_list = department_users_list + employee_users_list + users_role_list - false_none_list = [x for x in publish_user_list if x != False] - users.room_users_ids = [(6, 0, list(set(false_none_list)))] - - @api.depends('start_time', 'end_time') - def compute_is_enable(self): - for rec in self: - if rec.start_time and rec.end_time: - if rec.start_time < datetime.now() and rec.end_time > datetime.now(): - rec.is_enable = True - else: - rec.is_enable = False - else: - rec.is_enable = False - - - - - - diff --git a/yuthon_hr_attendance/models/holiday_manage_balance.py b/yuthon_hr_attendance/models/holiday_manage_balance.py deleted file mode 100644 index 275bb553d..000000000 --- a/yuthon_hr_attendance/models/holiday_manage_balance.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -from odoo import api, fields, models, tools -from odoo.exceptions import ValidationError - - -class HolidayManageBalance(models.Model): - _name = "holiday.manage.balance" - _description = '假期余额' - _rec_name = 'name' - - name = fields.Many2one('hr.employee', string="姓名") - department_id = fields.Many2one('hr.department', string='部门') - onboard_date = fields.Date(string="入职日期") - first_data = fields.Datetime(string="首次参加工作时间") - annual_leave = fields.Float(string="年假") - time_off = fields.Float(string="补休") - - leave = fields.Char(string="事假") - sick_leave = fields.Char(string="病假") - - type_leave = fields.Many2one('holiday.type.setting',string="请假类型") - estimated_time = fields.Datetime(string="预计时长") - actual_time = fields.Datetime(string="实际时长") - used_time = fields.Datetime(string="已用时长") - rest_time = fields.Datetime(string="剩余时长") - - - - diff --git a/yuthon_hr_attendance/security/ir.model.access.csv b/yuthon_hr_attendance/security/ir.model.access.csv index b3e4a98ad..684f152d2 100644 --- a/yuthon_hr_attendance/security/ir.model.access.csv +++ b/yuthon_hr_attendance/security/ir.model.access.csv @@ -3,20 +3,14 @@ access_resource_calendar_holiday,resource.calendar.holiday,model_resource_calend access_overtime_approval,overtime.approval,model_overtime_approval,base.group_user,1,1,1,1 access_go_approval,go.approval,model_go_approval,base.group_user,1,1,1,1 access_duty_approval,duty.approval,model_duty_approval,base.group_user,1,1,1,1 -access_leave_approval,leave.approval,model_leave_approval,base.group_user,1,1,1,1 -access_holidays_approval,holidays.approval,model_holidays_approval,base.group_user,1,1,1,1 access_remove_holiday_approval,remove.holiday.approval,model_remove_holiday_approval,base.group_user,1,1,1,1 access_card_approval,card.approval,model_card_approval,base.group_user,1,1,1,1 -access_holiday_manage,holiday_manage,model_holiday_manage,base.group_user,1,1,1,1 access_attendance_iot,attendance_iot,model_attendance_iot,base.group_user,1,1,1,1 access_attendance_iot_manager,attendance_iot_manager,model_attendance_iot_manager,base.group_user,1,1,1,1 access_attendance_iot_manager_wizard,attendance_iot_manager_wizard,model_attendance_iot_manager_wizard,base.group_user,1,1,1,1 -access_holiday_manage_balance,holiday_manage_balance,model_holiday_manage_balance,base.group_user,1,1,1,1 access_attendance_iot_datas,attendance_iot_datas,model_attendance_iot_datas,base.group_user,1,1,1,1 access_attendance_scheme,attendance_scheme,model_attendance_scheme,base.group_user,1,1,1,1 -access_holidays_approvals_line,holidays.approvals.line,model_holidays_approvals_line,base.group_user,1,1,1,1 access_card_approvals_line,card.approval.line,model_card_approvals_line,base.group_user,1,1,1,1 -access_holidays_approvals_line,holidays.approvals.line,model_holidays_approvals_line,base.group_user,1,1,1,1 access_go_approvals_line,go.approvals.line,model_go_approvals_line,base.group_user,1,1,1,1 access_overtime_user_line,overtime.user.line,model_overtime_user_line,base.group_user,1,1,1,1 access_duty_approval_line,duty.approval.line,model_duty_approval_line,base.group_user,1,1,1,1 diff --git a/yuthon_hr_attendance/views/all_attendance_menu.xml b/yuthon_hr_attendance/views/all_attendance_menu.xml index 62216cb65..4c263b4d8 100644 --- a/yuthon_hr_attendance/views/all_attendance_menu.xml +++ b/yuthon_hr_attendance/views/all_attendance_menu.xml @@ -20,12 +20,6 @@ parent="menu_hr_attendance_approval_request" sequence="10" action="approval_request_remove_holiday"/> - - - - - - holiday.manage.tree - holiday.manage - - - - - - - - - - - - - - holiday.manage.form - holiday.manage - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - - 假期类型 - holiday.manage - tree,form - - -
\ No newline at end of file diff --git a/yuthon_hr_attendance/views/holiday_manage_balance.xml b/yuthon_hr_attendance/views/holiday_manage_balance.xml deleted file mode 100644 index dd801bb2f..000000000 --- a/yuthon_hr_attendance/views/holiday_manage_balance.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - holiday.manage.balance.tree - holiday.manage.balance - - - - - - - - - - - - - - - - 假期余额 - holiday.manage.balance - tree - - - \ No newline at end of file diff --git a/yuthon_hr_employee_approval/__manifest__.py b/yuthon_hr_employee_approval/__manifest__.py index a56b570b0..dad43aa53 100644 --- a/yuthon_hr_employee_approval/__manifest__.py +++ b/yuthon_hr_employee_approval/__manifest__.py @@ -11,7 +11,7 @@ 'license': 'LGPL-3', 'author': 'pengyuthon', 'website': 'https://www.pengyuthon.com', - 'depends':['base', 'hr', 'yuthon_hr_employee', 'soong_workflow', 'documents', 'hr_recruitment', 'room'], + 'depends':['base', 'hr', 'yuthon_hr_employee', 'soong_workflow', 'documents', 'hr_recruitment', 'room','yuthon_issue'], 'data': [ 'security/ir.model.access.csv', 'data/process_code_data.xml', diff --git a/yuthon_hr_employee_approval/models/yuthon_interview_approval.py b/yuthon_hr_employee_approval/models/yuthon_interview_approval.py index 2aed61f50..0c22c1018 100644 --- a/yuthon_hr_employee_approval/models/yuthon_interview_approval.py +++ b/yuthon_hr_employee_approval/models/yuthon_interview_approval.py @@ -10,14 +10,14 @@ class YuthonInterviewApproval(models.Model): _inherit = 'soong.workflow.mixin' - name = fields.Char(string='名称') + name = fields.Char(string='标题') job_id = fields.Many2one('hr.job', string='应聘岗位') department_id = fields.Many2one("hr.department", string="应聘职务", required=True) code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_interview_approval_code')) applicant_ids = fields.One2many('hr.applicant', 'interview_approval_id', string='应聘面试信息') - + is_issues = fields.Boolean(string='是否上会') company_page = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储')], string="公司") - + related_issues_id = fields.Many2one('issue.library', string="关联议题") def scheduling_of_meetings(self): form_id = self.env.ref("room.room_booking_view_form").id diff --git a/yuthon_hr_employee_approval/views/yuthon_interview_approval_views.xml b/yuthon_hr_employee_approval/views/yuthon_interview_approval_views.xml index 47e84ca38..99a70cd0f 100644 --- a/yuthon_hr_employee_approval/views/yuthon_interview_approval_views.xml +++ b/yuthon_hr_employee_approval/views/yuthon_interview_approval_views.xml @@ -21,19 +21,17 @@
-
-

- -

-
+ + + diff --git a/yuthon_issue/models/__init__.py b/yuthon_issue/models/__init__.py index 493c668cf..313fe4791 100644 --- a/yuthon_issue/models/__init__.py +++ b/yuthon_issue/models/__init__.py @@ -8,3 +8,4 @@ from . import inherit_room_booking from . import issue_approval from . import inherit_hr_employee from . import issue_meeting_minutes +from . import inherit_soong_workflow_mixin diff --git a/yuthon_issue/models/inherit_soong_workflow_mixin.py b/yuthon_issue/models/inherit_soong_workflow_mixin.py new file mode 100644 index 000000000..791bdca43 --- /dev/null +++ b/yuthon_issue/models/inherit_soong_workflow_mixin.py @@ -0,0 +1,22 @@ +from odoo import api, fields, models, _ +from odoo.exceptions import UserError + + +class SoongWorkflowMixin(models.AbstractModel): + _inherit = 'soong.workflow.mixin' + + # 上议题 + def action_meeting(self): + if self.is_issues: + raise UserError('当前议题已上会,请勿重复提交') + self.write({'is_issues': 'Ture'}) + issue_id = self.env['issue.library'].create({'name': self.name}) + self.related_issues_id = issue_id.id + workflow_record_id = self.env["soong.workflow.record"].search([("res_model", "=", self._name), ("res_id", "=", self.id)]) + self.env['issue.library.approval.line'].create({ + 'issue_library_id': issue_id.id, + 'workflow_record_id': workflow_record_id.id, + 'approval_type': workflow_record_id.workflow_id.id, + 'code': self.code, + 'approval_date': fields.Datetime.now(), + }) diff --git a/yuthon_performance/models/yuthon_Index_approval.py b/yuthon_performance/models/yuthon_Index_approval.py index 12cdd88e3..296b489ba 100644 --- a/yuthon_performance/models/yuthon_Index_approval.py +++ b/yuthon_performance/models/yuthon_Index_approval.py @@ -35,8 +35,6 @@ class YuthonIndexApproval(models.Model): 'new_end_index_time': new.end_index_time, 'new_unit_compute': new.unit_compute, 'new_weight': new.weight, - 'new_compute_method': new.compute_method, - 'new_compute_act': new.compute_act, })) self.new_index_library_ids = new_lines diff --git a/yuthon_performance/models/yuthon_duty_management.py b/yuthon_performance/models/yuthon_duty_management.py index d2236e0c4..840b67ded 100644 --- a/yuthon_performance/models/yuthon_duty_management.py +++ b/yuthon_performance/models/yuthon_duty_management.py @@ -75,8 +75,8 @@ class YuthonDutyManagement(models.Model): 'type': 'ir.actions.act_window', 'res_model': 'yuthon.tissue.duty.approval', 'views': [(form_id, 'form')], - 'context': {'default_change_duty_kpi_ids':self.performance_kpi_ids.ids, - 'default_change_duty_gs_ids':self.performance_gs_ids.ids, + 'context': {'default_change_duty_kpi_ids': [(6, 0, self.performance_kpi_ids.ids)], + 'default_change_duty_gs_ids':[(6, 0, self.performance_gs_ids.ids)], }} diff --git a/yuthon_performance/models/yuthon_tissue_duty_approval.py b/yuthon_performance/models/yuthon_tissue_duty_approval.py index 01d0b8445..b6b70d307 100644 --- a/yuthon_performance/models/yuthon_tissue_duty_approval.py +++ b/yuthon_performance/models/yuthon_tissue_duty_approval.py @@ -52,17 +52,17 @@ class YuthonTissueDutyApproval(models.Model): })) self.new_gs_duty_approval_ids = new_lines - @api.model_create_multi - def create(self, vals_list): - res = super().create(vals_list) - for vals in vals_list: - if vals['new_kpi_duty_approval_ids']: - for line in vals['new_kpi_duty_approval_ids']: - self.env['yuthon.kpi.line'].create({ - 'performance_kpi_id':res.id, - 'duty_index_name':line.new_duty_index_name - }) - return res + # @api.model_create_multi + # def create(self, vals_list): + # res = super().create(vals_list) + # for vals in vals_list: + # if vals['new_kpi_duty_approval_ids']: + # for line in vals['new_kpi_duty_approval_ids']: + # self.env['yuthon.kpi.line'].create({ + # 'performance_kpi_id':line.id, + # 'duty_index_name':line.new_duty_index_name + # }) + # return res class NewKpiDutyApproval(models.Model): diff --git a/yuthon_performance/views/yuthon_Index_approval.xml b/yuthon_performance/views/yuthon_Index_approval.xml index a38f48712..107d8221f 100644 --- a/yuthon_performance/views/yuthon_Index_approval.xml +++ b/yuthon_performance/views/yuthon_Index_approval.xml @@ -54,8 +54,6 @@ - - @@ -74,8 +72,6 @@ - - diff --git a/yuthon_performance/views/yuthon_duty_management.xml b/yuthon_performance/views/yuthon_duty_management.xml index 645ac28df..8016fe0c9 100644 --- a/yuthon_performance/views/yuthon_duty_management.xml +++ b/yuthon_performance/views/yuthon_duty_management.xml @@ -12,7 +12,7 @@ -