添加功能

This commit is contained in:
zhou
2025-06-15 18:48:27 +08:00
parent db91e59fe8
commit a6dc31d548
4 changed files with 16 additions and 4 deletions
@@ -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':
@@ -137,4 +137,3 @@ class GoApprovals(models.Model):
+10 -1
View File
@@ -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')))
@@ -374,8 +374,7 @@
<field name="is_salary_push" column_invisible="1"/>
<field name="confirm_status"/>
<button name="payslip_wizard" string="发送" type="object" class="oe_highlight" invisible="confirm_status == 'confirm'"/>
<button name="open_record" string="详情" type="object" class="oe_highlight" invisible="confirm_status == 'confirm'"/>
<button name="open_archive_record" string="详情" type="object" class="oe_highlight" invisible="confirm_status == 'confirm'"/>
</tree>
</field>
</record>