Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
487 Widoki

Hello,

i need some help.

I want to write my own python class to communicate with a WebDAV Interface.


What is the best place for the own .py File? Also in the Model-Directory from my Module?


Thanks for your help.

André

Awatar
Odrzuć
Najlepsza odpowiedź

There is no fixed rule, where to place this python file as long as you can import somewhere inside your module. If the sole purpose of a file is to act as a driver/handler to something outside the Odoo, I usually place files like these in a handler folder inside my module (see e.g., the hw_drivers module from Odoo). If your file needs to save some variables within the Odoo scope, I usually save it as a model and place the class functionality there (see e.g., the payment modules from Odoo). But it really depends on your specific use case. I hope this helps!

Awatar
Odrzuć
Autor Najlepsza odpowiedź

Hello Jort,

thanks for your answer. 

The hw_drivers module is a good orientation.

I think i will find a way where to place my own Class.

Best regards

André

Awatar
Odrzuć