diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index 1d3568fec..dd0e6238a 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -63,6 +63,7 @@ class SoongWorkflowMixin(models.AbstractModel): string="Status", default=_compute_default_state, track_visibility="onchange", + store = True ) # approve_state = fields.Selection( # [ @@ -853,6 +854,11 @@ class SoongWorkflowMixin(models.AbstractModel): field_inst.set("readonly", "0") else: # Set Attributes + # if self.state in readonly_arr : + # field_inst.set("readonly", "1") + # else: + # field_inst.set("readonly", "0") + read_num = '' if readonly_arr: id_el = etree.Element("field") id_el.set("name", "log_ids") diff --git a/soong_workflow/models/soong_workflow_node.py b/soong_workflow/models/soong_workflow_node.py index 2c5fc44e9..79b1bc759 100644 --- a/soong_workflow/models/soong_workflow_node.py +++ b/soong_workflow/models/soong_workflow_node.py @@ -271,7 +271,7 @@ class SoongWorkflowNode(models.Model): field_names = set() for field_node in xml_tree.xpath("//field"): field_name = field_node.get("name") - if field_name: + if field_name and field_name != "name_title": field_names.add(field_name) for field in self.env["ir.model.fields"].search( [("model_id", "=", rec.model_id.id), ("name", "in", list(field_names))]): diff --git a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py index 04587ffe1..e3e668a10 100644 --- a/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py +++ b/yuthon_hr_attendance/models/hr_attendance_detail_wechat.py @@ -295,9 +295,9 @@ class HrAttendanceDetail(models.Model): for current_date in self.sudo().divide_time_range_fixed(start_time, now_time): self.sudo()._do_save_wx_attendance_data(user, current_date) self.sudo()._do_plan_save_wx_attendance_data(user, current_date) - attendance_records = self.env['hr.attendance'].search([], limit=1) - if attendance_records: - attendance_records[0].labor_update() + # attendance_records = self.env['hr.attendance'].search([], limit=1) + # if attendance_records: + # attendance_records[0].labor_update() return True diff --git a/yuthon_hr_employee/models/yuthon_hr_department.py b/yuthon_hr_employee/models/yuthon_hr_department.py index b0f0f1322..578309e50 100644 --- a/yuthon_hr_employee/models/yuthon_hr_department.py +++ b/yuthon_hr_employee/models/yuthon_hr_department.py @@ -9,6 +9,7 @@ class YuthonHrDepartment(models.Model): _rec_name = 'name' _order = 'department_code asc' + name = fields.Char(string="部门名称", tracking=True, required=True) department_phone = fields.Char(string="部门电话") department_fax = fields.Char(string="部门传真") department_location = fields.Char(string="部门地址") @@ -95,4 +96,45 @@ class YuthonHrDepartment(models.Model): old_suffix = employee.number[-2:] employee.number = record.department_code + old_suffix + def open_record(self): + return { + "type": "ir.actions.act_window", + "res_model": 'hr.department', + "res_id": self.id, + "name":"部门详情", + "view_mode": "form", + } + + def put_department_change(self): + form_id = self.env.ref('yuthon_hr_employee_approval.view_yuthon_department_change_form').id + department_list = [] + for record in self: + department_list.append([0, 0, {'department_id': record.id,}]) + return { + "type": "ir.actions.act_window", + "name": "部门变成审批", + "res_model": "yuthon.department.change", + "views": [[form_id, "form"]], + "context": { + 'default_approval_ids': department_list, + } + } + + def all_put_department_change(self): + department_list = [] + department_ids = self.env["hr.department"].browse( + self._context.get('active_ids', self._context.get('active_id'))) + for record in department_ids: + department_list.append([0, 0, {'department_id': record.id,}]) + form_id = self.env.ref('yuthon_hr_employee_approval.view_yuthon_department_change_form').id + return { + "type": "ir.actions.act_window", + "name": "部门变成审批", + "res_model": "yuthon.department.change", + "views": [[form_id, "form"]], + "context": { + 'default_approval_ids': department_list, + } + } + diff --git a/yuthon_hr_employee/views/yuthon_hr_department_views.xml b/yuthon_hr_employee/views/yuthon_hr_department_views.xml index 9787df868..394935c82 100644 --- a/yuthon_hr_employee/views/yuthon_hr_department_views.xml +++ b/yuthon_hr_employee/views/yuthon_hr_department_views.xml @@ -14,6 +14,11 @@ 20 True + + + + + 1 @@ -36,6 +41,8 @@ +