This commit is contained in:
李鹏宇
2025-06-01 12:31:07 +08:00
parent 99da88d602
commit ae5fbd5bb3
2 changed files with 10 additions and 1 deletions
+9 -1
View File
@@ -2,6 +2,10 @@ from odoo import api, fields, models, _
from odoo.exceptions import ValidationError, UserError
import json
from odoo.tools import date_utils
import logging
_logger = logging.getLogger(__name__)
class InheritHrPayslip(models.Model):
_inherit = 'hr.payslip'
@@ -278,11 +282,15 @@ class InheritHrPayslip(models.Model):
)
# 本期应收 - 三险一金 - 年金 - 应补退税 - 工会会费 - 个税退回
# total_before_tax - three_one - b_year - union_dues - tax_payable - individual_tax_refund
@api.depends('total_before_tax', 'three_one', 'b_year', 'union_dues', 'tax_payable', 'individual_tax_refund')
def _compute_actual_salary(self):
for record in self:
record.actual_salary = (record.total_before_tax - record.three_one - record.b_year - record.union_dues - record.tax_payable - record.individual_tax_refund)
if record.employee_id.name == '罗梦烨':
_logger.info("罗梦烨实发{} 本期应:{},31:{},年金:{}应补:{}工会{}个税{}".format(record.actual_salary, record.total_before_tax,
record.three_one, record.b_year, record.union_dues,
record.tax_payable, record.individual_tax_refund))
def put_button(self):
for record in self:
@@ -104,6 +104,7 @@
<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"/>
</xpath>
</field>
</record>