@@ -78,29 +78,27 @@ class YuthonSalaryActive(models.Model):
|
||||
reimbursed_medical_exam_fee = fields.Float(string='已报销体检费')
|
||||
remaining_medical_exam_fee = fields.Float(string='剩余体检费')
|
||||
|
||||
def payslip_wizard(self):
|
||||
return {
|
||||
"type": "ir.actions.act_window",
|
||||
"name": "工资条发送",
|
||||
"res_model": "payslip.send.wizard",
|
||||
"view_mode": "form",
|
||||
"target": "new",
|
||||
"context": {
|
||||
'default_employee_id': self.employee_id.id,
|
||||
}
|
||||
}
|
||||
def salary_confirm(self):
|
||||
self.write({'confirm_status': 'confirm'})
|
||||
|
||||
def payslip_transmit(self):
|
||||
self.sudo().env["wecom.apps"].sync_send_message(
|
||||
category='att', user_id=self.employee_id.wecom_userid,
|
||||
message=f"你{self.select_year}年{self.select_time}月的薪资条已经发放,请到手机端查看",
|
||||
)
|
||||
self.write({'confirm_status': 'un_confirm'})
|
||||
|
||||
def open_archive_record(self):
|
||||
tree_id = self.env.ref("yuthon_salary.view_yuthon_salary_active_tree").id
|
||||
return {
|
||||
'name': '工资条',
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_model': 'yuthon.salary.active',
|
||||
'views': [[tree_id, 'tree']],
|
||||
'view_mode': 'tree',
|
||||
'domain': [('employee_id', '=', self.employee_id.id)],
|
||||
}
|
||||
|
||||
|
||||
def _get_default_month(self):
|
||||
current_month = datetime.now().month
|
||||
return str(current_month)
|
||||
@@ -6,7 +6,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="工资单归档" create="0" edit="0" delete="0">
|
||||
<!-- 核心关联字段:员工 -->
|
||||
<button type="object" name="payslip_wizard" string="发放" class="oe_highlight"/>
|
||||
<button type="object" name="payslip_transmit" string="发送" class="oe_highlight"/>
|
||||
<field name="employee_id" string="员工"/>
|
||||
<field name="department_id" column_invisible="1"/>
|
||||
<field name="company_id" column_invisible="1"/>
|
||||
@@ -74,8 +74,8 @@
|
||||
<field name="model">yuthon.salary.active</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="我的薪资" create="false" delete="false" edit="false">
|
||||
<button name="payslip_wizard" 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'"/>
|
||||
<button name="salary_confirm" string="确认" type="object" class="oe_highlight"/>
|
||||
<button name="open_archive_record" string="详情" type="object" class="oe_highlight"/>
|
||||
<field name="basic_salary" string="基本工资"/>
|
||||
<field name="rank_salary" string="职级工资"/>
|
||||
<field name="pre_performance_bonus" string="预发绩效奖金"/>
|
||||
@@ -117,7 +117,7 @@
|
||||
<field name="domain">[('employee_id.user_id', '=', uid)]</field>
|
||||
<field name="view_ids"
|
||||
eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_salary.my_yuthon_salary_active_tree')})]" />
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_salary.'my_yuthon_salary_active_tree)})]" />
|
||||
</record>
|
||||
<record id="yuthon_salary_active_action" model="ir.actions.act_window">
|
||||
<field name="name">薪资归档</field>
|
||||
|
||||
Reference in New Issue
Block a user