跳至内容
菜单
此问题已终结
2 回复
4507 查看

Hello, 

I'm trying to import product template as purchase manager, but I get this error,

You cannot import images via URL, check with your administrator or support for the reason.

I know that this is related to access rights but which group of users is allowed to import product images with URLs?

Regards

Mahdi

形象
丢弃
最佳答案

In the module addons/base_import/models/base_import.py go to line 783 and 784 (odoo12) it checks if the user can import from url. The check consists checking is user is admin. So I commented these lines:

#    if not self.env.user._can_import_remote_urls():
#     raise AccessError(_("You can not import images via URL, check with your administrator or support for the reason."))

形象
丢弃
最佳答案

Hello,

If you use Odoo 12, please check these 2 methods and hope they would helps.

1: https://www.youtube.com/watch?v=q5wktQXNu7s

2: https://www.youtube.com/watch?v=TJULSRFndeo

Odoo 13: https://www.youtube.com/watch?v=apzDEXpL3Xo

Cheer!

形象
丢弃
编写者

Thank you for your answer, I do import with no problem using admin account, but when i use purchase manager account a i get the error.

A had a problem importing images behind an https server. I went to a non secure http server and had no ptoblem.
The problem using non admin users when importing from Excel file is explained by Megame in this post in Stackoverflow:

https://stackoverflow\.com/questions/58926627/how\-to\-set\-permissions\-for\-internal\-users\-to\-upload\-and\-import\-excel\-files\-into\#answer\-60864506

Or go directly to Github:

https://github.com/odoo-dev/odoo/commit/5a7a362188473de919cd7562996057f73deb5eaf

Actually I have this error when importing as non admin user:

You can not import images via URL, check with your administrator or support for the reason.