I would like to use ORM methods like browseor searchin the python console.
browse
search
$pwd /opt/odoo/ $python >>> import openerp >>> product_obj = pool.get('product.product) Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'pool' is not defined
How could I achieve this?
In version 9, you can run the odoo shell with odoo.py shell -d <database>, thanks to this commit
odoo.py shell -d <database>
In version 8, functionality is not built-in, but you can use this script , this module, or OERPLib
The pool must be connected to the database, so you need to create the pool first, for example:
pool = openerp.modules.registry.RegistryManager.get("test")
This should return the pool connected to the 'test' database
Source: https://habr.com/ru/post/1620144/More articles:Choosing odd or even elements from an array - arraysgradle Experimental include file directories through the srcDir srcFile directive - c ++Android snaps without the first character - androidTry-catch creates an endless loop - javaHow to determine the indices of the NA series in the vector - rGetting XML encoding from an XML declaration fragment: XmlDeclaration is not supported for partial content parsing - c #Read a "fake" XML document (xml fragment) in an XmlTextReader object - c #[python] [scapy] Raw download found, how to access? - pythonWordpress get_option in an external PHP file - phpHow to open an application between UITests in Xcode - xcode-ui-testingAll Articles