diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py
index 8c5cca738..8e2051507 100644
--- a/soong_workflow/models/soong_workflow_mixin.py
+++ b/soong_workflow/models/soong_workflow_mixin.py
@@ -17,6 +17,11 @@ class SoongWorkflowMixin(models.AbstractModel):
_name = "soong.workflow.mixin"
_description = "Soong Workflow Mixin"
+ def end_approval(self):
+ record = self.env['soong.workflow.record'].search([('code', '=', self.code)])
+ if record:
+ record.write({'approve_state': 'end'})
+
def read(self, fields=None, load='_classic_read'):
if self.log_ids:
if self.log_ids[-1].done_by.id == self.env.user.id and self.log_ids[-1].approval_state == '0':
diff --git a/yuthon_hr_attendance/models/go_approval.py b/yuthon_hr_attendance/models/go_approval.py
index caa871724..c8eef57cd 100644
--- a/yuthon_hr_attendance/models/go_approval.py
+++ b/yuthon_hr_attendance/models/go_approval.py
@@ -137,4 +137,3 @@ class GoApprovals(models.Model):
-
diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py
index 0da758b44..efc28bf1e 100644
--- a/yuthon_salary/models/inherit_hr_payslip.py
+++ b/yuthon_salary/models/inherit_hr_payslip.py
@@ -419,7 +419,7 @@ class InheritHrPayslip(models.Model):
"target": "new",
}
- def open_record(self):
+ def open_archive_record(self):
return {
"type": "ir.actions.act_window",
"res_model": "hr.payslip.line",
@@ -431,6 +431,15 @@ class InheritHrPayslip(models.Model):
"context": "{'tree_view_ref': 'yuthon_salary.view_hr_payslip_line_tree_custom'}"
}
+ def open_record(self):
+ return {
+ "type": "ir.actions.act_window",
+ "res_model": 'hr.payslip',
+ "res_id": self.id,
+ "name": "薪资详情",
+ "view_mode": "form",
+ }
+
def update_record(self):
payslip_ids = self.env["hr.payslip"].browse(
self._context.get('active_ids', self._context.get('active_id')))
diff --git a/yuthon_salary/views/inherit_hr_payslip_views.xml b/yuthon_salary/views/inherit_hr_payslip_views.xml
index 209ebfd77..7fc701796 100644
--- a/yuthon_salary/views/inherit_hr_payslip_views.xml
+++ b/yuthon_salary/views/inherit_hr_payslip_views.xml
@@ -374,8 +374,7 @@
-
-
+