From dcedd5bb6f38d4beb5f0b4499e5cd44a907fea74 Mon Sep 17 00:00:00 2001
From: zhou <123@>
Date: Fri, 6 Jun 2025 16:34:17 +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_hr_employee/models/inherit_hr_job.py | 24 -------------------
.../views/inherit_hr_job_views.xml | 1 -
.../models/inherit_hr_payroll_structure.py | 22 -----------------
.../inherit_hr_payroll_structure_views.xml | 2 --
4 files changed, 49 deletions(-)
diff --git a/yuthon_hr_employee/models/inherit_hr_job.py b/yuthon_hr_employee/models/inherit_hr_job.py
index e67a3a91f..b5468f1c4 100644
--- a/yuthon_hr_employee/models/inherit_hr_job.py
+++ b/yuthon_hr_employee/models/inherit_hr_job.py
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models, _
import datetime
-from odoo.exceptions import UserError
class HrJob(models.Model):
@@ -45,29 +44,6 @@ class HrJob(models.Model):
other_notes = fields.Text(string="任职要求")
function = fields.Text(string="岗位职责")
- is_company = fields.Boolean(string="本公司", default=True, compute='_compute_is_company',
- search='_search_part_of_company')
-
- @api.depends_context('uid', 'company')
- @api.depends('company_id')
- def _compute_is_company(self):
- active_company_ids = self.env.companies
- for employee in self:
- employee.is_company = employee.company_id in active_company_ids
-
- def _search_part_of_company(self, operator, value):
- if operator not in ('=', '!=') or not isinstance(value, bool):
- raise UserError(('Operation not supported'))
- company_ids = self.env.companies.ids # 获取公司ID列表
- # 处理反向操作符
- if not value:
- operator = '!=' if operator == '=' else '='
- # 使用company_id in company_ids的结构
- if operator == '=':
- return [('company_id', 'in', company_ids)]
- else: # operator == '!='
- return [('company_id', 'not in', company_ids)]
-
def action_create_new_job(self):
action = self.env.ref("hr_recruitment.hr_applicant_view_form")
return {
diff --git a/yuthon_hr_employee/views/inherit_hr_job_views.xml b/yuthon_hr_employee/views/inherit_hr_job_views.xml
index 2c87611ee..8fed581ce 100644
--- a/yuthon_hr_employee/views/inherit_hr_job_views.xml
+++ b/yuthon_hr_employee/views/inherit_hr_job_views.xml
@@ -53,7 +53,6 @@
-
diff --git a/yuthon_salary/models/inherit_hr_payroll_structure.py b/yuthon_salary/models/inherit_hr_payroll_structure.py
index df0724af9..7153613f1 100644
--- a/yuthon_salary/models/inherit_hr_payroll_structure.py
+++ b/yuthon_salary/models/inherit_hr_payroll_structure.py
@@ -1,7 +1,6 @@
from odoo import api, fields, models, _
import re
from pypinyin import pinyin, Style
-from odoo.exceptions import UserError, ValidationError
class HrPayrollStructure(models.Model):
@@ -26,27 +25,6 @@ class HrPayrollStructure(models.Model):
position_subsidy = fields.Monetary(string="岗位补贴", currency_field="currency_id")
integrated_subsidy = fields.Monetary(string="综合补贴", currency_field="currency_id")
advance_performance_bonuses = fields.Monetary(string="预发绩效奖金", currency_field="currency_id")
- is_company = fields.Boolean(string="本公司", default=True, compute='_compute_is_company',search='_search_part_of_company')
-
- @api.depends_context('uid', 'company')
- @api.depends('company_id')
- def _compute_is_company(self):
- active_company_ids = self.env.companies
- for employee in self:
- employee.is_company = employee.company_id in active_company_ids
-
- def _search_part_of_company(self, operator, value):
- if operator not in ('=', '!=') or not isinstance(value, bool):
- raise UserError(('Operation not supported'))
- company_ids = self.env.companies.ids # 获取公司ID列表
- # 处理反向操作符
- if not value:
- operator = '!=' if operator == '=' else '='
- # 使用company_id in company_ids的结构
- if operator == '=':
- return [('company_id', 'in', company_ids)]
- else: # operator == '!='
- return [('company_id', 'not in', company_ids)]
@api.model
def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):
diff --git a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
index ba58e8ea3..35576f498 100644
--- a/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
+++ b/yuthon_salary/views/inherit_hr_payroll_structure_views.xml
@@ -38,7 +38,6 @@
-
@@ -97,7 +96,6 @@
职级
hr.payroll.structure
tree,form,search
- [('is_company','=', True)]