콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
7262 화면

Hi , I'm trying to send a request to the server via an automated action in Odoo. i.e , lets suppose a Sales Order is created. I want to send some of its data to the server and process it elsewhere as well.


I created an automated action with the "Execute Python Code" option. When i try importing the requests library i get the error:

"forbidden opcode(s) in 'import requests\n\nprint("test")': IMPORT_NAME"

Is it possible to import libraries via Odoo automated actions ? If not what are alternatives or workarounds that can be made ?

Thanks in advance

아바타
취소
베스트 답변

You cannot directly import in an automated action. You will need to customize the python code of the model on which the automated action is based, add a function to it and call the function from the automated action.

아바타
취소
베스트 답변

Hello Ahamd
You can refer following question which will help you to solve your problem.
https://www.odoo.com/forum/help-1/how-to-use-import-module-in-automated-action-in-odoo-sh-11-0-136386

Thanks.

아바타
취소
관련 게시물 답글 화면 활동
3
12월 19
6339
2
7월 23
2176
1
8월 25
511
1
8월 25
708
2
7월 25
3250