添加功能
This commit is contained in:
@@ -596,12 +596,12 @@ class SoongWorkflowCommentWizard(models.TransientModel):
|
||||
elif hasattr(biz_record, 'users_id') and biz_record.users_id:
|
||||
employee = biz_record.users_id.employee_ids
|
||||
action_id = self.env['ir.actions.act_window'].search([('res_model', '=', self.res_model)])[0]
|
||||
url = f'https://oa.thtzjt.com/web?login={employee.user_id.login}&oauth_uid={employee.wecom_userid}#id={record_id.id}&cids=2&action={action_id.id}&model={record_id._name}&view_type=form&menu_id=10104'
|
||||
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa',
|
||||
user_id=employee.wecom_userid,
|
||||
title=record_id._description,
|
||||
description=f"编号为{record_id.code}的{record_id._description}已结束",
|
||||
url=url, btntxt="查看详情")
|
||||
# url = f'https://oa.thtzjt.com/web?login={employee.user_id.login}&oauth_uid={employee.wecom_userid}#id={record_id.id}&cids=2&action={action_id.id}&model={record_id._name}&view_type=form&menu_id=10104'
|
||||
# self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa',
|
||||
# user_id=employee.wecom_userid,
|
||||
# title=record_id._description,
|
||||
# description=f"编号为{record_id.code}的{record_id._description}已结束",
|
||||
# url=url, btntxt="查看详情")
|
||||
|
||||
recipients = []
|
||||
if self.node_btn_id.workflow_id.archive_type == 'applicant':
|
||||
|
||||
@@ -626,7 +626,7 @@ class YuthonVacationReports(models.Model):
|
||||
|
||||
def monthly_report(self):
|
||||
today = fields.Date.today()
|
||||
employees = self.env['hr.employee'].search(['contract_id.state', '=', 'open'])
|
||||
employees = self.env['hr.employee'].search([('contract_id.state', '=', 'open')])
|
||||
current_month_first = today.replace(day=1)
|
||||
last_month_last = current_month_first - timedelta(days=1)
|
||||
last_month_first = last_month_last.replace(day=1)
|
||||
|
||||
@@ -18,6 +18,13 @@ class EmployeeLogin(Controller):
|
||||
values['employee_id'] = int(employee_id)
|
||||
record = request.env['yuthon.message.login'].sudo().browse(values['employee_id'])
|
||||
values['staff_name'] = record.staff_name
|
||||
if record.login_state == 'filled':
|
||||
values['error'] = "该员工信息已提交,无法重复操作"
|
||||
response = request.render('yuthon_hr_employee_approval.website_form_employee', values)
|
||||
response.headers['X-Frame-Options'] = 'SAMEORIGIN'
|
||||
response.headers['Content-Security-Policy'] = "frame-ancestors 'self'"
|
||||
return response
|
||||
|
||||
if request.httprequest.method == 'POST':
|
||||
attachment = kw.get('attachment')
|
||||
if attachment:
|
||||
@@ -66,7 +73,8 @@ class EmployeeLogin(Controller):
|
||||
record.current_address = values.get("current_address", "")
|
||||
if "house_hold" in values and values.get("house_hold", ""):
|
||||
record.house_hold = values.get("house_hold", "")
|
||||
values["message"] = "员工信息创建成功"
|
||||
values["message"] = "员工信息更新成功"
|
||||
record.login_state = 'filled'
|
||||
response = request.render('yuthon_hr_employee_approval.website_form_employee', values)
|
||||
response.headers['X-Frame-Options'] = 'SAMEORIGIN'
|
||||
response.headers['Content-Security-Policy'] = "frame-ancestors 'self'"
|
||||
|
||||
@@ -21,7 +21,7 @@ nation_list = [('a', '汉族'), ('b', '壮族'), ('v', '满族'), ('d', '回族'
|
||||
class YuthonMessageLogin(models.Model):
|
||||
_name = 'yuthon.message.login'
|
||||
_description = "个人信息登记表"
|
||||
_rec_name = 'name'
|
||||
_rec_name = 'staff_name'
|
||||
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
|
||||
|
||||
# 基本信息
|
||||
@@ -95,6 +95,7 @@ class YuthonMessageLogin(models.Model):
|
||||
default='normal')
|
||||
active = fields.Boolean('Active', default=True, tracking=True)
|
||||
self_users_ids = fields.Many2many('res.users', string="当前经办人", default=lambda self: [(6, 0, [self.env.user.id])])
|
||||
login_state = fields.Selection([('filled', '已填'), ('to_do', '未填')], string='状态', default='to_do')
|
||||
|
||||
def _get_default_name_title(self):
|
||||
return self._description if self._description else self._name
|
||||
|
||||
@@ -25,7 +25,7 @@ class YuthonOnboardApproval(models.Model):
|
||||
name = fields.Char(string="标题")
|
||||
code = fields.Char(string="编号",
|
||||
default=lambda self: self.env['ir.sequence'].next_by_code('yuthon_onboard_approval_code'))
|
||||
employee_name_id = fields.Many2one('hr.applicant', string='姓名')
|
||||
information_form_id = fields.Many2one('yuthon.message.login', string="姓名")
|
||||
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
|
||||
company_id = fields.Many2one(related='users_id.company_id', string="公司")
|
||||
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
|
||||
@@ -54,7 +54,6 @@ class YuthonOnboardApproval(models.Model):
|
||||
salary = fields.Float(string='基本工资')
|
||||
oter = fields.Text(string='其他约定')
|
||||
documents_ids = fields.Many2many('ir.attachment', string="附件")
|
||||
information_form_id = fields.Many2one('yuthon.message.login', string="个人信息表详情", required=True)
|
||||
needs_form_id = fields.Many2one('yuthon.recruitment.approval', string="招聘需求详情")
|
||||
details_interview_form_id = fields.Many2one('hr.applicant', string="面试详情")
|
||||
is_issues = fields.Boolean(string='是否上会')
|
||||
@@ -77,7 +76,7 @@ class YuthonOnboardApproval(models.Model):
|
||||
salary_group_id = fields.Many2one(
|
||||
"yuthon.salary.group", string="工资单分组", store=True, index=True
|
||||
)
|
||||
|
||||
is_this_company = fields.Boolean(string='本公司', default=True)
|
||||
|
||||
def _get_default_name_title(self):
|
||||
return self._description if self._description else self._name
|
||||
@@ -93,11 +92,11 @@ class YuthonOnboardApproval(models.Model):
|
||||
else:
|
||||
self.duration_employment_end = False
|
||||
|
||||
@api.onchange('employee_name_id', 'job_id', 'department_id1')
|
||||
@api.onchange('information_form_id', 'job_id', 'department_id1')
|
||||
def _onchange_name(self):
|
||||
name_parts = []
|
||||
if self.employee_name_id:
|
||||
name_parts.append(self.employee_name_id.partner_name)
|
||||
if self.information_form_id:
|
||||
name_parts.append(self.information_form_id.staff_name)
|
||||
if self.job_id:
|
||||
name_parts.append(self.job_id.name)
|
||||
if self.department_id1:
|
||||
@@ -136,14 +135,16 @@ class YuthonOnboardApproval(models.Model):
|
||||
}
|
||||
}
|
||||
|
||||
@api.onchange('employee_name_id')
|
||||
def _onchange_employee_name_id(self):
|
||||
if self.employee_name_id:
|
||||
self.job_id = self.employee_name_id.job_id
|
||||
self.department_id1 = self.employee_name_id.department_id
|
||||
else:
|
||||
@api.onchange('information_form_id')
|
||||
def _onchange_information_form_id(self):
|
||||
self.job_id = False
|
||||
self.department_id1 = False
|
||||
if self.information_form_id:
|
||||
applicant_id = self.env['hr.applicant'].search([('partner_name', '=', self.information_form_id.staff_name)])
|
||||
if applicant_id:
|
||||
self.job_id = applicant_id.job_id
|
||||
self.department_id1 = applicant_id.department_id
|
||||
|
||||
|
||||
@api.onchange('is_issues')
|
||||
def _onchange_is_issues(self):
|
||||
@@ -166,7 +167,7 @@ class YuthonOnboardApproval(models.Model):
|
||||
marital = 'single'
|
||||
else:
|
||||
marital = 'married'
|
||||
employee_id = self.env['hr.employee'].create({'name': self.employee_name_id.partner_name,
|
||||
employee_id = self.env['hr.employee'].create({'name': self.information_form_id.staff_name,
|
||||
'birthday': login_id.date_birth,
|
||||
'retire_date': self.duration_employment_end,
|
||||
'political_aspects': login_id.political,
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<field name="name"/>
|
||||
<field name="users_id"/>
|
||||
<field name="create_time"/>
|
||||
<field name="login_state"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -91,6 +92,7 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="login_document_id" widget="preview_many2one"/>
|
||||
<field name="login_state"/>
|
||||
</group>
|
||||
<div class="oe_clear_row" style="margin: 35px 0">
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
invisible="urgency_level != 'urgent'"/>
|
||||
<widget name="web_ribbon" title="特级" bg_color="text-bg-danger"
|
||||
invisible="urgency_level != 'emergency'"/>
|
||||
<group col="4">
|
||||
<group col="5">
|
||||
<group>
|
||||
<field name="code" string="流水号" readonly="1"/>
|
||||
</group>
|
||||
@@ -40,6 +40,9 @@
|
||||
<group>
|
||||
<field name="related_issues_id" invisible="is_issues == False"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="is_this_company"/>
|
||||
</group>
|
||||
</group>
|
||||
<div class="col-12 text-center">
|
||||
<h1>
|
||||
@@ -65,7 +68,7 @@
|
||||
</group>
|
||||
<group col="3" string="乙方信息">
|
||||
<group>
|
||||
<field name="employee_name_id" required="1" domain="[('stage_id.name', '=', '待入职')]"/>
|
||||
<field name="information_form_id" required="1"/>
|
||||
<field name="employment_form"/>
|
||||
<label for="duration_employment"/>
|
||||
<div>
|
||||
@@ -76,7 +79,7 @@
|
||||
<field name="is_office"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="department_id1" readonly="0"/>
|
||||
<field name="department_id1" domain = "[('company_id', '=', company_id)] if is_this_company else []" options="{'no_create': True}"/>
|
||||
<field name="contract_type" invisible="employment_form == 'formal' or not employment_form"/>
|
||||
<field name="contract_type1" invisible="1"/>
|
||||
<field name="salary_group_id"/>
|
||||
@@ -112,15 +115,6 @@
|
||||
<group>
|
||||
<field name="oter"/>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="个人信息详情">
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="information_form_id" required="1"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user