From 342062734111726dc5946bac11816790ed677807 Mon Sep 17 00:00:00 2001 From: zhouzhou <123@qq.com> Date: Fri, 15 Nov 2024 21: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 --- yuthon_salary/__manifest__.py | 1 + yuthon_salary/models/inherit_hr_payroll_structure.py | 5 +++-- yuthon_salary/security/ir.model.access.csv | 2 +- yuthon_salary/security/yuthon_salary_company.xml | 12 ++++++++++++ .../views/inherit_hr_payroll_structure_views.xml | 6 +++--- 5 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 yuthon_salary/security/yuthon_salary_company.xml diff --git a/yuthon_salary/__manifest__.py b/yuthon_salary/__manifest__.py index d225fe239..03e58889b 100644 --- a/yuthon_salary/__manifest__.py +++ b/yuthon_salary/__manifest__.py @@ -13,6 +13,7 @@ 'depends': ['mail', 'base', 'hr', 'yuthon_hr_employee','hr_payroll'], 'data': [ 'security/ir.model.access.csv', + 'security/yuthon_salary_company.xml', 'views/inherit_hr_payroll_structure_views.xml', ], 'installable': True, diff --git a/yuthon_salary/models/inherit_hr_payroll_structure.py b/yuthon_salary/models/inherit_hr_payroll_structure.py index 49e9b5133..8fe23ede0 100644 --- a/yuthon_salary/models/inherit_hr_payroll_structure.py +++ b/yuthon_salary/models/inherit_hr_payroll_structure.py @@ -6,12 +6,13 @@ class HrPayrollStructure(models.Model): _order = 'sequence asc' lv = fields.Char(string="级别") - name = fields.Char(string="级别名称") + name = fields.Char(string="职级名称") sequence = fields.Char(string='级别序号', store=True) yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储'), - ('tctj', '天投城建')], string='公司') + ('tctj', '天投城建')], string='所属公司') create_time = fields.Datetime(string="生效日期", default=fields.Datetime.now) end_time = fields.Datetime(string="失效日期") + 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): diff --git a/yuthon_salary/security/ir.model.access.csv b/yuthon_salary/security/ir.model.access.csv index 97dd8b917..58262d444 100644 --- a/yuthon_salary/security/ir.model.access.csv +++ b/yuthon_salary/security/ir.model.access.csv @@ -1 +1 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink \ No newline at end of file diff --git a/yuthon_salary/security/yuthon_salary_company.xml b/yuthon_salary/security/yuthon_salary_company.xml new file mode 100644 index 000000000..b919d283e --- /dev/null +++ b/yuthon_salary/security/yuthon_salary_company.xml @@ -0,0 +1,12 @@ + + + + 薪资公司过滤 + + [('yuthon_company', '=', user.employee_id.yuthon_company)] + + + + + + \ No newline at end of file diff --git a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml index 916951aba..476221f2a 100644 --- a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml +++ b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml @@ -12,7 +12,7 @@ 1 - 级别名称 + 职级名称 @@ -31,14 +31,14 @@ - + - 级别名称 + 职级名称