summaryrefslogtreecommitdiff
path: root/addons/base_module_quality/base_module_quality.py
diff options
context:
space:
mode:
authormra (Open ERP) <mra@tinyerp.com>2008-12-24 19:21:31 +0530
committermra (Open ERP) <mra@tinyerp.com>2008-12-24 19:21:31 +0530
commitdfb4a39b6b67bc6ff7adc7c538b76eeb8019fa50 (patch)
tree3a2f25ef8f1d2baedbfc5e3d755fe01915795248 /addons/base_module_quality/base_module_quality.py
parenta5d8cf5d2c8a6de68fe5d0cead394a056ff1688d (diff)
base module quality
bzr revid: mra@tinyerp.com-20081224135131-7keeqeyqf168g5e1
Diffstat (limited to 'addons/base_module_quality/base_module_quality.py')
-rw-r--r--addons/base_module_quality/base_module_quality.py26
1 files changed, 23 insertions, 3 deletions
diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py
index 195e345e8ef..ef4a0c3c515 100644
--- a/addons/base_module_quality/base_module_quality.py
+++ b/addons/base_module_quality/base_module_quality.py
@@ -19,7 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
-
+import pooler
class abstract_quality_check(object):
'''
@@ -41,11 +41,11 @@ class abstract_quality_check(object):
#This bool defines if the test can be run only if the module is installed.
#True => the module have to be installed.
#False => the module can be uninstalled.
- bool_installed_only = True
+ bool_installed_only = True
def __init__(self):
'''
- this method should initialize the var
+ this method should initialize the var
'''
raise 'Not Implemented'
@@ -55,7 +55,27 @@ class abstract_quality_check(object):
'''
raise 'Not Implemented'
+ def get_objects(self, cr, uid, module):
+ # This function returns all object of the given module..
+ pool = pooler.get_pool(cr.dbname)
+ ids2 = pool.get('ir.model.data').search(cr, uid, [('module','=', module), ('model','=','ir.model')])
+ model_list = []
+ model_data = pool.get('ir.model.data').browse(cr, uid, ids2)
+ for model in model_data:
+ model_list.append(model.res_id)
+ obj_list = []
+ for mod in pool.get('ir.model').browse(cr, uid, model_list):
+ obj_list.append(str(mod.model))
+ return obj_list
+ def get_ids(self, cr, uid, object_list):
+ #This method return dictionary with ids of records of object for module
+ pool = pooler.get_pool(cr.dbname)
+ result_ids = {}
+ for obj in object_list:
+ ids = pool.get(obj).search(cr, uid, [])
+ result_ids[obj] = ids
+ return result_ids
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: