How to do debug in OpenERP v7?
In previous versions of OpenERP, it was easy to debug. But in the latest version it's tough to debug.
To debug your OpenERP+python code in eclipse, start eclipse (helios/indigo only) in debug perspective and follow the given steps:
1: Stop your openERP running server by pressing "ctr+c".
2: In eclipse go to Menu "Run/Debug Configurations". In configuration window under "Python Run", create new debug configuration(Double click on 'Python Run').
3: After creating new debug configuration follow the given steps:
3.1: In "Main" tab under "Project", select the "server" project or folder (in which Openerp Server resides) from your workspace.
3.2: Write location of 'openerp-server' under "Main Module".
Ex: ${workspace_loc:server/openerp-server}.
3.3: In "Arguments" tab under "Program Arguments", click on button "Variables" and new window will appear.
3.4: Then create new "Variable" by clicking on "Edit Variables" button and new window will appear.
3.5: Press on "New" button and give your addons path as value.
Ex: --addons ../addons,../your_module_path
3.6: Press Ok in all the opened windows and then "Apply".
4: Now into "PyDev Package Explorer" view go to 6.1/server and right click on "openerp-server" file, Select 'Debug As --> Python Run'.
5: Now in "Console" you can see your server has been started.
6: Now open your .py file which you want to debug and set a break-point.
7: Now start your module's form from 'gtk' or 'web-client' and execution will stop when execution will reach to break-point.
8: Now enjoy by debugging your code by pressing "F5, F6, F7" and you can see value of your variables.
You can refer following link: Debug OpenERP Code from Eclipse
Go to Administrator(in right top corner) in that click on About OpenERP in that you will find a link Activate the Developer Mode.
or
you can add a parameterdebug in of URL like
http://localhost:8069/?debug
both the way will let you open the developer mode.
You can also use the Odoo Debug pro chrome extension to toggle the developer mode using the keyboard shortcuts.
To debug openERP 7 from eclipse just Stop openERP server and rename the main file named openerp-server.py.From "Run/Debug Configurations" make a new configuration selecting Project and main module such as ${workspace_loc:openerp7/src/openerp-server.py} then press Apply.After that /openerp7/src/openerp-server.py 'Debug As --> Python Run' using new configuration.Server is running where pydev debugger is also started.Now run 'gtk' or 'web-client'.Then select the python file of that module where want to debug and give breakpoints.That's all.
Debugging is quite simple in interface.
For Programmers
By Default when you login to openerp, your url will look something like this
http://localhost:7373/?db=Test_July_25#menu_id=107&action=97
Edit the url and add debug=&
localhost:7373/?debug=&db=Test_July_25#menu_id=107&action=97
For Functional Users
Navigate mouse to top right corner and select About OpenERP
Now Activate Debug Mode
You Should be done now with interface debugging.
For Code Debugging (along with arya's method these images may help you)
You can use browse button to select the project and the openerp server file
Finally place breakpoints in your code where ever necessary
Navigate through
administrator(top Right)>>about OpenERP
Dialog Open Click on Activate Developer mode
Their is more complexity and less control by adding more fancy tools try and go low level and use python pdb and if you are debug geek then use winpdb with pdb which gives extreme contorl over your code navigation.
And for simple value abd flow use print or pprint module from python.
Bests.
Start debug mode on browser ??
In URL you can type ?debug after web
OR
go to About OpenERP select Activate Developer Mode
If You want to debug from eclipse then
go to PyDev Package Explorer --> openerp(odoo) --> Right click on openerp-server file
Select Debug as --> Python Run
It will ask for change current perspective from PyDev to Debug click "Yes" and its Done
Activate the Debug mode and use some print statements to debug the variable values
Related
I am currently working on a project using the Test Explorer in Visual Studio Code and I am having trouble with the context menu.
By default, the context menu displays
If I create a Run profile:
this._runProfile = this._testController.createRunProfile('Run', vscode.TestRunProfileKind.Run, this.runHandler, true);
and click on the command Run Test, then this.runHandler is executed.
However, when I create a Debug profile:
this._debugProfile = this._testController.createRunProfile('Debug', vscode.TestRunProfileKind.Debug, this.debugHandler, true);
the command Debug Test is not showing up in the context menu.
I was expecting to see Debug Test in the context menu and have it execute this.debugHandler every time it is clicked.
Any help would be greatly appreciated. Thank you.
I tried to manually add a command to the package.json and register it with a different handler, but I am unsure if this is the right approach.
I found that it was an issue was in my development environment.
Everything was building, linking, but it only worked once and after that the command Debug Test didn't show up again. I thought it was a bug in the api, but it is not.
After doing everything again, it worked well.
I need a programmatically start Visual Studio (devenv.exe) and open solution. I use EnvDte.
The problem is that EnvDTE.DTE.Solution.Open works, but StartWindow don't hide. If I click "Continue without code", I'll see the opened solution.
How can I programmatically close StartWindow?
You can customize it by setting the Startup option:
Click Tools -> Options -> Environment -> Startup
For On startup, open option select "Empty environment".
I don't find the way to close StartWindow programmatically.
The best one is to launch devenv.exe with /command argument:
devenv.exe /command "File.OpenProject {pathToSolution}"
https://learn.microsoft.com/en-us/visualstudio/ide/reference/command-devenv-exe?view=vs-2019
https://learn.microsoft.com/en-us/visualstudio/ide/reference/visual-studio-commands?view=vs-2019
After updating my Ubuntu to 20.04 this night, I noticed that my IntelliJ Main menu is missing.
The Problem is exactly the same as described here:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000667510-Main-Menu-not-showing
However:
the SHOW_MAIN_MENU option shows no effect
the shortcut workaround is not working
the View | Appearance: Main Menu action is disabled:
I have tried multiple reinstalls both via snap & zipped standalone. Including purges of ~/.config/JetBrains and ~/.local/share/JetBrains without success.
Invoke Help | Find in action.
Type Experimental features.
Uncheck linux.native.menu.
Make Main Menu reappear IntelliJ IDEA in Ubuntu
System Details:
Ubuntu 20.04.1 LTS
IntellJ IDEA Community 2020.2.3
How the issue was created: I wanted to hide the menu
Steps:
Click View > Appearance
Uncheck Main Menu
Solution to make the menu reappear
Steps:
Open folder: ~/.config/JetBrains
There could be more than one folder. I had two: IdeaIC2020.1, IdeaIC2020.2
Both has configuration xml files for the IntelliJ.
IdeaIC2020.2 seems to be the one with the configuration for IntelliJ.
IdeaIC2020.1 must have been for previous version or previous installation. Even if this is removed, IntelliJ worked.
Open IdeaIC2020.2 > options > ui.lnf.xml
Set value to true : option name="SHOW_MAIN_MENU" value="true"
I hope this helps.
Cheers,
I want to run Play Framework 2.x in debug mode in IntelliJ IDEA. I searched in the Internet and all results say that you have to use play console.
Is it possible to run in debug mode in IntelliJ IDEA without using play console?
Using activator :
From Terminal (Not intellij terminal), enter command : activator ui
Open your existing app
Choose "Code view & Open in IDE
In Browse Code, click setting icon
Choose Open Project in Intellij IDEA
Generate
Open Intellij IDEA
Open project - browse your app directory
Run - Edit Configuration
Add new configuration - Remote
Add name
Setting
transport : socket, debugger mode : attach, Host : localhost, port : 9999
module clashpath : your app
Tools - Open Terminal
activator -jvm-debug 9999 run
Run debug
Open browser localhost:9000
You need to use Idea 12+ Ultimate Edition
Install Play 2.0 Support, Scala and other required plugins in Idea
In command line perform play idea to generate project
Open created project in Idea (open, don't import)
Go to: Menu > Run > Edit Configurations... > Add New Configuration... > choose Play 2 App
In Menu > Run new buttons will appear Debug and Run, first will run app with enabled debbuger.
Preparation: Do not use the project creation by activator ui or similar. Just
open the project in IntelliJ.
activator -jvm-debug 9999 ~run. The ~ before run enables automatic reloading of generated HTML pages
In IntelliJ:
Run > Edit Configurations...
Select Defaults/Remote
Click on the green + at the upper left corner
Give the name "Play 2"
Ensure that Transport:Socket and Debugger mode:Attach are selected
Type in 9999 as port
Press "OK"
Run > Debug Play 2 (second entry in the list)
Pro hint: Check out the play-auto-refresh plugin to have Chrome automatically reloading on a change.
(based on #ARM's answer)
Open Intellij IDEA
Open project - browse your app directory Run - Edit Configuration
Add new configuration - Play2
Add http://localhost:9000 to url to open option
Add -Xms512M -Xmx1024M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M to JVM option
Set Debug port to 9999
Set your debug point and debug your application. Cheers :)
FYI : All of the above fields might filled up already
this works for me and maybe easier
file menue => settings => Build, Execution, Deployment => sbt => check "Enable debugging for sbt shell"
idea sbt shell now will start with debug enable, log out the port as "Listening for transport dt_socket at address: 52701"
Run/Debug Configurations => Add(the pluss(+) sign) => Remote => Set "Port" And "Use module classpath"
just type run in sbt shell, then click debug button
screent shot
enable idea emaded sbt debug
sbt shell start log
add remote in "Run/Debug"
type run here
I am facing a problem in J Profiler when I click on view source I get some error saying The IDE could not locate the selected class and unable to view source.
Edit the session settings, select the "Application Settings" tab, select the "Source path" radio button in the "Java File Path" section, and add your source file roots there.
An alternative is to start the profiling session from your IDE (with the appropriate JProfiler plugin), then the source code navigation will be in the IDE and you don't have to configure anything.