diff --git a/addons/account/account.py b/addons/account/account.py
index c249e704f81..0b2aa125a0a 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -289,8 +289,6 @@ class account_account(osv.osv):
'check_history': fields.boolean('Display History',
help="Check this box if you want to print all entries when printing the General Ledger, "\
"otherwise it will only print its balance."),
- 'merge_invoice': fields.boolean('Merge Invoice Entries',help="Check this box if you want that all lines of "\
- "a customer or supplier invoice using this account are created in one line only"),
}
def _default_company(self, cr, uid, context={}):
@@ -448,8 +446,8 @@ class account_journal(osv.osv):
'active': fields.boolean('Active'),
'view_id': fields.many2one('account.journal.view', 'View', required=True, help="Gives the view used when writing or browsing entries in this journal. The view tell Open ERP which fields should be visible, required or readonly and in which order. You can create your own view for a faster encoding in each journal."),
- 'default_credit_account_id': fields.many2one('account.account', 'Default Credit Account'),
- 'default_debit_account_id': fields.many2one('account.account', 'Default Debit Account'),
+ 'default_credit_account_id': fields.many2one('account.account', 'Default Credit Account', domain="[('type','!=','view')]"),
+ 'default_debit_account_id': fields.many2one('account.account', 'Default Debit Account', domain="[('type','!=','view')]"),
'centralisation': fields.boolean('Centralised counterpart', help="Check this box if you want that each entry doesn't create a counterpart but share the same counterpart for each entry of this journal. This is used in fiscal year closing."),
'update_posted': fields.boolean('Allow Cancelling Entries'),
'group_invoice_lines': fields.boolean('Group invoice lines', help="If this box is cheked, the system will try to group the accouting lines when generating them from invoices."),
@@ -1901,8 +1899,8 @@ class account_fiscal_position_account_template(osv.osv):
_rec_name = 'position_id'
_columns = {
'position_id': fields.many2one('account.fiscal.position.template', 'Fiscal Position', required=True, ondelete='cascade'),
- 'account_src_id': fields.many2one('account.account.template', 'Account Source', required=True),
- 'account_dest_id': fields.many2one('account.account.template', 'Account Destination', required=True)
+ 'account_src_id': fields.many2one('account.account.template', 'Account Source', domain=[('type','<>','view')], required=True),
+ 'account_dest_id': fields.many2one('account.account.template', 'Account Destination', domain=[('type','<>','view')], required=True)
}
account_fiscal_position_account_template()
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 2eb2ae92738..41fc73ca29d 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -28,7 +28,7 @@
-
+
@@ -130,7 +130,6 @@
-
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index 8a5cc00589e..c80cda3fe6d 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -182,7 +182,7 @@ class account_invoice(osv.osv):
'payment_term': fields.many2one('account.payment.term', 'Payment Term',readonly=True, states={'draft':[('readonly',False)]} ),
- 'period_id': fields.many2one('account.period', 'Force Period', help="Keep empty to use the period of the validation date."),
+ 'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation date."),
'account_id': fields.many2one('account.account', 'Account', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="The partner account used for this invoice."),
'invoice_line': fields.one2many('account.invoice.line', 'invoice_id', 'Invoice Lines', readonly=True, states={'draft':[('readonly',False)]}),
@@ -431,7 +431,6 @@ class account_invoice(osv.osv):
def action_move_create(self, cr, uid, ids, *args):
ait_obj = self.pool.get('account.invoice.tax')
cur_obj = self.pool.get('res.currency')
- acc_obj = self.pool.get('account.account')
self.button_compute(cr, uid, ids, context={}, set_total=False)
for inv in self.browse(cr, uid, ids):
if inv.move_id:
@@ -479,11 +478,7 @@ class account_invoice(osv.osv):
# create one move line for the total and possibly adjust the other lines amount
total = 0
total_currency = 0
- key_line=[]
for i in iml:
- if 'account_id' in i and 'taxes' in i:
- if not (i['account_id'],i['taxes']) in key_line:
- key_line.append((i['account_id'],i['taxes']))
if inv.currency_id.id != company_currency:
i['currency_id'] = inv.currency_id.id
i['amount_currency'] = i['price']
@@ -504,36 +499,6 @@ class account_invoice(osv.osv):
acc_id = inv.account_id.id
name = inv['name'] or '/'
- iml_temp=[]
- move_list=[]
-
- for item in key_line:
- move_temp={}
- if acc_obj.browse(cr,uid,item[0]).merge_invoice:
- repeat=False
- for move_line in iml:
- if (move_line.has_key('account_id') and move_line['account_id']==item[0]) and ('taxes' in move_line and move_line['taxes']==item[1]):
- move_list.append(move_line)
- if repeat:
- for key in move_line:
- if key in ['name','amount_currency','price_unit','price','quantity']:
- if key=='name':
- move_temp[key]=move_temp[key] + "," +move_line[key]
- else:
- move_temp[key] +=move_line[key]
- else:
- for key in move_line:
- move_temp[key]=move_line[key]
- repeat=True
- if move_temp:
- iml_temp.append(move_temp)
-
- if len(iml_temp)','view')], required=True),
+ 'account_dest_id': fields.many2one('account.account', 'Account Destination', domain=[('type','<>','view')], required=True)
}
account_fiscal_position_account()
diff --git a/addons/account_report/account.py b/addons/account_report/account.py
index de8a42f712a..528409bf845 100644
--- a/addons/account_report/account.py
+++ b/addons/account_report/account.py
@@ -159,7 +159,6 @@ class account_report(osv.osv):
('other','Others')],
'Type', required=True),
'expression': fields.char('Expression', size=240, required=True),
-# 'expression_status': fields.char('Status expression', size=240, required=True),
'badness_limit' :fields.float('Badness Indicator Limit', digits=(16,2),help='This Value depicts the limit of badness.'),
'goodness_limit' :fields.float('Goodness Indicator Limit', digits=(16,2),help='This Value depicts the limit of goodness.'),
'parent_id': fields.many2one('account.report.report', 'Parent'),
@@ -204,10 +203,7 @@ class account_report(osv.osv):
return self.name_get(cr, user, ids, context=context)
_constraints = [
- #TODO Put an expression to valid expression and expression_status
- ]
- _sql_constraints = [
- ('code_uniq', 'unique (code)', 'The code of the report entry must be unique !')
+ #TODO Put an expression to valid expression
]
account_report()
diff --git a/addons/base_module_quality/__terp__.py b/addons/base_module_quality/__terp__.py
index d77b50cd830..1ad92d5d3a9 100644
--- a/addons/base_module_quality/__terp__.py
+++ b/addons/base_module_quality/__terp__.py
@@ -25,8 +25,7 @@
'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.
+ '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...
diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py
index 0477e201cbb..b50ad8d20b0 100644
--- a/addons/base_module_quality/base_module_quality.py
+++ b/addons/base_module_quality/base_module_quality.py
@@ -23,6 +23,7 @@ import pooler
import os
import osv
from tools import config
+from tools.translate import _
class abstract_quality_check(object):
'''
@@ -52,24 +53,28 @@ class abstract_quality_check(object):
#Used to provide more details if necessary.
self.result_details = ""
- #This bool defines if the test can be run only if the module is installed.
+ #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 use to make result of test should have more weight (Some tests are more critical than others)
+ #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.
+ #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/')
+ 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']:
+ if os.path.exists(path + '/' + item + '.py') and item not in ['report', 'wizard', 'security']:
item2 = 'base_module_quality.' + item +'.' + item
x = __import__(item2)
x2 = getattr(x, item)
@@ -87,7 +92,8 @@ class abstract_quality_check(object):
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')])
+ 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:
diff --git a/addons/base_module_quality/base_module_quality_wizard.xml b/addons/base_module_quality/base_module_quality_wizard.xml
index 467e7e7dc24..21986b49959 100644
--- a/addons/base_module_quality/base_module_quality_wizard.xml
+++ b/addons/base_module_quality/base_module_quality_wizard.xml
@@ -2,6 +2,7 @@
+ Results of Quality Checks
@@ -45,7 +46,8 @@
-
+
+
diff --git a/addons/base_module_quality/terp_test/terp_test.py b/addons/base_module_quality/terp_test/terp_test.py
index cf9977c89b7..da64ca404c2 100644
--- a/addons/base_module_quality/terp_test/terp_test.py
+++ b/addons/base_module_quality/terp_test/terp_test.py
@@ -22,6 +22,7 @@
import os
import tools
+from tools.translate import _
from base_module_quality import base_module_quality
import pooler
@@ -30,9 +31,6 @@ import re
class quality_test(base_module_quality.abstract_quality_check):
def __init__(self):
-# '''
-# This test checks the quality of __terp__.py file in the selected module.
-# '''
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.")
@@ -94,16 +92,15 @@ class quality_test(base_module_quality.abstract_quality_check):
feel_bad_factor += 1
else:
if not res[key]:
- feel_bad_factor += 1
+ feel_bad_factor += 1
- if key == 'installable' and not res[key]: # installable tag is provided and True
+ if key == 'installable' and not res[key]: # installable tag is provided and False
feel_bad_factor +=1
else:
feel_bad_factor += 1
score = round((feel_good_factor) / float(feel_good_factor + feel_bad_factor),2)
-# self.result += "__terp__.py : "+ str(self.score) + "/10\n"
return [_('__terp__.py file'), score]
diff --git a/addons/base_module_quality/wizard/__init__.py b/addons/base_module_quality/wizard/__init__.py
index 917ecbf1ff9..440ab8c63d9 100644
--- a/addons/base_module_quality/wizard/__init__.py
+++ b/addons/base_module_quality/wizard/__init__.py
@@ -21,6 +21,7 @@
##############################################################################
import module_quality_check
+import quality_save_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/custom/custom.py b/addons/base_module_quality/wizard/quality_save_report.py
similarity index 54%
rename from addons/custom/custom.py
rename to addons/base_module_quality/wizard/quality_save_report.py
index 2000b89e66a..40b6a00c724 100644
--- a/addons/custom/custom.py
+++ b/addons/base_module_quality/wizard/quality_save_report.py
@@ -1,7 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
-# OpenERP, Open Source Management Solution
+# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved
# $Id$
#
@@ -20,17 +20,36 @@
#
##############################################################################
-from osv import osv, fields
+import wizard
+from osv import osv
+import pooler
+from tools.translate import _
-#class custom_material(osv.osv):
-# _name = 'network.material'
-# _inherit = 'network.material'
-# _columns = {
-# }
-# _defaults = {
-# }
-#custom_material()
+import base64
+form_rep = '''
+'''
+
+
+fields_rep = {
+ 'module_file': {'string': 'Save report', 'type': 'binary', 'required': True},
+}
+
+def get_detail(self, cr, uid, datas, context={}):
+ data = pooler.get_pool(cr.dbname).get('quality.check.detail').browse(cr, uid, datas['id'])
+ data.detail = base64.encodestring(data.detail)
+ return {'module_file':data.detail}
+
+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:
diff --git a/addons/custom/__init__.py b/addons/custom/__init__.py
index 345290445e6..7ed460db2b3 100644
--- a/addons/custom/__init__.py
+++ b/addons/custom/__init__.py
@@ -20,7 +20,5 @@
#
##############################################################################
-import custom
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/document/content_index.py b/addons/document/content_index.py
index db78217b6d6..96297ff7a8b 100644
--- a/addons/document/content_index.py
+++ b/addons/document/content_index.py
@@ -23,6 +23,7 @@ import time
import os
import StringIO
import odt2txt
+import tempfile
#
# This should be the indexer
@@ -36,11 +37,10 @@ def content_index(content, filename=None, content_type=None):
stdin.close()
result = stdout.read().decode('latin1','replace').encode('utf-8','replace')
elif ext == '.pdf':
- fname = os.tempnam(filename)+'.pdf'
- fp = file(fname,'wb')
- fp.write(content)
- fp.close()
- fp = os.popen('pdftotext -enc UTF-8 -nopgbrk '+fname+' -', 'r')
+ file_descriptor, file_name = tempfile.mkstemp(suffix=ext)
+ os.write(file_descriptor, content)
+ os.close(file_descriptor)
+ fp = os.popen('pdftotext -enc UTF-8 -nopgbrk '+file_name+' -', 'r')
result = fp.read()
fp.close()
elif ext in ('.xls','.ods','.odt','.odp'):
@@ -52,4 +52,4 @@ def content_index(content, filename=None, content_type=None):
result = content
else:
result = content
- return result
\ No newline at end of file
+ return result
diff --git a/addons/l10n_be/__terp__.py b/addons/l10n_be/__terp__.py
index a8dd1fea1f7..05c87181e45 100644
--- a/addons/l10n_be/__terp__.py
+++ b/addons/l10n_be/__terp__.py
@@ -40,12 +40,23 @@
""",
'author': 'Tiny',
- 'depends': ['account', 'account_report', 'base_vat', 'base_iban', 'account_chart'],
+ 'depends': [
+ 'account',
+ 'account_report',
+ 'base_vat',
+ 'base_iban',
+ 'account_chart'
+ ],
'init_xml': [],
- 'update_xml': ['account_pcmn_belgium.xml', 'l10n_be_wizard.xml',
- 'l10n_be_sequence.xml', 'fiscal_templates.xml',
+ 'update_xml': [
+ 'account_pcmn_belgium.xml',
+ 'l10n_be_wizard.xml',
+ 'l10n_be_sequence.xml',
+ 'fiscal_templates.xml',
],
- 'demo_xml': [],
+ 'demo_xml': [
+ 'account.report.report.csv'
+ ],
'installable': True,
'certificate': '31977724637',
}
diff --git a/addons/l10n_fr/taxes.xml b/addons/l10n_fr/taxes.xml
index c18a687373b..e98aba353ed 100644
--- a/addons/l10n_fr/taxes.xml
+++ b/addons/l10n_fr/taxes.xml
@@ -359,7 +359,7 @@
France PCMN
-
+
diff --git a/addons/product/product.py b/addons/product/product.py
index 8378e682dae..a58d6c46e76 100644
--- a/addons/product/product.py
+++ b/addons/product/product.py
@@ -249,9 +249,9 @@ class product_template(osv.osv):
'categ_id': fields.many2one('product.category','Category', required=True, change_default=True),
'list_price': fields.float('Sale Price', digits=(16, int(config['price_accuracy'])), help="Base price for computing the customer price. Sometimes called the catalog price."),
'standard_price': fields.float('Cost Price', required=True, digits=(16, int(config['price_accuracy'])), help="The cost of the product for accounting stock valorisation. It can serves as a base price for supplier price."),
- 'volume': fields.float('Volume', help="The weight in Kg."),
- 'weight': fields.float('Gross weight'),
- 'weight_net': fields.float('Net weight'),
+ 'volume': fields.float('Volume', help="The volume in m3."),
+ 'weight': fields.float('Gross weight', help="The gross weight in Kg."),
+ 'weight_net': fields.float('Net weight', help="The net weight in Kg."),
'cost_method': fields.selection([('standard','Standard Price'), ('average','Average Price')], 'Costing Method', required=True,
help="Standard Price: the cost price is fixed and recomputed periodically (usually at the end of the year), Average Price: the cost price is recomputed at each reception of products."),
'warranty': fields.float('Warranty (months)'),