diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py
index bea4dd5bb..4554c4f2d 100644
--- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py
+++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py
@@ -132,38 +132,7 @@ class YuthonVacationReports(models.Model):
def confirm_state(self):
for rec in self:
- rec.vacation_state = 'confirmed'
- # 计算下个月的日期(基于当前记录的vacation_date)
- current_date = rec.vacation_date
- if current_date.month == 12:
- next_month_date = current_date.replace(year=current_date.year + 1, month=1, day=1)
- else:
- next_month_date = current_date.replace(month=current_date.month + 1, day=1)
- # 查找下个月是否已有该员工的记录
- next_month_record = self.search([
- ('employee_id', '=', rec.employee_id.id),
- ('vacation_date', '=', next_month_date)
- ], limit=1)
-
- inherit_vals = {
- 'leave': rec.leave,
- 'working_overtime': rec.working_overtime,
- 'medical_fee': rec.medical_fee,
- }
- if next_month_record:
- # 如果下个月记录已存在,更新继承字段
- next_month_record.write(inherit_vals)
-
- # 处理年假明细行继承
- if rec.leave:
- leave_hours = rec.leave * 8
- self._update_leave_lines(next_month_record, [rec], leave_hours)
-
- # 处理补休明细行继承
- if rec.working_overtime:
- overtime_hours = rec.working_overtime * 8
- self._update_over_lines(next_month_record, [rec], overtime_hours)
-
+ rec.manage_reject()
@api.depends('vacation_date')
def _compute_display_date(self):
diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
index 48c802a89..e119c8238 100644
--- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml
+++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
@@ -396,7 +396,8 @@
-
+
+
@@ -410,9 +411,6 @@
-
-
-
diff --git a/yuthon_report/models/receivable_report.py b/yuthon_report/models/receivable_report.py
index 2376e20a6..1d25442d3 100644
--- a/yuthon_report/models/receivable_report.py
+++ b/yuthon_report/models/receivable_report.py
@@ -63,18 +63,24 @@ class YuthonProperty(models.Model):
@api.model
def get_domain(self, start_date=False, end_date=False, company_id=False):
-
if not start_date or not end_date:
return []
if not company_id:
return []
# 这里进行条件的修改
- property_records = self.env['yuthon.property'].search([('company_id', '=', company_id),('effective_date','>',start_date),('effective_date','<',end_date)])
+ property_records = self.env['yuthon.property'].search([('company_id', '=', company_id)])
user_ids = set()
for property_record in property_records:
- user_ids.add(property_record.admin_id.id)
- user_ids.add(property_record.users_id.id)
+ user_ids.add(property_record.admin_id.employee_ids.id)
return list(user_ids)
+
+ @api.model
+ def get_company_domain(self, user_id=False):
+ if not user_id:
+ return []
+
+ company_id = self.env['yuthon.property'].search([('admin_id', '=', user_id)], limit=1).company_id.id
+ return company_id
\ No newline at end of file
diff --git a/yuthon_report/static/src/components/yuthon_report/receivable_report.js b/yuthon_report/static/src/components/yuthon_report/receivable_report.js
index 07f1fc4f9..20ee7de59 100644
--- a/yuthon_report/static/src/components/yuthon_report/receivable_report.js
+++ b/yuthon_report/static/src/components/yuthon_report/receivable_report.js
@@ -87,11 +87,14 @@ class ReceivableReport extends Component {
}
getDomain() {
- // 过滤条件
- // return [['id', 'in', [107, 106, 215, 112, 110, 214, 218, 173, 219]]]
- console.log(this.state)
- return [['id','in',this.state.domainUsers]]
+ console.log(this.state)
+ const isCompanyEmpty = Object.keys(this.state.selectCompany).length === 0;
+ if (isCompanyEmpty) {
+ return [];
+ } else {
+ return [['id','in', this.state.domainUsers]];
}
+}
async onUpdatePartner(v) {
console.log(v)
@@ -118,8 +121,7 @@ class ReceivableReport extends Component {
}
async onUpdateCompany(v) {
- this.state.selectCompany = v[0]
-
+ this.state.selectCompany = v[0] || {}
// 查询这个过程中的 user_id 组合成列表.返回.
// 重置 partner 筛选结果
// 修改过滤条件
diff --git a/yuthon_report/static/src/components/yuthon_report/receivable_report.xml b/yuthon_report/static/src/components/yuthon_report/receivable_report.xml
index 0daa8a6d4..71ff2767f 100644
--- a/yuthon_report/static/src/components/yuthon_report/receivable_report.xml
+++ b/yuthon_report/static/src/components/yuthon_report/receivable_report.xml
@@ -59,7 +59,7 @@