Hello everyone,
We are a non-profit running ERPNext v16 as a single legal entity, so one Company with centralized accounting.
We report per department through an Accounting Dimension.
We are building our own apps on top of ERPNext, and we want to follow the approach Frappe recommends from the
start: native mechanisms first, customization only where the framework expects it. That way we build on solid
foundations and keep future upgrades (v17 and beyond) smooth. So we are looking for the recommended way, not
just a way that works.
This is close to the Multi-branch Companies ( Multi-branch Companies ) thread,
which ended without a solution. Multi-Company is not an option for us: we are one entity, and each department
is an operational unit, not a subsidiary.
Setup
- Each department has its own warehouses and its own item groups. One sub-department manages batch items with
expiry dates. - Stock documents are receipts, issues and reconciliations. There are no transfers between departments.
- Some users work for several departments.
What we need
- Users can only move stock in their own department’s warehouses.
- Users only see their own department’s stock documents, lists and reports. Hiding other departments’ items
would be nice to have. - Access to a parent department covers its sub-departments.
User Permissions on Warehouse are our starting point. As far as we can tell, though, they only filter the
parent document: child-table rows (s_warehouse / t_warehouse) and SQL-based stock reports are not restricted.
That gap is what we are asking about.
Questions
- What is the recommended way to close that gap: configuration alone, or custom permission_query_conditions /
has_permission hooks on Warehouse? - How do you handle users in several departments?
- Do you know of any open-source app or public example of this pattern?
Thanks for any pointers!