添加功能
This commit is contained in:
@@ -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):
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user