diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py
index 29514311192..cce4bf85c80 100644
--- a/addons/account/__terp__.py
+++ b/addons/account/__terp__.py
@@ -19,9 +19,11 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
"name" : "Accounting and financial management",
- "version" : "1.0",
+ "version" : "1.1",
"depends" : ["product", "base", "process"],
"author" : "Tiny",
"description": """Financial and accounting module that covers:
@@ -33,43 +35,40 @@
Customer and Supplier Invoices
Bank statements
""",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Accounting",
- "init_xml" : [
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['product', 'base', 'process'],
+ 'init_xml': [],
+ 'update_xml': [
+ 'security/account_security.xml',
+ 'security/ir.model.access.csv',
+ 'account_menuitem.xml',
+ 'account_wizard.xml',
+ 'account_view.xml',
+ 'account_end_fy.xml',
+ 'account_invoice_view.xml',
+ 'account_report.xml',
+ 'partner_view.xml',
+ 'data/account_invoice.xml',
+ 'data/account_data2.xml',
+ 'account_invoice_workflow.xml',
+ 'project/project_view.xml',
+ 'project/project_report.xml',
+ 'product_view.xml',
+ 'account_assert_test.xml',
+ 'process/statement_process.xml',
+ 'process/customer_invoice_process.xml',
+ 'process/supplier_invoice_process.xml'
],
- "demo_xml" : [
- "account_demo.xml",
- "project/project_demo.xml",
- "project/analytic_account_demo.xml",
- "demo/account_minimal.xml",
- "account_unit_test.xml",
+ 'demo_xml': [
+ 'account_demo.xml',
+ 'project/project_demo.xml',
+ 'project/analytic_account_demo.xml',
+ 'demo/account_minimal.xml',
+ 'account_unit_test.xml'
],
- "update_xml" : [
- "security/account_security.xml",
- "security/ir.model.access.csv",
- "account_menuitem.xml",
- "account_wizard.xml",
- "account_view.xml",
- "account_end_fy.xml",
- "account_invoice_view.xml",
- "account_report.xml",
- "partner_view.xml",
- "data/account_invoice.xml",
- "data/account_data2.xml",
- "account_invoice_workflow.xml",
- "project/project_view.xml",
- "project/project_report.xml",
- "product_view.xml",
- "account_assert_test.xml",
- "process/statement_process.xml",
- "process/customer_invoice_process.xml",
- "process/supplier_invoice_process.xml",
- ],
- "translations" : {
- "fr": "i18n/french_fr.csv"
- },
- "active": False,
- "installable": True
+ 'installable': True,
+ 'active': False,
+ 'certificate': '80331923549',
}
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/account/account.py b/addons/account/account.py
index d5cb84674ba..dece8d18b21 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -154,7 +154,7 @@ class account_account(osv.osv):
args[pos] = ('id','in',ids1)
pos+=1
- if context and context.has_key('consolidate_childs'): #add concolidated childs of accounts
+ if context and context.has_key('consolidate_childs'): #add consolidated childs of accounts
ids = super(account_account,self).search(cr, uid, args, offset, limit,
order, context=context, count=count)
for consolidate_child in self.browse(cr, uid, context['account_id']).child_consol_ids:
@@ -166,15 +166,14 @@ class account_account(osv.osv):
def _get_children_and_consol(self, cr, uid, ids, context={}):
#this function search for all the children and all consolidated children (recursively) of the given account ids
- res = self.search(cr, uid, [('parent_id', 'child_of', ids)])
- for id in res:
- this = self.browse(cr, uid, id, context)
- for child in this.child_consol_ids:
- if child.id not in res:
- res.append(child.id)
- if len(res) != len(ids):
- return self._get_children_and_consol(cr, uid, res, context)
- return res
+ ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)], context=context)
+ ids3 = []
+ for rec in self.browse(cr, uid, ids2, context=context):
+ for child in rec.child_consol_ids:
+ ids3.append(child.id)
+ if ids3:
+ ids3 = self._get_children_and_consol(cr, uid, ids3, context)
+ return ids2+ids3
def __compute(self, cr, uid, ids, field_names, arg, context={}, query=''):
#compute the balance/debit/credit accordingly to the value of field_name for the given account ids
@@ -1224,15 +1223,15 @@ class account_tax(osv.osv):
#
'base_code_id': fields.many2one('account.tax.code', 'Base Code', help="Use this code for the VAT declaration."),
'tax_code_id': fields.many2one('account.tax.code', 'Tax Code', help="Use this code for the VAT declaration."),
- 'base_sign': fields.float('Base Code Sign', help="Usualy 1 or -1."),
- 'tax_sign': fields.float('Tax Code Sign', help="Usualy 1 or -1."),
+ 'base_sign': fields.float('Base Code Sign', help="Usually 1 or -1."),
+ 'tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."),
# Same fields for refund invoices
'ref_base_code_id': fields.many2one('account.tax.code', 'Refund Base Code', help="Use this code for the VAT declaration."),
'ref_tax_code_id': fields.many2one('account.tax.code', 'Refund Tax Code', help="Use this code for the VAT declaration."),
- 'ref_base_sign': fields.float('Base Code Sign', help="Usualy 1 or -1."),
- 'ref_tax_sign': fields.float('Tax Code Sign', help="Usualy 1 or -1."),
+ 'ref_base_sign': fields.float('Base Code Sign', help="Usually 1 or -1."),
+ 'ref_tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."),
'include_base_amount': fields.boolean('Include in base amount', help="Indicate if the amount of tax must be included in the base amount for the computation of the next taxes"),
'company_id': fields.many2one('res.company', 'Company', required=True),
'description': fields.char('Internal Name',size=32),
@@ -1594,7 +1593,7 @@ class account_config_wizard(osv.osv_memory):
ids=module_obj.search(cr, uid, [('category_id', '=', 'Account Charts'), ('state', '<>', 'installed')])
res=[(m.id, m.shortdesc) for m in module_obj.browse(cr, uid, ids)]
res.append((-1, 'None'))
- res.sort(lambda x,y: cmp(x[1],y[1]))
+ res.sort(key=lambda x: x[1])
return res
_columns = {
@@ -1621,25 +1620,12 @@ class account_config_wizard(osv.osv_memory):
'target':'new',
}
- def install_account_chart(self, cr, uid,ids, context=None):
+ def install_account_chart(self, cr, uid, ids, context=None):
for res in self.read(cr,uid,ids):
- id = res['charts']
- def install(id):
+ chart_id = res['charts']
+ if chart_id > 0:
mod_obj = self.pool.get('ir.module.module')
- mod_obj.write(cr , uid, [id] ,{'state' : 'to install'})
- mod_obj.download(cr, uid, [id], context=context)
- cr.commit()
- cr.execute("select m.id as id from ir_module_module_dependency d inner join ir_module_module m on (m.name=d.name) where d.module_id=%s and m.state='uninstalled'",(id,))
- ret = cr.fetchall()
- if len(ret):
- for r in ret:
- install(r[0])
- else:
- mod_obj.write(cr , uid, [id] ,{'state' : 'to install'})
- mod_obj.download(cr, uid, [id], context=context)
- cr.commit()
- if id>0:
- install(id)
+ mod_obj.button_install(cr, uid, [chart_id], context=context)
cr.commit()
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 3bb49a94f7b..a6d44eda261 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -493,7 +493,7 @@ class account_move_line(osv.osv):
merges_rec = []
for line in self.browse(cr, uid, ids, context):
if line.reconcile_id:
- raise _('Already Reconciled')
+ raise osv.except_osv(_('Already Reconciled'), _('Already Reconciled'))
if line.reconcile_partial_id:
for line2 in line.reconcile_partial_id.line_partial_ids:
if not line2.reconcile_id:
@@ -791,6 +791,7 @@ class account_move_line(osv.osv):
move_id = vals.get('move_id', False)
journal = self.pool.get('account.journal').browse(cr, uid, context['journal_id'])
+ is_new_move = False
if not move_id:
if journal.centralisation:
# use the first move ever created for this journal and period
@@ -815,10 +816,7 @@ class account_move_line(osv.osv):
vals['move_id'] = move_id
else:
raise osv.except_osv(_('No piece number !'), _('Can not create an automatic sequence for this piece !\n\nPut a sequence in the journal definition for automatic numbering or create a sequence manually for this piece.'))
- else:
- if 'date' in vals:
- self.pool.get('account.move').write(cr, uid, [move_id], {'date':vals['date']}, context=context)
- del vals['date']
+ is_new_move = True
ok = not (journal.type_control_ids or journal.account_control_ids)
if ('account_id' in vals):
@@ -931,6 +929,8 @@ class account_move_line(osv.osv):
if data['tax_code_id']:
self.create(cr, uid, data, context)
+ if not is_new_move and 'date' in vals:
+ self.pool.get('account.move').write(cr, uid, [move_id], {'date':vals['date']}, context=context)
if check:
tmp = self.pool.get('account.move').validate(cr, uid, [vals['move_id']], context)
if journal.entry_posted and tmp:
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index d7762e3a503..64a1c31da64 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -31,7 +31,7 @@ from tools import config
from tools.translate import _
class account_invoice(osv.osv):
- def _amount_all(self, cr, uid, ids, name, args, context={}):
+ def _amount_all(self, cr, uid, ids, name, args, context=None):
res = {}
for invoice in self.browse(cr,uid,ids, context=context):
res[invoice.id] = {
@@ -47,6 +47,8 @@ class account_invoice(osv.osv):
return res
def _get_journal(self, cr, uid, context):
+ if context is None:
+ context = {}
type_inv = context.get('type', 'out_invoice')
type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale', 'in_refund': 'purchase'}
journal_obj = self.pool.get('account.journal')
@@ -63,7 +65,7 @@ class account_invoice(osv.osv):
else:
return pooler.get_pool(cr.dbname).get('res.currency').search(cr, uid, [('rate','=',1.0)])[0]
- def _get_journal_analytic(self, cr, uid, type_inv, context={}):
+ def _get_journal_analytic(self, cr, uid, type_inv, context=None):
type2journal = {'out_invoice': 'sale', 'in_invoice': 'purchase', 'out_refund': 'sale', 'in_refund': 'purchase'}
tt = type2journal.get(type_inv, 'sale')
result = self.pool.get('account.analytic.journal').search(cr, uid, [('type','=',tt)], context=context)
@@ -71,7 +73,9 @@ class account_invoice(osv.osv):
raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal of type '%s' !") % (tt,))
return result[0]
- def _get_type(self, cr, uid, context={}):
+ def _get_type(self, cr, uid, context=None):
+ if context is None:
+ context = {}
type = context.get('type', 'out_invoice')
return type
@@ -84,7 +88,7 @@ class account_invoice(osv.osv):
def _get_reference_type(self, cr, uid, context=None):
return [('none', _('Free Reference'))]
- def _amount_residual(self, cr, uid, ids, name, args, context={}):
+ def _amount_residual(self, cr, uid, ids, name, args, context=None):
res = {}
data_inv = self.browse(cr, uid, ids)
for inv in data_inv:
@@ -113,19 +117,19 @@ class account_invoice(osv.osv):
res[id]=[x for x in l if x <> line.id]
return res
- def _get_invoice_line(self, cr, uid, ids, context={}):
+ def _get_invoice_line(self, cr, uid, ids, context=None):
result = {}
for line in self.pool.get('account.invoice.line').browse(cr, uid, ids, context=context):
result[line.invoice_id.id] = True
return result.keys()
- def _get_invoice_tax(self, cr, uid, ids, context={}):
+ def _get_invoice_tax(self, cr, uid, ids, context=None):
result = {}
for tax in self.pool.get('account.invoice.tax').browse(cr, uid, ids, context=context):
result[tax.invoice_id.id] = True
return result.keys()
- def _compute_lines(self, cr, uid, ids, name, args, context={}):
+ def _compute_lines(self, cr, uid, ids, name, args, context=None):
result = {}
for invoice in self.browse(cr, uid, ids, context):
moves = self.move_line_id_payment_get(cr, uid, [invoice.id])
@@ -373,7 +377,7 @@ class account_invoice(osv.osv):
ok = ok and bool(cr.fetchone()[0])
return ok
- def button_reset_taxes(self, cr, uid, ids, context={}):
+ def button_reset_taxes(self, cr, uid, ids, context=None):
ait_obj = self.pool.get('account.invoice.tax')
for id in ids:
cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s", (id,))
@@ -381,7 +385,7 @@ class account_invoice(osv.osv):
ait_obj.create(cr, uid, taxe)
return True
- def button_compute(self, cr, uid, ids, context={}, set_total=False):
+ def button_compute(self, cr, uid, ids, context=None, set_total=False):
self.button_reset_taxes(cr, uid, ids, context)
for inv in self.browse(cr, uid, ids):
if set_total:
@@ -626,7 +630,7 @@ class account_invoice(osv.osv):
self._log_event(cr, uid, ids)
return True
- def line_get_convert(self, cr, uid, x, part, date, context={}):
+ def line_get_convert(self, cr, uid, x, part, date, context=None):
return {
'date_maturity': x.get('date_maturity', False),
'partner_id':part,
@@ -717,7 +721,7 @@ class account_invoice(osv.osv):
self.pool.get('res.partner.event').create(cr, uid, {'name':'Invoice: '+name, 'som':False, 'description':name+' '+str(inv['id']), 'document':name, 'partner_id':part, 'date':time.strftime('%Y-%m-%d %H:%M:%S'), 'canal_id':False, 'user_id':uid, 'partner_type':partnertype, 'probability':1.0, 'planned_revenue':pr, 'planned_cost':pc, 'type':eventtype})
return len(invs)
- def name_get(self, cr, uid, ids, context={}):
+ def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
types = {
@@ -731,7 +735,7 @@ class account_invoice(osv.osv):
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=80):
if not args:
args=[]
- if not context:
+ if context is None:
context={}
ids = []
if name:
@@ -809,7 +813,9 @@ class account_invoice(osv.osv):
new_ids.append(self.create(cr, uid, invoice))
return new_ids
- def pay_and_reconcile(self, cr, uid, ids, pay_amount, pay_account_id, period_id, pay_journal_id, writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context={}, name=''):
+ def pay_and_reconcile(self, cr, uid, ids, pay_amount, pay_account_id, period_id, pay_journal_id, writeoff_acc_id, writeoff_period_id, writeoff_journal_id, context=None, name=''):
+ if context is None:
+ context = {}
#TODO check if we can use different period for payment and the writeoff line
assert len(ids)==1, "Can only pay one invoice at a time"
invoice = self.browse(cr, uid, ids[0])
@@ -871,7 +877,9 @@ class account_invoice_line(osv.osv):
res[line.id] = round(line.price_unit * line.quantity * (1-(line.discount or 0.0)/100.0),2)
return res
- def _price_unit_default(self, cr, uid, context={}):
+ def _price_unit_default(self, cr, uid, context=None):
+ if context is None:
+ context = {}
if 'check_total' in context:
t = context['check_total']
for l in context.get('invoice_line', {}):
@@ -910,7 +918,7 @@ class account_invoice_line(osv.osv):
'price_unit': _price_unit_default,
}
- def product_id_change_unit_price_inv(self, cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context={}):
+ def product_id_change_unit_price_inv(self, cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=None):
tax_obj = self.pool.get('account.tax')
if price_unit:
taxes = tax_obj.browse(cr, uid, tax_id)
@@ -918,7 +926,9 @@ class account_invoice_line(osv.osv):
price_unit = price_unit - tax['amount']
return {'price_unit': price_unit,'invoice_line_tax_id': tax_id}
- def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, price_unit=False, address_invoice_id=False, context={}):
+ def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, price_unit=False, address_invoice_id=False, context=None):
+ if context is None:
+ context = {}
if not partner_id:
raise osv.except_osv(_('No Partner Defined !'),_("You must first select a partner !") )
if not product:
@@ -965,7 +975,7 @@ class account_invoice_line(osv.osv):
domain = {'uos_id':[('category_id','=',res2 )]}
return {'value':result, 'domain':domain}
- def move_line_get(self, cr, uid, invoice_id, context={}):
+ def move_line_get(self, cr, uid, invoice_id, context=None):
res = []
tax_grouped = {}
tax_obj = self.pool.get('account.tax')
@@ -1007,7 +1017,7 @@ class account_invoice_line(osv.osv):
res[-1]['tax_amount'] = cur_obj.compute(cr, uid, inv.currency_id.id, company_currency, tax_amount, context={'date': inv.date_invoice})
return res
- def move_line_get_item(self, cr, uid, line, context={}):
+ def move_line_get_item(self, cr, uid, line, context=None):
return {
'type':'src',
'name': line.name[:64],
diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml
index e1a65319898..74c873f9374 100644
--- a/addons/account/report/invoice.rml
+++ b/addons/account/report/invoice.rml
@@ -297,7 +297,7 @@
-
+
Description
@@ -312,7 +312,7 @@
Unit Price
- Disc. (%)
+ Disc.(%)
Price
@@ -350,7 +350,7 @@
- [[ format(l.note or removeParentNode('tr')) ]]
+ [[ format(l.note) or removeParentNode('tr') ]]
@@ -463,7 +463,7 @@
-
+
@@ -541,7 +541,7 @@
- [[ format(o.comment or removeParentNode('blockTable')) ]]
+ [[ format(o.comment) or removeParentNode('blockTable') ]]
@@ -551,7 +551,7 @@
- [[ format((o.payment_term and o.payment_term.note) or removeParentNode('blockTable')) ]]
+ [[ format(o.payment_term and o.payment_term.note) or removeParentNode('blockTable') ]]
diff --git a/addons/account/wizard/wizard_bank_reconcile.py b/addons/account/wizard/wizard_bank_reconcile.py
index 02e52cd2c65..9ac1053b125 100644
--- a/addons/account/wizard/wizard_bank_reconcile.py
+++ b/addons/account/wizard/wizard_bank_reconcile.py
@@ -37,7 +37,7 @@ def _action_open_window(self, cr, uid, data, context):
cr.execute('select default_credit_account_id from account_journal where id=%s', (form['journal_id'],))
account_id = cr.fetchone()[0]
if not account_id:
- raise Exception, _('You have to define the bank account\nin the journal definition for reconciliation.')
+ raise wizard.except_wizard(_('Error'), _('You have to define the bank account\nin the journal definition for reconciliation.'))
return {
'domain': "[('journal_id','=',%d), ('account_id','=',%d), ('state','<>','draft')]" % (form['journal_id'],account_id),
'name': _('Standard Encoding'),
diff --git a/addons/account/wizard/wizard_fiscalyear_close.py b/addons/account/wizard/wizard_fiscalyear_close.py
index c30878aae71..7f1928d816c 100644
--- a/addons/account/wizard/wizard_fiscalyear_close.py
+++ b/addons/account/wizard/wizard_fiscalyear_close.py
@@ -51,18 +51,19 @@ def _data_load(self, cr, uid, data, context):
def _data_save(self, cr, uid, data, context):
if not data['form']['sure']:
- raise wizard.except_wizard(_('UserError'), _('Closing of fiscal year canceled, please check the box !'))
+ raise wizard.except_wizard(_('UserError'), _('Closing of fiscal year cancelled, please check the box !'))
pool = pooler.get_pool(cr.dbname)
fy_id = data['form']['fy_id']
+ new_fyear = pool.get('account.fiscalyear').browse(cr, uid, data['form']['fy2_id'])
+ start_jp = new_fyear.start_journal_period_id
+
if data['form']['report_new']:
periods_fy2 = pool.get('account.fiscalyear').browse(cr, uid, data['form']['fy2_id']).period_ids
if not periods_fy2:
raise wizard.except_wizard(_('UserError'),
_('There are no periods defined on New Fiscal Year.'))
period=periods_fy2[0]
- new_fyear = pool.get('account.fiscalyear').browse(cr, uid, data['form']['fy2_id'])
- start_jp = new_fyear.start_journal_period_id
if not start_jp:
raise wizard.except_wizard(_('UserError'),
_('The new fiscal year should have a journal for new entries define on it'))
@@ -98,7 +99,7 @@ def _data_save(self, cr, uid, data, context):
'period_id': period.id,
'account_id': account.id
}, {'journal_id': new_journal.id, 'period_id':period.id})
- if accnt_type_data.close_method=='unreconciled':
+ if accnt_type_data.close_method == 'unreconciled':
offset = 0
limit = 100
while True:
@@ -162,8 +163,8 @@ def _data_save(self, cr, uid, data, context):
cr.execute('UPDATE account_period SET state = %s ' \
'WHERE fiscalyear_id = %s', ('done',fy_id))
cr.execute('UPDATE account_fiscalyear ' \
- 'SET state = %s, end_journal_period_id = %s' \
- 'WHERE id = %s', ('done',start_jp,fy_id))
+ 'SET state = %s, end_journal_period_id = %s ' \
+ 'WHERE id = %s', ('done', start_jp and start_jp.id or None, fy_id))
return {}
class wiz_journal_close(wizard.interface):
diff --git a/addons/account_analytic_analysis/__terp__.py b/addons/account_analytic_analysis/__terp__.py
index 28a2aeec8b5..b45b828c2a8 100644
--- a/addons/account_analytic_analysis/__terp__.py
+++ b/addons/account_analytic_analysis/__terp__.py
@@ -19,12 +19,16 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "report_account_analytic",
- "description": """Modify account analytic view to show
+ 'name': 'report_account_analytic',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Accounting',
+ 'description': """Modify account analytic view to show
important data for project manager of services companies.
Add menu to show relevant information for each manager.""",
- "version" : "1.0",
+ "version" : "1.1",
"author" : "Camptocamp",
"category" : "Generic Modules/Accounting",
"module": "",
@@ -36,10 +40,9 @@ Add menu to show relevant information for each manager.""",
"account_analytic_analysis_view.xml",
"account_analytic_analysis_menu.xml",
],
- "demo_xml" : [],
- "active": False,
- "installable": True
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '42927202589',
}
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_analytic_default/__terp__.py b/addons/account_analytic_default/__terp__.py
index d8d7b908ed9..ae3e599119d 100644
--- a/addons/account_analytic_default/__terp__.py
+++ b/addons/account_analytic_default/__terp__.py
@@ -19,13 +19,13 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Account Analytic Default",
- "version" : "1.0",
- "author" : "Tiny",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Accounting",
- "description": """
+ 'name': 'Account Analytic Default',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Accounting',
+ 'description': """
Allows to automatically select analytic accounts based on criterions:
* Product
* Partner
@@ -33,14 +33,14 @@ Allows to automatically select analytic accounts based on criterions:
* Company
* Date
""",
- "depends" : ['account'],
- "init_xml" : [],
- "demo_xml" : [],
- "update_xml" : [
- "security/ir.model.access.csv",
- "account_analytic_default_view.xml"],
- "active": False,
- "installable": True
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['account'],
+ 'init_xml': [],
+ 'update_xml': ['security/ir.model.access.csv', 'account_analytic_default_view.xml'],
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '74229833581',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_analytic_plans/__terp__.py b/addons/account_analytic_plans/__terp__.py
index e1274107e00..4aa0112276f 100644
--- a/addons/account_analytic_plans/__terp__.py
+++ b/addons/account_analytic_plans/__terp__.py
@@ -19,12 +19,13 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Multiple-plans management in Analytic Accounting",
- "version" : "1.0",
- "depends" : ["account", "account_analytic_default"],
- "author" : "Tiny",
- "description": """This module allows to use several analytic plans, according to the general journal,
+ 'name': 'Multiple-plans management in Analytic Accounting',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Accounting',
+ 'description': """This module allows to use several analytic plans, according to the general journal,
so that multiple analytic lines are created when the invoice or the entries
are confirmed.
@@ -52,19 +53,19 @@ Plan2:
So when this line of invoice will be confirmed, it will generate 3 analytic lines,
for one account entry.
""",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Accounting",
- "init_xml" : [
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['account', 'account_analytic_default'],
+ 'init_xml': [],
+ 'update_xml': [
+ 'security/ir.model.access.csv',
+ 'model_wizard.xml',
+ 'account_analytic_plans_view.xml',
+ 'account_analytic_plans_report.xml'
],
- "demo_xml" : [
- ],
- "update_xml" : [
- "security/ir.model.access.csv",
- "model_wizard.xml","account_analytic_plans_view.xml",
- "account_analytic_plans_report.xml"],
-
- "active": False,
- "installable": True
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '36417675373',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_balance/__terp__.py b/addons/account_balance/__terp__.py
index 11a7e7dc1d2..05de61e62ae 100644
--- a/addons/account_balance/__terp__.py
+++ b/addons/account_balance/__terp__.py
@@ -19,12 +19,13 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Accounting and financial management-Compare Accounts",
- "version" : "1.1",
- "depends" : ["account"],
- "author" : "Tiny",
- "description": """Account Balance Module is an added functionality to the Financial Management module.
+ 'name': 'Accounting and financial management-Compare Accounts',
+ 'version': '1.1',
+ 'category': 'Generic Modules/Accounting',
+ 'description': """Account Balance Module is an added functionality to the Financial Management module.
This module gives you the various options for printing balance sheet.
@@ -38,17 +39,14 @@
5. You have an option to print the desired report in Landscape format.
""",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Accounting",
- "init_xml" : [
- ],
- "demo_xml" : [],
- "update_xml" : ["account_report.xml","account_wizard.xml",],
-# "translations" : {
-# "fr": "i18n/french_fr.csv"
-# },
- "active": False,
- "installable": True
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['account'],
+ 'init_xml': [],
+ 'update_xml': ['account_report.xml', 'account_wizard.xml'],
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '81928745309',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_budget/__terp__.py b/addons/account_budget/__terp__.py
index 5bb24c1b24a..bcb1ab7ffd6 100644
--- a/addons/account_budget/__terp__.py
+++ b/addons/account_budget/__terp__.py
@@ -19,13 +19,13 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Budget Management",
- "version" : "1.0",
- "author" : "Tiny",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Accounting",
- "description": """This module allows accountants to manage analytic and crossovered budgets.
+ 'name': 'Budget Management',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Accounting',
+ 'description': """This module allows accountants to manage analytic and crossovered budgets.
Once the Master Budgets and the Budgets defined (in Financial
Management/Budgets/), the Project Managers can set the planned amount on each
@@ -44,15 +44,20 @@ Three reports are available:
3. The last one is available from the Analytic Chart of Accounts. It gives the spreading, for the selected Analytic Accounts, of the Master Budgets per Budgets.
""",
- "depends" : ["account"],
- "init_xml" : [],
- "demo_xml" : ["crossovered_budget_demo.xml"],
- "update_xml" : [
- "security/ir.model.access.csv","account_budget_wizard.xml",
- "crossovered_budget_view.xml","crossovered_budget_report.xml","crossovered_budget_workflow.xml"
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['account'],
+ 'init_xml': [],
+ 'update_xml': [
+ 'security/ir.model.access.csv',
+ 'account_budget_wizard.xml',
+ 'crossovered_budget_view.xml',
+ 'crossovered_budget_report.xml',
+ 'crossovered_budget_workflow.xml'
],
- "active": False,
- "installable": True
+ 'demo_xml': ['crossovered_budget_demo.xml'],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '43819694157',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_chart/__terp__.py b/addons/account_chart/__terp__.py
index b87b690e475..bb3aee9760c 100644
--- a/addons/account_chart/__terp__.py
+++ b/addons/account_chart/__terp__.py
@@ -19,24 +19,20 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Charts of Accounts",
- "version" : "1.1",
- "depends" : ["account"],
- "author" : "Tiny",
- "description": """Remove minimal account chart""",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Accounting",
- "init_xml" : [
- ],
- "demo_xml" : [
- ],
- "update_xml" : [
-# Must be loaded by each modules
-# "account_chart.xml",
- ],
- "installable": True
+ 'name': 'Charts of Accounts',
+ 'version': '1.1',
+ 'category': 'Generic Modules/Accounting',
+ 'description': """Remove minimal account chart""",
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['account'],
+ 'init_xml': [],
+ 'update_xml': [],
+ 'demo_xml': [],
+ 'installable': True,
+ 'certificate': '73332443901',
}
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_date_check/__terp__.py b/addons/account_date_check/__terp__.py
index 5773993fe7b..9f38a0c5305 100644
--- a/addons/account_date_check/__terp__.py
+++ b/addons/account_date_check/__terp__.py
@@ -19,16 +19,13 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Account Date check",
- "version" : "1.0",
- "author" : "Tiny",
- "website" : "http://www.openerp.com",
- "depends" : ["account"],
- "category" : "Generic Modules/Accounting",
- "init_xml" : [],
- "demo_xml" : [],
- "description": """
+ 'name': 'Account Date check',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Accounting',
+ 'description': """
* Adds a field on journals: "Allows date not in the period"
* By default, this field is checked.
@@ -37,11 +34,14 @@ period when you create an account entry. Otherwise, it generates an
error message: "The date of your account move is not in the defined
period !"
""",
- "update_xml" : [
- "account_date_check_view.xml",
- ],
- "active": False,
- "installable": True
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['account'],
+ 'init_xml': [],
+ 'update_xml': ['account_date_check_view.xml'],
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '66174843389',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_followup/__terp__.py b/addons/account_followup/__terp__.py
index faf5e6f1dd9..5c58289f215 100644
--- a/addons/account_followup/__terp__.py
+++ b/addons/account_followup/__terp__.py
@@ -19,12 +19,13 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Accounting follow-ups management",
- "version" : "1.0",
- "depends" : ["account"],
- "author" : "Tiny",
- "description": """
+ 'name': 'Accounting follow-ups management',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Accounting',
+ 'description': """
Modules to automate letters for unpaid invoices, with multi-level recalls.
You can define your multiple levels of recall through the menu:
@@ -37,20 +38,19 @@
It will generate a PDF with all the letters according the the
different levels of recall defined. You can define different policies
for different companies.""",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Accounting",
- "init_xml" : [],
- "demo_xml" : ["followup_demo.xml"],
- "update_xml" : [
- "security/ir.model.access.csv",
- "wizard/wizard_view.xml",
- "followup_view.xml",
- "followup_report_view.xml",
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['account'],
+ 'init_xml': [],
+ 'update_xml': [
+ 'security/ir.model.access.csv',
+ 'wizard/wizard_view.xml',
+ 'followup_view.xml',
+ 'followup_report_view.xml'
],
- "active": False,
- "installable": True
+ 'demo_xml': ['followup_demo.xml'],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '72481076453',
}
-
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_invoice_layout/__terp__.py b/addons/account_invoice_layout/__terp__.py
index 03c85f76f66..05389645833 100644
--- a/addons/account_invoice_layout/__terp__.py
+++ b/addons/account_invoice_layout/__terp__.py
@@ -19,12 +19,13 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "account_invoice_layout",
- "version" : "1.0",
- "depends" : ["base", "account"],
- "author" : "Tiny",
- "description": """
+ 'name': 'account_invoice_layout',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Projects & Services',
+ 'description': """
This module provides some features to improve the layout of the invoices.
It gives you the possibility to
@@ -35,17 +36,18 @@
Moreover, there is one option which allow you to print all the selected invoices with a given special message at the bottom of it. This feature can be very useful for printing your invoices with end-of-year wishes, special punctual conditions...
""",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Projects & Services",
- "init_xml" : [],
- "demo_xml" : [],
- "update_xml" : [
- "security/ir.model.access.csv",
- "account_invoice_layout_view.xml",
- "account_invoice_layout_report.xml",
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['base', 'account'],
+ 'init_xml': [],
+ 'update_xml': [
+ 'security/ir.model.access.csv',
+ 'account_invoice_layout_view.xml',
+ 'account_invoice_layout_report.xml'
],
- "active": False,
- "installable": True
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '57235078173',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_invoice_layout/report/report_account_invoice_layout.rml b/addons/account_invoice_layout/report/report_account_invoice_layout.rml
index 9690d42236a..e118288b547 100644
--- a/addons/account_invoice_layout/report/report_account_invoice_layout.rml
+++ b/addons/account_invoice_layout/report/report_account_invoice_layout.rml
@@ -287,11 +287,11 @@
-[[ format(o.comment or '') ]]
+[[ format(o.comment) or '' ]]
-[[ format((o.payment_term and o.payment_term.note) or '') ]]
+[[ format(o.payment_term and o.payment_term.note) or '' ]]
diff --git a/addons/account_invoice_layout/report/special_message_invoice.rml b/addons/account_invoice_layout/report/special_message_invoice.rml
index 1e146007883..e29f845e185 100644
--- a/addons/account_invoice_layout/report/special_message_invoice.rml
+++ b/addons/account_invoice_layout/report/special_message_invoice.rml
@@ -287,11 +287,11 @@
-[[ format(o.comment or '') ]]
+[[ format(o.comment) or '' ]]
-[[ format((o.payment_term and o.payment_term.note) or '') ]]
+[[ format(o.payment_term and o.payment_term.note) or '' ]][[ repeatIn((spcl_msg(data['form']) and spcl_msg(data['form']).splitlines()) or [], 'note') ]][[ note or removeParentNode('para') ]]
diff --git a/addons/account_payment/__terp__.py b/addons/account_payment/__terp__.py
index 50f8c4dea74..348b9b1ce08 100644
--- a/addons/account_payment/__terp__.py
+++ b/addons/account_payment/__terp__.py
@@ -19,9 +19,11 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
"name": "Payment Management",
- "version": "1.0",
+ "version": "1.1",
"author": "Tiny",
"category": "Generic Modules/Payment",
"depends": ["account"],
@@ -31,21 +33,22 @@
* a more efficient way to manage invoice payment.
* a basic mechanism to easily plug various automated payment.
""",
- "demo_xml": [],
- "update_xml": [
- "security/account_payment_security.xml",
- "security/ir.model.access.csv",
- "payment_wizard.xml",
- "payment_view.xml",
- "payment_workflow.xml",
- "payment_sequence.xml",
- "account_invoice_view.xml",
- "payment_report.xml",
+ 'author': 'Tiny',
+ 'depends': ['account'],
+ 'init_xml': [],
+ 'update_xml': [
+ 'security/account_payment_security.xml',
+ 'security/ir.model.access.csv',
+ 'payment_wizard.xml',
+ 'payment_view.xml',
+ 'payment_workflow.xml',
+ 'payment_sequence.xml',
+ 'account_invoice_view.xml',
+ 'payment_report.xml'
],
- "active": False,
- "installable": True
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '61703998541',
}
-
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_report/__terp__.py b/addons/account_report/__terp__.py
index ad8e36fe955..4b7e64864fc 100644
--- a/addons/account_report/__terp__.py
+++ b/addons/account_report/__terp__.py
@@ -19,31 +19,29 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Reporting for accounting",
- "version" : "1.0",
- "depends" : ["account"],
- "author" : "Tiny",
- "description": """Financial and accounting reporting
+ 'name': 'Reporting for accounting',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Accounting',
+ 'description': """Financial and accounting reporting
Fiscal statements
Indicators
""",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Accounting",
- "init_xml" : [ ],
- "demo_xml" : [ ],
- "update_xml" : [
- "security/ir.model.access.csv",
- "account_view.xml",
- "account_report.xml",
- "account_wizard.xml",
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['account'],
+ 'init_xml': [],
+ 'update_xml': [
+ 'security/ir.model.access.csv',
+ 'account_view.xml',
+ 'account_report.xml',
+ 'account_wizard.xml'
],
-# "translations" : {
-# "fr": "i18n/french_fr.csv"
-# },
- "active": False,
- "installable": True
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '50976406925',
}
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_reporting/__terp__.py b/addons/account_reporting/__terp__.py
index a5863cbaaf4..4f98660da09 100644
--- a/addons/account_reporting/__terp__.py
+++ b/addons/account_reporting/__terp__.py
@@ -19,27 +19,26 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Reporting of Balancesheet for accounting",
- "version" : "1.0",
- "depends" : ["account"],
- "author" : "Tiny",
- "description": """Financial and accounting reporting
+ 'name': 'Reporting of Balancesheet for accounting',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Accounting',
+ 'description': """Financial and accounting reporting
Balance Sheet Report""",
- "category" : "Generic Modules/Accounting",
- "init_xml" : [ ],
- "demo_xml" : [ ],
- "update_xml" : [
- "security/ir.model.access.csv",
- "account_view.xml",
- "account_report.xml",
- "account_data.xml",
+ 'author': 'Tiny',
+ 'depends': ['account'],
+ 'init_xml': [],
+ 'update_xml': [
+ 'security/ir.model.access.csv',
+ 'account_view.xml',
+ 'account_report.xml',
+ 'account_data.xml'
],
-# "translations" : {
-# "fr": "i18n/french_fr.csv"
-# },
- "active": False,
- "installable": True
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '72305016797',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_tax_include/__terp__.py b/addons/account_tax_include/__terp__.py
index f889777b3a3..9e8c138cd41 100644
--- a/addons/account_tax_include/__terp__.py
+++ b/addons/account_tax_include/__terp__.py
@@ -19,24 +19,25 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Invoices and prices with taxes included",
- "version" : "1.0",
- "depends" : ["account"],
- "author" : "Tiny",
- "description": """Allow the user to work tax included prices.
+ 'name': 'Invoices and prices with taxes included',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Accounting',
+ 'description': """Allow the user to work tax included prices.
Especially useful for b2c businesses.
This module implement the modification on the invoice form.
""",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Accounting",
- "init_xml" : [ ],
- "demo_xml" : [ ],
- "update_xml" : [ 'invoice_tax_incl.xml' ],
- "active": False,
- "installable": True
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['account'],
+ 'init_xml': [],
+ 'update_xml': ['invoice_tax_incl.xml'],
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '70514190381',
}
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/account_tax_include/invoice_tax_incl.py b/addons/account_tax_include/invoice_tax_incl.py
index 1b76b9a17da..cb5345dcb39 100644
--- a/addons/account_tax_include/invoice_tax_incl.py
+++ b/addons/account_tax_include/invoice_tax_incl.py
@@ -40,7 +40,7 @@ account_invoice()
class account_invoice_line(osv.osv):
_inherit = "account.invoice.line"
- def _amount_line2(self, cr, uid, ids, name, args, context={}):
+ def _amount_line2(self, cr, uid, ids, name, args, context=None):
"""
Return the subtotal excluding taxes with respect to price_type.
"""
@@ -87,7 +87,9 @@ class account_invoice_line(osv.osv):
res[line.id]['price_subtotal_incl']= round(res[line.id]['price_subtotal_incl'], 2)
return res
- def _price_unit_default(self, cr, uid, context={}):
+ def _price_unit_default(self, cr, uid, context=None):
+ if context is None:
+ context = {}
if 'check_total' in context:
t = context['check_total']
if context.get('price_type', False) == 'tax_included':
@@ -116,7 +118,7 @@ class account_invoice_line(osv.osv):
'price_unit': _price_unit_default,
}
- def move_line_get_item(self, cr, uid, line, context={}):
+ def move_line_get_item(self, cr, uid, line, context=None):
return {
'type':'src',
'name':line.name,
@@ -129,28 +131,30 @@ class account_invoice_line(osv.osv):
'account_analytic_id':line.account_analytic_id.id,
}
-# TODO: check why ?
-#
-# def product_id_change_unit_price_inv(self, cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context={}):
-# if context.get('price_type', False) == 'tax_included':
-# return {'price_unit': price_unit,'invoice_line_tax_id': tax_id}
-# else:
-# return super(account_invoice_line, self).product_id_change_unit_price_inv(cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=context)
-#
-# def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, price_unit=False, address_invoice_id=False, price_type='tax_excluded', context={}):
-# context.update({'price_type': price_type})
-# return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, price_unit, address_invoice_id, context=context)
+ def product_id_change_unit_price_inv(self, cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=None):
+ if context is None:
+ context = {}
+ # if the tax is already included, just return the value without calculations
+ if context.get('price_type', False) == 'tax_included':
+ return {'price_unit': price_unit,'invoice_line_tax_id': tax_id}
+ else:
+ return super(account_invoice_line, self).product_id_change_unit_price_inv(cr, uid, tax_id, price_unit, qty, address_invoice_id, product, partner_id, context=context)
+
+ def product_id_change(self, cr, uid, ids, product, uom, qty=0, name='', type='out_invoice', partner_id=False, price_unit=False, address_invoice_id=False, price_type='tax_excluded', context=None):
+ # note: will call product_id_change_unit_price_inv with context...
+ if context is None:
+ context = {}
+ context.update({'price_type': price_type})
+ return super(account_invoice_line, self).product_id_change(cr, uid, ids, product, uom, qty, name, type, partner_id, price_unit, address_invoice_id, context=context)
account_invoice_line()
class account_invoice_tax(osv.osv):
_inherit = "account.invoice.tax"
- def compute(self, cr, uid, invoice_id, context={}):
+ def compute(self, cr, uid, invoice_id, context=None):
inv = self.pool.get('account.invoice').browse(cr, uid, invoice_id)
line_ids = map(lambda x: x.id, inv.invoice_line)
-
-
tax_grouped = {}
tax_obj = self.pool.get('account.tax')
cur_obj = self.pool.get('res.currency')
diff --git a/addons/account_voucher/__terp__.py b/addons/account_voucher/__terp__.py
index 1eea24579c9..d8991034e59 100755
--- a/addons/account_voucher/__terp__.py
+++ b/addons/account_voucher/__terp__.py
@@ -19,11 +19,13 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Accounting - Voucher Management",
- "version" : "1.0",
- "author" : "Tiny",
- "description": """
+ 'name': 'Accounting - Voucher Management',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Accounting',
+ 'description': """
India Accounting module includes all the basic requirenment of
Basic Accounting, plus new things which available are:
* New Invoice - (Local, Retail)
@@ -33,22 +35,20 @@ Basic Accounting, plus new things which available are:
* VAT Declaration report
* Accounting Periods
""",
- "category" : "Generic Modules/Accounting",
- "website" : "http://www.openerp.com",
- "depends" : ["base", "account"],
- "init_xml" : [
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['base', 'account'],
+ 'init_xml': [],
+ 'update_xml': [
+ 'security/ir.model.access.csv',
+ 'account_voucher_sequence.xml',
+ 'account_view.xml',
+ 'account_report.xml',
+ 'voucher_view.xml'
],
-
- "demo_xml" : [
- ],
-
- "update_xml" : [
- "security/ir.model.access.csv",
- "account_voucher_sequence.xml",
- "account_view.xml",
- "account_report.xml",
- "voucher_view.xml",
- ],
- "active": False,
- "installable": True
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '37580727101',
}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/analytic_journal_billing_rate/__terp__.py b/addons/analytic_journal_billing_rate/__terp__.py
index 252b26f2fae..882ef832758 100644
--- a/addons/analytic_journal_billing_rate/__terp__.py
+++ b/addons/analytic_journal_billing_rate/__terp__.py
@@ -19,28 +19,27 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Analytic Journal Billing Rate",
- "version" : "1.0",
- "depends" : ["analytic_user_function", "account", "hr_timesheet_invoice"],
- "author" : "Tiny",
- "description": """
+ 'name': 'Analytic Journal Billing Rate',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Others',
+ 'description': """
This module allows you to define what is the default invoicing rate for a specific journal on a given account. This is mostly used when a user encode his timesheet: the values are retrieved and the fields are auto-filled... but the possibility to change these values is still available.
Obviously if no data has been recorded for the current account, the default value is given as usual by the account data so that this module is perfectly compatible with older configurations.
""",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Others",
- "init_xml" : [],
- "demo_xml" : [],
- "update_xml" : [
- "analytic_journal_billing_rate_view.xml",
- "security/ir.model.access.csv",
- ],
- "active": False,
- "installable": True
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['analytic_user_function', 'account', 'hr_timesheet_invoice'],
+ 'init_xml': [],
+ 'update_xml': ['analytic_journal_billing_rate_view.xml', 'security/ir.model.access.csv'],
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '30271787965',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/analytic_user_function/__terp__.py b/addons/analytic_user_function/__terp__.py
index 0d85a5862a8..ae5231cb84e 100644
--- a/addons/analytic_user_function/__terp__.py
+++ b/addons/analytic_user_function/__terp__.py
@@ -19,28 +19,27 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Analytic User Function",
- "version" : "1.0",
- "depends" : ["hr_timesheet_sheet"],
- "author" : "Tiny",
- "description": """
+ 'name': 'Analytic User Function',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Others',
+ 'description': """
This module allows you to define what is the default function of a specific user on a given account. This is mostly used when a user encode his timesheet: the values are retrieved and the fields are auto-filled... but the possibility to change these values is still available.
Obviously if no data has been recorded for the current account, the default value is given as usual by the employee data so that this module is perfectly compatible with older configurations.
""",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Others",
- "init_xml" : [],
- "demo_xml" : [],
- "update_xml" : [
- "analytic_user_function_view.xml",
- "security/ir.model.access.csv",
- ],
- "active": False,
- "installable": True
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['hr_timesheet_sheet'],
+ 'init_xml': [],
+ 'update_xml': ['analytic_user_function_view.xml', 'security/ir.model.access.csv'],
+ 'demo_xml': [],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '82277138269',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/auction/__terp__.py b/addons/auction/__terp__.py
index 22dbccbfdf4..e2e7cd53e11 100644
--- a/addons/auction/__terp__.py
+++ b/addons/auction/__terp__.py
@@ -19,30 +19,29 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Auction module",
- "version" : "1.0",
- "author" : "Tiny",
- "category" : "Generic Modules/Auction",
- "depends" : ["base","account","hr_attendance"],
- "description": '''This module provides functionality to
+ 'name': 'Auction module',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Auction',
+ 'description': """This module provides functionality to
manage artists, articles, sellers, buyers and auction.
Manage bids, track of sold, paid and unpaid objects.
Delivery Management.
- ''',
- "update_xml" : [
- # FIXME: review security rules...
- "security/ir.model.access.csv",
- "auction_view.xml",
- "auction_report.xml",
- "auction_wizard.xml",
+ """,
+ 'author': 'Tiny',
+ 'depends': ['base', 'account', 'hr_attendance'],
+ 'init_xml': ['auction_sequence.xml'],
+ 'update_xml': [
+ 'security/ir.model.access.csv',
+ 'auction_view.xml',
+ 'auction_report.xml',
+ 'auction_wizard.xml'
],
- "demo_xml" : [
- "auction_demo.xml"
- ],
- "init_xml" : ["auction_sequence.xml"],
- "active": False,
- "installable": True
+ 'demo_xml': ['auction_demo.xml'],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '39333102717',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/auction/wizard/wizard_aie_send.py b/addons/auction/wizard/wizard_aie_send.py
index c9a4615f723..a261892e660 100644
--- a/addons/auction/wizard/wizard_aie_send.py
+++ b/addons/auction/wizard/wizard_aie_send.py
@@ -161,7 +161,7 @@ def _get_dates(self,cr,uid, datas,context={}):
return (x.split(' - ')[0], (' - '.join(x.split(' - ')[1:]).decode('latin1','replace').encode('utf-8','replace')))
send_fields['dates']['selection'] = map(_date_decode, response.read().split('\n'))
else:
- raise "Connection to WWW.Auction-in-Europe.com failed !"
+ raise wizard.except_wizard(_('Error'), _("Connection to WWW.Auction-in-Europe.com failed !"))
return {'objects':len(datas['ids'])}
def _send(self,db_name,uid, datas,context={}):
diff --git a/addons/auction/wizard/wizard_aie_send_result.py b/addons/auction/wizard/wizard_aie_send_result.py
index 9e7955471d7..a1fc9dce280 100644
--- a/addons/auction/wizard/wizard_aie_send_result.py
+++ b/addons/auction/wizard/wizard_aie_send_result.py
@@ -103,7 +103,8 @@ def _get_dates(self,cr,uid, datas, context):
return (x.split(' - ')[0], (' - '.join(x.split(' - ')[1:]).decode('latin1').encode('utf-8')))
send_fields['dates']['selection'] = map(_date_decode, response.read().split('\n'))
else:
- raise "Connection to WWW.Auction-in-Europe.com failed !"
+ raise wizard.except_wizard(_('Error'),
+ _("Connection to WWW.Auction-in-Europe.com failed !"))
return {'objects':len(datas['ids'])}
def _send(self,cr,uid, datas, context):
diff --git a/addons/audittrail/__terp__.py b/addons/audittrail/__terp__.py
index 1f84cea7871..ccd86944270 100644
--- a/addons/audittrail/__terp__.py
+++ b/addons/audittrail/__terp__.py
@@ -19,23 +19,26 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Audit Trail",
- "version" : "1.0",
- "depends" : ["base","account","purchase","mrp"],
- "website" : "http://www.openerp.com",
- "author" : "Tiny",
- "init_xml" : [],
- "description": """Allows the administrator to track every user operations on all objects of the system.
+ 'name': 'Audit Trail',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Others',
+ 'description': """Allows the administrator to track every user operations on all objects of the system.
Subscribe Rules for read, write, create and delete on objects and check logs""",
- "category" : "Generic Modules/Others",
- "update_xml" : ["audittrail_view.xml",
- "security/ir.model.access.csv",
- "security/audittrail_security.xml",
- ],
- "demo_xml" : ["audittrail_demo.xml"],
- "active" : False,
- "installable": True
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['base', 'account', 'purchase', 'mrp'],
+ 'init_xml': [],
+ 'update_xml': [
+ 'audittrail_view.xml',
+ 'security/ir.model.access.csv',
+ 'security/audittrail_security.xml'
+ ],
+ 'demo_xml': ['audittrail_demo.xml'],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '62572348749',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py
index 767536e7a88..54e2d813681 100644
--- a/addons/audittrail/audittrail.py
+++ b/addons/audittrail/audittrail.py
@@ -341,7 +341,7 @@ def tmp_fct(fct_src):
return res
return execute
-obj = netsvc._service['object']
+obj = netsvc.SERVICES['object']
obj.execute = tmp_fct(obj.execute)
obj.exportMethod(obj.execute)
diff --git a/addons/base_contact/__terp__.py b/addons/base_contact/__terp__.py
index 2e5cae98010..f50bfdef95a 100644
--- a/addons/base_contact/__terp__.py
+++ b/addons/base_contact/__terp__.py
@@ -19,13 +19,13 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Base Contact",
- "version" : "1.0",
- "author" : "Tiny",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Base",
- "description": """
+ 'name': 'Base Contact',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Base',
+ 'description': """
This module allows you to manage entirely your contacts.
It lets you define
@@ -39,18 +39,18 @@
Pay attention that this module converts the existing addresses into "addresses + contacts". It means that some fields of the addresses will be missing (like the contact name), since these are supposed to be defined in an other object.
""",
- "depends" : ["base", "process"],
- "init_xml" : [],
- "demo_xml" : [
- "base_contact_demo.xml"
- ],
- "update_xml" : [
- "security/ir.model.access.csv",
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['base', 'process'],
+ 'init_xml': [],
+ 'update_xml': [
+ 'security/ir.model.access.csv',
'base_contact_view.xml',
- "process/base_contact_process.xml"
+ 'process/base_contact_process.xml'
],
- "active": False,
- "installable": True
+ 'demo_xml': ['base_contact_demo.xml'],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '31287885469',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/base_iban/__terp__.py b/addons/base_iban/__terp__.py
index 2be819ed760..99af88babf2 100644
--- a/addons/base_iban/__terp__.py
+++ b/addons/base_iban/__terp__.py
@@ -19,21 +19,22 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "IBAN",
- "version" : "1.0",
- "author" : "Tiny",
- "category" : "Generic Modules/Base",
- "depends" : ["base"],
- "description": """
+ 'name': 'IBAN',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Base',
+ 'description': """
This module install the base for IBAN bank accounts.
""",
- "update_xml" : ["base_iban_view.xml"],
- "init_xml" : ["base_iban_data.xml"],
- "active": False,
- "installable": True
+ 'author': 'Tiny',
+ 'depends': ['base'],
+ 'init_xml': ['base_iban_data.xml'],
+ 'update_xml': ['base_iban_view.xml'],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '50014379549',
}
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/base_module_merge/__terp__.py b/addons/base_module_merge/__terp__.py
index 34090af5442..6d7b4d97fe1 100644
--- a/addons/base_module_merge/__terp__.py
+++ b/addons/base_module_merge/__terp__.py
@@ -19,13 +19,13 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Module Merger",
- "version" : "1.0",
- "author" : "Tiny",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Base",
- "description": """
+ 'name': 'Module Merger',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Base',
+ 'description': """
* The wizard asks a many2many of modules
* And then generate a module which is the merge of all selected modules
* The new module is provided as a .zip file
@@ -34,11 +34,13 @@
* Merging all .py files with the same name in the new module
* merging all .xml files and take care of id's.
""",
- "depends" : ["base"],
- "init_xml" : [ ],
- "demo_xml" : [ ],
- "update_xml" : [ "base_module_merge_wizard.xml" ],
- "installable": True
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['base'],
+ 'init_xml': [],
+ 'update_xml': ['base_module_merge_wizard.xml'],
+ 'demo_xml': [],
+ 'installable': True,
+ 'certificate': '35756279709',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/base_module_merge/wizard/base_module_merge.py b/addons/base_module_merge/wizard/base_module_merge.py
index 4fe2db39ff9..e2c8bb3f107 100644
--- a/addons/base_module_merge/wizard/base_module_merge.py
+++ b/addons/base_module_merge/wizard/base_module_merge.py
@@ -193,7 +193,7 @@ class base_module_merge(wizard.interface):
pool = pooler.get_pool(cr.dbname)
dep_obj=pool.get('ir.module.module.dependency')
if level<1:
- raise Exception, 'Recursion error in modules dependencies !'
+ raise wizard.except_wizard(_('Error'), _('Recursion error in modules dependencies !'))
for module in pool.get('ir.module.module').browse(cr, uid, ids):
dep_ids = dep_obj.search(cr, uid, [('module_id', '=', module.id)])
if dep_ids:
diff --git a/addons/base_module_publish/__terp__.py b/addons/base_module_publish/__terp__.py
index 5631c29c833..e65a6b421e4 100644
--- a/addons/base_module_publish/__terp__.py
+++ b/addons/base_module_publish/__terp__.py
@@ -19,13 +19,13 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Module publisher",
- "version" : "1.0",
- "author" : "Tiny",
- "website" : "http://www.openerp.com",
- "category" : "Generic Modules/Base",
- "description": """
+ 'name': 'Module publisher',
+ 'version': '1.0',
+ 'category': 'Generic Modules/Base',
+ 'description': """
This module can be used by developpers to automatically publish their modules
in a few click to the following websites:
* http://OpenERP.com, section module
@@ -36,12 +36,13 @@ in a few click to the following websites:
It adds a button "Publish module" on each module, so that you simply have
to call this button when you want to release a new version of your module.
""",
- "depends" : ["base"],
- "init_xml" : [ ],
- "demo_xml" : [ ],
- "update_xml" : [ "base_module_publish_wizard.xml" ],
- "installable": True
+ 'author': 'Tiny',
+ 'website': 'http://www.openerp.com',
+ 'depends': ['base'],
+ 'init_xml': [],
+ 'update_xml': ['base_module_publish_wizard.xml'],
+ 'demo_xml': [],
+ 'installable': True,
+ 'certificate': '67939821245',
}
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/base_module_quality/__terp__.py b/addons/base_module_quality/__terp__.py
index 1c056d84771..d77b50cd830 100644
--- a/addons/base_module_quality/__terp__.py
+++ b/addons/base_module_quality/__terp__.py
@@ -19,23 +19,25 @@
# along with this program. If not, see .
#
##############################################################################
+
+
{
- "name" : "Base module quality",
- "author" : "Tiny",
- "version" : "1.0",
- "depends" : ["base",],
- "description": """"
+ '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
""",
- "init_xml" : [],
- "update_xml" : ["base_module_quality_wizard.xml", "security/ir.model.access.csv",],
- "category" : "Tiny Specific Modules/Base module quality",
- "active": False,
- "installable": True
+ 'author': 'Tiny',
+ 'depends': ['base'],
+ 'init_xml': [],
+ 'update_xml': ['base_module_quality_wizard.xml', 'security/ir.model.access.csv'],
+ 'installable': True,
+ 'active': False,
+ 'certificate': '75119475677',
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py
index 0564d7c9066..4590a51dfe3 100644
--- a/addons/base_module_quality/base_module_quality.py
+++ b/addons/base_module_quality/base_module_quality.py
@@ -21,38 +21,29 @@
##############################################################################
import pooler
import os
+import osv
from tools import config
class abstract_quality_check(object):
'''
- This Class provide...
+ This Class provides...
'''
-# #This float have to store the rating of the module.
-# #Used to compute the final score (average of all scores).
-# score = 0.0
-#
-# #This char have to store the result.
-# #Used to display the result of the test.
-# result = ""
-#
-# #This char have to store the result with more details.
-# #Used to provide more details if necessary.
-# result_details = ""
-#
-# #This bool defines if the test can be run only if the module is installed.
-# #True => the module have to be installed.
-# #False => the module can be uninstalled.
-# bool_installed_only = True
-
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 = ""
@@ -66,13 +57,13 @@ class abstract_quality_check(object):
#False => the module can be uninstalled.
self.bool_installed_only = True
-
#This variable is use to make result of test should have more weight (Some tests are more critical than others)
- self.ponderation = 0.0
+ 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:
@@ -86,11 +77,12 @@ class abstract_quality_check(object):
self.tests.append(x3)
# raise 'Not Implemented'
- def run_test(self, cr, uid, module_path="", module_state=""):
+ def run_test(self, cr, uid, module_path=""):
'''
this method should do the test and fill the score, result and result_details var
'''
-# raise 'Not Implemented'
+
+ 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..
@@ -114,40 +106,19 @@ class abstract_quality_check(object):
result_ids[obj] = ids
return result_ids
- def format_table(self, test='', header=[], data_list=[]):
- res_format = {}
- if test=='method':
- detail = ""
- detail += "\n===Method Test===\n"
- res_format['detail'] = detail
- if not data_list[2]:
- detail += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-16s \n! %-20s \n! %-16s ') % (header[0].ljust(40), header[1].ljust(16), header[2].ljust(20), header[3].ljust(16))
- for res in data_list[1]:
- detail += ('\n|-\n| %s \n| %s \n| %s \n| %s ') % (res, data_list[1][res][0], data_list[1][res][1], data_list[1][res][2])
- res_format['detail'] = detail + '\n|}'
- res_format['summary'] = data_list[0]
- elif test=='pylint':
- res_format['summary'] = data_list[0]
- res_format['detail'] = data_list[1]
- elif test=='speed':
- detail = ""
- detail += "\n===Speed Test===\n"
- res_format['detail'] = detail
- if not data_list[2]:
- detail += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n! %-10s \n! %-10s \n! %-10s \n! %-20s') % (header[0].ljust(40), header[1].ljust(10), header[2].ljust(10), header[3].ljust(10), header[4].ljust(10), header[5].ljust(20))
- for data in data_list[1]:
- detail += ('\n|-\n| %s \n| %s \n| %s \n| %s \n| %s \n| %s ') % (data[0], data[1], data[2], data[3], data[4], data[5])
- res_format['detail'] = detail + '\n|}\n'
- res_format['summary'] = data_list[0]
- elif test=='terp':
- res_format['summary'] = data_list[0]
- res_format['detail'] = data_list[1]
- return res_format
+ def format_table(self, header=[], data_list=[]):
+ 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 add_quatation(self, x, y):
return x/y
-
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_module_quality/base_module_quality_wizard.xml b/addons/base_module_quality/base_module_quality_wizard.xml
index a61d1f4e980..467e7e7dc24 100644
--- a/addons/base_module_quality/base_module_quality_wizard.xml
+++ b/addons/base_module_quality/base_module_quality_wizard.xml
@@ -3,46 +3,75 @@
-
+
+ Results of Quality Checks
+ wizard.quality.check
+ tree
+
+
+
+
+
+
+
+
+ Results of Quality Checkswizard.quality.checkform
-
+ Results of Quality Checks with detailquality.check.detailform
-
+
+
+ Results of Quality Checks with detail
+ quality.check.detail
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/base_module_quality/method_test/method_test.py b/addons/base_module_quality/method_test/method_test.py
index 38a07c9428b..34841dd41cc 100644
--- a/addons/base_module_quality/method_test/method_test.py
+++ b/addons/base_module_quality/method_test/method_test.py
@@ -20,9 +20,7 @@
#
##############################################################################
-
-import os
-from tools import config
+from tools.translate import _
from base_module_quality import base_module_quality
import pooler
@@ -31,69 +29,56 @@ class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
super(quality_test, self).__init__()
-# self.result = """
-#===Method Test===:
-#
-#This test checks if the module classes are raising exception when calling basic methods or no.
-#
-#"""
+ 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
self.ponderation = 1.0
return None
- def run_test(self, cr, uid, module_path, module_state):
+ 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 = {}
ok_count = 0
ex_count = 0
+ result_dict = {}
for obj in obj_list:
- temp = []
+ temp = [obj]
try:
res = pool.get(obj).search(cr, uid, [])
- temp.append('Ok')
+ temp.append(_('Ok'))
ok_count += 1
except:
- temp.append('Exception')
+ temp.append(_('Exception'))
ex_count += 1
try:
res1 = pool.get(obj).fields_view_get(cr, uid,)
- temp.append('Ok')
+ temp.append(_('Ok'))
ok_count += 1
except:
- temp.append('Exception')
+ temp.append(_('Exception'))
ex_count += 1
try:
res2 = pool.get(obj).read(cr, uid, [])
- temp.append('Ok')
+ temp.append(_('Ok'))
ok_count += 1
except:
- temp.append('Exception')
+ temp.append(_('Exception'))
ex_count += 1
- result[obj] = temp
-# self.result += ('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-16s \n! %-20s \n! %-16s ') % ('Object Name'.ljust(40), 'search()'.ljust(16), 'fields_view_get()'.ljust(20), 'read()'.ljust(16))
- header_list = ['Object Name', 'search()', 'fields_view_get', 'read']
-# for res in result:
-# self.result += ('\n|-\n| %s \n| %s \n| %s \n| %s ') % (res, result[res][0],result[res][1], result[res][2])
-# self.result += '\n|}'
+ result_dict[obj] = temp
self.score = (ok_count + ex_count) and float(ok_count)/float(ok_count + ex_count) or 0.0
- if not self.bool_installed_only or module_state=="installed":
- summary = """
-===Method Test===:
-
-This test checks if the module classes are raising exception when calling basic methods or no.
-
-""" #+ "Score: " + str(self.score) + "/10\n"
- else:
- summary =""" \n===Method Test===:
-
-The module has to be installed before running this test.\n\n """
- header_list = ""
- self.error = True
- self.result = self.format_table(test='method', header=header_list, data_list=[summary,result,self.error])
+ self.result = self.get_result(result_dict)
return None
+ def get_result(self, dict):
+ 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)
+ return detail
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_module_quality/pylint_test/pylint_test.py b/addons/base_module_quality/pylint_test/pylint_test.py
index 5877dc6ff39..04eef3fa7e1 100644
--- a/addons/base_module_quality/pylint_test/pylint_test.py
+++ b/addons/base_module_quality/pylint_test/pylint_test.py
@@ -23,6 +23,7 @@
import os
from tools import config
+from tools.translate import _
from base_module_quality import base_module_quality
@@ -31,17 +32,15 @@ class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
super(quality_test, self).__init__()
-# self.result = """
-#===Pylint Test===:
-#
-# This test checks if the module satisfy the current coding standard used by OpenERP.
-#
-#"""
+ 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
self.ponderation = 1.0
+ self.result = ""
+ self.result_details = ""
return None
- def run_test(self, cr, uid, module_path, module_state):
+ 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:
@@ -52,12 +51,20 @@ class quality_test(base_module_quality.abstract_quality_check):
n = 0
score = 0.0
- detail = ""
- detail = "\n===Pylint Test===\n"
+ dict = {}
+ self.result_details += '''
+
+
+
+ '''
for file in list_files:
if file.split('.')[-1] == 'py' and not file.endswith('__init__.py') and not file.endswith('__terp__.py'):
file_path = os.path.join(module_path, file)
- res = os.popen('pylint --rcfile=' + config_file_path + ' ' + file_path).read()
+ try:
+ res = os.popen('pylint --rcfile=' + config_file_path + ' ' + file_path).read()
+ except:
+ self.result += _("Error. Is pylint correctly installed?")+"\n"
+ break
n += 1
leftchar = -1
while res[leftchar:leftchar+1] != ' ' and leftchar-1 <= 0:
@@ -65,33 +72,26 @@ class quality_test(base_module_quality.abstract_quality_check):
rightchar = -10
while res[rightchar:rightchar+1] != '/' and rightchar+1 <= 0:
rightchar += 1
-
try:
score += float(res[leftchar+1:rightchar])
-# self.result += file + ": " + res[leftchar+1:rightchar] + "/10\n"
- detail += file + ": " + res[leftchar+1:rightchar] + "/10\n"
+ #self.result += file + ": " + res[leftchar+1:rightchar] + "/10\n"
+ dict[file] = [file, res[leftchar+1:rightchar]]
except:
score += 0
-# self.result += file + ": Unable to parse the result. Check the details.\n"
- detail += file + ": Unable to parse the result. Check the details.\n"
- self.result_details += res
- self.score = n and score / n or score
- if not self.bool_installed_only or module_state=="installed":
- summary ="""
-===Pylint Test===:
-
-This test checks if the module satisfies the current coding standard used by OpenERP.
-
-""" #+ "Score: " + str(self.score) + "/10\n"
- else:
- summary =""" \n===Pylint Test===:
-
-The module has to be installed before running this test.\n\n """
- header_list = ""
- self.error = True
- self.result = self.format_table(test='pylint', data_list=[summary,detail,self.error])
+ #self.result += file + ": "+_("Unable to parse the result. Check the details.")+"\n"
+ dict[file] = [file, _("Unable to parse the result. Check the details.")]
+ self.result_details += res.replace('''