diff --git a/yuthon_holiday/models/inherit_hr_leave_type.py b/yuthon_holiday/models/inherit_hr_leave_type.py
index 6744ba092..c1a55b020 100644
--- a/yuthon_holiday/models/inherit_hr_leave_type.py
+++ b/yuthon_holiday/models/inherit_hr_leave_type.py
@@ -10,5 +10,4 @@ class HrLeaveType(models.Model):
request_unit = fields.Selection([('day', '天'), ('hour', '小时'), ('half_day', '半天')], string="请假单位", default='hour')
employee_requests = fields.Selection([('yes', '允许的额外天数要求'), ('no', '不允许')], string='员工要求', default='yes')
allocation_validation_type = fields.Selection(defalt='no')
- yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储'),
- ('tctj', '天投城建')], string='公司')
\ No newline at end of file
+ yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储')], string='公司')
\ No newline at end of file
diff --git a/yuthon_hr_attendance/models/overtime_page.py b/yuthon_hr_attendance/models/overtime_page.py
index d192106d1..dae9a8c6c 100644
--- a/yuthon_hr_attendance/models/overtime_page.py
+++ b/yuthon_hr_attendance/models/overtime_page.py
@@ -6,8 +6,7 @@ class OvertimePage(models.Model):
_name = 'overtime.page'
_description = '加班说明配置'
- yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储'),
- ('tctj', '天投城建')], string='公司')
+ yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储')], string='公司')
department_id = fields.Many2one("hr.department", string="部门")
day_time = fields.Char(string="每日加班时长不得超过")
month_time = fields.Char(string="每月加班时长不得超过")
diff --git a/yuthon_hr_attendance/models/yuthon_duty_arrangement.py b/yuthon_hr_attendance/models/yuthon_duty_arrangement.py
index c5f40309a..503310edc 100644
--- a/yuthon_hr_attendance/models/yuthon_duty_arrangement.py
+++ b/yuthon_hr_attendance/models/yuthon_duty_arrangement.py
@@ -26,22 +26,6 @@ class YuthonDutyArrangement(models.Model):
is_abnormal = fields.Boolean(string='是否异常')
weekday_count = fields.Float(string='值班次数')
- @api.model_create_multi
- def create(self, vals_list):
- performance_records = super().create(vals_list)
- for performance in performance_records:
- summary = self.env['yuthon.duty.summary'].search([
- ('employee_id', '=', performance.employee_id.id),
- ])
- if summary:
- pass
- else:
- summary = self.env['yuthon.duty.summary'].create({
- 'employee_id': performance.employee_id.id,
- 'duty_arrangement_id': performance.id,
- })
- return performance_records
-
@api.depends('duration', 'duration_two', 'duration_three')
def _compute_is_photo(self):
for record in self:
diff --git a/yuthon_hr_attendance/models/yuthon_duty_summary.py b/yuthon_hr_attendance/models/yuthon_duty_summary.py
index 1ca592029..03076f54a 100644
--- a/yuthon_hr_attendance/models/yuthon_duty_summary.py
+++ b/yuthon_hr_attendance/models/yuthon_duty_summary.py
@@ -7,13 +7,33 @@ class YuthonDutySummary(models.Model):
employee_id = fields.Many2one('hr.employee', string='员工')
duty_weekdays = fields.Float(string='周一至周五值班次数')
- subtotal_weekdays = fields.Float(string='小计')
+ subtotal_weekdays = fields.Float(string='小计', compute='_compute_subtotal_weekdays')
duty_weekends = fields.Float(string='周六日值班次数(不调休)')
- subtotal_weekends = fields.Float(string='小计')
+ subtotal_weekends = fields.Float(string='小计', compute='_compute_subtotal_weekends')
duty_weekends_leave = fields.Float(string='周六日值班次数(调休)')
subtotal_weekends_leave = fields.Float(string='小计')
- total_duty_shifts = fields.Float(string='值班合计')
+ total_duty_shifts = fields.Float(string='值班合计', compute='_compute_total_duty_shifts')
holidays = fields.Float(string='节假日值班费(元)')
- total = fields.Float(string='总合计')
+ total = fields.Float(string='总合计', compute='_compute_total')
remake = fields.Text(string='备注')
- duty_arrangement_id = fields.Many2one('yuthon.duty.arrangement', string='关联值班安排')
\ No newline at end of file
+ duty_arrangement_id = fields.Many2one('yuthon.duty.arrangement', string='关联值班安排')
+
+ @api.depends('subtotal_weekdays', 'subtotal_weekends', 'subtotal_weekends_leave')
+ def _compute_total_duty_shifts(self):
+ for record in self:
+ record.total_duty_shifts = record.subtotal_weekdays + record.subtotal_weekends + record.subtotal_weekends_leave
+
+ @api.depends('duty_weekdays')
+ def _compute_subtotal_weekdays(self):
+ for record in self:
+ record.subtotal_weekdays = record.duty_weekdays * 60
+
+ @api.depends('duty_weekends')
+ def _compute_subtotal_weekends(self):
+ for record in self:
+ record.subtotal_weekends = record.duty_weekends * 160
+
+ @api.depends('subtotal_weekdays', 'subtotal_weekends', 'subtotal_weekends_leave','holidays')
+ def _compute_total(self):
+ for record in self:
+ record.total = record.subtotal_weekdays + record.subtotal_weekends + record.subtotal_weekends_leave + record.holidays
\ No newline at end of file
diff --git a/yuthon_hr_attendance/security/ir.model.access.csv b/yuthon_hr_attendance/security/ir.model.access.csv
index 5d155b7c3..9f5273462 100644
--- a/yuthon_hr_attendance/security/ir.model.access.csv
+++ b/yuthon_hr_attendance/security/ir.model.access.csv
@@ -15,3 +15,4 @@ access_yuthon_adjustments_approval,yuthon.adjustments.approval,model_yuthon_adju
access_yuthon_duty_arrangement,yuthon.duty.arrangement,model_yuthon_duty_arrangement,base.group_user,1,1,1,1
access_yuthon_duty_setting,yuthon.duty.setting,model_yuthon_duty_setting,base.group_user,1,1,1,1
access_yuthon_duty_arrangement_wizard,yuthon.duty.arrangement.wizard,model_yuthon_duty_arrangement_wizard,base.group_user,1,1,1,1
+access_yuthon_duty_summary_wizard,yuthon.duty.summary.wizard,model_yuthon_duty_summary_wizard,base.group_user,1,1,1,1
\ No newline at end of file
diff --git a/yuthon_hr_attendance/wizard/yuthon_duty_arrangement_wizard.py b/yuthon_hr_attendance/wizard/yuthon_duty_arrangement_wizard.py
index 4daf94bf6..c2792b279 100644
--- a/yuthon_hr_attendance/wizard/yuthon_duty_arrangement_wizard.py
+++ b/yuthon_hr_attendance/wizard/yuthon_duty_arrangement_wizard.py
@@ -14,7 +14,13 @@ class YuthonDutyArrangementWizard(models.TransientModel):
num_people = self.number_personnel
available_people = self.env['hr.employee'].search([('department_id.name', '=', '仓储组')])
selected_people = random.sample(available_people, num_people)
- self.env['yuthon.duty.arrangement'].search([]).unlink()
+ today = date.today()
+ first_day_of_month = today.replace(day=1)
+ last_day_of_month = (today.replace(day=1) + timedelta(days=32)).replace(day=1) - timedelta(days=1)
+ self.env['yuthon.duty.arrangement'].search([
+ ('start_time', '>=', first_day_of_month),
+ ('start_time', '<=', last_day_of_month),
+ ]).unlink()
today = date.today()
next_month = (today.replace(day=1) + timedelta(days=32)).replace(day=1)
current_date = today
diff --git a/yuthon_hr_attendance/wizard/yuthon_duty_summary_wizard.py b/yuthon_hr_attendance/wizard/yuthon_duty_summary_wizard.py
index b9041998c..64978ea21 100644
--- a/yuthon_hr_attendance/wizard/yuthon_duty_summary_wizard.py
+++ b/yuthon_hr_attendance/wizard/yuthon_duty_summary_wizard.py
@@ -1,5 +1,7 @@
+from dateutil.relativedelta import relativedelta
+
from odoo import api, fields, models, tools, _
-from datetime import datetime
+from datetime import date, timedelta, datetime
class YuthonDutySummaryWizard(models.TransientModel):
_name = 'yuthon.duty.summary.wizard'
@@ -31,21 +33,4 @@ class YuthonDutySummaryWizard(models.TransientModel):
}
def confirm(self):
- employees = self.env['hr.employee'].search([])
- for employee in employees:
- duty_arrangements = self.env['yuthon.duty.arrangement'].search([
- ('employee_id', '=', employee.id),
- ])
- weekday_count = 0
- weekend_count = 0
- for arrangement in duty_arrangements:
- if 0 <= arrangement.start_time.weekday() <= 4:
- weekday_count += 1
- elif arrangement.start_time.weekday() in (5, 6):
- weekend_count += 1
- summary = self.env['yuthon.duty.summary'].search([
- ('employee_id', '=', employee.id),
- ], limit=1)
- if summary:
- summary.duty_weekdays = weekday_count
- summary.duty_weekends = weekend_count
\ No newline at end of file
+ pass
\ No newline at end of file
diff --git a/yuthon_hr_attendance/wizard/yuthon_duty_summary_wizard_views.xml b/yuthon_hr_attendance/wizard/yuthon_duty_summary_wizard_views.xml
index 419e845c0..338525c16 100644
--- a/yuthon_hr_attendance/wizard/yuthon_duty_summary_wizard_views.xml
+++ b/yuthon_hr_attendance/wizard/yuthon_duty_summary_wizard_views.xml
@@ -15,11 +15,11 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+ 值班汇总计算
+
+ code
+ action = model.action_duty_summary_wizard()
+
+
+
diff --git a/yuthon_hr_employee/models/inherit_hr_job.py b/yuthon_hr_employee/models/inherit_hr_job.py
index 968caa5b3..58e71e9ba 100644
--- a/yuthon_hr_employee/models/inherit_hr_job.py
+++ b/yuthon_hr_employee/models/inherit_hr_job.py
@@ -14,7 +14,7 @@ class HrJob(models.Model):
number = fields.Char(string="序号")
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建'),('thtjbb', '天河投资本部')], string="所属公司")
+ ('thlc', '天河粮储'), ('thtjbb', '天河投资本部')], string="所属公司")
job_type_id = fields.Many2one('hr.job.type', string="岗位类别")
job_lv_id = fields.Many2one('yuthon.job.lv', string="职级")
start_date = fields.Date(string="生效日期", default=lambda self: fields.Date.today())
diff --git a/yuthon_hr_employee/models/yuthon_hr_employee.py b/yuthon_hr_employee/models/yuthon_hr_employee.py
index 585886c1a..a8644db3b 100644
--- a/yuthon_hr_employee/models/yuthon_hr_employee.py
+++ b/yuthon_hr_employee/models/yuthon_hr_employee.py
@@ -33,8 +33,7 @@ class YuthonHrEmployee(models.Model):
job_lv_id = fields.Many2one('yuthon.job.lv', string="最新职级")
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')],
- default='thtz', store=True, compute="compute_company", string="所属公司")
+ ('thlc', '天河粮储')], default='thtz', store=True, compute="compute_company", string="所属公司")
# 个人信息
user_salary = fields.Float(string="基本工资")
job_lv_salary = fields.Float(string="职级工资")
@@ -117,7 +116,6 @@ class YuthonHrEmployee(models.Model):
company_mapping = {'天河投资集团': 'thtz',
'天河物管': 'thwg',
'天河粮储': 'thlc',
- '天投城建': 'tctj',
'天河投资本部': 'thtjbb'}
for record in self:
visited_departments = set()
diff --git a/yuthon_hr_employee/models/yuthon_job_lv.py b/yuthon_hr_employee/models/yuthon_job_lv.py
index 435d43500..025dd8427 100644
--- a/yuthon_hr_employee/models/yuthon_job_lv.py
+++ b/yuthon_hr_employee/models/yuthon_job_lv.py
@@ -22,7 +22,7 @@ class YuthonJobLv(models.Model):
all_wage = fields.Float(string="应发工资", group_operator=None)
comprehensive_subsidy = fields.Float(string="综合补贴", group_operator=None)
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')], string="所属公司")
+ ('thlc', '天河粮储')], string="所属公司")
create_time = fields.Datetime(string="生效日期", default=fields.Datetime.now)
end_time = fields.Datetime(string="失效日期")
diff --git a/yuthon_hr_employee_approval/models/yuthon_interview_approval.py b/yuthon_hr_employee_approval/models/yuthon_interview_approval.py
index dcd1401fb..852b114e4 100644
--- a/yuthon_hr_employee_approval/models/yuthon_interview_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_interview_approval.py
@@ -18,7 +18,7 @@ class YuthonInterviewApproval(models.Model):
applicant_ids = fields.One2many('interview.approval.line', 'interview_approval_id', string='应聘面试信息')
is_issues = fields.Boolean(string='是否上会')
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')], string="公司")
+ ('thlc', '天河粮储')], string="公司")
related_issues_id = fields.Many2one('issue.library', string="关联议题")
def scheduling_of_meetings(self):
diff --git a/yuthon_hr_employee_approval/models/yuthon_leaving_approval.py b/yuthon_hr_employee_approval/models/yuthon_leaving_approval.py
index aaae174e2..5c6a1100f 100644
--- a/yuthon_hr_employee_approval/models/yuthon_leaving_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_leaving_approval.py
@@ -13,7 +13,7 @@ class YuthonLeavingApproval(models.Model):
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_leaving_approval_code'))
phone = fields.Char(related='users_id.employee_id.work_phone',string='手机号')
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')], string="任职单位")
+ ('thlc', '天河粮储')], string="任职单位")
job_id = fields.Many2one(related='users_id.employee_id.job_id', string="主岗")
duties = fields.Char(string="职务")
diff --git a/yuthon_hr_employee_approval/models/yuthon_onboard_approval.py b/yuthon_hr_employee_approval/models/yuthon_onboard_approval.py
index ede25a418..3a75eaef0 100644
--- a/yuthon_hr_employee_approval/models/yuthon_onboard_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_onboard_approval.py
@@ -27,7 +27,7 @@ class YuthonOnboardApproval(models.Model):
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')], string="甲方")
+ ('thlc', '天河粮储')], string="甲方")
grades_id = fields.Many2one('yuthon.job.lv', string='职级')
account = fields.Char(string='账号')
bank = fields.Char(string='开户行')
diff --git a/yuthon_hr_employee_approval/models/yuthon_prepare_approval.py b/yuthon_hr_employee_approval/models/yuthon_prepare_approval.py
index 5ae657901..f4d88199e 100644
--- a/yuthon_hr_employee_approval/models/yuthon_prepare_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_prepare_approval.py
@@ -10,7 +10,7 @@ class YuthonPrepareApproval(models.Model):
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_prepare_approval_code'))
- yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储'), ('tctj', '天投城建')], string="所属公司")
+ yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储')], string="所属公司")
name = fields.Char(string='标题')
reason = fields.Html(string="正文")
is_issues = fields.Boolean(string='是否上会')
@@ -82,7 +82,7 @@ class PrepareApprovalLine(models.Model):
hr_job_id = fields.Many2one('hr.job', string='工作岗位')
department_id = fields.Many2one("hr.department", string="部门")
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')], string="所属公司")
+ ('thlc', '天河粮储')], string="所属公司")
job_type_id = fields.Many2one('hr.job.type', string="岗位类型")
compiling_external = fields.Integer(string="编制外人数")
job_lv_id = fields.Many2one('yuthon.job.lv', string="职级")
@@ -139,7 +139,7 @@ class NewPrepareApprovalLine(models.Model):
hr_job_id = fields.Many2one('hr.job', string='工作岗位')
department_id = fields.Many2one("hr.department", string="部门")
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')], string="所属公司")
+ ('thlc', '天河粮储')], string="所属公司")
job_type_id = fields.Many2one('hr.job.type', string="岗位类型")
compiling_external = fields.Integer(string="编制外人数")
job_lv_id = fields.Many2one('yuthon.job.lv', string="职级")
diff --git a/yuthon_hr_employee_approval/models/yuthon_reassignment_approval.py b/yuthon_hr_employee_approval/models/yuthon_reassignment_approval.py
index 467a22e19..ccb385bad 100644
--- a/yuthon_hr_employee_approval/models/yuthon_reassignment_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_reassignment_approval.py
@@ -13,7 +13,7 @@ class YuthonReassignmentApproval(models.Model):
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_reassignment_approval_code'))
phone = fields.Char(related='users_id.employee_id.work_phone',string='联系电话')
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')], string="任职单位")
+ ('thlc', '天河粮储')], string="任职单位")
job_id = fields.Many2one(related='users_id.employee_id.job_id', string="主岗")
duties = fields.Char(string="职务")
job_lv_id = fields.Many2one(related='users_id.employee_id.job_lv_id', string='职级')
diff --git a/yuthon_hr_employee_approval/models/yuthon_recruitment_approval.py b/yuthon_hr_employee_approval/models/yuthon_recruitment_approval.py
index 2874e07a3..0a9499e2f 100644
--- a/yuthon_hr_employee_approval/models/yuthon_recruitment_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_recruitment_approval.py
@@ -19,7 +19,7 @@ class YuthonRecruitmentApproval(models.Model):
notice_documents_ids = fields.Many2many('ir.attachment', string='议题附件')
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')], string="所属公司")
+ ('thlc', '天河粮储')], string="所属公司")
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
@api.onchange('is_issues')
diff --git a/yuthon_hr_employee_approval/models/yuthon_regularization_approval.py b/yuthon_hr_employee_approval/models/yuthon_regularization_approval.py
index f8578a2de..110697f02 100644
--- a/yuthon_hr_employee_approval/models/yuthon_regularization_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_regularization_approval.py
@@ -15,7 +15,7 @@ class YuthonRegularizationPrepareApproval(models.Model):
phone = fields.Char(string='手机号')
job = fields.Char(string="职务")
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')], string="任职单位")
+ ('thlc', '天河粮储')], string="任职单位")
job_type_id = fields.Many2one('hr.job.type', string="岗位类别")
job_lv_id = fields.Many2one(related='users_id.employee_id.job_lv_id', string='职级')
onboarding_time = fields.Date(related='users_id.employee_id.entry_date',string="入职日期")
diff --git a/yuthon_hr_employee_approval/models/yuthon_reward_approval.py b/yuthon_hr_employee_approval/models/yuthon_reward_approval.py
index 40e7a1a1b..94720755d 100644
--- a/yuthon_hr_employee_approval/models/yuthon_reward_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_reward_approval.py
@@ -13,7 +13,7 @@ class YuthonRewardApproval(models.Model):
code = fields.Char(string="编号",
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_salary_approval_code'))
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')], string="所属公司")
+ ('thlc', '天河粮储')], string="所属公司")
users_id = fields.Many2one('res.users', string="录入人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
entrant_date = fields.Date(string="录入日期")
diff --git a/yuthon_hr_employee_approval/models/yuthon_transfer_approval.py b/yuthon_hr_employee_approval/models/yuthon_transfer_approval.py
index f66dae2ed..a1d892d35 100644
--- a/yuthon_hr_employee_approval/models/yuthon_transfer_approval.py
+++ b/yuthon_hr_employee_approval/models/yuthon_transfer_approval.py
@@ -14,7 +14,7 @@ class YutransferApproval(models.Model):
users_id = fields.Many2one('res.users', string="录入人", default=lambda self: self.env.user.id)
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')], string="所属公司")
+ ('thlc', '天河粮储')], string="所属公司")
main_post = fields.Many2one("hr.job", string="主岗")
duties = fields.Char(string="职务")
grades = fields.Many2one('yuthon.job.lv', string='职级')
diff --git a/yuthon_issue/models/issue_approval.py b/yuthon_issue/models/issue_approval.py
index 1270b5deb..b14fcfd7f 100644
--- a/yuthon_issue/models/issue_approval.py
+++ b/yuthon_issue/models/issue_approval.py
@@ -15,7 +15,7 @@ class IssueApproval(models.Model):
employee_id = fields.Many2one('hr.employee', string="经办人", default=lambda self: self.env.user.employee_id)
department_id = fields.Many2one(related='employee_id.department_id', string="部门")
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储'),
- ('tctj', '天投城建'), ('thtjbb', '天河投资本部')],
+ ('thtjbb', '天河投资本部')],
related='employee_id.yuthon_company', string="所属公司")
user_id = fields.Many2one('res.users', string="经办人", default=lambda self: self.env.user)
meeting_details = fields.Char(string="会议详情")
diff --git a/yuthon_issue/models/issue_approval_decision.py b/yuthon_issue/models/issue_approval_decision.py
index c5a3bfaf1..6463ac994 100644
--- a/yuthon_issue/models/issue_approval_decision.py
+++ b/yuthon_issue/models/issue_approval_decision.py
@@ -16,7 +16,7 @@ class IssueApprovalDecision(models.Model):
board_meet = fields.Selection([('approval', '审'), ('decide', '决'), ('commission', '授权投决会')], string='董事会', compute='_compute_board_meet', readonly=False)
district_bureau = fields.Selection([('record', '备案'), ('approved', '核准'), ('record_approved', '备案、核准')], string='上级单位')
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')], string="所属公司")
+ ('thlc', '天河粮储')], string="所属公司")
department_id = fields.Many2one('hr.department', string="部门")
start_date = fields.Date(string="生效日期")
end_date = fields.Date(string="失效日期")
diff --git a/yuthon_issue/models/issue_library.py b/yuthon_issue/models/issue_library.py
index 226678bd2..ac2c0d608 100644
--- a/yuthon_issue/models/issue_library.py
+++ b/yuthon_issue/models/issue_library.py
@@ -37,7 +37,7 @@ class IssueLibrary(models.Model):
employee_id = fields.Many2one('hr.employee', string='创建人', default=lambda self: self.env.user.employee_id)
department_id = fields.Many2one('hr.department', string='部门', related='employee_id.department_id')
yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
- ('thlc', '天河粮储'), ('tctj', '天投城建')], string="所属公司", related='employee_id.yuthon_company')
+ ('thlc', '天河粮储')], string="所属公司", related='employee_id.yuthon_company')
users_role_ids = fields.Many2many('soong.user.role', string='角色范围', related='employee_id.user_role_ids')
approval_name = fields.Char(string="审批标题")
meeting_place = fields.Char(string="会议地点")
diff --git a/yuthon_official/models/yuthon_offficial_incoming_party.py b/yuthon_official/models/yuthon_offficial_incoming_party.py
index d328dbe5e..5c5c86dec 100644
--- a/yuthon_official/models/yuthon_offficial_incoming_party.py
+++ b/yuthon_official/models/yuthon_offficial_incoming_party.py
@@ -32,4 +32,23 @@ class YuthonOfficialIncomingParty(models.Model):
string="状态", default='drft')
deadline = fields.Date(string="办理期限")
red_suit = fields.Char(string="套红")
- official_documents_ids = fields.Many2many('documents.document', string="公文相关文件")
+ official_documents_ids = fields.Many2many('documents.document', string="附件")
+ is_issues = fields.Boolean(string="是否上会")
+ related_issues_id = fields.Many2one('issue.library', string="关联议题")
+
+ @api.onchange('is_issues')
+ def _onchange_is_issues(self):
+ if self.is_issues:
+ issue_id = self.env['issue.library'].create({'name': self.name})
+ self.related_issues_id = issue_id.id
+ workflow_record_id = self.env["soong.workflow.record"].search(
+ [("res_model", "=", self._name), ("res_id", "=", self.id)])
+ self.env['issue.library.approval.line'].create({
+ 'issue_library_id': issue_id.id,
+ 'workflow_record_id': workflow_record_id.id,
+ 'approval_type': workflow_record_id.workflow_id.id,
+ 'code': self.code,
+ 'approval_date': fields.Datetime.now(),
+ })
+ elif self.related_issues_id:
+ raise UserError("已经创建了相关的上会记录,不能取消勾选")
\ No newline at end of file
diff --git a/yuthon_official/models/yuthon_official_incoming_labor.py b/yuthon_official/models/yuthon_official_incoming_labor.py
index 930e65fa9..a9b8eca2b 100644
--- a/yuthon_official/models/yuthon_official_incoming_labor.py
+++ b/yuthon_official/models/yuthon_official_incoming_labor.py
@@ -32,4 +32,23 @@ class YuthonOfficialIncomingLabor(models.Model):
string="状态", default='drft')
deadline = fields.Date(string="办理期限")
red_suit = fields.Char(string="套红")
- official_documents_ids = fields.Many2many('documents.document', string="公文相关文件")
+ official_documents_ids = fields.Many2many('documents.document', string="附件")
+ is_issues = fields.Boolean(string="是否上会")
+ related_issues_id = fields.Many2one('issue.library', string="关联议题")
+
+ @api.onchange('is_issues')
+ def _onchange_is_issues(self):
+ if self.is_issues:
+ issue_id = self.env['issue.library'].create({'name': self.name})
+ self.related_issues_id = issue_id.id
+ workflow_record_id = self.env["soong.workflow.record"].search(
+ [("res_model", "=", self._name), ("res_id", "=", self.id)])
+ self.env['issue.library.approval.line'].create({
+ 'issue_library_id': issue_id.id,
+ 'workflow_record_id': workflow_record_id.id,
+ 'approval_type': workflow_record_id.workflow_id.id,
+ 'code': self.code,
+ 'approval_date': fields.Datetime.now(),
+ })
+ elif self.related_issues_id:
+ raise UserError("已经创建了相关的上会记录,不能取消勾选")
\ No newline at end of file
diff --git a/yuthon_official/models/yuthon_official_incoming_normal.py b/yuthon_official/models/yuthon_official_incoming_normal.py
index 1edde5d70..d5e89d469 100644
--- a/yuthon_official/models/yuthon_official_incoming_normal.py
+++ b/yuthon_official/models/yuthon_official_incoming_normal.py
@@ -11,8 +11,7 @@ class YuthonOfficialIncomingNormal(models.Model):
name = fields.Char(string="标题")
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('official_code'))
- yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储'),
- ('tctj', '天投城建')], string='公司')
+ yuthon_company = fields.Selection(related='users_id.employee_id.yuthon_company', string="公司")
official_type_id = fields.Many2one('official.type', string="公文种类")
reference_cold = fields.Integer(string="来文字号")
reference_date = fields.Date(string='来问日期')
@@ -76,7 +75,6 @@ class YuthonOfficialIncomingNormal(models.Model):
'default_incoming_normal_id': self.id,
},
}
-
# def button_meet(self):
# return {
# "name": "会议",
diff --git a/yuthon_official/views/yuthon_official_incoming_labor_views.xml b/yuthon_official/views/yuthon_official_incoming_labor_views.xml
index fac6b2fdc..c8909f804 100644
--- a/yuthon_official/views/yuthon_official_incoming_labor_views.xml
+++ b/yuthon_official/views/yuthon_official_incoming_labor_views.xml
@@ -22,20 +22,20 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
+
@@ -43,25 +43,13 @@
-
-
-
-
-
+
-
-
-
-
-
-
-
-
diff --git a/yuthon_official/views/yuthon_official_incoming_normal_views.xml b/yuthon_official/views/yuthon_official_incoming_normal_views.xml
index 884701d53..630c8a6f5 100644
--- a/yuthon_official/views/yuthon_official_incoming_normal_views.xml
+++ b/yuthon_official/views/yuthon_official_incoming_normal_views.xml
@@ -17,6 +17,11 @@
-
yuthon.official.incoming.party.form
yuthon.official.incoming.party
@@ -22,46 +21,34 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/yuthon_performance/models/yuthon_Index_management.py b/yuthon_performance/models/yuthon_Index_management.py
index a46059600..617cee336 100644
--- a/yuthon_performance/models/yuthon_Index_management.py
+++ b/yuthon_performance/models/yuthon_Index_management.py
@@ -6,29 +6,29 @@ class YuthonIndexManagement(models.Model):
_description = "组织绩效标准库"
_rec_name = 'index_name'
- dimension = fields.Char('维度', required=True)
- development_goals = fields.Char('发展目标', required=True)
- index_name = fields.Char('指标名称', required=True)
- index_definition = fields.Text('指标定义', required=True)
+ sequence = fields.Char(string='序号', store=True)
+ dimension = fields.Char('维度')
+ development_goals = fields.Char('发展目标')
+ index_name = fields.Char('指标名称')
+ index_definition = fields.Text('指标定义')
index_type = fields.Selection([('kpi', 'KPI'),
- ('gs', 'GS')],'指标类别')
- index_compute = fields.Char('指标计算公式', required=True)
+ ('gs', 'GS'), ('no', '否决指标')],'指标类别')
+ index_compute = fields.Char('指标计算公式')
compute_type = fields.Selection([('bad_index', '反向指标'),
('good_index', '正向指标'),
('two_index', '双向指标'),],'计算类别')
- check_norm = fields.Char('考核标准', required=True)
- department_ids = fields.Many2many("hr.department", string="指标来源", required=True)
+ check_norm = fields.Text('考核标准')
+ yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'),
+ ('thlc', '天河粮储')], string="所属公司")
+ department_ids = fields.Many2many("hr.department", string="指标来源")
in_charge_role_ids = fields.Many2many('soong.user.role', string='角色')
employee_id = fields.Many2one('hr.employee', string="人员")
- start_index_time = fields.Date(string='生效时间', required=True)
+ start_index_time = fields.Date(string='生效时间', default=fields.Date.today())
end_index_time = fields.Date(string='失效时间')
unit_compute = fields.Char('计算单位')
weight = fields.Char(string="权重%")
compute_method = fields.Char(string="计算方法")
compute_act = fields.Char(string="计划安排及具体措施/行动")
-
-
-
change_index_library_id = fields.Many2one("yuthon.index.approval", string="指标库变更明细")
index_duty_id = fields.Many2one('yuthon.duty.management', string="绩效明细")
index_duty_approval_id = fields.Many2one('yuthon.duty.approval', string="部门责任变更明细")
diff --git a/yuthon_performance/views/yuthon_Index_management.xml b/yuthon_performance/views/yuthon_Index_management.xml
index 0a5f886c4..a5a921b5f 100644
--- a/yuthon_performance/views/yuthon_Index_management.xml
+++ b/yuthon_performance/views/yuthon_Index_management.xml
@@ -10,6 +10,7 @@
+
@@ -23,6 +24,7 @@
+
@@ -40,12 +42,13 @@