How can I make the leads be assigned to a user who has less leads?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
You can create a server action that assigns the lead to the user that has less leads, you can make it with a python script.
Try this bro, it worked to me.
bro i want that script :)
# Get all active, internal users
users = env['res.users'].search([('share', '=', False), ('active', '=', True)])
# Find the user with the fewest leads
min_lead_user = None
min_lead_count = float('inf')
for user in users:
lead_count = env['crm.lead'].search_count([('user_id', '=', user.id)])
if lead_count < min_lead_count:
min_lead_count = lead_count
min_lead_user = user
# Assign the lead to the user with the fewest leads
if min_lead_user:
record.user_id = min_lead_user.id
thanks bro,its worked
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
2
wrz 18
|
3397 | ||
|
1
lip 15
|
4140 | ||
|
1
mar 15
|
4763 | ||
|
0
mar 15
|
3567 | ||
|
0
mar 15
|
3214 |
Good question! Even activating "Rule-Based Assignment" doesn't seem to be easy to create a rule in sales teams like the one for helpdesk teams to "Automatic assign an equal number of tickets to each user".