How debug code with breakpoint in Tryton?

Hi ,
I’m newbie with Tryton , I need some help to setting up my environment in Pycharm IDE to debug my code with breakpoint method. I can’t find the entry file or main method in the Trytond Module. If there is another method to debug my code please let me know .
My local environment:



I do not use such tools for development. Usually I’m fine with logging and some print statement.
The main difficulty is that trytond is a multi-threaded server.

Modules do not have main entry. They are loaded by the trytond server, registered in the Pool and their RPC API is exposed. So the main entry for trytond is the bin/trytond if you are using the default werkzeug server otherwise it should be

You should start development with more recent version. If you want LTS it should be 6.0 otherwise 6.2.
The 5.0 is the older LTS (still maintained but missing a lot of new features and improvements).

1 Like

@ced That seems clear to me, thanks for the help.

I usually use pdb / pudb librarys to debug through the terminal.

1 Like

I use Pycharm with Tryton and u can debug with Run/Configuration profile like this

I hope it helps you

Hello @JonatanGk Thanks for the answer . Now the server run in the debug mode but when i try to connect in the terminal with client side I get this error :

raise IOError(‘Database “%s” doesn\‘t exist!’ % db_filename)\nOSError: Database “training.sqlite” doesn’t exist!\n’>

The problem is that I use Postgres database but it’s readed as Sqlite .
In the paramaters field i set :

-c trytond.conf -d training -v

How can i change the configuration to identify my table ?

Hello @oscarQ Thanks for the answer. Yes I use those librarys but also i want to find a way to stop runnig code and check values before proceeding further.

The --config option must point to the existing configuration file.
I guess in this case it can be relative to the working directory (but in case of doubt you could use absolute path).

1 Like

Yes, it’s works with the absolute path . Thank you !

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.