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

I want to be able to execute a data export from within a common method (Odoo v8)

All is done up to the point in which I have to call the "[URL]/web/export/csv" router.

Apparently, despite this being executed by ir.cron, the user session is not recognized and the controller returns a result just as if it had been called by an "outsider".


Has anyone done this? I'm sure this has to do with the way the http request is being done.

requests.post("http://www.whatever.xpto/web/export/csv",data=data)


By the way, if I pick the URL (along with the JSON) and just put it in the browser's address (logged in), I get the csv file.

아바타
취소

request.redirect ?

Hi Rui! Any luck with this?

작성자

No. I had to find another way of doing the job.

Mind to share your way? I'm trying to do the exact same thing as yours, and have been following Temur's answer on https://www.odoo.com/forum/help-1/question/how-to-invoke-a-controller-function-from-inside-a-model-function-87620. I have successfully called the base method using his suggestion but the request object inside it is somehow a JsonRequest not an HttpRequest which causes an error.

관련 게시물 답글 화면 활동
2
8월 25
2435
1
7월 25
1745
2
6월 25
789
3
2월 25
14939
1
4월 25
2078