Customer Ownership & Assignment
Understanding how customers are owned, assigned, and transferred in Dernetz ERP
Last Updated: November 5, 2025 | Version: 1.0
Quick Summary
When you create a customer, you automatically become its owner.
- ✅ You always see your own customers
- ✅ Owners and Managers can see (and reassign) your customers
- ❌ Other team members cannot see your customers
How It Works
Creating
When you create a new customer:
- System sets
created_byfield to your user ID - You are now the "owner"
- Customer appears in your list
Automatic! No manual steps needed
Viewing
Who can see this customer:
- You: ✅ Always visible
- Owners: ✅ Can see it
- Managers: ✅ Can see it
- Other Consultants: ❌ Cannot see it
Based on your role in RBAC
Reassigning
Managers/Owners can transfer:
- Open customer detail
- Click "Reassign" button
- Select new owner
- Confirm transfer
Only Managers/Owners
Ownership Scenarios
Example: Sarah (Energy Consultant) creates "ABC Manufacturing Ltd"
| User | Role | Can See ABC Ltd? |
|---|---|---|
| Sarah | Energy Consultant | ✅ YES (she created it) |
| Dionis | Owner | ✅ YES (sees everything) |
| Mike | Manager | ✅ YES (manages team) |
| John | Energy Consultant | ❌ NO (not his customer) |
Example: Mike (Manager) reassigns "ABC Manufacturing Ltd" from Sarah to John
Before Reassignment:
- Sarah can see ABC Ltd ✅
- John cannot see ABC Ltd ❌
After Reassignment:
- Sarah cannot see ABC Ltd ❌ (unless she's a Manager/Owner)
- John can now see ABC Ltd ✅
- ABC Ltd's
created_byfield now = John's ID
Example: Sarah leaves the company
Problem:
Sarah has 47 customers. If we deactivate her account, those customers are orphaned!
Solution:
- First: Reassign all 47 customers to other team members
- Then: Deactivate Sarah's account
- Result: No customers lost, seamless transition
How to Reassign Customers
Prerequisites
- ✅ You must be an Owner or Manager
- ✅ You must have access to see the customer
- ✅ The new owner must be a valid active user
Step-by-Step Instructions
Method 1: From Customer Detail Page
- Open the customer you want to reassign
- Look for the button
- Click it
- Select the new owner from dropdown
- Click "Reassign Customer"
Method 2: Bulk Reassignment (Coming Soon)
- Go to customer list
- Select multiple customers (checkboxes)
- Click "Bulk Actions" → "Reassign"
- Choose new owner
- Confirm
Bulk reassignment feature coming in future update
Best Practices
Do's
- ✅ Reassign customers before deactivating users
- ✅ Balance customer load across team
- ✅ Assign based on expertise/region
- ✅ Document reassignment reasons
- ✅ Notify customer of account manager changes
- ✅ Keep ownership records up to date
Don'ts
- ❌ Don't delete users without reassigning customers first
- ❌ Don't reassign without team member's knowledge
- ❌ Don't leave customers unassigned
- ❌ Don't overload one person with all customers
- ❌ Don't reassign mid-contract without reason
Customer Visibility Matrix
| Scenario | Owner | Manager | Consultant (Creator) | Consultant (Other) |
|---|---|---|---|---|
| Customer created by Consultant | ✓ Can See | ✓ Can See | ✓ Can See | ✗ Cannot See |
| Customer created by Manager | ✓ Can See | ✓ Can See (if not owner-owned) | ✗ Cannot See | ✗ Cannot See |
| Customer created by Owner | ✓ Can See | ✗ Cannot See | ✗ Cannot See | ✗ Cannot See |
| After reassignment to you | ✓ Can See | ✓ Can See | ✓ Can See | ✗ Cannot See (unless reassigned to them) |
Technical Details
For Developers
Database Field: customer.created_by
- Type: String (Foreign Key to
user.id) - Nullable: Yes (for backwards compatibility)
- Index: Yes (for performance)
RBAC Filter Logic:
# Owner
if user.role == "owner":
return True # No filter
# Manager/Sales Director
if user.role in ["manager", "sales_director"]:
owner_ids = [list of owner user IDs]
return customer.created_by NOT IN owner_ids
# Everyone else
return customer.created_by == user.id
Frequently Asked Questions
A Manager or Owner must reassign your customers to another team member before you're deactivated.
This ensures continuity for the customer.
Yes! Managers and Owners can see customer counts per user in the Users list (Settings → Users tab).
Yes! You can reassign customers one at a time using the Reassign button on the customer detail page.
Unassigned customers (
created_by = null) are visible to Managers and Owners.
They should be assigned to an appropriate team member.
Related Documentation:
- RBAC & Access Control - Full permissions guide
- User Management - Creating and managing users