Merge pull request !2325 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2025-04-03 04:03:54 +00:00
committed by Gitee
8 changed files with 0 additions and 74 deletions
@@ -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="部门地址")
@@ -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)
@@ -40,14 +40,6 @@
</field>
</record>
<record id="all_data_departmentt_company_id" model="ir.actions.server">
<field name="name">测试更新公司company_id</field>
<field name="model_id" ref="hr.model_hr_department"/>
<field name="binding_model_id" ref="hr.model_hr_department"/>
<field name="state">code</field>
<field name="code">action = model.change_company_id()</field>
</record>
<record id="sync_hr_do_department_to_res_groups" model="ir.actions.server">
<field name="name">批量生成权限组</field>
<field name="model_id" ref="hr.model_hr_department"/>
@@ -404,14 +404,6 @@
<field name="code">action = model.action_hr_employee()</field>
</record>
<record id="all_data_employee_company_id" model="ir.actions.server">
<field name="name">测试更新公司company_id</field>
<field name="model_id" ref="hr.model_hr_employee"/>
<field name="binding_model_id" ref="hr.model_hr_employee"/>
<field name="state">code</field>
<field name="code">action = model.change_company_id()</field>
</record>
<record id="hr.open_view_employee_list_my" model="ir.actions.act_window">
<field name="view_mode">tree,kanban,form,activity,graph,pivot,hierarchy</field>
</record>
@@ -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="级别")
@@ -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)
@@ -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="公司")
@@ -94,27 +94,6 @@
<field name="view_mode">tree,form,search</field>
<field name="context">{'group_by_no_leaf':1,'group_by':[]}</field>
</record>
<record id="all_data_payroll_structure_company_id" model="ir.actions.server">
<field name="name">测试更新公司company_id</field>
<field name="model_id" ref="hr_payroll.model_hr_payroll_structure"/>
<field name="binding_model_id" ref="hr_payroll.model_hr_payroll_structure"/>
<field name="state">code</field>
<field name="code">action = model.change_company_id()</field>
</record>
<record id="all_data_payroll_hr_payslip_id" model="ir.actions.server">
<field name="name">测试更新公司company_id</field>
<field name="model_id" ref="hr_payroll.model_hr_payslip"/>
<field name="binding_model_id" ref="hr_payroll.model_hr_payslip"/>
<field name="state">code</field>
<field name="code">action = model.change_company_id()</field>
</record>
<record id="all_data_payroll_common_company_id" model="ir.actions.server">
<field name="name">测试更新公司company_id</field>
<field name="model_id" ref="model_yuthon_payroll_common"/>
<field name="binding_model_id" ref="model_yuthon_payroll_common"/>
<field name="state">code</field>
<field name="code">action = model.change_company_id()</field>
</record>
<record id="all_paroll_write_salary" model="ir.actions.server">
<field name="name">批量更新职级类型</field>
<field name="model_id" ref="hr_payroll.model_hr_payroll_structure"/>