跳至内容
菜单
此问题已终结

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!

形象
丢弃
最佳答案

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

形象
丢弃
编写者

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/

编写者

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

相关帖文 回复 查看 活动
1
2月 24
2348
1
4月 17
6994
2
10月 15
4980
1
10月 22
3451
2
2月 21
6911