diff --git a/yuthon_hr_employee/models/yuthon_hr_department.py b/yuthon_hr_employee/models/yuthon_hr_department.py index c2d1a855d..d9fcced62 100644 --- a/yuthon_hr_employee/models/yuthon_hr_department.py +++ b/yuthon_hr_employee/models/yuthon_hr_department.py @@ -8,13 +8,6 @@ class YuthonHrDepartment(models.Model): _rec_name = 'name' _order = 'department_code asc' - def change_company_id(self): - department_ids = self.browse(self._context.get('active_ids', self._context.get('active_id'))) - for i in department_ids: - company_id = self.env['res.company'].search([('name', '=', i.parent_id.name)]) - if company_id: - i.write({'company_id': company_id}) - department_phone = fields.Char(string="部门电话") department_fax = fields.Char(string="部门传真") department_location = fields.Char(string="部门地址") diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py index 1c0e136d1..64cb416ee 100644 --- a/yuthon_hr_employee/models/yuthon_hr_employee.py +++ b/yuthon_hr_employee/models/yuthon_hr_employee.py @@ -26,13 +26,6 @@ class YuthonHrEmployee(models.Model): _inherit = "hr.employee" _order = 'number asc' - def change_company_id(self): - employee_ids = self.browse(self._context.get('active_ids', self._context.get('active_id'))) - for i in employee_ids.search([('name', '!=', 'Administrator')]): - if i.user_id: - i.user_id.write({'company_id': i.company_id, 'company_ids': i.company_id}) - - user_role_ids_changed = fields.Boolean(string="xxx") # bug wecom_userid = fields.Char(string="成员UserID", default="") number = fields.Char(string="序号", store=True) diff --git a/yuthon_hr_employee/views/yuthon_hr_department_views.xml b/yuthon_hr_employee/views/yuthon_hr_department_views.xml index b787cfa01..8abcc3c1b 100644 --- a/yuthon_hr_employee/views/yuthon_hr_department_views.xml +++ b/yuthon_hr_employee/views/yuthon_hr_department_views.xml @@ -40,14 +40,6 @@ - - 测试更新公司company_id - - - code - action = model.change_company_id() - - 批量生成权限组 diff --git a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml index c8f42aaa8..2b60fb651 100644 --- a/yuthon_hr_employee/views/yuthon_hr_employee_views.xml +++ b/yuthon_hr_employee/views/yuthon_hr_employee_views.xml @@ -404,14 +404,6 @@ action = model.action_hr_employee() - - 测试更新公司company_id - - - code - action = model.change_company_id() - - tree,kanban,form,activity,graph,pivot,hierarchy diff --git a/yuthon_salary/models/inherit_hr_payroll_structure.py b/yuthon_salary/models/inherit_hr_payroll_structure.py index 5514cc62a..7deb00184 100644 --- a/yuthon_salary/models/inherit_hr_payroll_structure.py +++ b/yuthon_salary/models/inherit_hr_payroll_structure.py @@ -7,19 +7,6 @@ class HrPayrollStructure(models.Model): _inherit = 'hr.payroll.structure' _order = 'sequence asc' - def change_company_id(self): - structure_ids = self.browse(self._context.get('active_ids', self._context.get('active_id'))) - for i in structure_ids: - if i.sequence[0] == '1': - company_id = self.env['res.company'].search([('name', '=', '集团本部')]) - i.write({'company_id': company_id}) - if i.sequence[0] == '2': - company_id = self.env['res.company'].search([('name', '=', '天河物管')]) - i.write({'company_id': company_id}) - if i.sequence[0] == '3': - company_id = self.env['res.company'].search([('name', '=', '天河粮储')]) - i.write({'company_id': company_id}) - company_id = fields.Many2one('res.company', string="公司", default=lambda self: self.env.company) type_id = fields.Many2one('hr.payroll.structure.type', string="职级类型") level_id = fields.Many2one('yuthon.payroll.type.setting', string="级别") diff --git a/yuthon_salary/models/inherit_hr_payslip.py b/yuthon_salary/models/inherit_hr_payslip.py index a16f839f0..cf7479a80 100644 --- a/yuthon_salary/models/inherit_hr_payslip.py +++ b/yuthon_salary/models/inherit_hr_payslip.py @@ -5,11 +5,6 @@ from odoo.exceptions import ValidationError, UserError class InheritHrPayslip(models.Model): _inherit = 'hr.payslip' - def change_company_id(self): - structure_ids = self.browse(self._context.get('active_ids', self._context.get('active_id'))) - for i in structure_ids: - i.write({'company_id': i.employee_id.company_id}) - company_id = fields.Many2one(related='employee_id.company_id', string="公司") employee_id = fields.Many2one('hr.employee', string="姓名") base_salary = fields.Float(string='基本工资', compute='_compute_salary', store=True) diff --git a/yuthon_salary/models/yuthon_payroll_project.py b/yuthon_salary/models/yuthon_payroll_project.py index 8bebfb5de..8b4b86419 100644 --- a/yuthon_salary/models/yuthon_payroll_project.py +++ b/yuthon_salary/models/yuthon_payroll_project.py @@ -8,11 +8,6 @@ class YuthonPayrollCommon(models.Model): _name = 'yuthon.payroll.common' _description = '薪资常用项' _order = 'sequence asc' - def change_company_id(self): - all_records = self.env['yuthon.payroll.common'].sudo().search([]) - company_id = self.env['res.company'].search([('name', '=', '集团本部')]) - for record in all_records: - record.write({'company_id': company_id, 'yuthon_company': 'thtz'}) yuthon_company = fields.Selection([('thtz', 'thtz')], default="thtz") company_id = fields.Many2one('res.company', string="公司") diff --git a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml index a4cbfd7f9..12902265a 100644 --- a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml +++ b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml @@ -94,27 +94,6 @@ tree,form,search {'group_by_no_leaf':1,'group_by':[]} - - 测试更新公司company_id - - - code - action = model.change_company_id() - - - 测试更新公司company_id - - - code - action = model.change_company_id() - - - 测试更新公司company_id - - - code - action = model.change_company_id() - 批量更新职级类型