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

Hello !


I'm new with Oddo 10. I'm trying to do some integration with another ERP and I want to send newly created sales orders to a message queue.


I want to do this through a server action with pyhton code but it seems you cannot use "import" in this code to add external libraries.


How would I do that ! Do I have to create a new odoo module ? If so, how do I refer to it from my python code inside the server action ?


Thanks !


Hugues

아바타
취소

Why don't you use an automated scheduler if you'd like to do this every x time? If you wish to do it on save or create you could do it in the create or write function and call your external service there. Any specific requirement that made you choose for a server action to do this?

작성자 베스트 답변

Thanks,


Since we are newbies, we did not have a complete understanding of where custom code sould be.

We ended up creating a new model that inherits the Sales Order class and added a method to send the record to the RabbitMQ queue. This model is used in On Create action. Works great ! 

아바타
취소

on create and write to update other part too