Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
3864 Widoki

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!

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
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!

Powiązane posty Odpowiedzi Widoki Czynność
1
lut 24
2282
1
kwi 17
6900
2
paź 15
4919
1
paź 22
3373
2
lut 21
6824