diff --git a/yuthon_salary/models/inherit_hr_payroll_structure.py b/yuthon_salary/models/inherit_hr_payroll_structure.py
index 60ecb797e..5d54a8e49 100644
--- a/yuthon_salary/models/inherit_hr_payroll_structure.py
+++ b/yuthon_salary/models/inherit_hr_payroll_structure.py
@@ -5,15 +5,14 @@ class HrPayrollStructure(models.Model):
_inherit = 'hr.payroll.structure'
_order = 'sequence asc'
- lv_id = fields.Many2one('hr.payroll.structure.type', string="级别")
- lv_name = fields.Char(related='lv_id.name', string='级别名称', store=True)
+ type_id = fields.Many2one('hr.payroll.structure.type', string="级别")
+ lv_name = fields.Char(related='type_id.name', string='级别名称', store=True)
name = fields.Char(string="职级名称")
- sequence = fields.Char(related='lv_id.sequence', string='级别序号', store=True)
+ sequence = fields.Char(related='type_id.sequence', string='级别序号', store=True)
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储')], string='所属公司')
create_time = fields.Date(string="生效日期", default=fields.Date.today())
end_time = fields.Date(string="失效日期")
is_enable = fields.Boolean(string="启用", default=True)
- type_id = fields.Many2one('hr.payroll.structure.type', string="岗位类别",required=False)
@api.model
def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):
@@ -36,3 +35,11 @@ class HrPayrollStructure(models.Model):
return (False, 0) # 首位非0的放前面
res.sort(key=sort_by_sequence_number)
return res
+
+ def action_yuthon_salary(self):
+ pass
+ # structure_ids = self.env["hr.payroll.structure"].browse(self._context.get('active_ids', self._context.get('active_id')))
+ # for record in structure_ids:
+ # type_id = self.env['hr.payroll.structure.type'].search([('id', '=', record.id)])
+ # if not type_id.default_struct_id:
+ # type_id.default_struct_id = record.id
diff --git a/yuthon_salary/models/inherit_hr_salary_rule.py b/yuthon_salary/models/inherit_hr_salary_rule.py
index c2d4c7a17..7a1c61b13 100644
--- a/yuthon_salary/models/inherit_hr_salary_rule.py
+++ b/yuthon_salary/models/inherit_hr_salary_rule.py
@@ -9,7 +9,7 @@ class InheritHrSalaryRule(models.Model):
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储')],
string='所属公司')
amount_fix = fields.Float(string='固定金额', group_operator=None)
-
+
def action_yuthon_salary_wizard(self):
return {
"type": "ir.actions.act_window",
diff --git a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
index 80891c9d5..bfd959340 100644
--- a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
+++ b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
@@ -16,7 +16,7 @@
-
+
@@ -34,7 +34,6 @@
-
@@ -85,4 +84,11 @@
{'search_default_group_lv_name': 1}
[('yuthon_company', '=', 'thwg')]
+
+ 批量更新职级类型
+
+
+ code
+ action = model.action_yuthon_salary()
+
\ No newline at end of file