Skip to content

Commit

Permalink
[MOD] add user details in activity done or eco validation message
Browse files Browse the repository at this point in the history
  • Loading branch information
jayraj-omnia committed Jan 9, 2025
1 parent 347c05d commit 7ac6bd8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions activity_validation/models/mail_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,13 @@ def checkChildrenECODone(self, activity_id):
raise UserError(_('You cannot move to Done because there are pending ECO activities.'))

def checkChildrenECRDone(self, activity_id):
do_ecr = True
do_ecr = f"You cannot move to ECO or to Done because there are pending ECR activities for User:\n"
for child in activity_id.children_ids:
if child.plm_state not in ['done', 'cancel']:
do_ecr = False
if not do_ecr:
raise UserError(_('You cannot move to ECO or to Done because there are pending ECR activities.'))
do_ecr += f"\t-->\t{child.user_id.name}\n"

if do_ecr:
raise UserError(_(do_ecr))

def action_to_eco(self):
for activity_id in self:
Expand Down

0 comments on commit 7ac6bd8

Please sign in to comment.