Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
3534 Visualizzazioni

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

Avatar
Abbandona

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?

Autore Risposta migliore

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 ! 

Avatar
Abbandona

on create and write to update other part too