From a6dc31d548904697b92988d2f0a405c55c4ce85b Mon Sep 17 00:00:00 2001 From: zhou <123@> Date: Sun, 15 Jun 2025 18:48:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- soong_workflow/models/soong_workflow_mixin.py | 5 +++++ yuthon_hr_attendance/models/go_approval.py | 1 - yuthon_salary/models/inherit_hr_payslip.py | 11 ++++++++++- yuthon_salary/views/inherit_hr_payslip_views.xml | 3 +-- 4 files changed, 16 insertions(+), 4 deletions(-) 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 @@