添加功能
This commit is contained in:
@@ -577,27 +577,10 @@ class InheritHrPayslip(models.Model):
|
||||
"target": "new",
|
||||
}
|
||||
|
||||
|
||||
def put_payslip(self):
|
||||
url =f'http://oa.thtzjt.com/webh5#/notice?id={self.employee_id.user_id.id}'
|
||||
we_id = self.env['hr.employee'].search([('id', '=', self.employee_id.id)]).wecom_userid
|
||||
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='payslip', user_id=we_id, title="薪资确认",
|
||||
description=self.employee_id.name + '请确认你的薪资:',
|
||||
url=url, btntxt="详细信息")
|
||||
return {
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'display_notification',
|
||||
'params': {
|
||||
'type': 'success',
|
||||
'message': '确认通知已发送',
|
||||
'sticky': False,
|
||||
}
|
||||
}
|
||||
|
||||
def payslip_wizard(self):
|
||||
return {
|
||||
"type": "ir.actions.act_window",
|
||||
"name": "工资条推送",
|
||||
"name": "工资条发送",
|
||||
"res_model": "payslip.send.wizard",
|
||||
"view_mode": "form",
|
||||
"target": "new",
|
||||
|
||||
@@ -53,7 +53,7 @@ class InheritHrPayslipRun(models.Model):
|
||||
|
||||
return {
|
||||
"type": "ir.actions.act_window",
|
||||
"name": "工资条推送",
|
||||
"name": "工资发送",
|
||||
"res_model": "payslip.send.wizard",
|
||||
"view_mode": "form",
|
||||
"target": "new",
|
||||
|
||||
@@ -302,7 +302,6 @@
|
||||
<field name="is_salary_push" column_invisible="1"/>
|
||||
<field name="is_bold"/>
|
||||
<button name="put_release" type="object" string="推送" class="btn-primary" invisible="is_salary_release"/>
|
||||
<button name="put_payslip" type="object" string="发送" class="btn-primary" invisible="not is_salary_release"/>
|
||||
<button name="return_salary_button" string="退回" type="object" class="oe_highlight" invisible="not is_salary_release"/>
|
||||
<button name="open_record" string="详情" type="object" class="oe_highlight"/>
|
||||
</tree>
|
||||
@@ -360,7 +359,6 @@
|
||||
<field name="is_salary_push" column_invisible="1"/>
|
||||
<field name="is_bold"/>
|
||||
<button name="put_release" type="object" string="推送" class="btn-primary" invisible="is_salary_release"/>
|
||||
<button name="put_payslip" type="object" string="发送" class="btn-primary" invisible="not is_salary_release"/>
|
||||
<button name="return_salary_button" string="退回" type="object" class="oe_highlight" invisible="not is_salary_release"/>
|
||||
<button name="open_record" string="详情" type="object" class="oe_highlight"/>
|
||||
</tree>
|
||||
@@ -416,7 +414,6 @@
|
||||
<field name="is_salary_push" column_invisible="1"/>
|
||||
<field name="is_bold"/>
|
||||
<button name="put_release" type="object" string="推送" class="btn-primary" invisible="is_salary_release"/>
|
||||
<button name="put_payslip" type="object" string="发送" class="btn-primary" invisible="not is_salary_release"/>
|
||||
<button name="return_salary_button" string="退回" type="object" class="oe_highlight" invisible="not is_salary_release"/>
|
||||
<button name="open_record" string="详情" type="object" class="oe_highlight"/>
|
||||
</tree>
|
||||
|
||||
@@ -21,7 +21,7 @@ class PayslipSendWizard(models.Model):
|
||||
if not employee.wecom_userid:
|
||||
raise UserError(f"请同步{employee.name}的企业微信")
|
||||
url = f"https://oa.thtzjt.com/webh5/#/salary?id={payslip.id}"
|
||||
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='task',
|
||||
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='default',
|
||||
user_id=employee.wecom_userid,
|
||||
title="薪资确认",
|
||||
url=url, btntxt="详细信息")
|
||||
@@ -32,7 +32,7 @@ class PayslipSendWizard(models.Model):
|
||||
if not employee.wecom_userid:
|
||||
raise UserError(f"请同步{employee.name}的企业微信")
|
||||
url = f"https://oa.thtzjt.com/webh5/#/salary?id={payslip.id}"
|
||||
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='task',
|
||||
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='default',
|
||||
user_id=employee.wecom_userid,
|
||||
title="薪资确认",
|
||||
url=url, btntxt="详细信息")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<record id="payslip_send_wizard_form" model="ir.ui.view">
|
||||
<field name="name">推送弹窗</field>
|
||||
<field name="name">发送消息弹窗</field>
|
||||
<field name="model">payslip.send.wizard</field>
|
||||
<field name="arch" type="xml">
|
||||
<form>
|
||||
|
||||
Reference in New Issue
Block a user