diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py
index a8f0403bd..d9d074812 100644
--- a/soong_workflow/wizard/soong_workflow_comment_wizard.py
+++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py
@@ -697,14 +697,25 @@ class SoongWorkflowCommentWizard(models.TransientModel):
current_datetime = fields.Datetime.now()
is_admin = current_user.has_group('base.group_system')
if is_admin:
- last_log = record_id.log_ids[-1]
- if last_log.approval_state not in ['2', '3']:
- last_log.sudo().write({
+ user_log = record_id.log_ids.filtered(
+ lambda log: log.done_by == current_user and log.node_btn_name != '1' and log.approval_state == '0'
+ )
+ if user_log:
+ user_log.write({
'comment': self.comment,
'approval_state': "2",
- 'lase_click_date': fields.Datetime.now() - timedelta(hours=8),
+ 'lase_click_date': current_datetime,
'document_ids': [(6, 0, self.document_ids.ids)]
})
+ else:
+ last_log = record_id.log_ids[-1]
+ if last_log.approval_state not in ['2', '3']:
+ last_log.sudo().write({
+ 'comment': self.comment,
+ 'approval_state': "2",
+ 'lase_click_date': fields.Datetime.now() - timedelta(hours=8),
+ 'document_ids': [(6, 0, self.document_ids.ids)]
+ })
self.env['soong.workflow.record'].search([('code', '=', record_id.code)]).write({'approve_state': 'end',
"employee_ids": False,
"node_id": False, })
diff --git a/yuthon_issue/views/issue_library_views.xml b/yuthon_issue/views/issue_library_views.xml
index c1846ce77..616874b91 100644
--- a/yuthon_issue/views/issue_library_views.xml
+++ b/yuthon_issue/views/issue_library_views.xml
@@ -57,7 +57,7 @@
-
+