diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index 743981bd0..fcd04ba59 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -659,11 +659,28 @@ class SoongWorkflowMixin(models.AbstractModel): self.env["soong.workflow.record"].create(values) if record_obj: - record_obj.update({"workflow_id": rec.workflow_id.id, - "node_id": rec.node_id.id, - "done_by": self.env.uid, - "write_date2": fields.Datetime.now(), - }) + # 获取上一节点的结束时间(即log_ids最后一条记录的lase_click_date) + node_update_time = False + try: + if hasattr(rec, 'log_ids') and rec.log_ids: + # 按ID排序获取最后一条日志 + sorted_logs = rec.log_ids.sorted(lambda log: log.id) + if sorted_logs and sorted_logs[-1].lase_click_date: + node_update_time = sorted_logs[-1].lase_click_date + except Exception as e: + _logger.debug(f"Failed to get node_update_time: {e}") + + # 更新记录 + update_vals = { + "workflow_id": rec.workflow_id.id, + "node_id": rec.node_id.id, + "done_by": self.env.uid, + "write_date2": fields.Datetime.now(), + } + if node_update_time: + update_vals["node_update_time"] = node_update_time + + record_obj.update(update_vals) def find_fields_by_string(self,record_id): """ diff --git a/soong_workflow/models/soong_workflow_record.py b/soong_workflow/models/soong_workflow_record.py index b54864820..e4625d0fe 100644 --- a/soong_workflow/models/soong_workflow_record.py +++ b/soong_workflow/models/soong_workflow_record.py @@ -82,6 +82,9 @@ class SoongWorkflowRecord(models.Model): is_company = fields.Boolean(string="本公司", default=True, compute='_compute_is_company',search='_search_part_of_company') + # 办结时间(上一节点的结束时间) + node_update_time = fields.Datetime(string="办结时间") + @api.depends_context('uid', 'company') @api.depends('company_id') def _compute_is_company(self): diff --git a/soong_workflow/security/soong_workflow_security.xml b/soong_workflow/security/soong_workflow_security.xml index f6de335eb..53e5e05c4 100644 --- a/soong_workflow/security/soong_workflow_security.xml +++ b/soong_workflow/security/soong_workflow_security.xml @@ -8,10 +8,18 @@ User + + + 工作流--人事分组 + + + + + Manager - + @@ -38,17 +46,5 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/soong_workflow/static/src/css/record_scss.scss b/soong_workflow/static/src/css/record_scss.scss index cf994af51..ea7524cb1 100644 --- a/soong_workflow/static/src/css/record_scss.scss +++ b/soong_workflow/static/src/css/record_scss.scss @@ -19,4 +19,16 @@ } .o_comment_combined_input { flex: 2; +} + +.o_kanban_soong_wkf_record { + .o_kanban_record_headings { + flex: 1; + } + .o_kanban_record_bottom { + flex: 0 0 94px; + @include media-breakpoint-down(sm) { + flex: 0 0 56px; + } + } } \ No newline at end of file diff --git a/soong_workflow/templates/soong_workflow_templates.xml b/soong_workflow/templates/soong_workflow_templates.xml index 6a176b10f..7b2195461 100644 --- a/soong_workflow/templates/soong_workflow_templates.xml +++ b/soong_workflow/templates/soong_workflow_templates.xml @@ -175,21 +175,21 @@ -
+
- - 节点: - +
+ + 节点: + + + 状态: + +
- 状态: - -
-
- - 经办人: + 经办人:
@@ -197,7 +197,7 @@ 意见:
-
+
附件: diff --git a/soong_workflow/views/soong_workflow_record.xml b/soong_workflow/views/soong_workflow_record.xml index fe4111ea0..57b8f1623 100644 --- a/soong_workflow/views/soong_workflow_record.xml +++ b/soong_workflow/views/soong_workflow_record.xml @@ -243,7 +243,7 @@ decoration-danger="approve_state == 'end'" decoration-success="approve_state == 'pending'"/> - + @@ -252,7 +252,42 @@ invisible="not is_unlink"/>
diff --git a/yuthon_report/static/src/components/yuthon_report/yuthon_report.scss b/yuthon_report/static/src/components/yuthon_report/yuthon_report.scss index b48b3cd88..3847f6bd2 100644 --- a/yuthon_report/static/src/components/yuthon_report/yuthon_report.scss +++ b/yuthon_report/static/src/components/yuthon_report/yuthon_report.scss @@ -23,4 +23,9 @@ } .stat-change { font-size: 0.9rem; + } + + /* 下拉框placeholder样式 */ + #formview_default_conditions option[value=""] { + color: #6c757d; } \ No newline at end of file diff --git a/yuthon_salary/controllers/salary_phone.py b/yuthon_salary/controllers/salary_phone.py index 226e1be6a..477bf3cea 100644 --- a/yuthon_salary/controllers/salary_phone.py +++ b/yuthon_salary/controllers/salary_phone.py @@ -66,16 +66,16 @@ class YuthonWillTask(http.Controller): users_id = int(kw.get('users_id')) user = request.env['res.users'].sudo().browse(int(users_id)) employee_id = user.with_company(user.company_id.id).employee_id.id - records = request.env['hr.payslip'].sudo().search([('employee_id', '=', employee_id)]) + records = request.env['yuthon.salary.active'].sudo().search([('employee_id', '=', employee_id)]) data = {} for record in records: - year = record.date_from.year - month = record.date_from.month + year = int(record.select_year) + month = int(record.select_time) if year not in data.keys(): data[year] = {'total': 0} if month not in data[year].keys(): - data[year][month] = {'total': record.actual_salary} - data[year]['total'] += record.actual_salary + data[year][month] = {'total': record.actual_paid_salary} + data[year]['total'] += record.actual_paid_salary return json.dumps({'data': data, 'code': 200, 'message': ''}) @http.route('/phone/salary/self/detail', type='http', auth="none", csrf=False, cors='*') diff --git a/yuthon_will_task/controllers/main.py b/yuthon_will_task/controllers/main.py index 7a3983343..3d01ae9b4 100644 --- a/yuthon_will_task/controllers/main.py +++ b/yuthon_will_task/controllers/main.py @@ -73,12 +73,10 @@ class YuthonWillTask(http.Controller): @http.route('/will/task/list', methods=['POST'], type='http', auth='public', csrf=False) def will_task_list(self, **kwargs): - employee_id = request.env['hr.employee'].search([('user_id', '=', int(kwargs.get('users_id')))]) start = kwargs.get('start') request_hour_selection = request.env['yuthon.will.task'].sudo().fields_get(allfields=['request_hour_from'])['request_hour_from']['selection'] result_list = [] - # task_ids = request.env['yuthon.will.task'].sudo().search([], offset=start, limit=20) - task_ids = request.env['yuthon.will.task'].sudo().search(['|', ('employee_ids', 'in', employee_id.id), ('employee_id.id', '=', employee_id.id)], offset=start, limit=20) + task_ids = request.env['yuthon.will.task'].sudo().search([('users_ids', 'in', [int(kwargs.get('users_id'))])], offset=start, limit=20) for task in task_ids: weekday_str = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"][task.start_date.weekday()] result = { @@ -123,15 +121,21 @@ class YuthonWillTask(http.Controller): 'id': task.id, 'name': task.name, 'employee_id': task.employee_id.name, - 'employee_ids': ', '.join(task.employee_ids.mapped('name')), + 'employee_ids': ','.join(task.employee_ids.mapped('name')), + 'employee_ids2': ','.join(task.employee_ids2.mapped('name')), + 'task_time_ids': ','.join(task.task_time_ids.mapped('name')), + 'drivers': task.employee_ids2.read(['name']), + 'employee': task.employee_ids.read(['name']), + 'task_time': task.task_time_ids.read(['name']), 'employee_num': len(task.employee_ids), 'start_date': fields.Date.to_string(task.start_date), 'weekday': weekday_str, - 'request_hour_from': '', - 'request_hour_to': '', + 'request_hour_from': task.request_hour_from, + 'request_hour_to': task.request_hour_to, 'remarks': task.remarks, 'address': task.address, 'file_list': file_list, + 'priority': task.priority, } hour_dict = dict(request_hour_selection) diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml index 45229df20..9d89f5109 100644 --- a/yuthon_work_brand/views/hr_menus.xml +++ b/yuthon_work_brand/views/hr_menus.xml @@ -757,7 +757,7 @@ - + @@ -767,7 +767,7 @@ - +