添加功能
This commit is contained in:
@@ -148,7 +148,7 @@
|
||||
</xpath>
|
||||
<xpath expr="//page[@name='public']//group[@name='departure']" position="after">
|
||||
<group string="工资计算">
|
||||
<field name="salary_group_id"/>
|
||||
<field name="salary_group_id" options="{'no_create': True}"/>
|
||||
<field name="last_year_salary"/>
|
||||
<field name="social_base_on"/>
|
||||
<field name="social_base_off"/>
|
||||
|
||||
@@ -129,7 +129,10 @@ class InheritHrPayslip(models.Model):
|
||||
payslip_records = self.browse(self._context.get('active_ids', self._context.get('active_id')))
|
||||
payslips = payslip_records or self
|
||||
# 过滤出状态为草稿或已验证的工资单
|
||||
payslips = payslips.filtered(lambda slip: slip.state in ['draft', 'verify'])
|
||||
payslips = payslips.filtered(
|
||||
lambda slip: slip.state in ['draft', 'verify']
|
||||
and slip.employee_id.contract_id.is_probation
|
||||
)
|
||||
# delete old payslip lines
|
||||
payslips.line_ids.unlink()
|
||||
# this guarantees consistent results
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<tree string="薪资发放" editable="bottom">
|
||||
<field name="current_year"/>
|
||||
<field name="current_month"/>
|
||||
<field name="salary_group_id"/>
|
||||
<field name="salary_group_id" options="{'no_create': True}"/>
|
||||
<field name="actual_salary"/>
|
||||
<field name="company_id" optional="hide"/>
|
||||
</tree>
|
||||
|
||||
@@ -3,6 +3,7 @@ from odoo import models, fields, api, _, SUPERUSER_ID
|
||||
from odoo.exceptions import ValidationError, UserError
|
||||
from odoo.exceptions import ValidationError
|
||||
from pypinyin import pinyin, Style
|
||||
import math
|
||||
import xlrd
|
||||
import base64
|
||||
import datetime
|
||||
@@ -56,7 +57,7 @@ class SalaryComputeWizard(models.Model):
|
||||
# f"在 {self.select_year} 年 {self.select_time} 月没有出勤月度汇总记录,请先完成考勤统计。")
|
||||
# if not all(record.is_state for record in attendance_records):
|
||||
# raise ValidationError(
|
||||
# f"在 {self.select_year} 年 {self.select_time} 月的出勤月度汇总记录未全部确认,请先确认考勤。")
|
||||
# f"在 {self.select_year} 年 {self.select_time} 月的出勤月度汇总记录未全部确认,请先确认考勤。"
|
||||
for employee in self.employee_ids:
|
||||
contract_id = self.env['hr.contract'].search([('employee_id', '=', employee.id)], limit=1)
|
||||
year = int(self.select_year)
|
||||
@@ -140,15 +141,14 @@ class SalaryComputeWizard(models.Model):
|
||||
if field_name == 'performance_bonuses':
|
||||
result = 0
|
||||
elif field_name in ['commuting_allowance', 'seniority_salary']:
|
||||
if work_days != days:
|
||||
result = line.total * internship_days / days + line.total * work_days / days
|
||||
else:
|
||||
result = line.total * internship_days / days
|
||||
result = line.total * internship_days / days + line.total * work_days / days
|
||||
elif field_name in ['base_salary', 'rank_salary']:
|
||||
base_value = line.total
|
||||
if base_value % 1 != 0:
|
||||
base_value = math.ceil(base_value)
|
||||
result = base_value * 0.8 * internship_days / days + line.total * work_days / days
|
||||
else:
|
||||
if work_days != days:
|
||||
result = line.total * 0.8 * internship_days / days + line.total * work_days / days
|
||||
else:
|
||||
result = line.total * 0.8 * internship_days / days
|
||||
result = line.total * 0.8 * internship_days / days + line.total * work_days / days
|
||||
|
||||
setattr(internship_id, field_name, result)
|
||||
line.write({'total': result})
|
||||
|
||||
Reference in New Issue
Block a user