From 02955f85176e77021352673a9fbe8b5dccfac3ea Mon Sep 17 00:00:00 2001
From: zhouzhou <123@qq.com>
Date: Thu, 28 Nov 2024 19:04:06 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../models/inherit_hr_payroll_structure.py | 15 +++++++++++----
yuthon_salary/models/inherit_hr_salary_rule.py | 2 +-
.../views/inherit_hr_payroll_structure_views.xml | 10 ++++++++--
3 files changed, 20 insertions(+), 7 deletions(-)
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