This commit is contained in:
李鹏宇
2025-04-02 16:05:47 +08:00
parent cca67f7ea9
commit 63c6833cb9
7 changed files with 8 additions and 30 deletions
@@ -13,7 +13,6 @@ class HrJob(models.Model):
]
number = fields.Char(string="序号")
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'), ('thlc', '天河粮储')], string="所属公司")
job_type_id = fields.Many2one('hr.job.type', string="岗位类别")
start_date = fields.Date(string="生效日期", default=lambda self: fields.Date.today())
end_date = fields.Date(string="失效日期", default=fields.Date.from_string('2099-01-01'))
@@ -8,12 +8,7 @@ class YuthonHrDepartment(models.Model):
_rec_name = 'name'
_order = 'department_code asc'
def change_company_id(self):
company_dict = {'thtz':'集团本部', 'thwg':'天河物管', 'thlc':'天河粮储', }
employee_ids = self.browse(self._context.get('active_ids', self._context.get('active_id')))
for i in employee_ids:
company_id = self.env['res.company'].search([('name', '=', company_dict[i.yuthon_company])])
i.company_id = company_id
department_phone = fields.Char(string="部门电话")
department_fax = fields.Char(string="部门传真")
@@ -21,8 +16,6 @@ class YuthonHrDepartment(models.Model):
department_function = fields.Char(string="部门职能")
is_institution = fields.Boolean(string="是否机构")
is_global_department = fields.Boolean(string="是否全局部门")
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], default='thtz', store=True, compute="_compute_company",string="所属公司")
create_date = fields.Date(string="创建时间", default=fields.Date.today())
start_date = fields.Date(string="生效日期", default=fields.Date.today())
expiration_date = fields.Date(string="失效日期", default=fields.Date.today())
@@ -26,13 +26,6 @@ class YuthonHrEmployee(models.Model):
_inherit = "hr.employee"
_order = 'number asc'
def change_company_id(self):
company_dict = {'thtz':'集团本部', 'thwg':'天河物管', 'thlc':'天河粮储', }
employee_ids = self.browse(self._context.get('active_ids', self._context.get('active_id')))
for i in employee_ids:
company_id = self.env['res.company'].search([('name', '=', company_dict[i.yuthon_company])])
i.company_id = company_id
# odoo里是这样做的,一个用户可以多个公司绑定多个员工,每个员工都有自己的部门和岗位
user_role_ids_changed = fields.Boolean(string="xxx") # bug
wecom_userid = fields.Char(string="成员UserID", default="")
number = fields.Char(string="序号", store=True)
@@ -42,10 +35,6 @@ class YuthonHrEmployee(models.Model):
('formal_none', '正式合同(无固定)'),
('part_time', '兼职协议'), ('employment', '用工协议'), ('internship', '实习协议')], string="用工形式")
contract_company = fields.Selection([('thtz', '天河投资'), ('thwg', '天河物管'),
('thlc', '天河粮储'), ('ttcj','天投城建')], default='thtz', string="合同所属公司")
yuthon_company = fields.Selection([('thtz', '集团本部'), ('thwg', '天河物管'),
('thlc', '天河粮储')], default='thtz', store=True, compute="compute_company", string="所属公司")
# 个人信息
user_salary = fields.Float(string="基本工资")
job_lv_salary = fields.Float(string="职级工资")
@@ -34,7 +34,6 @@
<xpath expr="//field[@name='department_id']" position="after">
<field name="job_personnel_ids" column_invisible="1"/>
<field name="job_personnel" class="list_width"/>
<field name="yuthon_company"/>
<field name="establishment_quotas"/>
<field name="no_of_employee" string="在编人数"/>
<field name="compiling_external"/>
@@ -29,7 +29,6 @@
<field name="department_fax" column_invisible="1"/>
<field name="department_location"/>
<field name="parent_id" string="上级部门"/>
<field name="yuthon_company" string="所属公司"/>
<field name="total_employee" string="员工数量"/>
<field name="department_function" column_invisible="1"/>
<field name="is_institution" column_invisible="1"/>
@@ -5,5 +5,4 @@ class HrPayrollStructureType(models.Model):
_inherit = 'hr.payroll.structure.type'
_description = '职级类别'
name = fields.Char(string='职级类型', required=True)
yuthon_company = fields.Selection([])
name = fields.Char(string='职级类型', required=True)
@@ -29,12 +29,12 @@
</xpath>
<xpath expr="//field[@name='name']" position="after">
<field name="base_salary"/>
<field name="rank_salary" groups="yuthon_hr_employee.group_hr_employee_tt_user"/>
<field name="position_subsidy" groups="yuthon_hr_employee.group_hr_employee_lc_user"/>
<field name="integrated_subsidy" groups="yuthon_hr_employee.group_hr_employee_wg_user"/>
<field name="communication_subsidy" groups="yuthon_hr_employee.group_hr_employee_wg_user"/>
<field name="position_salary" groups="yuthon_hr_employee.group_hr_employee_wg_user,yuthon_hr_employee.group_hr_employee_lc_user"/>
<field name="advance_performance_bonuses" groups="yuthon_hr_employee.group_hr_employee_tt_user,yuthon_hr_employee.group_hr_employee_lc_user"/>
<field name="rank_salary"/>
<field name="position_subsidy"/>
<field name="integrated_subsidy"/>
<field name="communication_subsidy"/>
<field name="position_salary"/>
<field name="advance_performance_bonuses"/>
<field name="create_time"/>
<field name="end_time"/>
<field name="is_enable"/>