Restrict Workflow/Notifications by Company in Multi-Company Setup

Hi everyone,

In a multi-company ERPNext setup, I want to restrict Workflows and Notifications so that only users belonging to the same company as the document receive them.

Right now, if I use a common role like “Sales User”, all users with that role across all companies receive the notification even if they don’t have access to the document’s company.

I’ve tried:

User Permissions (each user is limited to one company)

Conditions like doc.company == “Company 1”

But ERPNext still sends notifications to all users with the role.

Question:
Is there a clean way to apply role-based notifications or workflow transitions per company, without duplicating roles (e.g. “Sales User – 1”)?

Any ideas or best practices?

Thanks!

Hi,

With my experience, I always create empty roles for each user. I use these roles for workflow assignment and add that role to the concerned user account.

In this way, only concerned users will receive the notification.

Alternate option is to install this app: kittiu/thai_workflow: Workflow enhancements

Thanks,

Divyesh Mangroliya

3 Likes

Thank you for sharing this information bro. It would have been even better if these notifications or workflows were linked to user permissions also.