Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
757 Vistas

Hi,


I need to add into a custom module some .py files to use them in my module, but when I add them, I have an error (500 Internal Error)

The files I want to add are in a folder in my models folder and I import this folder in my __init__.py


So I was wondering if I can add any .py files or if it has to respect a certain structure


For more infos, the files I'm talking about are the files of an API used to get fields to put in an invoice to respect a law in the country I am


Thanks for your help

Avatar
Descartar
Autor Mejor respuesta

Hi,


Thank you for your answer. I would like to know where the third-party Python files should be stored. I'm using Odoo On-premise and I don't know if it has to be in my custome module or in any other folder

Avatar
Descartar
Mejor respuesta

Hi,

When adding custom Python files to an Odoo module, it is important to follow the proper file structure and naming conventions. 

You can refer the below link

https://www.odoo.com/documentation/16.0/contributing/development/coding_guidelines.html#file-naming

When adding third-party Python files to your module, it is also important to make sure that any dependencies are installed and that the file paths are correct. Make sure the necessary packages are installed and that the file paths are correct in any import statements.

If you are still experiencing issues after following these guidelines, try checking the server logs for more information on the error. The server logs can often provide helpful clues as to what might be causing the problem.

Regards.

Avatar
Descartar