@@ -11,6 +11,7 @@ class HrContract(models.Model):
|
||||
|
||||
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('contract_code'))
|
||||
name = fields.Char(string="合同名称", compute='_compute_name', readonly=False)
|
||||
is_annual_salary = fields.Boolean(string="是否年薪")
|
||||
resource_calendar_id = fields.Many2one('resource.calendar', string='考勤时间表')
|
||||
state = fields.Selection([
|
||||
('draft', '草稿'),
|
||||
@@ -205,6 +206,15 @@ class HrContract(models.Model):
|
||||
else:
|
||||
employee.salary_group_id = False
|
||||
|
||||
@api.onchange('is_annual_salary')
|
||||
def _compute_is_annual_salary(self):
|
||||
for contract_id in self:
|
||||
employee = self.env['hr.employee'].search([('id', '=', contract_id.employee_id.id)], limit=1)
|
||||
if employee:
|
||||
employee.is_annual_salary = contract_id.is_annual_salary
|
||||
else:
|
||||
employee.is_annual_salary = False
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
contract = super(HrContract, self).create(vals)
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
<field name="salary_group_id" options="{'no_create': True}"/>
|
||||
<field name="is_internship" invisible="1"/>
|
||||
<field name="is_probation"/>
|
||||
<field name="is_annual_salary"/>
|
||||
<field name="start_date" invisible="not is_probation"/>
|
||||
<field name="end_date" invisible="not is_probation"/>
|
||||
</xpath>
|
||||
|
||||
@@ -14,6 +14,7 @@ class YuthonVacationReports(models.Model):
|
||||
leave_ids = fields.One2many('vacation.leave.line', 'vacation_id', string='年假明细')
|
||||
overtime_ids = fields.One2many('vacation.over.line', 'vacation_id', string='加班明细')
|
||||
meal_fee_ids = fields.One2many('vacation.meal.line', 'vacation_id', string='误餐明细')
|
||||
medical_fee_ids = fields.One2many('vacation.medical.line', 'vacation_id', string='体检费明细')
|
||||
|
||||
leave = fields.Float(string='年假', compute='_compute_leave', store=True)
|
||||
working_overtime = fields.Float(string='加班时', compute='_compute_working_overtime', store=True)
|
||||
@@ -218,6 +219,8 @@ class VacationLeaveLine(models.Model):
|
||||
update_lines = fields.Float(string='更新额度')
|
||||
is_void = fields.Boolean(string='是否作废')
|
||||
allocation_type = fields.Selection([('vacation', '休假'), ('allocation', '分配')], string='分配类型')
|
||||
valid_date = fields.Date(string='有效期至')
|
||||
adjust_date = fields.Date(string='调整至')
|
||||
text = fields.Text(string='备注')
|
||||
|
||||
@api.model
|
||||
@@ -258,6 +261,8 @@ class VacationOverline(models.Model):
|
||||
meal_number = fields.Integer(string='误餐次数')
|
||||
update_date = fields.Date(string='更新时间')
|
||||
is_void = fields.Boolean(string='是否作废')
|
||||
valid_date = fields.Date(string='有效期至')
|
||||
adjust_date = fields.Date(string='调整至')
|
||||
text = fields.Text(string='备注')
|
||||
|
||||
# def _sync_to_employee(self, reverse=False):
|
||||
@@ -304,6 +309,8 @@ class VacationMealLine(models.Model):
|
||||
update_lines = fields.Float(string='更新额度')
|
||||
is_soon = fields.Boolean(string="流程修改")
|
||||
is_void = fields.Boolean(string='是否作废', default=False)
|
||||
valid_date = fields.Date(string='有效期至')
|
||||
adjust_date = fields.Date(string='调整至')
|
||||
is_manual = fields.Boolean(string="手动修改")
|
||||
text = fields.Text(string='备注')
|
||||
|
||||
@@ -333,6 +340,21 @@ class VacationMealLine(models.Model):
|
||||
self._sync_to_employee(reverse=True)
|
||||
return super(VacationMealLine, self).unlink()
|
||||
|
||||
|
||||
class VacationMedicalLine(models.Model):
|
||||
_name = 'vacation.medical.line'
|
||||
_description = '体检费明细'
|
||||
|
||||
vacation_id = fields.Many2one('yuthon.vacation.reports', string='关联假期额度记录')
|
||||
employee_id = fields.Many2one('hr.employee', string='员工')
|
||||
workflow_record_id = fields.Many2one('soong.workflow.record', string='流程')
|
||||
update_type = fields.Selection([('add', '增加'), ('reduce', '减少')], string='更新类型')
|
||||
update_date = fields.Date(string='更新时间')
|
||||
valid_date = fields.Date(string='有效期至')
|
||||
adjust_date = fields.Date(string='调整至')
|
||||
is_void = fields.Boolean(string='是否作废', default=False)
|
||||
text = fields.Text(string='备注')
|
||||
|
||||
class DetailsTree(models.Model):
|
||||
_name = 'details.tree'
|
||||
_description = '明细表'
|
||||
|
||||
@@ -11,3 +11,4 @@ access_vacation_leave_line,vacation_leave_line,model_vacation_leave_line,base.gr
|
||||
access_vacation_meal_line,vacation_meal_line,model_vacation_meal_line,base.group_user,1,1,1,1
|
||||
access_vacation_over_line,vacation_over_line,model_vacation_over_line,base.group_user,1,1,1,1
|
||||
access_details_tree, details_tree,model_details_tree,base.group_user,1,1,1,1
|
||||
access_vacation_medical_line,vacation_medical_line,model_vacation_medical_line,base.group_user,1,1,1,1
|
||||
|
||||
|
@@ -43,6 +43,8 @@
|
||||
<field name="update_type" readonly="1"/>
|
||||
<field name="update_date" readonly="1"/>
|
||||
<field name="update_lines"/>
|
||||
<field name="valid_date"/>
|
||||
<field name="adjust_date"/>
|
||||
<field name="allocation_type" optional="hide"/>
|
||||
<field name="is_void" optional="hide"/>
|
||||
<field name="text"/>
|
||||
@@ -62,6 +64,8 @@
|
||||
<field name="workday"/>
|
||||
<field name="legal_day"/>
|
||||
<field name="public_holidays"/>
|
||||
<field name="valid_date"/>
|
||||
<field name="adjust_date"/>
|
||||
<field name="meal_number" column_invisible="1"/>
|
||||
<field name="is_void" optional="hide"/>
|
||||
<field name="text"/>
|
||||
@@ -78,12 +82,29 @@
|
||||
<field name="update_type" readonly="1"/>
|
||||
<field name="update_date" readonly="1"/>
|
||||
<field name="update_lines"/>
|
||||
<field name="valid_date"/>
|
||||
<field name="adjust_date"/>
|
||||
<field name="is_void" optional="hide"/>
|
||||
<field name="text"/>
|
||||
<button name="unlink" string="删除" invisible="workflow_record_id" type="object" class="btn-primary"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="体检费">
|
||||
<field name="medical_fee_ids" context="{'default_employee_id': employee_id}">
|
||||
<tree editable="bottom" delete="false" decoration-muted="is_void">
|
||||
<field name="employee_id" column_invisible="1"/>
|
||||
<field name="vacation_id" column_invisible="1"/>
|
||||
<field name="workflow_record_id" domain="[('workflow_id.name', '=', '外出'), ('create_uid.employee_id', '=', employee_id)]"/>
|
||||
<field name="update_type" readonly="1"/>
|
||||
<field name="update_date" readonly="1"/>
|
||||
<field name="valid_date"/>
|
||||
<field name="adjust_date"/>
|
||||
<field name="is_void" optional="hide"/>
|
||||
<field name="text"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
@@ -166,6 +187,21 @@
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<page string="体检费">
|
||||
<field name="medical_fee_ids" context="{'default_employee_id': employee_id}">
|
||||
<tree editable="bottom" delete="false" decoration-muted="is_void" edit="false" create="false">
|
||||
<field name="employee_id" column_invisible="1"/>
|
||||
<field name="vacation_id" column_invisible="1"/>
|
||||
<field name="workflow_record_id" domain="[('workflow_id.name', '=', '外出'), ('create_uid.employee_id', '=', employee_id)]"/>
|
||||
<field name="update_type" readonly="1"/>
|
||||
<field name="update_date" readonly="1"/>
|
||||
<field name="valid_date"/>
|
||||
<field name="adjust_date"/>
|
||||
<field name="is_void" optional="hide"/>
|
||||
<field name="text"/>
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
|
||||
@@ -64,17 +64,17 @@ class YuthonPayrollCommon(models.Model):
|
||||
if ins.name == '工龄工资' and ins.company_id.name == '天河物管':
|
||||
formula_salary = "result = employee.company_old_year * 10 if employee.company_old_year >= 1 and employee.department_id.name != '领导班子' else 0"
|
||||
if ins.name == '工龄工资' and ins.company_id.name == '集团本部':
|
||||
formula_salary = "result = 0 if (employee.is_annual_salary or employee.salary_group_id.name in ['天投城建劳务外派', '天投城建退休']) else (employee.company_old_year * 10)"
|
||||
formula_salary = "result = 0 if (employee.is_annual_salary or '劳务' in (employee.contract_id.structure_type_id.name or '') or '工勤返聘' in (employee.contract_id.structure_type_id.name or '')) else (employee.company_old_year * 10)"
|
||||
if ins.name == '误餐费':
|
||||
formula_salary = "result = employee.meal_number * 40 + employee.meal_supplement"
|
||||
if ins.name == '通讯补贴':
|
||||
formula_salary = "result = 0 if (employee.is_annual_salary or employee.salary_group_id.name in ['天投城建劳务外派', '天投城建退休']) else 300"
|
||||
formula_salary = "result = 0 if (employee.is_annual_salary or '劳务' in (employee.contract_id.structure_type_id.name or '') or '工勤返聘' in (employee.contract_id.structure_type_id.name or '')) else 300"
|
||||
if ins.name == '全勤奖' and ins.company_id.name == '集团本部':
|
||||
formula_salary = "result = 0 if (employee.is_annual_salary or employee.salary_group_id.name in ['天投城建外派', '天投城建退休']) else (200 if employee.last_attendance else 0)"
|
||||
formula_salary = "result = 0 if (employee.is_annual_salary or '劳务' in (employee.contract_id.structure_type_id.name or '') or '工勤返聘' in (employee.contract_id.structure_type_id.name or '')) else (200 if employee.last_attendance else 0)"
|
||||
if ins.name == '全勤奖' and ins.company_id.name == '天河物管':
|
||||
formula_salary = "result = 100 if employee.last_attendance else 0"
|
||||
if ins.name == '加班费':
|
||||
formula_salary = "result = 0 if (employee.is_annual_salary or employee.salary_group_id.name == '天投城建工勤人员') else (round(((employee.all_overtime_hours - 40) * (payslip.base_salary / 21.75 / 8) * 1.5), 0) if employee.all_overtime_hours > 40 else 0)"
|
||||
formula_salary = "result = 0 if (employee.is_annual_salary or employee.contract_id.structure_type_id.name == '工勤返聘') else (round(((employee.all_overtime_hours - 40) * (payslip.base_salary / 21.75 / 8) * 1.5), 0) if employee.all_overtime_hours > 40 else 0)"
|
||||
if ins.name == '安全生产管理补贴':
|
||||
formula_salary = "result = employee.security_amount "
|
||||
if ins.name == '工龄补贴' and ins.company_id.name == '天河物管':
|
||||
|
||||
@@ -137,8 +137,8 @@ class SalaryComputeWizard(models.Model):
|
||||
employee = internship_id.employee_id
|
||||
contract = employee.contract_id
|
||||
|
||||
# 集团本部 岗位工资只有退休才用值
|
||||
if contract.salary_group_id.name == '天投城建退休' and self.company_id.name == '集团本部':
|
||||
# 集团本部 岗位工资除了工勤返聘才用值
|
||||
if contract.structure_type_id.name == '工勤返聘' and self.company_id.name == '集团本部':
|
||||
for line in internship_id.line_ids:
|
||||
if line.name == '岗位工资':
|
||||
line.total = 0
|
||||
|
||||
Reference in New Issue
Block a user