summaryrefslogtreecommitdiff
path: root/addons/base_module_quality/wizard/module_quality_check.py
diff options
context:
space:
mode:
authormra (Open ERP) <mra@tinyerp.com>2009-07-03 10:50:40 +0530
committermra (Open ERP) <mra@tinyerp.com>2009-07-03 10:50:40 +0530
commit484d021700986e73aa15534cb7303b0457e1a4df (patch)
treeb2f6a99093affd36b2e26cd66f4ffd13a62ad24f /addons/base_module_quality/wizard/module_quality_check.py
parenta3b98e29d585bc1fca4df4613bb8b54306740822 (diff)
[ADD] add base_module_quality module
bzr revid: mra@tinyerp.com-20090703052040-3rokridr4h3z33xj
Diffstat (limited to 'addons/base_module_quality/wizard/module_quality_check.py')
-rw-r--r--addons/base_module_quality/wizard/module_quality_check.py63
1 files changed, 63 insertions, 0 deletions
diff --git a/addons/base_module_quality/wizard/module_quality_check.py b/addons/base_module_quality/wizard/module_quality_check.py
new file mode 100644
index 00000000000..2dbefa6b049
--- /dev/null
+++ b/addons/base_module_quality/wizard/module_quality_check.py
@@ -0,0 +1,63 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+import os
+
+import wizard
+import pooler
+from osv import osv, fields
+
+#TODO: add cheks: do the class quality_check inherits the class abstract_quality_check?
+
+class quality_check(wizard.interface):
+
+ def _create_quality_check(self, cr, uid, data, context={}):
+ pool = pooler.get_pool(cr.dbname)
+ obj_quality = pool.get('module.quality.check')
+ objs = []
+ for id in data['ids']:
+ module_data = pool.get('ir.module.module').browse(cr, uid, id)
+ data = obj_quality.check_quality(cr, uid, module_data.name, module_data.state)
+ obj = obj_quality.create(cr, uid, data, context)
+ objs.append(obj)
+ return objs
+
+ def _open_quality_check(self, cr, uid, data, context):
+ obj_ids = self._create_quality_check(cr, uid, data, context)
+ return {
+ 'domain': "[('id','in', ["+','.join(map(str,obj_ids))+"])]",
+ 'name': _('Quality Check'),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'module.quality.check',
+ 'type': 'ir.actions.act_window'
+ }
+
+ states = {
+ 'init' : {
+ 'actions' : [],
+ 'result': {'type':'action', 'action':_open_quality_check, 'state':'end'}
+ }
+ }
+
+quality_check("create_quality_check_wiz")
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file