[ADD] add base_module_quality module

bzr revid: mra@tinyerp.com-20090703052040-3rokridr4h3z33xj
This commit is contained in:
mra (Open ERP) 2009-07-03 10:50:40 +05:30
parent a3b98e29d5
commit 484d021700
57 changed files with 4488 additions and 0 deletions

View File

@ -0,0 +1,11 @@
This module provide a generic framework to define your own quality test.
All you have to do is to:
* create a folder with your test in 'base_module_quality' (e.g: mkdir base_module_quality\mytest)
* create a .py file in it with same name as the folder you just created (e.g: touch base_module_quality\mytest\mytest.py)
* edit your file and define a class 'quality_check' that
* inherits the class 'abstract_quality_test' (defined in base_module_quality.py)
* implements the __init__() method accordingly to what you want to test.

View File

@ -0,0 +1,26 @@
# -*- 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 base_module_quality
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,51 @@
# -*- 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/>.
#
##############################################################################
{
'name': 'Base module quality',
'version': '1.0',
'category': 'Tiny Specific Modules/Base module quality',
'description': """
This module's aim is to check the quality of other modules.
It defines a wizard on the list of modules in OpenERP, which allow you to
evaluate them on different criteria such as: the respect of OpenERP coding
standards, the speed efficiency...
This module also provides generic framework to define your own quality test.
For further info, coders may take a look into base_module_quality\README.txt
WARNING: This module can not work as a ZIP file, you must unzip it before
using it, otherwise it may crash.
""",
'author': 'Tiny',
'website': 'http://www.openerp.com',
'depends': ['base'],
'init_xml': [],
'update_xml': ['base_module_quality_wizard.xml', 'base_module_quality_view.xml', 'security/ir.model.access.csv'],
'demo_xml': [],
'installable': True,
'active': False,
'certificate': '0175119475677',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,250 @@
# -*- 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 pooler
import osv
import tools
from tools import config
from tools.translate import _
from osv import osv, fields
class abstract_quality_check(object):
'''
This Class provides...
'''
def __init__(self):
'''
this method should initialize the var
'''
#This float have to store the rating of the module.
#Used to compute the final score (average of all scores).
#0 <= self.score <= 1
self.score = 0.0
#This char have to store the name of the test.
self.name = ""
#This char have to store the aim of the test and eventually a note.
self.note = ""
#This char have to store the result.
#Used to display the result of the test.
self.result = ""
#This char have to store the result with more details.
#Used to provide more details if necessary.
self.result_details = ""
# This boolean variable defines that if you do not want to calculate score and just only need detail
# or summary report for some test then you will make it False.
self.bool_count_score = True
#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.
self.bool_installed_only = True
#This variable is used to give result of test more weight,
#because some tests are more critical than others.
self.ponderation = 1.0
#Specify test got an error on module
self.error = False
#The tests have to subscribe itselfs in this list, that contains
#all the test that have to be performed.
self.tests = []
self.list_folders = os.listdir(config['addons_path'] +
'/base_module_quality/')
for item in self.list_folders:
self.item = item
path = config['addons_path']+'/base_module_quality/'+item
if os.path.exists(path + '/' + item + '.py') and item not in ['report', 'wizard', 'security']:
item2 = 'base_module_quality.' + item +'.' + item
x_module = __import__(item2)
x_file = getattr(x_module, item)
x_obj = getattr(x_file, item)
self.tests.append(x_obj)
# raise 'Not Implemented'
def run_test(self, cr, uid, module_path=""):
'''
this method should do the test and fill the score, result and result_details var
'''
raise osv.except_osv(_('Programming Error'), _('Test Is 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_model_ids(self, cr, uid, models=[]):
# This function returns all ids of the given objects..
if not models:
return []
pool = pooler.get_pool(cr.dbname)
return pool.get('ir.model').search(cr, uid, [('model', 'in', models)])
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, [])
ids = filter(lambda id: id != None, ids)
result_ids[obj] = ids
return result_ids
def format_table(self, header=[], data_list={}): #This function can work forwidget="text_wiki"
detail = ""
detail += (header[0]) % tuple(header[1])
frow = '\n|-'
for i in header[1]:
frow += '\n| %s'
for key, value in data_list.items():
detail += (frow) % tuple(value)
detail = detail + '\n|}'
return detail
def format_html_table(self, header=[], data_list=[]): #This function can work for widget="html_tag"
# function create html table....
detail = ""
detail += (header[0]) % tuple(header[1])
frow = '<tr>'
for i in header[1]:
frow += '<td>%s</td>'
frow += '</tr>'
for key, value in data_list.items():
detail += (frow) % tuple(value)
return detail
def add_quatation(self, x_no, y_no):
return x_no/y_no
class module_quality_check(osv.osv):
_name = 'module.quality.check'
_columns = {
'name': fields.char('Rated Module', size=64, ),
'final_score': fields.char('Final Score (%)', size=10,),
'check_detail_ids': fields.one2many('module.quality.detail', 'quality_check_id', 'Tests',)
}
def check_quality(self, cr, uid, module_name, module_state=None):
'''
This function will calculate score of openerp module
It will return data in below format:
Format: {'final_score':'80.50', 'name': 'sale',
'check_detail_ids':
[(0,0,{'name':'workflow_test', 'score':'100', 'ponderation':'0', 'summary': text_wiki format data, 'detail': html format data, 'state':'done', 'note':'XXXX'}),
((0,0,{'name':'terp_test', 'score':'60', 'ponderation':'1', 'summary': text_wiki format data, 'detail': html format data, 'state':'done', 'note':'terp desctioption'}),
..........]}
So here the detail result is in html format and summary will be in text_wiki format.
'''
#list_folders = os.listdir(config['addons_path']+'/base_module_quality/')
pool = pooler.get_pool(cr.dbname)
obj_module = pool.get('ir.module.module')
if not module_state:
module_id = obj_module.search(cr, uid, [('name', '=', module_name)])
if module_id:
module_state = obj_module.browse(cr, uid, module_id[0]).state
abstract_obj = abstract_quality_check()
score_sum = 0.0
ponderation_sum = 0.0
create_ids = []
for test in abstract_obj.tests:
ad = tools.config['addons_path']
if module_name == 'base':
ad = tools.config['root_path']+'/addons'
module_path = os.path.join(ad, module_name)
val = test.quality_test()
if not val.bool_installed_only or module_state == "installed":
val.run_test(cr, uid, str(module_path))
if not val.error:
data = {
'name': val.name,
'score': val.score * 100,
'ponderation': val.ponderation,
'summary': val.result,
'detail': val.result_details,
'state': 'done',
'note': val.note,
}
if val.bool_count_score:
score_sum += val.score * val.ponderation
ponderation_sum += val.ponderation
else:
data = {
'name': val.name,
'score': 0,
'summary': val.result,
'state': 'skipped',
'note': val.note,
}
else:
data = {
'name': val.name,
'note': val.note,
'score': 0,
'state': 'skipped',
'summary': _("The module has to be installed before running this test.")
}
create_ids.append((0, 0, data))
final_score = '%.2f' % (score_sum / ponderation_sum * 100)
data = {
'name': module_name,
'final_score': final_score,
'check_detail_ids' : create_ids,
}
return data
module_quality_check()
class module_quality_detail(osv.osv):
_name = 'module.quality.detail'
_columns = {
'quality_check_id': fields.many2one('module.quality.check', 'Quality'),
'name': fields.char('Name',size=128,),
'score': fields.float('Score (%)'),
'ponderation': fields.float('Ponderation', help='Some tests are more critical than others, so they have a bigger weight in the computation of final rating'),
'note': fields.text('Note',),
'summary': fields.text('Summary'),
'detail': fields.text('Details'),
'state': fields.selection([('done','Done'),('skipped','Skipped'),], 'State', size=6, help='The test will be completed only if the module is installed or if the test may be processed on uninstalled module.'),
}
module_quality_detail()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_wizard_quality_check_tree" model="ir.ui.view">
<field name="name">Results of Quality Checks</field>
<field name="model">module.quality.check</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Result">
<field name="name"/>
<field name="final_score"/>
</tree>
</field>
</record>
<record id="view_wizard_quality_check_form" model="ir.ui.view">
<field name="name">Results of Quality Checks</field>
<field name="model">module.quality.check</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Result">
<field name="name" readonly="1" search="1"/>
<field name="final_score" readonly="1" search="1"/>
<separator colspan="4" string="Tests"/>
<field name="check_detail_ids" nolabel="1" colspan="4" height="350" width="800" readonly="1">
</field>
</form>
</field>
</record>
<record id="view_wizard_quality_detail_form" model="ir.ui.view">
<field name="name">Results of Quality Checks with detail</field>
<field name="model">module.quality.detail</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Result">
<notebook>
<page string="Summary">
<field name="name" readonly="1"/>
<field name="score" readonly="1"/>
<field name="note" readonly="1" colspan="4"/>
<field name="summary" widget="text_wiki" nolabel="1" colspan="4" height="350" width="800" readonly="1"/>
<field name="ponderation" readonly="1"/>
<field name="state" readonly="1"/>
</page>
<page string="Detail">
<button name="%(quality_detail_save)d" string="Save Report" type="action"/>
<field name="detail" widget="text_html" nolabel="1" colspan="4" readonly="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record id="view_wizard_quality_detail_tree" model="ir.ui.view">
<field name="name">Results of Quality Checks with detail</field>
<field name="model">module.quality.detail</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Result" limit="80" min_rows="9" >
<field name="name" required="1"/>
<field name="state"/>
<field name="score" required="1"/>
<field name="ponderation"/>
</tree>
</field>
</record>
</data>
</openerp>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<wizard id="quality_detail_save" model="ir.module.module" name="quality_detail_save" string="Report Save" menu="False"/>
<wizard string="Quality Check"
model="ir.module.module"
name="create_quality_check_wiz"
id="create_quality_check_id"
menu="True"/>
</data>
</openerp>

Binary file not shown.

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:00:15+0000\n"
"PO-Revision-Date: 2009-01-03 02:00:15+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:18:25+0000\n"
"PO-Revision-Date: 2009-01-03 02:18:25+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:quality.check.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:quality.check.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:quality.check.detail,detail:0
#: view:quality.check.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:wizard.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "quality.check.detail"
msgstr ""
#. module: base_module_quality
#: view:wizard.quality.check:0
#: view:quality.check.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "wizard.quality.check"
msgstr ""
#. module: base_module_quality
#: view:wizard.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:quality.check.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:00:56+0000\n"
"PO-Revision-Date: 2009-01-03 02:00:56+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Невалиден XML за преглед на архитектурата"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "Името на обекта трябва да започва с \"x_\" и да не съдържа никакви специални символи!"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:17:41+0000\n"
"PO-Revision-Date: 2009-01-03 02:17:41+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Neodgovarajući XML za arhitekturu prikaza!"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:01:35+0000\n"
"PO-Revision-Date: 2009-01-03 02:01:35+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "XML invàlid per a la definició de la vista!"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "El nom de l'objecte ha de començar amb x_ i no contenir cap caràcter especial!"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:04:15+0000\n"
"PO-Revision-Date: 2009-01-03 02:04:15+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:06:58+0000\n"
"PO-Revision-Date: 2009-01-03 02:06:58+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:13:59+0000\n"
"PO-Revision-Date: 2009-01-03 02:13:59+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:14:45+0000\n"
"PO-Revision-Date: 2009-01-03 02:14:45+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "¡XML inválido para la definición de la vista!"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "¡El nombre del objeto debe empezar con x_ y no contener ningún carácter especial!"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:05:36+0000\n"
"PO-Revision-Date: 2009-01-03 02:05:36+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Vigane vaate arhitektuuri XML!"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "Objekti nimi peab algama x_'ga ja ei tohi sisaldada ühtegi erisümbolit !"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:06:17+0000\n"
"PO-Revision-Date: 2009-01-03 02:06:17+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "XML non valide pour l'architecture de la vue"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "Le nom de l'objet doit commencer avec x_ et ne pas contenir de charactères spéciaux !"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:03:35+0000\n"
"PO-Revision-Date: 2009-01-03 02:03:35+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:07:39+0000\n"
"PO-Revision-Date: 2009-01-03 02:07:39+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:08:21+0000\n"
"PO-Revision-Date: 2009-01-03 02:08:21+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "XML non valido per Visualizzazione Architettura!"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "Il nome oggetto deve iniziare con x_ e non può contenere caratteri speciali !"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:09:02+0000\n"
"PO-Revision-Date: 2009-01-03 02:09:02+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:04:56+0000\n"
"PO-Revision-Date: 2009-01-03 02:04:56+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Ongeldige XML voor weergave opbouw"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "De objectnaam moet beginnen met x_ en mag geen speciale karakters bevatten !"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:09:43+0000\n"
"PO-Revision-Date: 2009-01-03 02:09:43+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "XML niewłaściwy dla tej architektury wyświetlania!"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "Nazwa obiektu musi zaczynać się od x_ oraz nie może zawierać znaków specjalnych !"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:10:25+0000\n"
"PO-Revision-Date: 2009-01-03 02:10:25+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Invalido XML para Arquitetura da View"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "O nome do objeto precisa iniciar com x_ e não conter nenhum caracter especial!"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:11:07+0000\n"
"PO-Revision-Date: 2009-01-03 02:11:07+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "XML inválido para a arquitectura de vista"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "O nome do objecto deve começar com x_ e não pode conter um caracter especial!"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:11:49+0000\n"
"PO-Revision-Date: 2009-01-03 02:11:49+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:12:32+0000\n"
"PO-Revision-Date: 2009-01-03 02:12:32+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Неправильный XML для просмотра архитектуры!"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "Название объекта должно начинаться с x_ и не должно содержать специальных символов !"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:13:15+0000\n"
"PO-Revision-Date: 2009-01-03 02:13:15+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Neveljaven XML za arhitekturo pogleda."
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "Naziv objekta se mora začeti z 'x_' in ne sme vsebovati posebnih znakov."
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:15:28+0000\n"
"PO-Revision-Date: 2009-01-03 02:15:28+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:16:12+0000\n"
"PO-Revision-Date: 2009-01-03 02:16:12+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Görüntüleme mimarisi için Geçersiz XML"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:16:57+0000\n"
"PO-Revision-Date: 2009-01-03 02:16:57+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "Неправильний XML для Архітектури Вигляду!"
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "Назва об'єкту має починатися з x_ і не містити ніяких спеціальних символів!"
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:02:15+0000\n"
"PO-Revision-Date: 2009-01-03 02:02:15+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,74 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * base_module_quality
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.0_rc3\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2009-01-03 02:02:55+0000\n"
"PO-Revision-Date: 2009-01-03 02:02:55+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: base_module_quality
#: field:module.quality.detail,general_info:0
msgid "General Info"
msgstr ""
#. module: base_module_quality
#: view:module.quality.detail:0
msgid "Summary"
msgstr ""
#. module: base_module_quality
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: base_module_quality
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,detail:0
#: view:module.quality.detail:0
msgid "Detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.check,verbose_detail:0
msgid "Verbose Detail"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_quality_check_detail
msgid "module.quality.detail"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
#: view:module.quality.detail:0
msgid "Result"
msgstr ""
#. module: base_module_quality
#: model:ir.model,name:base_module_quality.model_wizard_quality_check
msgid "module.quality.check"
msgstr ""
#. module: base_module_quality
#: view:module.quality.check:0
msgid "Verbose detail"
msgstr ""
#. module: base_module_quality
#: field:module.quality.detail,quality_check:0
msgid "Quality"
msgstr ""

View File

@ -0,0 +1,24 @@
# -*- 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/>.
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,85 @@
# -*- 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/>.
#
##############################################################################
from tools.translate import _
from base_module_quality import base_module_quality
import pooler
class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
super(quality_test, self).__init__()
self.name = _("Method Test")
self.note = _("""
This test checks if the module classes are raising exception when calling basic methods or not.
""")
self.bool_installed_only = True
return None
def run_test(self, cr, uid, module_path):
pool = pooler.get_pool(cr.dbname)
module_name = module_path.split('/')[-1]
obj_list = self.get_objects(cr, uid, module_name)
result_dict = {}
if not obj_list:
self.error = True
self.result = _("Module has no objects")
return None
ok_count = 0
ex_count = 0
for obj in obj_list:
temp = [obj]
try:
pool.get(obj).search(cr, uid, [])
temp.append(_('Ok'))
ok_count += 1
except:
temp.append(_('Exception'))
ex_count += 1
try:
pool.get(obj).fields_view_get(cr, uid,)
temp.append(_('Ok'))
ok_count += 1
except:
temp.append(_('Exception'))
ex_count += 1
try:
pool.get(obj).read(cr, uid, [])
temp.append(_('Ok'))
ok_count += 1
except:
temp.append(_('Exception'))
ex_count += 1
result_dict[obj] = temp
self.score = (ok_count + ex_count) and float(ok_count)/float(ok_count + ex_count) or 0.0
self.result = self.get_result(result_dict)
return None
def get_result(self, dict_method):
header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-16s \n! %-20s \n! %-16s ', [_('Object Name'), 'search()', 'fields_view_get()', 'read()'])
detail = ""
if not self.error:
detail += self.format_table(header, dict_method)
return detail
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,24 @@
# -*- 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/>.
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,209 @@
# -*- 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 re
from tools.translate import _
from base_module_quality import base_module_quality
import pooler
class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
super(quality_test, self).__init__()
self.name = _("Object Test")
self.note = _("""
Test checks for fields, views, security rules, dependancy level
""")
self.bool_installed_only = True
return None
def run_test(self, cr, uid, module_path):
pool = pooler.get_pool(cr.dbname)
module_name = module_path.split('/')[-1]
obj_list = self.get_objects(cr, uid, module_name)
ids_model = self.get_model_ids(cr, uid, obj_list)
result_security = {}
if obj_list: # if module has no new created classes skipp fields, views, security tests
field_obj = pool.get('ir.model.fields')
view_obj = pool.get('ir.ui.view')
access_obj = pool.get('ir.model.access')
field_ids = field_obj.search(cr, uid, [('model', 'in', obj_list)])
view_ids = view_obj.search(cr, uid, [('model', 'in', obj_list), ('type', 'in', ['tree', 'form'])])
access_ids = access_obj.search(cr, uid, [('model_id', 'in', ids_model)])
field_data = field_obj.browse(cr, uid, field_ids)
view_data = view_obj.browse(cr, uid, view_ids)
access_data = access_obj.browse(cr, uid, access_ids)
result_dict = {}
result_view = {}
good_field = 0
total_field = 0
# field test .....
for field in field_data:
result_dict[field.model] = []
for field in field_data:
ttype = field.ttype
name = field.name
total_field += 1
check_str = re.compile('[a-z]+[\w_]*$') #re.compile('[a-z]+[_]?[a-z]+$')
if ttype == 'many2one':
if name.split('_')[-1] == 'id':
good_field += 1
else:
data = 'many2one field should end with _id'
result_dict[field.model].append([field.model, name, data])
elif ttype in ['many2many', 'one2many']:
if name.split('_')[-1] == 'ids':
good_field += 1
else:
data = '%s field should end with _ids'% (ttype)
result_dict[field.model].append([field.model, name, data])
elif check_str.match(name):
good_field += 1
else:
data = 'Field name should be in lower case or it should follow python standard'
result_dict[field.model].append([field.model, name, data])
#views tests
for res in result_dict.keys():
if not result_dict[res]:
del result_dict[res]
view_dict = {}
total_views = len(obj_list) * 2
model_views = 0
for view in view_data:
view_dict[view.model] = []
model_views += 1
for view in view_data:
ttype = view.type
view_dict[view.model].append(ttype)
for view in view_dict:
if len(view_dict[view]) < 2:
model_views -= 1
result_view[view] = [view, 'You should have atleast form/tree view of an object']
if model_views > total_views:
model_views = total_views
#security rules test...
list_files = os.listdir(module_path)
security_folder = False
for file_sec in list_files:
if file_sec == 'security':
path = os.path.join(module_path, file_sec)
if os.path.isdir(path):
security_folder = True
if not security_folder:
result_security[module_name] = [module_name, 'Security folder is not available (All security rules and groups should define in security folder)']
access_list = []
good_sec = len(obj_list)
bad_sec = 0
for access in access_data:
access_list.append(access.model_id.model)
if not access.group_id:
result_security[access.model_id.model] = [access.model_id.model, 'Specified object has no related group define on access rules']
bad_sec += 1 # to be check
not_avail_access = filter(lambda x: not x in access_list, obj_list)
for obj in not_avail_access:
bad_sec += 1
result_security[obj] = [obj, 'Object should have at least one security rule defined on it']
# Dependacy test of module
module_obj = pool.get('ir.module.module')
module_ids = module_obj.search(cr, uid, [('name', '=', module_name)])
module_data = module_obj.browse(cr, uid, module_ids)
depend_list = []
depend_check = []
remove_list = []
for depend in module_data[0].dependencies_id:
depend_list.append(depend.name)
module_ids = module_obj.search(cr, uid, [('name', 'in', depend_list)])
module_data = module_obj.browse(cr, uid, module_ids)
for data in module_data:
for check in data.dependencies_id:
depend_check.append(check.name)
for dep in depend_list:
if dep in depend_check and not dep in remove_list:
remove_list.append(str(dep))
if remove_list:
result_security[module_name] = [remove_list, 'Unnecessary dependacy should be removed please Provide only highest requirement level']
bad_depend = len(remove_list)
if not obj_list:
score_depend = (100 - (bad_depend * 5)) / 100.0 # note : score is calculated based on if you have for e.g. two module extra in dependancy it will score -10 out of 100
self.score = score_depend
self.result = self.get_result({ module_name: ['No object found', 'No object found', 'No object found', int(score_depend * 100)]})
self.result_details += self.get_result_general(result_security, name="General")
return None
score_view = total_views and float(model_views) / float(total_views)
score_field = total_field and float(good_field) / float(total_field)
score_depend = (100 - (bad_depend * 5)) / 100.0 # note : score is calculated based on if you have for e.g. two module extra in dependancy it will score -10 out of 100
score_security = good_sec and float(good_sec - bad_sec) / float(good_sec)
self.score = (score_view + score_field + score_security + score_depend) / 4
self.result = self.get_result({ module_name: [int(score_field * 100), int(score_view * 100), int(score_security * 100), int(score_depend * 100)]})
self.result_details += self.get_result_details(result_dict)
self.result_details += self.get_result_general(result_view, name="View")
self.result_details += self.get_result_general(result_security, name="General")
return None
def get_result(self, dict_obj):
header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-40s \n! %-40s \n! %-10s \n', [_('Result of fields in %'), _('Result of views in %'), _('Result of Security in %'), _('Result of dependancy in %')])
if not self.error:
return self.format_table(header, data_list=dict_obj)
return ""
def get_result_details(self, dict_obj):
res = ""
if dict_obj != {}:
str_html = '''<html><strong> Fields Result</strong><head></head><body>'''
res += str_html
header = ('<tr><th width="200">%s</th><th width="200">%s</th><th width="300">%s</th></tr>', [_('Object Name'), _('Field name'), _('Suggestion')])
if not self.error:
for key in dict_obj.keys():
data_list = []
final_dict = {}
data_list = dict_obj[key]
count = 0
for i in data_list:
count = count + 1
final_dict[key + str(count)] = i
res += '<table>' + self.format_html_table(header, data_list=final_dict) + '</table><br>'
return res + '</body></html>'
return ""
def get_result_general(self, dict_obj, name=''):
str_html = '''<html><strong> %s Result</strong><head></head><body><table>'''% (name)
header = ('<tr><th>%s</th><th>%s</th></tr>', [_('Object Name'), _('Suggestion')])
if not self.error:
res = str_html + self.format_html_table(header, data_list=dict_obj) + '</table></body></html>'
return res
return ""
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,24 @@
# -*- 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/>.
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,278 @@
# -*- 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
from tools.translate import _
from base_module_quality import base_module_quality
class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
super(quality_test, self).__init__()
self.name = _("PEP-8 Test")
self.note = _("""
PEP-8 Test , copyright of py files check, method can not call from loops
""")
self.bool_installed_only = False
self.bad_standard = 0
self.good_standard = 0
self.result_py = {}
return None
def run_test(self, cr, uid, module_path):
list_files = os.listdir(module_path)
for i in list_files:
path = os.path.join(module_path, i)
if os.path.isdir(path):
for j in os.listdir(path):
list_files.append(os.path.join(i, j))
py_list = []
for file_py in list_files:
if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__terp__.py'):
file_path = os.path.join(module_path, file_py)
py_list.append(file_path)
open_files = map(lambda x: open(x, 'r'), py_list)
if not py_list:
self.error = True
self.result = _("No python file found")
return None
#below functions check:
#1. Imports should usually be on separate lines
#2. Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants
self.check_import(open_files)
#1. there should be a one space after , : ;
self.check_space(open_files)
#1. Have all the .py files a copyright?
self.check_licence(open_files)
#1. Does the module avoid unecessary queries like when we put a browse into a loop?
self.check_loop(open_files)
#1.More than one space around an assignment (or other) operator to align it with another.
# self.check_space_operator(open_files)
#1. For sequences, (strings, lists, tuples), use the fact that empty sequences are false
#for e.g : if seq: => good & if len(seq): => not good
self.check_len(open_files)
# below function checks
# 1. Don't compare boolean values to True or False using == and !=
self.check_boolean(open_files)
self.score = self.good_standard and float(self.good_standard) / float(self.good_standard + self.bad_standard)
self.result = self.get_result({ module_path: [int(self.score * 100)]})
self.result_details += self.get_result_general(self.result_py)
return None
def check_import(self, open_files):
for py in open_files:
py.seek(0)
class_or_def = False
line_counter = 0
file_name = py.name.split('/')[-1]
while True:
line_counter += 1
line = py.readline()
if not line: break
if ((line.find('class') > -1) or (line.find('def') > -1)):
class_or_def = True
import_found = line.find('import')
comment_found = line.find('#')
if comment_found == -1 and import_found != -1:
self.good_standard += 1
if (class_or_def):
self.bad_standard += 1
self.result_py[file_name + str(line_counter)] = [file_name, line_counter, 'Imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants']
if (line.find('from') < 0 and line.find(',') != -1):
self.bad_standard += 1
self.result_py[file_name + str(line_counter)] = [file_name, line_counter, 'Imports should usually be on separate lines']
def check_licence(self, open_files):
for py in open_files:
py.seek(0)
bad_position = False
copyright_found = False
gnu_found = False
license_found = False
gnu_website_found = False
line_counter = 0
file_name = py.name.split('/')[-1]
while True:
declaration = False
flag = False
line_counter += 1
line = py.readline()
if not line: break
if ((line.find('class') > -1) or (line.find('def') > -1) or (line.find('import') > -1)):
bad_position = True
comment_found = line.find('#')
copyright_found = line.find('Copyright')
gnu_found = line.find('GNU')
license_found = line.find('License')
gnu_website_found = line.find('www.gnu.org/licenses')
if ((copyright_found > -1) or (gnu_found > -1) or (license_found > -1) or (gnu_website_found > -1)):
self.good_standard += 1
declaration = True
flag = True
break
if (comment_found > -1) and bad_position and declaration:
self.bad_standard += 1
self.result_py[file_name + str(line_counter)] = [file_name, line_counter, 'Declaration of copyright must be at the top of file']
break
if bad_position and (not flag):
self.bad_standard += 1
self.result_py[file_name] = [file_name, '--', 'File is not copyright']
def check_loop(self, open_files):
for py in open_files:
py.seek(0)
methods = ['browse', 'search', 'read', 'copy', 'unlink']
place_for = 1000
file_name = py.name.split('/')[-1]
line_counter = 0
counter = 0
while True:
line_counter += 1
line = py.readline()
if not line: break
place_method = 0
for i in line :
if (i == ' '):
place_method += 1
elif (i != ' '):
break
elif (place_method > 100):
break
if (line.find('for') > -1):
place_for = place_method
if (place_for < place_method):
counter += 1
for method in methods:
got = line.find(method)
if(got > -1):
self.bad_standard += 1
self.result_py[file_name + str(line_counter)] = [file_name, line_counter, 'puting method inside loop is not good']
self.good_standard += counter
def check_space(self, open_files):
for py in open_files:
py.seek(0)
counter_line = 0
file_name = py.name.split('/')[-1]
counter = 0
while True:
counter_line += 1
line = py.readline()
if not line: break
pos_comma = line.find(',')
pos_semicolon = line.find(';')
pos_colon = line.find(':')
space_find = -1
if (pos_comma != -1 or pos_semicolon != -1 or pos_colon != -1):
counter += 1
for i in line:
space_find += 1
if (i == ' '):
if ((space_find + 1) == pos_comma) or ((space_find + 1) == pos_semicolon) or ((space_find + 1) == pos_colon):
self.bad_standard += 1
self.result_py[file_name + str(counter_line)] = [file_name, counter_line, 'You should not have space before (: ; ,)']
self.good_standard += counter # to be check
def check_space_operator(self, open_files):
for py in open_files:
py.seek(0)
space_counter = 0
eq_found = False
operator_found = False
line_counter = 0
file_name = py.name.split('/')[-1]
while True:
line_counter += 1
line = py.readline()
if not line: break
for counter in line:
if (counter == ' '):
space_counter += 1
else:
if (space_counter > 1):
if counter in ['=', '<', '>', '!', '+', '-', '*', '/', '^', '%'] or operator_found:
self.bad_standard += 1
self.result_py[file_name + str(line_counter)] = [file_name, line_counter, 'More than one space around an assignment (or other) operator to align it with another']
operator_found = False
space_counter = 0
if counter in ['=', '<', '>', '!', '+', '-', '*', '/', '^', '%']:
self.good_standard += 1
operator_found = True
def check_len(self, open_files):
for py in open_files:
py.seek(0)
line_counter = 0
file_name = py.name.split('/')[-1]
while True:
line_counter += 1
line = py.readline()
if not line: break
if (line.find('if') > -1) and (line.find('len(') > -1) and (line.find(')') > -1):
self.good_standard += 1
if (line.find(':') > -1) and not line.find('<') > -1 and not line.find('>') > -1 and not line.find('=') > -1 and not line.find('!') > -1 :
self.bad_standard += 1
self.result_py[file_name + str(line_counter)] = [file_name, line_counter, ' For sequences, (strings, lists, tuples), use the fact that empty sequences are false']
def check_boolean(self, open_files):
for py in open_files:
py.seek(0)
line_counter = 0
file_name = py.name.split('/')[-1]
while True:
line_counter += 1
line = py.readline()
if not line: break
if (line.find('if') > -1):
self.good_standard += 1
if ((line.find('==') > -1) or (line.find('!=') > -1)) and ((line.find('True') > -1) or (line.find('False') > -1)):
self.bad_standard += 1
self.result_py[file_name + str(line_counter)] = [file_name, line_counter, "Don't compare boolean values to True or False using == or !="]
def get_result(self, dict_obj):
header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n', [_('Result of pep8_test in %')])
if not self.error:
return self.format_table(header, data_list=dict_obj)
return ""
def get_result_general(self, dict_obj):
str_html = '''<html><strong>Result</strong><head></head><body><table>'''
header = ('<tr><th>%s</th><th>%s</th><th>%s</th></tr>', [_('Object Name'), _('Line number'), _('Suggestion')])
if not self.error:
res = str_html + self.format_html_table(header, data_list=dict_obj) + '</table></body></html>'
return res
return ""
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,24 @@
# -*- 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/>.
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,120 @@
# -*- 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
from tools import config
from tools.translate import _
from base_module_quality import base_module_quality
class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
super(quality_test, self).__init__()
self.name = _("Pyflakes Test")
self.note = _("""This test uses Pyflakes to analyze Python programs and detect various errors. It works by parsing the source file, not importing it. See http://www.divmod.org/trac/wiki/DivmodPyflakes for further info.\n (This test score does not effect final score) """)
self.bool_installed_only = False
self.bool_count_score = False #This test display on report (summary/detail) does not count score
return None
def run_test(self, cr, uid, module_path):
list_files = os.listdir(module_path)
for i in list_files:
path = os.path.join(module_path, i)
if os.path.isdir(path):
for j in os.listdir(path):
list_files.append(os.path.join(i, j))
dict_py = {}
flag = False
self.result_details += '''<html>
<head>
<link rel="stylesheet" type="text/css" href="/tg_widgets/openerp/css/wiki.css" media="all">
</head>
<body><table><tr><b>Report</b>'''
for file_py in list_files:
if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__terp__.py'):
if not flag:
flag = True
file_path = os.path.join(module_path, file_py)
try:
res = os.popen('pyflakes' + ' ' + file_path).read()
if not res:
continue
self.result_details += '''<table border="2" bordercolor="black" width="100%" align="center"><tr><td width="30%"> ''' + file_py + '</td><td width="70%"><table border=2 bordercolor=black >'
list_res = res.split('\n')
temp_dict = {}
keys = ['imported but unused statements', 'unable to detect undefined names', \
'undefined name', 'redefinition of unused from line', \
'import shadowed by loop variable', 'local variables referenced before assignment', \
'duplicate argument in function definition', 'redefinition of function from line', \
'future import after other statements']
map(lambda key:temp_dict.setdefault(key, 0), keys)
detail_str = ''
for line in list_res:
self.result_details += '''<tr><td width="100%"> ''' + line + '</td></tr>'
detail_str += line + '\n'
if line.find("imported but unused") != -1:
temp_dict['imported but unused statements'] += 1
elif line.find("*' used; unable to detect undefined names") != -1:
temp_dict['unable to detect undefined names'] += 1
elif line.find("undefined name") != -1:
temp_dict['undefined name'] += 1
elif line.find("redefinition of unused") != -1:
temp_dict['redefinition of unused from line'] += 1
elif line.find("shadowed by loop variable") != -1:
temp_dict['import shadowed by loop variable'] += 1
elif line.find("referenced before assignment") != -1:
temp_dict['local variables referenced before assignment'] += 1
elif line.find("in function definition") != -1:
temp_dict['duplicate argument in function definition'] += 1
elif line.find("redefinition of function") != -1:
temp_dict['redefinition of function from line'] += 1
elif line.find("after other statements") != -1:
temp_dict['future import after other statements'] += 1
final_str = '\n'
for t in temp_dict:
if str(temp_dict[t]) != '0':
final_str += '\n' + str(t) + ' : ' + str(temp_dict[t]) + '\n'
except:
self.result += _("Error! Is pyflakes correctly installed? (http://pypi.python.org/pypi/pyflakes/0.3.0)")+"\n"
break
try:
dict_py[file_py] = [file_py, final_str]
except:
dict_py[file_py] = [file_py, _("Unable to parse the result. Check the details.")]
self.result_details += '</table></td>'
if not flag:
self.error = True
self.result = _("No python file found")
return None
self.result_details += '</tr></table></body></html>'
self.score = 0
self.result = self.get_result(dict_py)
return None
def get_result(self, dict_py):
header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n', [_('File Name'), _('Result')])
if not self.error:
return self.format_table(header, data_list=dict_py)
return ""
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,26 @@
# -*- 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 pylint_test
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,101 @@
# -*- 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
from tools import config
from tools.translate import _
from base_module_quality import base_module_quality
class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
super(quality_test, self).__init__()
self.name = _("Pylint Test")
self.note = _("""This test uses Pylint and checks if the module satisfies the coding standard of Python. See http://www.logilab.org/project/name/pylint for further info.\n """)
self.bool_installed_only = False
return None
def run_test(self, cr, uid, module_path):
config_file_path = config['addons_path']+'/base_module_quality/pylint_test/pylint_test_config.txt'
list_files = os.listdir(module_path)
for i in list_files:
path = os.path.join(module_path, i)
if os.path.isdir(path):
for j in os.listdir(path):
list_files.append(os.path.join(i, j))
count = 0
score = 0.0
dict_py = {}
flag = False
self.result_details += '''<html>
<head>
<link rel="stylesheet" type="text/css" href="/tg_widgets/openerp/css/wiki.css" media="all">
</head>
<body>'''
for file_py in list_files:
if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__terp__.py'):
if not flag:
flag = True
file_path = os.path.join(module_path, file_py)
try:
res = os.popen('pylint --rcfile=' + config_file_path + ' ' + file_path).read()
except:
self.result += _("Error. Is pylint correctly installed?")+"\n"
break
count += 1
# leftchar = -1
# while res[leftchar:leftchar+1] != ' ' and leftchar-1 <= 0:
# leftchar -= 1
# rightchar = -10
# while res[rightchar:rightchar+1] != '/' and rightchar+1 <= 0:
# rightchar += 1
try:
# score += float(res[leftchar+1:rightchar])
scr = res.split("Your code has been rated at")[1].split("</div>")[0].split("/")[0]
score += float(scr)
#self.result += file + ": " + res[leftchar+1:rightchar] + "/10\n"
dict_py[file_py] = [file_py, scr]
except:
score += 0
#self.result += file + ": "+_("Unable to parse the result. Check the details.")+"\n"
dict_py[file_py] = [file_py, _("Unable to parse the result. Check the details.")]
self.result_details += res.replace('''<div''', '''<div class="wikiwidget readonlyfield"''')
if not flag:
self.error = True
self.result = _("No python file found")
return None
self.result_details += '</body></html>'
average_score = count and score / count or score
self.score = (max(average_score, 0)) / 10
self.result = self.get_result(dict_py)
return None
def get_result(self, dict_py):
header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n', [_('File Name'), _('Result (/10)')])
if not self.error:
return self.format_table(header, data_list=dict_py)
return ""
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,308 @@
# lint Python modules using external checkers.
#
# This is the main checker controlling the other ones and the reports
# generation. It is itself both a raw checker and an astng checker in order
# to:
# * handle message activation / deactivation at the module level
# * handle some basic but necessary stats'data (number of classes, methods...)
#
[MASTER]
# Specify a configuration file.
#rcfile=
# Profiled execution.
profile=no
# Add <file or directory> to the black list. It should be a base name, not a
# path. You may set this option multiple times.
ignore=CVS
# Pickle collected data for later comparisons.
persistent=no
# Set the cache size for astng objects.
cache-size=500
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
[COMMANDS]
# Display a help message for the given message id and exit. The value may be a
# comma separated list of message ids.
#help-msg=
[MESSAGES CONTROL]
# Enable only checker(s) with the given id(s). This option conflict with the
# disable-checker option
#enable-checker=
# Enable all checker(s) except those with the given id(s). This option conflict
# with the disable-checker option
#disable-checker=
# Enable all messages in the listed categories.
#enable-msg-cat=
# Disable all messages in the listed categories.
#disable-msg-cat=
# Enable the message(s) with the given id(s).
#enable-msg=
# Disable the message(s) with the given id(s).
disable-msg=C0103,F0401,E0611,R0903,W0232,W0102,E1002,R0913,R0904
[REPORTS]
# set the output format. Available formats are text, parseable, colorized and
# html
output-format=html
# Include message's id in output
include-ids=yes
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no
# Tells wether to display a full report or only the messages
reports=yes
# Python expression which should return a note less than 10 (10 is the highest
# note).You have access to the variables errors warning, statement which
# respectivly contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (R0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# Add a comment according to your evaluation note. This is used by the global
# evaluation report (R0004).
comment=no
# Enable the report(s) with the given id(s).
#enable-report=
# Disable the report(s) with the given id(s).
#disable-report=
# checks for
# * unused variables / imports
# * undefined variables
# * redefinition of variable from builtins or from an outer scope
# * use of variable before assigment
#
[VARIABLES]
# Tells wether we should check for unused import in __init__ files.
init-import=no
# A regular expression matching names used for dummy variables (i.e. not used).
dummy-variables-rgx=_|dummy
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=
# try to find bugs in the code using type inference
#
[TYPECHECK]
# Tells wether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# When zope mode is activated, consider the acquired-members option to ignore
# access to some undefined attributes.
zope=no
# List of members which are usually get through zope's acquisition mecanism and
# so shouldn't trigger E0201 when accessed (need zope=yes to be considered).
acquired-members=REQUEST,acl_users,aq_parent
# checks for :
# * doc strings
# * modules / classes / functions / methods / arguments / variables name
# * number of arguments, local variables, branchs, returns and statements in
# functions, methods
# * required module attributes
# * dangerous default values as arguments
# * redefinition of function / method / class
# * uses of the global statement
#
[BASIC]
# Required attributes for module, separated by a comma
required-attributes=
# Regular expression which should only match functions or classes name which do
# not require a docstring
no-docstring-rgx=__.*__
# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Regular expression which should only match correct module level names
const-rgx=(([A-Z_][A-Z1-9_]*)|(__.*__))$
# Regular expression which should only match correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$
# Regular expression which should only match correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Good variable names which should always be accepted, separated by a comma
good-names=i,j,k,ex,Run,_
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,apply,input
# checks for
# * external modules dependencies
# * relative / wildcard imports
# * cyclic imports
# * uses of deprecated modules
#
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,string,TERMIOS,Bastion,rexec
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report R0402 must not be disabled)
import-graph=
# Create a graph of external dependencies in the given file (report R0402 must
# not be disabled)
ext-import-graph=
# Create a graph of internal dependencies in the given file (report R0402 must
# not be disabled)
int-import-graph=
# checks for :
# * methods without self as first argument
# * overridden methods signature
# * access only to existant members via self
# * attributes not defined in the __init__ method
# * supported interfaces implementation
# * unreachable code
#
[CLASSES]
# List of interface methods to ignore, separated by a comma. This is used for
# instance to not check methods defines in Zope's Interface base class.
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
# checks for sign of poor/misdesign:
# * number of methods, attributes, local variables...
# * size, complexity of functions, methods
#
[DESIGN]
# Maximum number of arguments for function / method
max-args=5
# Maximum number of locals for function / method body
max-locals=15
# Maximum number of return / yield for function / method body
max-returns=6
# Maximum number of branch for function / method body
max-branchs=12
# Maximum number of statements in function / method body
max-statements=50
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of attributes for a class (see R0902).
max-attributes=7
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
# checks for :
# * unauthorized constructions
# * strict indentation
# * line length
# * use of <> instead of !=
#
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=80
# Maximum number of lines in a module
max-module-lines=1000
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
#indent-string="\t"
# checks for similarities and duplicated code. This computation may be
# memory / CPU intensive, so you should disable it if you experiments some
# problems.
#
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=4
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
# checks for:
# * warning notes in the code like FIXME, XXX
# * PEP 263: source code with non ascii character but no encoding declaration
#
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO

View File

@ -0,0 +1,3 @@
"id","name","model_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_module_quality_check","module.quality.check","model_module_quality_check",1,1,1,1
"access_module_quality_detail","module.quality.detail","model_module_quality_detail",1,1,1,1
1 id name model_id:id perm_read perm_write perm_create perm_unlink
2 access_module_quality_check module.quality.check model_module_quality_check 1 1 1 1
3 access_module_quality_detail module.quality.detail model_module_quality_detail 1 1 1 1

View File

@ -0,0 +1,24 @@
# -*- 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/>.
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,125 @@
# -*- 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/>.
#
##############################################################################
from osv import fields, osv
from tools.translate import _
import pooler
from base_module_quality import base_module_quality
class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
super(quality_test, self).__init__()
self.bool_installed_only = True
self.name = _("Speed Test")
self.note = _("""
This test checks the speed of the module. Note that at least 5 demo data is needed in order to run it.
""")
return None
def run_test(self, cr, uid, module_path):
pool = pooler.get_pool(cr.dbname)
module_name = module_path.split('/')[-1]
obj_list = self.get_objects(cr, uid, module_name)
# remove osv_memory class becaz it does not have demo data
if obj_list:
cr.execute("select w.res_model from ir_actions_todo as t left join ir_act_window as w on t.action_id=w.id where w.res_model in ('%s')"% ("','".join(obj_list)))
res = cr.fetchall()
for remove_obj in res:
if remove_obj and (remove_obj[0] in obj_list):
obj_list.remove(remove_obj[0])
result_dict2 = {}
if not obj_list:
self.error = True
self.result += _("Given module has no objects.Speed test can work only when new objects are created in the module along with demo data")
return None
obj_counter = 0
score = 0.0
obj_ids = self.get_ids(cr, uid, obj_list)
result_dict = {}
result_dict2 = {}
self.result_details += _("<html>O(1) means that the number of SQL requests to read the object does not depand on the number of objects we are reading. This feature is hardly wished.\n</html>")
for obj, ids in obj_ids.items():
obj_counter += 1
ids = ids[:100]
size = len(ids)
list2 = []
if size:
speed_list = []
#we perform the operation twice, and count the number of queries in the second run. This allows to avoid the cache effect. (like translated terms that asks for more queries)
pool.get(obj).read(cr, uid, [ids[0]])
cnt = cr.count
pool.get(obj).read(cr, uid, [ids[0]])
code_base_complexity = cr.count - cnt
pool.get(obj).read(cr, uid, ids[:size/2])
cnt = cr.count
pool.get(obj).read(cr, uid, ids[:size/2])
code_half_complexity = cr.count - cnt
pool.get(obj).read(cr, uid, ids)
cnt = cr.count
pool.get(obj).read(cr, uid, ids)
code_size_complexity = cr.count - cnt
if size < 5:
speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, _("Warning! Not enough demo data")]
list2 = [obj, _("No enough data")]
else:
if code_size_complexity <= (code_base_complexity + size):
complexity = _("O(1)")
score += 1
list2 = [obj, _("Efficient")]
else:
complexity = _("O(n) or worst")
list2 = [obj, _("Not Efficient")]
speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, complexity]
else:
speed_list = [obj, size, "", "", "", _("Warning! Object has no demo data")]
list2 = [obj, _("No data")]
result_dict[obj] = speed_list
result_dict2[obj] = list2
self.score = obj_counter and score / obj_counter or 0.0
self.result_details += self.get_result_details(result_dict)
self.result += self.get_result(result_dict2)
return None
def get_result(self, dict_speed):
header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s', [_('Object Name'), _('Result')])
if not self.error:
return self.format_table(header, data_list=dict_speed)
return ""
def get_result_details(self, dict_speed):
str_html = '''<html><head></head><body><table border="1">'''
header = ('<tr><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th><th>%s</th></tr>', [_('Object Name'), _('N (Number of Records)'), _('1'), _('N/2'), _('N'), _('Reading Complexity')])
if not self.error:
res = str_html + self.format_html_table(header, data_list=dict_speed) + '</table></body></html>'
return res
return ""
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,24 @@
# -*- 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/>.
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,176 @@
# -*- 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
from tools.translate import _
from base_module_quality import base_module_quality
class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
super(quality_test, self).__init__()
self.name = _("Structure Test")
self.note = _("""
This test checks if the module satisfy tiny structure
""")
self.bool_installed_only = False
self.result_dict = {}
self.module_score = 0.0
self.count = 0
self.recur = True
return None
def run_test_struct(self, cr, uid, module_path):
len_module = len(module_path.split('/'))
module_name = module_path.split('/')
module_name = module_name[len_module-1]
list_files = os.listdir(module_path)
self.result_dict = {}
f_list = []
module_dict = {}
module_dict['module'] = []
# count = 0
final_score = 0.0
if not module_name.islower():
self.result_dict[module_name] = [module_name, 'Module name should have in lowercase']
for file_struct in list_files:
if file_struct.split('.')[-1] != 'pyc':
path = os.path.join(module_path, file_struct)
if file_struct == 'wizard' and os.path.isdir(path):
module_dict[file_struct] = []
elif file_struct == 'report' and os.path.isdir(path):
module_dict[file_struct] = []
elif file_struct == 'security' and os.path.isdir(path):
module_dict[file_struct] = []
elif file_struct == 'process' and os.path.isdir(path):
module_dict[file_struct] = []
elif file_struct != 'i18n' and os.path.isdir(path):
# self.counter += 1
self.run_test(cr, uid, path)
module_dict['module'].append(file_struct)
f_list.append(file_struct)
for i in f_list:
path = os.path.join(module_path, i)
if os.path.isdir(path) and not i == 'i18n':
for j in os.listdir(path):
if i in ['report', 'wizard', 'security', 'module', 'process'] and j.split('.')[-1] != 'pyc':
module_dict[i].append(j)
f_list.append(os.path.join(i, j))
# module files calculation (module.py,module_view.xml,etc..)
com_list = ['_unit_test.xml', '.py', '_view.xml', '_workflow.xml' , '_wizard.xml', '_report.xml', '_data.xml', '_demo.xml', '_security.xml', '_sequence.xml', '_graph.xml']
com_list = map(lambda x: module_name + x, com_list)
main_file = ['__init__.py', '__terp__.py']
com_list.extend(main_file)
module_dict['module'] = filter(lambda x: len(x.split(".")) > 1, module_dict['module'])
score = self.get_score(module_dict['module'], com_list)
self.count = self.count + 1
final_score += score
# report folder checking...
if module_dict.has_key('report'):
report_pys = filter(lambda x: (len(x.split('.'))>1 and x.split('.')[1] == 'py') and x != '__init__.py', module_dict['report'])
report_pys = map(lambda x:x.split('.')[0], report_pys)
reports = ['.sxw', '.rml', '.xsl', '.py', '.xml']
org_list_rep = []
for pys in report_pys:
for report in reports:
org_list_rep.append(pys + report)
org_list_rep.append('__init__.py')
score_report = self.get_score(module_dict['report'], org_list_rep, 'report/')
self.count = self.count + 1
final_score += score_report
# wizard folder checking...
if module_dict.has_key('wizard'):
wizard_pys = filter(lambda x: (len(x.split('.'))>1 and x.split('.')[1] == 'py') and x != '__init__.py', module_dict['wizard'])
wizard_pys = map(lambda x:x.split('.')[0], wizard_pys)
wizards = ['_view.xml', '_workflow.xml', '.py']
org_list_wiz = []
for pys in wizard_pys:
for report in wizards:
org_list_wiz.append(pys + report)
org_list_wiz.append('__init__.py')
score_wizard = self.get_score(module_dict['wizard'], org_list_wiz, 'wizard/')
self.count = self.count + 1
final_score += score_wizard
# security folder checking...
if module_dict.has_key('security'):
security = [module_name + '_security.xml']
security.extend(['ir.model.access.csv'])
score_security = self.get_score(module_dict['security'], security, 'security/')
self.count = self.count + 1
final_score += score_security
# process folder checking...
if module_dict.has_key('process'):
process = [module_name + '_process.xml']
score_process = self.get_score(module_dict['process'], process, 'process/')
self.count = self.count + 1
final_score += score_process
# final score
self.module_score += final_score
self.score = self.module_score / (self.count)
self.result = self.get_result({ module_name: [module_name, int(self.score*100)]})
# self.result_details += self.get_result_details(self.result_dict)
return None
def run_test(self, cr, uid, module_path):
self.run_test_struct(cr, uid, module_path)
if self.score != 1:
self.result_details = self.get_result_details(self.result_dict)
return None
def get_result(self, dict_struct):
header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n', [_('Module Name'), _('Result in %')])
if not self.error:
return self.format_table(header, data_list=dict_struct)
return ""
def get_score(self, module_list, original_files, mod_folder=''):
score = 0
module_length = len(module_list)
for i in module_list:
if i in original_files:
score += 1
else:
if mod_folder != 'wizard/':
self.result_dict[i] = [mod_folder + i, 'File name does not follow naming standards.']
score -= 1
module_length -= 1
score = module_length and float(score) / float(module_length)
return score
def get_result_details(self, dict_struct):
str_html = '''<html><head></head><body><table>'''
header = ('<tr><th>%s</th><th>%s</th></tr>', [_('File Name'), _('Feedback about structure of module')])
if not self.error:
res = str_html + self.format_html_table(header, data_list=dict_struct) + '</table></body></html>'
return res
return ""
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,24 @@
# -*- 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/>.
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,145 @@
# -*- 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 re
import tools
from tools.translate import _
from base_module_quality import base_module_quality
import pooler
class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
super(quality_test, self).__init__()
self.name = _("Terp Test")
self.note = _("This test checks if the module satisfies the current coding standard used by OpenERP.")
self.bool_installed_only = False
self.no_terp = False
self.ponderation = 2
return None
def run_test_terp(self, cr, uid, module_path):
list_files = os.listdir(module_path)
current_module = module_path.split('/')[-1]
for i in list_files:
path = os.path.join(module_path, i)
if os.path.isdir(path):
for j in os.listdir(path):
list_files.append(os.path.join(i, j))
score = 1.0
feel_good_factor = 0
feel_bad_factor = 0
if '__terp__.py' not in list_files:
self.no_terp = True
self.result += _("The module does not contain the __terp__.py file")
return None
result_dict = {}
result_dict1 = {}
terp_file = os.path.join(module_path,'__terp__.py')
res = eval(tools.file_open(terp_file).read())
terp_keys = ['category', 'name', 'description', 'author', 'website', 'update_xml', 'init_xml', 'depends', 'version', 'active', 'installable', 'demo_xml', 'certificate']
for key in terp_keys:
if key in res:
feel_good_factor += 1 # each tag should appear
if isinstance(res[key], (str, unicode, list)):
if not res[key]:
if key in ['description', 'author', 'website', 'category', 'version']:
data = "Module's terp file has no information about " + key + " tag"
result_dict1[key] = [key, data]
elif key in ['name', 'depends']:
data = "Module's terp file has no information about " + key + " tag"
result_dict1[key] = [key, data]
elif key == 'update_xml':
data = " Module update_xml tag is empty it shows that you do not have any views,wizard,workflow"
result_dict1[key] = [key, data]
elif key == 'demo_xml':
data = 'Module demo_xml tag is empty it shows that you do not have any demo data '
result_dict1[key] = [key, data]
feel_bad_factor += 1
else:
flag = False
if key == 'description' and len(str(res[key])) >= 150: # no. of chars should be >=150
feel_good_factor += 1
flag = True
if res['description'].count('\n') >= 4:# description contains minimum 5 lines
feel_good_factor += 1
flag = True
if not flag and key == 'description':
result_dict[key] = [key, 'Description of the module in terp is not enough, you must describe your module enough because good description is the beginning of a good documentation. And a good documentation limits the support requests.']
if key == 'website':
ptrn = re.compile('[https?://]?[\w\.:]+[\w /:]+$') # reg ex matching on temporary basis.Website is correctly formatted
result = ptrn.search(str(res[key]))
if result:
feel_good_factor += 1
else:
result_dict[key] = [key, 'Website tag of terp file should be in valid format or it should be lead to valid page']
feel_bad_factor += 1
if isinstance(res[key], bool):
if key == 'active':
if current_module != 'base':
if res[key]:
feel_bad_factor += 1
result_dict[key] = [key, 'Active tag of terp file should not be set to True!']
else:
if not res[key]:
result_dict[key] = [key, 'Active tag of terp file of base module should be set to True!']
feel_bad_factor += 1
if key == 'installable' and not res[key]: # installable tag is provided and False
result_dict[key] = [key, 'Installable tag of terp file of module should be set to True so that it can install on client!']
feel_bad_factor += 1
else:
feel_bad_factor += 1
result_dict1[key] = [key, "Tag is missing!"]
if result_dict1 or result_dict1:
score = round((feel_good_factor) / float(feel_good_factor + feel_bad_factor), 2)
self.result_details += self.get_result_details(result_dict)
self.result_details += self.get_result_details(result_dict1)
return [_('__terp__.py file'), score]
def run_test(self, cr, uid, module_path):
terp_score = self.run_test_terp(cr, uid, module_path)
self.score = terp_score and terp_score[1] or 0.0
if terp_score:
self.result = self.get_result({'__terp__.py': terp_score})
return None
def get_result(self, dict_terp):
header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n', [_('Object Name'), _('Result (/1)')])
if not self.error:
return self.format_table(header, data_list=dict_terp)
return ""
def get_result_details(self, dict_terp):
if dict_terp:
str_html = '''<html><head></head><body><table border="1">'''
header = ('<tr><th>%s</th><th>%s</th></tr>', [_('Tag Name'), _('Feed back About terp file of Module')])
if not self.error:
res = str_html + self.format_html_table(header, data_list=dict_terp) + '</table><newline/></body></html>'
return res
return ""
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,28 @@
# -*- 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 module_quality_check
import quality_save_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -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:

View File

@ -0,0 +1,61 @@
# -*- 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 base64
import cStringIO
import wizard
from osv import osv
import pooler
form_rep = '''<?xml version="1.0"?>
<form string="Standard entries">
<field name="name"/>
<newline/>
<field name="module_file"/>
</form>'''
fields_rep = {
'name': {'string': 'File name', 'type': 'char', 'required': True, 'help': 'Save report as .html format'},
'module_file': {'string': 'Save report', 'type': 'binary', 'required': True},
}
def get_detail(self, cr, uid, datas, context={}):
data = pooler.get_pool(cr.dbname).get('module.quality.detail').browse(cr, uid, datas['id'])
if not data.detail:
raise wizard.except_wizard(_('Warning'), _('No report to save!'))
buf = cStringIO.StringIO(data.detail)
out = base64.encodestring(buf.getvalue())
buf.close()
return {'module_file': out, 'name': data.name + '.html'}
class save_report(wizard.interface):
states = {
'init': {
'actions': [get_detail],
'result': {'type': 'form', 'arch': form_rep, 'fields':fields_rep, 'state': [('end','Cancel')]}
},
}
save_report('quality_detail_save')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,24 @@
# -*- 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/>.
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,150 @@
# -*- 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 xml.dom.minidom
import tools
from tools.translate import _
from base_module_quality import base_module_quality
import pooler
class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
super(quality_test, self).__init__()
self.name = _("Workflow Test")
self.note = _("This test checks where object has workflow or not on it if there is a state field and several buttons on it and also checks validity of workflow xml file")
self.bool_installed_only = True
return None
def run_test(self, cr, uid, module_path):
pool = pooler.get_pool(cr.dbname)
module_name = module_path.split('/')[-1]
obj_list = self.get_objects(cr, uid, module_name)
view_obj = pool.get('ir.ui.view')
view_ids = view_obj.search(cr, uid, [('model', 'in', obj_list), ('type', 'in', ['form'])])
view_data = view_obj.browse(cr, uid, view_ids)
field_obj = pool.get('ir.model.fields')
field_ids = field_obj.search(cr, uid, [('model', 'in', obj_list)])
field_data = field_obj.browse(cr, uid, field_ids)
wkf_obj = pool.get('workflow')
wkf_activity_obj = pool.get('workflow.activity')
state_check = []
wkf_avail = []
result_dict = {}
activity_chk = {}
bad_view = 0
good_view = 0
act_ok = 0
not_ok = 0
wkfs = []
if obj_list:
wkf_ids = wkf_obj.search(cr, uid, [('osv', 'in', obj_list)])
wkfs = wkf_obj.read(cr, uid, wkf_ids, ['osv'])
for i in wkfs:
activity_chk[i['osv']] = {'start': 'not_ok', 'stop': 'not_ok'}
wkf_avail.append(i['osv'])
model_ids = self.get_ids(cr, uid, [i['osv']])
if len(model_ids[i['osv']]) < 2: # to be modified..
bad_view += 1
result_dict[i['osv']] = [i['osv'], 'You should have enough demo data which allows testing of integrity of module and ensures the proper functioning of workflows']
else:
good_view += 1
wkf_ids = map(lambda x:x['id'], wkfs)
if not wkf_ids:
result_dict[module_name] = [module_name, 'No workflow defined on module']
#Activity of workflow checking...
activity_ids = wkf_activity_obj.search(cr, uid, [('wkf_id', 'in', wkf_ids)])
activities = wkf_activity_obj.browse(cr, uid, activity_ids)
for activity in activities:
if activity.flow_start:
activity_chk[activity.wkf_id.osv]['start'] = 'ok'
if activity.flow_stop:
activity_chk[activity.wkf_id.osv]['stop'] = 'ok'
activity_chk[activity.wkf_id.osv]['model'] = activity.wkf_id.osv
if activity.in_transitions and activity.out_transitions:
act_ok += 1
if not activity.in_transitions and not activity.out_transitions:
not_ok += 1
result_dict[activity.id] = [activity.name, 'Use less activity (improves readability and protects server resources)']
for act in activity_chk:
if activity_chk[act]['start'] == 'ok':
act_ok += 1
else:
not_ok += 1
result_dict[activity_chk[act]['model']] = [activity_chk[act]['model'], 'Workflow activities should have atleast one starting node']
if activity_chk[act]['stop'] == 'ok':
act_ok += 1
else:
not_ok += 1
result_dict[activity_chk[act]['model']] = [activity_chk[act]['model'], 'Workflow activities should have atleast one ending node']
score_general = act_ok and float(act_ok) / float(act_ok + not_ok)
# workflow defined on object or not checking..
for field in field_data:
if field.name == 'state':
state_check.append(field.model)
for view in view_data:
if view.model in state_check:
dom = xml.dom.minidom.parseString(view.arch)
node = dom.childNodes
count = self.count_button(node[0], count=0)
if count > 3 and not view.model in wkf_avail:
bad_view += 1
result_dict[view.model] = [view.model, 'The presence of a field state in object often indicative of a need for workflow behind. And connect them to ensure consistency in this field.']
elif count > 0 and view.model in wkf_avail:
good_view += 1
score_avail = good_view and float(good_view) / float(bad_view + good_view)
self.score = (score_general + score_avail) / 2
if not wkf_ids and not bad_view:
self.error = True
self.result = _("No Workflow define")
return None
self.result = self.get_result({module_name: [module_name, int(self.score * 100)]})
self.result_details += self.get_result_details(result_dict)
return None
def get_result(self, dict_wf):
header = ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n', [_('Module Name'), _('Result of views in %')])
if not self.error:
return self.format_table(header, data_list=dict_wf)
return ""
def get_result_details(self, dict_wf):
str_html = '''<html><head></head><body><table border="1">'''
header = ('<tr><th>%s</th><th>%s</th></tr>', [_('Object Name'), _('Feed back About Workflow of Module')])
if not self.error:
res = str_html + self.format_html_table(header, data_list=dict_wf) + '</table><newline/></body></html>'
return res
return ""
def count_button(self, node, count):
for node in node.childNodes:
if node.localName == 'button':
count += 1
if node.childNodes:
count = self.count_button(node, count)
return count
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: