diff options
| author | pso (tiny) <pso@tinyerp.com> | 2009-01-05 11:34:12 +0530 |
|---|---|---|
| committer | pso (tiny) <pso@tinyerp.com> | 2009-01-05 11:34:12 +0530 |
| commit | cff804f5f868d6ade63995c54f32c523fa22d77c (patch) | |
| tree | f5821ee2f0567c11280a44124346b2ba8db1daf2 /addons/base_module_quality/wizard | |
| parent | 3340f800f0f570fa6948fc4da18eb921c6c6326b (diff) | |
| parent | 21f104a506545f869453c7aa9416ce40c49a1c00 (diff) | |
merge
bzr revid: pso@tinyerp.com-20090102045406-ko0sbzkugrhsq0h3
bzr revid: pso@tinyerp.com-20090105060412-448pd2c8hlm5r4e3
Diffstat (limited to 'addons/base_module_quality/wizard')
| -rw-r--r-- | addons/base_module_quality/wizard/__init__.py | 2 | ||||
| -rw-r--r-- | addons/base_module_quality/wizard/module_quality_check.py | 39 |
2 files changed, 31 insertions, 10 deletions
diff --git a/addons/base_module_quality/wizard/__init__.py b/addons/base_module_quality/wizard/__init__.py index a8454f95f3f..917ecbf1ff9 100644 --- a/addons/base_module_quality/wizard/__init__.py +++ b/addons/base_module_quality/wizard/__init__.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved +# 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 diff --git a/addons/base_module_quality/wizard/module_quality_check.py b/addons/base_module_quality/wizard/module_quality_check.py index c0640d9a078..1da35f9f68a 100644 --- a/addons/base_module_quality/wizard/module_quality_check.py +++ b/addons/base_module_quality/wizard/module_quality_check.py @@ -2,7 +2,7 @@ ############################################################################## # # OpenERP, Open Source Management Solution -# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved +# 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 @@ -66,6 +66,9 @@ class wiz_quality_check(osv.osv_memory): list_folders = os.listdir(config['addons_path']+'/base_module_quality/') module_name = module_data[0].name abstract_obj = base_module_quality.abstract_quality_check() + score_sum = 0.0 + ponderation_sum = 0.0 + final_score = "" for test in abstract_obj.tests: ad = tools.config['addons_path'] if module_data[0].name == 'base': @@ -73,14 +76,21 @@ class wiz_quality_check(osv.osv_memory): module_path = os.path.join(ad, module_data[0].name) val = test.quality_test() val.run_test(cr, uid, str(module_path), str(module_data[0].state)) - string_ret += val.result['summary'] - string_detail += val.result['detail'] + string_ret += val.result['summary'] #summary tab + if not val.error: + string_ret += "Score: " + str(val.score) + "/10\n" #val.score = val.score * val.ponderation ??? + string_detail += val.result['detail'] # detail tab + score_sum += (val.add_quatation(val.score, 10) * val.ponderation) + ponderation_sum += val.ponderation + final_score = str(score_sum / ponderation_sum * 100) + "%" + string_ret += "\n\nPonderation Result for module:" + final_score self.string_detail = string_detail - return string_ret + return "" def _check_detail(self, cr, uid, data, context={}): return self.string_detail + # def _general_info(self, cr, uid, data, context={}): # return self.general_info @@ -98,16 +108,27 @@ class wiz_quality_check(osv.osv_memory): #~ 'result': {'type':'form', 'arch':form_check, 'fields':fields_check, 'state':[('end','Cancel'),('do','Do Test')]} #~ }, _columns = { - 'general_info': fields.text('General Info', readonly="1",), - 'detail' : fields.text('Detail', readonly="1",), - 'verbose_detail' : fields.text('Verbose Detail', readonly="1",) +# 'general_info': fields.text('General Info', readonly="1",), +# 'detail' : fields.text('Detail', readonly="0",), + 'verbose_detail' : fields.one2many('quality.check.detail', 'quality_check', 'Verbose Detail', readonly="0",) } _defaults = { - 'general_info': _check, - 'detail': _check_detail +# 'general_info': _check, +# 'detail': _check_detail + 'verbose_detail': _check, } wiz_quality_check() +class quality_check_detail(osv.osv_memory): + _name = 'quality.check.detail' + _rec_name = 'quality_check' + _columns = { + 'quality_check': fields.many2one('wizard.quality.check', 'Quality'), + 'general_info': fields.text('General Info', readonly="1",), + 'detail' : fields.text('Detail', readonly="1",), + } +quality_check_detail() + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
