Plugins
Package¶
This package contains plugins provided out-of-the-box
module_utils
Plugin¶
-
class
openerp_proxy.plugins.module_utils.
ModuleObject
(service, object_name)[source]¶ Bases:
openerp_proxy.orm.object.Object
Add shortcut methods to ‘ir.module.module’ object / model to install or upgrade modules
Also this methods will be available for Record instances too
-
class
openerp_proxy.plugins.module_utils.
ModuleUtils
(*args, **kwargs)[source]¶ Bases:
openerp_proxy.plugin.Plugin
,openerp_proxy.utils.DirMixIn
Utility plugin to simplify module management
Allows to access Odoo module objects as attributes of this plugin:
# this method supports IPython autocomplete db.plugins.module_utils.m_stock
or dictionary style access to modules:
db.plugins.moduld_utils['stock']
which is equivalent to
db.get_obj('ir.module.module').search_records( [('name','=','stock')])[0]
Also autocomplete in IPython supported for this syntax
-
ModuleUtils.
installed_modules
¶ RecordList with list of modules installed in currenct database
Return type: RecordList
-
ModuleUtils.
modules
¶ Returns dictionary of modules registered in system.
Result dict is like:
{'module_name': module_inst}
where module_inst is Record instance for this module
-
external_ids
Plugin¶
-
class
openerp_proxy.plugins.external_ids.
ExternalIDS
(client)[source]¶ Bases:
openerp_proxy.plugin.Plugin
This plugin adds aditional methods to work with external_ids (xml_id) for Odoo records.
-
ExternalIDS.
get_for
(val, module=None)[source]¶ Return RecordList of ‘ir.model.data’ for val or False
Parameters: - val – value to get ‘ir.model.data’ records for
- module (str) – module name to search ‘ir.model.data’ for
Return type: Returns: RecordList with ‘ir.model.data’ records found
Raises ValueError: if val argument could not be parsed
val
could be one of folowing types:Record
instanceRecordList
instancetuple(model, res_id)
, for example('res.partner', 5)
str
, string in format ‘module.name’.
Note, in case of val is str: if module specified as parameter, then val supposed to be name only. For example, folowing calls are equal:
cl.plugins.external_ids.get_for('base.group_configuration') cl.plugins.external_ids.get_for('group_configuration', module='base')
-
ExternalIDS.
get_record
(xml_id, module=None)[source]¶ Return Record instance for specified xml_id
Parameters: - xml_id (str) – string with xml_id to search record for
- module (str) – module name to search Record in
Return type: Returns: Record for val or False if not found
Raises ValueError: if xml_id argument could not be parsed
-
ExternalIDS.
get_xmlid
(val, module=None)[source]¶ Return xml_id for val. Note, that only first xml_id will be returned!
Parameters: - val – look in documentation for get_for method
- module (str) – module name to search xml_id for
Return type: str
Returns: xml_id for val or False if not found
Raises ValueError: if val argument could not be parsed
Note, that if module specified as parametr, then val supposed to be name only
-
-
class
openerp_proxy.plugins.external_ids.
Record__XMLIDS
(obj, rid, cache=None, context=None)[source]¶ Bases:
openerp_proxy.orm.record.Record
Simple class to add ability to get xmlid from record itself
diagraming
Plugin¶
Warning!!! This plugin is in experimental stage!!!
diagraming.graph
Module¶
-
class
openerp_proxy.plugins.diagraming.graph.
Graph
(*args, **kwargs)[source]¶ Bases:
openerp_proxy.plugin.Plugin
Plugin that allow to build graphs.
At this point it is in experimental stage
-
Graph.
model_graph
(models, depth=1)¶ Build model graph
-
-
class
openerp_proxy.plugins.diagraming.graph.
Model
(obj)[source]¶ Bases:
openerp_proxy.plugins.diagraming.graphml_yed.NodeBigEntity
Odoo model abstraction layer
-
client
¶
-
fields
¶
-
name
¶
-
object
¶
-
-
class
openerp_proxy.plugins.diagraming.graph.
ModelGraph
(client, models, depth=1)[source]¶ Bases:
extend_me.Extensible
Contains single model graph
-
clean
()¶ Clean graph
-
depth
¶ Graph depth
-
generate_graph
()¶ Return pydot.Dot instance of graph
-
graph
¶ Return pydot.Dot instance of graph
-