Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
3862 Vistas

When I import many sale orders from an Excel or CSV file, the related sale person (field called 'user_id') is always the user who imported the orders. Normally it should be the user who is related to the concrete customer in partners module. I do not want to import another column with the salespersons because that would be too much work. So is there an action I can schedule or call after import that sets the correct salesperson for each order?

Thanks in advance!

Avatar
Descartar
Mejor respuesta

It's simple to setup an Automated Action to automatically assign the salesperson from the customer record.  

Enable Developer Mode and navigate to Settings / Technical / (Automation) / Automated Actions and add the following


Python code is:

record['user_id'] = record.partner_id.user_id
Note: if you can't find Automated Actions in Developer Mode you may need to install the base_automation module as explained here

Avatar
Descartar
Autor

Thanks for your answer. Unfortunately, I cannot set automated actions because I am not using Odoo Studio. Do you know if there is any possibility to perform this within a scheduled action?

You don't need Odoo Studio to create Automated Actions. They are available in all versions of Odoo, but sometimes you need to install the base_automation module as explained here: https://odootricks.tips/automated-actions/

Autor

Very nice to know. Now it works. Thank you!

Publicaciones relacionadas Respuestas Vistas Actividad
1
feb 24
2282
1
abr 17
6896
2
oct 15
4918
1
oct 22
3372
2
feb 21
6822