!3110 添加功能

Merge pull request !3110 from 李鹏宇/dev_zhou
This commit is contained in:
李鹏宇
2025-06-05 09:33:36 +00:00
committed by Gitee
4 changed files with 22 additions and 5 deletions
+11 -3
View File
@@ -20,7 +20,7 @@ class InheritHrPayslip(models.Model):
three_one = fields.Float(string='三险一金', store=True, compute='_compute_salary')
identification_id = fields.Char(string='证件号码', related='employee_id.identification_id', store=True)
card_type = fields.Char(string='证件类型', store=True, default="居民身份证")
salary_group_id = fields.Many2one(related='employee_id.salary_group_id', string="工资组", store=True, index=True)
salary_group_id = fields.Many2one('yuthon.salary.group', string="工资组", store=True, index=True)
performance_bonuses = fields.Float(string='预发绩效奖金', compute='_compute_salary', store=True)
full_attendance_award = fields.Float(string='全勤奖', compute='_compute_salary', store=True)
commuting_allowance = fields.Float(string='通信补贴', compute='_compute_salary', store=True)
@@ -115,7 +115,7 @@ class InheritHrPayslip(models.Model):
# 粮储常用项
quality_allowance = fields.Float(string='质检员津贴')
environmental_allowance = fields.Float(string='环境作业津贴')
performance_deduction = fields.Float(string='扣发绩效奖金', compute='_compute_deduction', store=True)
commuting_deduction = fields.Float(string='扣发通信补贴', compute='_compute_deduction', store=True)
base_salary_deduction = fields.Float(string='扣发基本工资', compute='_compute_deduction', store=True)
@@ -407,4 +407,12 @@ class InheritHrPayslip(models.Model):
"res_id": self.id,
"name": "薪资详情",
"view_mode": "form",
}
}
def update(self):
payslip_ids = self.env["hr.payslip"].browse(
self._context.get('active_ids', self._context.get('active_id')))
for record in payslip_ids:
record.write({
'salary_group_id': record.employee_id.contract_id.salary_group_id.id,
})
@@ -65,4 +65,13 @@
<field name="name">粮储公司用户</field>
<field name="category_id" ref="module_category_salary_company"/>
</record>
<record id="group_lc_user" model="res.groups">
<field name="name">粮储公司用户</field>
<field name="category_id" ref="module_category_salary_company"/>
</record>
<record id="salary_rule_confirm_group" model="res.groups">
<field name="name">工资批次确认</field>
<field name="category_id" ref="module_category_salary_company"/>
</record>
</odoo>
@@ -15,7 +15,7 @@
<field name="document_ids" widget="preview_many2many"/>
<field name="run_stage" readonly="1"/>
<button type="object" name="Fileline" string="归档明细" class="oe_highlight"/>
<button type="object" name="add_comment" string="完成" class="oe_highlight" invisible="run_stage == 'issued'"/>
<button type="object" name="add_comment" string="完成" class="oe_highlight" invisible="run_stage == 'issued'" groups="yuthon_salary.salary_rule_confirm_group"/>
<button type="object" name="open_payslip" string="详情" class="oe_highlight"/>
</xpath>
</field>
@@ -96,7 +96,7 @@ class SalaryComputeWizard(models.Model):
'contract_id': contract_id.id,
'date_from': start_date,
'date_to': end_date,
'salary_group_id': employee.salary_group_id.id,
'salary_group_id': employee.contract_id.salary_group_id.id,
'payslip_run_id': payslip_run_id.id,
'state': 'draft',
})