Workflow condition, loop through child table

For a custom workflow I would like to use the new conditions field (introduced in v11). We would like to allow a specific transition when all Items in a child table have a certain field set.

Some background:
DocType: RMA
RMA contains multiple Items (child table)
One workflow transition is only allowed when the field ‘Warranty’ is set to ‘Yes’ on all Items inside the child table. So the condition would be something like this:

for row in doc.items
item[row.idx].warranty = ‘Yes’
end for

This means the transition is not allowed when only a few Items are under warranty.

Is it possible to check multiple rows in a child table for a Workflow condition? If so, what would be the syntax?


1 Like

Hey can you find the solution for this?

did you find any solution ??

[row for row in doc.items if row.warranty]


it is throwing this error???

No, unfortunately I didn’t find any solution…

This is working for me.

This is my condition for checking if the session user is in the child table(doc.manager_list) in the form. If yes then the session user is allowed to approve the document:

[row for row in doc.manager_list if (row.user_id == frappe.session.user)]

1 Like

its said frappe not defiend