Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
3 Odpovědi
3865 Zobrazení

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
Zrušit
Nejlepší odpověď

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
Zrušit
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!

Related Posts Odpovědi Zobrazení Aktivita
1
úno 24
2285
1
dub 17
6902
2
říj 15
4919
1
říj 22
3373
2
úno 21
6824