添加功能

This commit is contained in:
李鹏宇
2026-03-20 11:23:16 +08:00
parent 6197300bf9
commit 67fc0bfdeb
2 changed files with 16 additions and 5 deletions
@@ -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, })
+1 -1
View File
@@ -57,7 +57,7 @@
<button name="all_meeting_issue" type="object" string="会议安排" class="oe_highlight" groups="yuthon_salary.group_lc_user"/>
</header>
<field name="name" column_invisible="1"/>
<field name="is_meeting" invisible="1"/>
<field name="is_meeting" column_invisible="1"/>
<field name="department_id"/>
<field name="name_text" class="list_width"/>
<field name="is_party" groups="yuthon_salary.group_jtbb_user" string="党总支"/>