sf-创建员工时提示员工已存在
This commit is contained in:
@@ -23,6 +23,16 @@ class JkmPracticeEmployee(models.Model):
|
|||||||
vals["we_id"] = self._get_we_id(vals.get('work_email'))
|
vals["we_id"] = self._get_we_id(vals.get('work_email'))
|
||||||
return super(JkmPracticeEmployee, self).write(vals)
|
return super(JkmPracticeEmployee, self).write(vals)
|
||||||
|
|
||||||
|
def unlink(self):
|
||||||
|
for record in self:
|
||||||
|
res_partner_obj = record.env['res.partner'].sudo().search([('email', '=', record.work_email)])
|
||||||
|
if res_partner_obj:
|
||||||
|
res_partner_obj.unlink()
|
||||||
|
res = super(JkmPracticeEmployee, self).unlink()
|
||||||
|
|
||||||
|
return res
|
||||||
|
|
||||||
|
|
||||||
@api.depends('work_contact_id', 'work_contact_id.mobile', 'work_contact_id.email')
|
@api.depends('work_contact_id', 'work_contact_id.mobile', 'work_contact_id.email')
|
||||||
def _compute_work_contact_details(self):
|
def _compute_work_contact_details(self):
|
||||||
for employee in self:
|
for employee in self:
|
||||||
|
|||||||
Reference in New Issue
Block a user