commit
c6522e4b64
|
|
@ -42,8 +42,8 @@ class PurchaseRequest(models.Model):
|
|||
raise ValidationError(_("Can't Confirm Request With No Item!"))
|
||||
if not self.department_id:
|
||||
raise ValidationError(_("Please Select department for employee"))
|
||||
direct_manager = self.sudo().employee_id.department_id.manager_id
|
||||
if direct_manager and self.env.user.id != direct_manager.id:
|
||||
direct_manager = self.sudo().department_id.manager_id
|
||||
if direct_manager and direct_manager.user_id and self.env.user.id != direct_manager.user_id.id:
|
||||
raise ValidationError(_("You should be The Direct Manager"))
|
||||
if any(self.line_ids.filtered(lambda line: line.product_id.type == "product")):
|
||||
self.write({'state': 'warehouse'})
|
||||
|
|
|
|||
Loading…
Reference in New Issue