Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Automated action to assign different person on lead/opportunity depending sales team defined stage

Tomas Parnarauskas
on 6/10/13, 5:03 AM 1,959 views

I want to make automated action that would assign person on lead/opportunity every time stages is changed depending on what person (user) is chosen for given stage. I know firstly I would need to expand crm.case.stage module, so there you could add users that belong to particular stage. So with that information, automated action would check what user must be assigned if stage changes. Fro example let say there are three stages - first, second and third. So user1 belongs to first stage, user2, belongs to stage2 and three. When stage changes to second, it assigns that lead/opportunity to user2.

I think it should looks something like this example (assigns sales team to sales deparament on lead/opportunity):

sales_team = self.pool.get('ir.model.data').get_object(cr, uid, 'crm', 'section_sales_department')
object.write({'section_id': sales_team.id})

But this action only assigns specific sales team. It would be best to have an approach that universally selects which user needs to be assigned depending on a stage and user added to that stage.

Any suggestions?

Have you found any solution ?

on 12/6/13, 3:37 AM
John Baldwin
On 9/9/14, 4:07 AM

You could just assign sales teams making user1 a child team of user two and only able to use or see there stage. Then when it's time for the next stage you escalate the lead to the next team and define an auto saleman assignment for each team.

On 5/29/15, 2:46 AM

Hi John, 

Do you have the code for an auto escalate?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


Asked: 6/10/13, 5:03 AM
Seen: 1959 times
Last updated: 5/29/15, 2:46 AM