employee_id = self.env['hr.employee.ref'].sudo().search([('employees_id.id', '=', self.employees_id.id)])
if employee_id:
for emp in employee_id:
if not emp.end_date:
action = self.env.ref('project.open_view_project_all').read()[0]
action['domain'] = [('id', '=', emp.project_id.id)]
# print(action['domain'])
msg = (_('You cant add %s in this Project ,He/She is already busy with Project : %s,Please go back to the Project %s and add the End date ') % (
self.employees_id.name, emp.project_id.name, emp.project_id.name))
raise RedirectWarning(msg, action['id'], _('VIEW PROJECT'), )
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1756
Views
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
6
Aug 20
|
6101 | ||
|
0
Sep 24
|
285 | ||
|
4
May 24
|
10073 | ||
|
1
May 24
|
1310 | ||
|
1
Apr 24
|
502 |
Were you able to resolve it ? facing same issue.