I am trying to set up a department condition to only trigger a workflow transition rule in Purchase Order.
I added a custom field to Purchase Order for Deparment and setup a custom script to filter department based on permissions:
frappe.ui.form.on('Purchase Order', {
onload(frm) {
// your code here
frm.set_query('department', () => {
return {
filters: {
company: frm.doc.company
}
}
});
}
})
The filter works as intended but my condition seems to be failing. The condition set in the Workflow Transition is self.department_name == Shared Services
to trigger workflow transition rule if this condition is met (That is, permission is set for Shared Services for users on that Role) when at that workflow state. any idea if i got something wrong?