Then in your python code you can print "whatever"Īnd you'll get whatever printed to the terminal.Īs mentioned above, eclipse will work. lets say server path is /usr/bin/openerp-server and config file is: /etc/openerp/nf, then you'll run it as "/usr/bin/openerp-server -config=/etc/openerp/nf" ( here you can use other options as well, including -logfile=/var/log/openerp/openerp-server.log if you like) from terminal. Then start the server from the terminal (you've to figure out what's path to the openep startup script, the odoo.py for v8 or openerp.py/openerp-server.py for v7), using command line options, at least use "-config=/path/to/your/config/file" option for reuse your config file. If you've installed nightly version and/or you're running openerp server in daemon mode, then you've to shutdown your server instance first ( something like: "/etc/init.d/openerp stop" or whatever is correct for your case). ![]() Instead of redirecting logs to logfile (to the /var/log/openerp/openerp-server.log in your case) and then read them from there using "tail -f" you can simply run openerp server from command line and you'll get printed stuff (including simple "print" command in python code) directly in the terminal from where you'll run the server. There is several ways to debug and I see you've got some good tips on the topic, but I'll narrow down your question to get worked print statement in python code as it's what you've tried, maybe it's your preferred way. ![]() Self.pt_cli = CommandLineInterface(self._pt_app, eventloop=self.shell._eventloop)ĪttributeError: 'TerminalInteractiveShell' object has no attribute '_eventloop' UpdateResponse = baseClass().updateInventoryForProvuPhoneOrder(product_itemlist, item_mac)įile "/var/lib/odoo/addons/10.0/allip_provu_phone/base/base_class.py", line 180, in updateInventoryForProvuPhoneOrderįile "/usr/lib/python2.7/site-packages/ipdb/_main_.py", line 93, in set_traceįile "/usr/lib/python2.7/site-packages/ipdb/_main_.py", line 76, in _init_pdbįile "/usr/lib/python2.7/site-packages/IPython/terminal/debugger.py", line 15, in _init_įile "/usr/lib/python2.7/site-packages/IPython/terminal/debugger.py", line 38, in pt_init I got this error when i added in called function in odooįile "/var/lib/odoo10/odoo/addons/base/ir/ir_cron.py", line 119, in _callbackįile "/var/lib/odoo/addons/10.0/allip_provu_phone/models/mac_address.py", line 116, in syncMacAddressProvuOrder add breakpoint (on line () for example) and click debug, test breakpoints, inspect vars, test UI from browser.Right click openerp7debug->new->python file->openerp-server.py->add contentĮdit configuration.-> + -> Python->Name: Debug openerp7->Script: F:\Users\orlov\YandexDisk\Work\openerp7debug\openerp-server.py-> create new python project (openerp7debug) and configure python sdkįile->new project->python module->openerp7debug->next->Python Interpreter->Configure-> +.copy listed files from portable python (F:\PortableApps\PortablePython_1.1_py2.6.1\App).download and install python 2.6 (i prefere portable version). ![]() installed Openerp7 įile->settings->plugins->install jetbrains plugins->python->install.Simple howto debugging openerp7 with intellij idea on windows. py file which you want to debug and set a breakpoint.Ħ) Now start your module's form from 'gtk' or 'web-client' and execution will stop when execution will reach to breakpoint.ħ) Now debug your code by pressing " F5, F6, F7" and you can see value of your variables. addons./your_module_pathĢ.4: Press Ok in all the opened windows and then "Apply".ģ) Now into "PyDev Package Explorer" view go to 6.1/server and right click on "openerp-server" file, Select 'Debug As -> Python Run'.Ĥ) Now in "Console" you can see your server has been started.ĥ) Now open your. Follow the given steps to debug your python code in eclipse:ġ) Go to '/openerp/server/openerp-server' and select openerp-server file, then right click on that file and select Debug As -> Python Run which will start the server.Ģ) After creating new debug configuration Go to 'Run -> Debug Configuration' and follow the given steps:Ģ.1: In "Arguments" tab under "Program Arguments", click on button "Variables" and new window will appear.Ģ.2: Then create new "Variable" by clicking on "Edit Variables" button and new window will appear.Ģ.3: Press on "New" button and give your addons path as value.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |