From 988263fd7cdac8eefd6ebbc96e0074b0391c4a87 Mon Sep 17 00:00:00 2001 From: "Apa (Open ERP)" Date: Sat, 27 Dec 2008 10:44:44 +0530 Subject: [PATCH 01/19] modify bzr revid: apa@tinyerp.com-20081227051444-9mflf9m5vjj2n071 --- addons/account_payment/payment_report.xml | 2 +- addons/account_payment/report/payment_order.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account_payment/payment_report.xml b/addons/account_payment/payment_report.xml index 0f39148f719..699207e1733 100644 --- a/addons/account_payment/payment_report.xml +++ b/addons/account_payment/payment_report.xml @@ -1,6 +1,6 @@ - + diff --git a/addons/account_payment/report/payment_order.py b/addons/account_payment/report/payment_order.py index f3e9b612d62..ee4dcefed5c 100644 --- a/addons/account_payment/report/payment_order.py +++ b/addons/account_payment/report/payment_order.py @@ -31,4 +31,4 @@ class payment_order(report_sxw.rml_parse): 'time': time, }) -report_sxw.report_sxw('report.payment.order', 'payement.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order,header=False) \ No newline at end of file +report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order,header=False) \ No newline at end of file From 06882ed8a0c5bd9c660e9a87f11c0a5af0ab93e4 Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Sat, 27 Dec 2008 14:40:14 +0530 Subject: [PATCH 02/19] base module quality bzr revid: mra@tinyerp.com-20081227091014-ds6ad7ylqtfkgi6j --- .../base_module_quality.py | 78 +++++++++++++---- .../base_module_quality_wizard.xml | 16 +++- .../method_test/method_test.py | 31 ++++--- .../pylint_test/pylint_test.py | 29 +++++-- .../speed_test/speed_test.py | 85 ++++++++++--------- .../wizard/module_quality_check.py | 16 +++- 6 files changed, 167 insertions(+), 88 deletions(-) diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py index ef4a0c3c515..101043b498c 100644 --- a/addons/base_module_quality/base_module_quality.py +++ b/addons/base_module_quality/base_module_quality.py @@ -26,34 +26,51 @@ class abstract_quality_check(object): This Class provide... ''' - #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 +# #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 ''' - raise 'Not Implemented' + #This float have to store the rating of the module. + #Used to compute the final score (average of all scores). + self.score = 0.0 + + #This char have to store the result. + #Used to display the result of the test. + self.result = "" + + #This char have to store the result with more details. + #Used to provide more details if necessary. + self.result_details = "" + + #This 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 + +# raise 'Not Implemented' def run_test(self, cr, uid, module_path=""): ''' this method should do the test and fill the score, result and result_details var ''' - raise 'Not Implemented' +# raise 'Not Implemented' def get_objects(self, cr, uid, module): # This function returns all object of the given module.. @@ -77,5 +94,30 @@ 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" + 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][0]: + detail += ('\n|-\n| %s \n| %s \n| %s \n| %s ') % (res, data_list[1][0][res][0], data_list[1][0][res][1], data_list[1][0][res][2]) + res_format['summary'] = [data_list[0][0]] + res_format['detail'] = [detail + '\n|}'] + elif test=='pylint': + res_format['summary'] = data_list[0] + res_format['detail'] = data_list[1] + elif test=='speed': + detail = "" + detail += "\n===Speed Test===\n" + 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['summary'] = data_list[0] + res_format['detail'] = [detail + '\n|}\n'] + return res_format + + + # 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 b49c17667a7..f85c19ab6f7 100644 --- a/addons/base_module_quality/base_module_quality_wizard.xml +++ b/addons/base_module_quality/base_module_quality_wizard.xml @@ -9,8 +9,20 @@ form
- - + + + + + + + + + + + + + + diff --git a/addons/base_module_quality/method_test/method_test.py b/addons/base_module_quality/method_test/method_test.py index 0ef59cc2b29..b2015723dcb 100644 --- a/addons/base_module_quality/method_test/method_test.py +++ b/addons/base_module_quality/method_test/method_test.py @@ -30,12 +30,13 @@ import pooler class quality_test(base_module_quality.abstract_quality_check): def __init__(self): - self.result = """ -===Method Test===: - -This test checks if the module classes are raising exception when calling basic methods or no. - -""" + 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.bool_installed_only = True return None @@ -46,7 +47,6 @@ This test checks if the module classes are raising exception when calling basic result = {} ok_count = 0 ex_count = 0 - for obj in obj_list: temp = [] try: @@ -71,13 +71,18 @@ This test checks if the module classes are raising exception when calling basic 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)) - - 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|}' +# 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|}' self.score = (ok_count + ex_count) and float(ok_count)/float(ok_count + ex_count) or 0.0 + summary = """\n ===Method Test===: + +This test checks if the module classes are raising exception when calling basic methods or no. + +""" + "Score: " + str(self.score) + "/10\n" + self.result = self.format_table(test='method', header=header_list, data_list=[[summary],[result]]) return None diff --git a/addons/base_module_quality/pylint_test/pylint_test.py b/addons/base_module_quality/pylint_test/pylint_test.py index bc05b5fc850..5bf240346d1 100644 --- a/addons/base_module_quality/pylint_test/pylint_test.py +++ b/addons/base_module_quality/pylint_test/pylint_test.py @@ -30,12 +30,13 @@ from base_module_quality import base_module_quality class quality_test(base_module_quality.abstract_quality_check): def __init__(self): - self.result = """ -===Pylint Test===: - - This test checks if the module satisfy the current coding standard used by OpenERP. - -""" + super(quality_test, self).__init__() +# self.result = """ +#===Pylint Test===: +# +# This test checks if the module satisfy the current coding standard used by OpenERP. +# +#""" self.bool_installed_only = False return None @@ -50,6 +51,8 @@ class quality_test(base_module_quality.abstract_quality_check): n = 0 score = 0.0 + detail = "" + detail = "\n===Pylint Test===\n" 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) @@ -64,13 +67,21 @@ class quality_test(base_module_quality.abstract_quality_check): try: score += float(res[leftchar+1:rightchar]) - self.result += file + ": " + res[leftchar+1:rightchar] + "/10\n" +# self.result += file + ": " + res[leftchar+1:rightchar] + "/10\n" + detail += file + ": " + res[leftchar+1:rightchar] + "/10\n" except: score += 0 - self.result += file + ": Unable to parse the result. Check the details.\n" - +# 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 + summary =""" +===Pylint Test===: + + This test checks if the module satisfy the current coding standard used by OpenERP. + +""" + "Score: " + str(self.score) + "/10\n" + self.result = self.format_table(test='pylint', data_list=[[summary],[detail]]) return None diff --git a/addons/base_module_quality/speed_test/speed_test.py b/addons/base_module_quality/speed_test/speed_test.py index 55c05e594b9..5a9176e4946 100644 --- a/addons/base_module_quality/speed_test/speed_test.py +++ b/addons/base_module_quality/speed_test/speed_test.py @@ -34,74 +34,75 @@ from base_module_quality import base_module_quality class quality_test(base_module_quality.abstract_quality_check): def __init__(self): - self.result = """ -===Speed Test===: - -This test checks the speed of the module. - -""" + super(quality_test, self).__init__() +# self.result = """ +#===Speed Test===: +# +#This test checks the speed of the module. +# +#""" self.bool_installed_only = True return None - def run_test(self, cr, uid, module_path): pool = pooler.get_pool(cr.dbname) module_name = module_path.split('/')[-1] - self.result+=('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n! %-10s \n! %-10s \n! %-10s \n! %-20s') % ('Object Name'.ljust(40), 'Size (S)'.ljust(10), '1'.ljust(10), 'S/2'.ljust(10), 'S'.ljust(10), 'Complexity'.ljust(20)) +# self.result+=('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n! %-10s \n! %-10s \n! %-10s \n! %-20s') % ('Object Name'.ljust(40), 'Size-Number of Records (S)'.ljust(10), '1'.ljust(10), 'S/2'.ljust(10), 'S'.ljust(10), 'Complexity using query'.ljust(20)) + header_list = ['Object Name', 'Size-Number of Records (S)', '1', 'S/2', 'S', 'Complexity using query'] obj_list = self.get_objects(cr, uid, module_name) obj_counter = 0 score = 0 obj_ids = self.get_ids(cr, uid, obj_list) + detail = "" + list1 = [] for obj in obj_ids: obj_counter += 1 ids = obj_ids[obj] ids = ids[:100] size = len(ids) if size: - c1 = time.time() + c1 = cr.count + pool.get(obj).read(cr, uid, ids[0]) - c2 = time.time() - base_time = c2 - c1 - c1 = time.time() + pool.get(obj).read(cr, uid, ids[0]) + code_base_complexity = cr.count - c1 + pool.get(obj).read(cr, uid, ids[:size/2]) - c2 = time.time() - halfsize_time = c2 - c1 - c1 = time.time() + pool.get(obj).read(cr, uid, ids[:size/2]) + code_half_complexity = cr.count - c1 + pool.get(obj).read(cr, uid, ids) - c2 = time.time() - size_time = c2 - c1 + pool.get(obj).read(cr, uid, ids) + code_size_complexity = cr.count - c1 + if size < 5: self.score += -2 - self.result += ('\n|-\n| %s \n| %s \n| %s \n| %s \n| %s \n| %s ') % (obj, size, base_time, halfsize_time, size_time, "Warning! Not enough demo data") +# self.result += ('\n|-\n| %s \n| %s \n| %s \n| %s \n| %s \n| %s ') % (obj, size, code_base_complexity, code_half_complexity, code_size_complexity, "Warning! Not enough demo data") + list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, "Warning! Not enough demo data"] + list1.append(list) else: - tolerated_margin = 5/100 - complexity = "not recognized" - if min(size_time,base_time,halfsize_time) != base_time: + if code_size_complexity <= (code_base_complexity + size): complexity = "O(1)" - score += 10 - + score = 10 else: - k1 = (halfsize_time - base_time)*1000 / ((size/2) - 1) - k2 = (size_time - base_time)*1000 / ((size) - 1) - tmp = k1 * tolerated_margin - if (k1 - tmp) < k2 and k2 < (k1 + tmp): - complexity = "O(n)" - if round(tmp) == 0: - complexity = "O(1)" - score += 10 - else: - score += 5 - else: - complexity = "O(n²) or worst" - score += 0 - - self.result += ('\n|-\n| %s \n| %s \n| %s \n| %s \n| %s \n| %s ') % (obj, size, base_time, halfsize_time, size_time, complexity) + complexity = "O(n) or worst" + score = 0 +# self.result += ('\n|-\n| %s \n| %s \n| %s \n| %s \n| %s \n| %s ') % (obj, size, code_base_complexity, code_half_complexity, code_size_complexity, complexity) + list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, complexity] + list1.append(list) else: score += -5 - self.result += ('\n|-\n| %s \n| %s \n| %s \n| %s \n| %s \n| %s ') % (obj, size, "", "", "", "Warning! Object has no demo data") - - - self.result += '\n|}\n' +# self.result += ('\n|-\n| %s \n| %s \n| %s \n| %s \n| %s \n| %s ') % (obj, size, "", "", "", "Warning! Object has no demo data") + list = [obj, size, "", "", "", "Warning! Object has no demo data"] + list1.append(list) +# self.result += '\n|}\n' self.score = obj_counter and score/obj_counter or 0.0 + summary = """ +===Speed Test===: + + This test checks the speed of the module. + +"""+ "Score: " + str(self.score) + "/10\n" + self.result = self.format_table(test='speed', header=header_list, data_list=[[summary],list1]) return None # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_module_quality/wizard/module_quality_check.py b/addons/base_module_quality/wizard/module_quality_check.py index e029a94b137..48a04f8f921 100644 --- a/addons/base_module_quality/wizard/module_quality_check.py +++ b/addons/base_module_quality/wizard/module_quality_check.py @@ -56,9 +56,9 @@ class wiz_quality_check(osv.osv_memory): # general_info = "" _name = 'wizard.quality.check' - def _check(self, cr, uid, data, context={}): string_ret = "" + string_detail = "" from tools import config data['ids'] = data.get('module_id', False) pool = pooler.get_pool(cr.dbname) @@ -72,7 +72,7 @@ class wiz_quality_check(osv.osv_memory): if module_data[0].name == 'base': ad = tools.config['root_path']+'/addons' module_path = os.path.join(ad, module_data[0].name) - item2 = 'base_module_quality.'+item+'.'+item + item2 = 'base_module_quality.' + item +'.' + item x = __import__(item2) x2 = getattr(x, item) x3 = getattr(x2, item) @@ -81,9 +81,14 @@ class wiz_quality_check(osv.osv_memory): val.run_test(cr, uid, str(module_path)) else: val.result += "The module has to be installed before running this test." - string_ret += val.result + string_ret += val.result['summary'][0] + string_detail += val.result['detail'][0] + self.string_detail = string_detail return string_ret + def _check_detail(self, cr, uid, data, context={}): + return self.string_detail + # def _general_info(self, cr, uid, data, context={}): # return self.general_info @@ -102,9 +107,12 @@ class wiz_quality_check(osv.osv_memory): #~ }, _columns = { 'general_info': fields.text('General Info', readonly="1",), + 'detail' : fields.text('Detail', readonly="1",), + 'verbose_detail' : fields.text('Verbose Detail', readonly="1",) } _defaults = { - 'general_info': _check + 'general_info': _check, + 'detail': _check_detail } wiz_quality_check() From e9d20e01bc09f768f004ed4c986f9483d9d6e647 Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Mon, 29 Dec 2008 11:10:49 +0530 Subject: [PATCH 03/19] base module quality bzr revid: mra@tinyerp.com-20081229054049-ht4jqvwjt8047plb --- addons/base_module_quality/base_module_quality.py | 10 +++++----- addons/base_module_quality/method_test/method_test.py | 2 +- addons/base_module_quality/pylint_test/pylint_test.py | 2 +- addons/base_module_quality/speed_test/speed_test.py | 2 +- .../base_module_quality/wizard/module_quality_check.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py index 101043b498c..78e2b903495 100644 --- a/addons/base_module_quality/base_module_quality.py +++ b/addons/base_module_quality/base_module_quality.py @@ -100,10 +100,10 @@ class abstract_quality_check(object): detail = "" detail += "\n===Method Test===\n" 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][0]: - detail += ('\n|-\n| %s \n| %s \n| %s \n| %s ') % (res, data_list[1][0][res][0], data_list[1][0][res][1], data_list[1][0][res][2]) - res_format['summary'] = [data_list[0][0]] - res_format['detail'] = [detail + '\n|}'] + 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['summary'] = data_list[0] + res_format['detail'] = detail + '\n|}' elif test=='pylint': res_format['summary'] = data_list[0] res_format['detail'] = data_list[1] @@ -114,7 +114,7 @@ class abstract_quality_check(object): 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['summary'] = data_list[0] - res_format['detail'] = [detail + '\n|}\n'] + res_format['detail'] = detail + '\n|}\n' return res_format diff --git a/addons/base_module_quality/method_test/method_test.py b/addons/base_module_quality/method_test/method_test.py index b2015723dcb..09dbdb3f30a 100644 --- a/addons/base_module_quality/method_test/method_test.py +++ b/addons/base_module_quality/method_test/method_test.py @@ -82,7 +82,7 @@ class quality_test(base_module_quality.abstract_quality_check): This test checks if the module classes are raising exception when calling basic methods or no. """ + "Score: " + str(self.score) + "/10\n" - self.result = self.format_table(test='method', header=header_list, data_list=[[summary],[result]]) + self.result = self.format_table(test='method', header=header_list, data_list=[summary,result]) return None diff --git a/addons/base_module_quality/pylint_test/pylint_test.py b/addons/base_module_quality/pylint_test/pylint_test.py index 5bf240346d1..d448cf1595a 100644 --- a/addons/base_module_quality/pylint_test/pylint_test.py +++ b/addons/base_module_quality/pylint_test/pylint_test.py @@ -81,7 +81,7 @@ class quality_test(base_module_quality.abstract_quality_check): This test checks if the module satisfy the current coding standard used by OpenERP. """ + "Score: " + str(self.score) + "/10\n" - self.result = self.format_table(test='pylint', data_list=[[summary],[detail]]) + self.result = self.format_table(test='pylint', data_list=[summary,detail]) return None diff --git a/addons/base_module_quality/speed_test/speed_test.py b/addons/base_module_quality/speed_test/speed_test.py index 5a9176e4946..5200bd2b4bd 100644 --- a/addons/base_module_quality/speed_test/speed_test.py +++ b/addons/base_module_quality/speed_test/speed_test.py @@ -102,7 +102,7 @@ class quality_test(base_module_quality.abstract_quality_check): This test checks the speed of the module. """+ "Score: " + str(self.score) + "/10\n" - self.result = self.format_table(test='speed', header=header_list, data_list=[[summary],list1]) + self.result = self.format_table(test='speed', header=header_list, data_list=[summary,list1]) return None # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_module_quality/wizard/module_quality_check.py b/addons/base_module_quality/wizard/module_quality_check.py index 48a04f8f921..cda3a92dcbf 100644 --- a/addons/base_module_quality/wizard/module_quality_check.py +++ b/addons/base_module_quality/wizard/module_quality_check.py @@ -81,8 +81,8 @@ class wiz_quality_check(osv.osv_memory): val.run_test(cr, uid, str(module_path)) else: val.result += "The module has to be installed before running this test." - string_ret += val.result['summary'][0] - string_detail += val.result['detail'][0] + string_ret += val.result['summary'] + string_detail += val.result['detail'] self.string_detail = string_detail return string_ret From 8ecb170ce0c7e0de67e212885b70f4ae2cf35208 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 29 Dec 2008 12:31:21 +0530 Subject: [PATCH 04/19] Bugfixed and correction on account_payment lp bug: https://launchpad.net/bugs/311727 fixed bzr revid: jvo@tinyerp.com-20081229070121-5wozed2ko26a3dwf --- addons/account_payment/payment.py | 16 +++++----- addons/account_payment/payment_view.xml | 4 +-- .../wizard/wizard_populate_statement.py | 30 ++++++++++--------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/addons/account_payment/payment.py b/addons/account_payment/payment.py index 9d5b3682f74..b0bc71568f9 100644 --- a/addons/account_payment/payment.py +++ b/addons/account_payment/payment.py @@ -19,7 +19,6 @@ # along with this program. If not, see . # ############################################################################## - from osv import fields from osv import osv import time @@ -110,7 +109,7 @@ class payment_order(osv.osv): ('now', 'Directly'), ('due', 'Due date'), ('fixed', 'Fixed date') - ], "Prefered date", change_default=True, required=True,help="Choose an option for the Payment Order:'Fixed' stands for a date specified by you.'Directly' stands for the direct execution.'Due date' stands for the scheduled date of execution."), + ], "Preferred date", change_default=True, required=True,help="Choose an option for the Payment Order:'Fixed' stands for a date specified by you.'Directly' stands for the direct execution.'Due date' stands for the scheduled date of execution."), 'date_created': fields.date('Creation date', readonly=True), 'date_done': fields.date('Execution date', readonly=True), } @@ -401,13 +400,13 @@ class payment_line(osv.osv): # 'reference': fields.function(select_by_name, string="Ref", method=True, # type='char'), 'ml_maturity_date': fields.function(_get_ml_maturity_date, method=True, type='date', string='Maturity Date'), - 'ml_inv_ref': fields.function(_get_ml_inv_ref, method=True, type='many2one', relation='account.invoice', string='Invoice Ref'), + 'ml_inv_ref': fields.function(_get_ml_inv_ref, method=True, type='many2one', relation='account.invoice', string='Invoice Ref.'), 'info_owner': fields.function(info_owner, string="Owner Account", method=True, type="text",help='Address of the Main Partner'), 'info_partner': fields.function(info_partner, string="Destination Account", method=True, type="text",help='Address of the Ordering Customer.'), # 'partner_payable': fields.function(partner_payable, string="Partner payable", method=True, type='float'), # 'value_date': fields.function(_value_date, string='Value Date', # method=True, type='date'), - 'date': fields.date('Payment Date',help="If no payment date is specified, the bank will treat this payment line direclty"), + 'date': fields.date('Payment Date',help="If no payment date is specified, the bank will treat this payment line directly"), 'create_date': fields.datetime('Created' ,readonly=True), 'state': fields.selection([('normal','Free'), ('structured','Structured')], 'Communication Type', required=True) } @@ -430,6 +429,7 @@ class payment_line(osv.osv): if move_line_id: line = self.pool.get('account.move.line').browse(cr,uid,move_line_id) data['amount_currency']=line.amount_to_pay + res = self.onchange_amount(cr, uid, ids, data['amount_currency'], currency, company_currency, context) if res: @@ -460,12 +460,12 @@ class payment_line(osv.osv): return {'value': data} - def onchange_amount(self,cr,uid,ids,amount,currency,cmpny_currency,context=None): - if not amount: - return {} + def onchange_amount(self, cr, uid, ids, amount, currency, cmpny_currency, context=None): + if (not amount) or (not cmpny_currency): + return {'value': {'amount':False}} res = {} currency_obj = self.pool.get('res.currency') - company_amount = currency_obj.compute(cr, uid, currency, cmpny_currency,amount) + company_amount = currency_obj.compute(cr, uid, currency, cmpny_currency, amount) res['amount'] = company_amount return {'value': res} diff --git a/addons/account_payment/payment_view.xml b/addons/account_payment/payment_view.xml index 5de9f36a074..4202ca94b6c 100644 --- a/addons/account_payment/payment_view.xml +++ b/addons/account_payment/payment_view.xml @@ -220,14 +220,14 @@ - + - + diff --git a/addons/account_payment/wizard/wizard_populate_statement.py b/addons/account_payment/wizard/wizard_populate_statement.py index 5646ae71ae6..c9c37c2094f 100644 --- a/addons/account_payment/wizard/wizard_populate_statement.py +++ b/addons/account_payment/wizard/wizard_populate_statement.py @@ -67,22 +67,24 @@ def _populate_statement(obj, cursor, user, data, context): for line in line_obj.browse(cursor, user, line_ids, context=context): ctx = context.copy() - ctx['date'] = line.value_date + ctx['date'] = line.ml_maturity_date # was value_date earlier,but this field exists no more now amount = currency_obj.compute(cursor, user, line.currency.id, statement.currency.id, line.amount_currency, context=ctx) - reconcile_id = statement_reconcile_obj.create(cursor, user, { - 'line_ids': [(6, 0, [line.move_line_id.id])] - }, context=context) - statement_line_obj.create(cursor, user, { - 'name': line.order_id.reference or '?', - 'amount': - amount, - 'type': 'supplier', - 'partner_id': line.partner_id.id, - 'account_id': line.move_line_id.account_id.id, - 'statement_id': statement.id, - 'ref': line.reference, - 'reconcile_id': reconcile_id, - }, context=context) + + if line.move_line_id: + reconcile_id = statement_reconcile_obj.create(cursor, user, { + 'line_ids': [(6, 0, [line.move_line_id.id])] + }, context=context) + statement_line_obj.create(cursor, user, { + 'name': line.order_id.reference or '?', + 'amount': - amount, + 'type': 'supplier', + 'partner_id': line.partner_id.id, + 'account_id': line.move_line_id.account_id.id, + 'statement_id': statement.id, + 'ref': line.communication, + 'reconcile_id': reconcile_id, + }, context=context) return {} From 55a598d504cc8c5d5ed7afa8be144858bbe56088 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 29 Dec 2008 09:56:31 +0100 Subject: [PATCH 05/19] [IMP] PEP8 bzr revid: stephane@tinyerp.com-20081229085631-i9ux70nm57g5tx4s --- bin/openerp-server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/openerp-server.py b/bin/openerp-server.py index 6dec12d9664..8065f1ff7bd 100755 --- a/bin/openerp-server.py +++ b/bin/openerp-server.py @@ -34,7 +34,9 @@ GNU Public Licence. #---------------------------------------------------------- # python imports #---------------------------------------------------------- -import sys, os, signal +import sys +import os +import signal #---------------------------------------------------------- # ubuntu 8.04 has obsoleted `pyxml` package and installs here. # the path needs to be updated before any `import xml` From 58113254babc8195d5ca842658d8fcb999a30a58 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 29 Dec 2008 14:32:05 +0530 Subject: [PATCH 06/19] Added Reports and lines objects for l10n_fr bzr revid: jvo@tinyerp.com-20081229090205-u9c7v25q9k9y0kfw --- addons/l10n_fr/__init__.py | 1 + addons/l10n_fr/__terp__.py | 7 +- addons/l10n_fr/fr_data.xml | 930 ++++++++++++++++++++++++++++++++ addons/l10n_fr/l10n_fr.py | 57 ++ addons/l10n_fr/l10n_fr_view.xml | 47 ++ 5 files changed, 1039 insertions(+), 3 deletions(-) create mode 100644 addons/l10n_fr/fr_data.xml create mode 100644 addons/l10n_fr/l10n_fr.py create mode 100644 addons/l10n_fr/l10n_fr_view.xml diff --git a/addons/l10n_fr/__init__.py b/addons/l10n_fr/__init__.py index b888eb373fc..747566bf5d1 100644 --- a/addons/l10n_fr/__init__.py +++ b/addons/l10n_fr/__init__.py @@ -20,6 +20,7 @@ # ############################################################################## +import l10n_fr import wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_fr/__terp__.py b/addons/l10n_fr/__terp__.py index cbd0d92e4da..d632dbae9ff 100644 --- a/addons/l10n_fr/__terp__.py +++ b/addons/l10n_fr/__terp__.py @@ -41,13 +41,14 @@ * We have the account templates which can be helpful to generate Charts of Accounts. * On that particular wizard,You will be asked to pass the name of the company,the chart template to follow,the no. of digits to generate the code for your account and Bank account,currency to create Journals. Thus,the pure copy of Chart Template is generated. - * This is the same wizard that runs from Financial Managament/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template. + * This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template. * This module installs : The Tax Code chart and taxes for French Accounting. """, - "init_xml" : [], - "update_xml" : ["types.xml", "plan-99-03_societe.xml", "taxes.xml","fr_wizard.xml"], + "init_xml" : ["fr_data.xml"], + "update_xml" : ["l10n_fr_view.xml","types.xml", "plan-99-03_societe.xml", + "taxes.xml","fr_wizard.xml"], "demo_xml" : [], "installable": True } diff --git a/addons/l10n_fr/fr_data.xml b/addons/l10n_fr/fr_data.xml new file mode 100644 index 00000000000..9cef085c7ae --- /dev/null +++ b/addons/l10n_fr/fr_data.xml @@ -0,0 +1,930 @@ + + + + + + Bilan Comptable + bilan + + + + Compte de Résultat + cdr + + + + Actif : Capital souscrit - non appelé + {'load':['+:109:S'], 'except':[]} + bavar1 + + + + + Immobilisations incorporelles : Frais d'établissement + {'load':['+:201:S'], 'except':[]} + bavar2 + + + + + Immobilisations incorporelles : Frais d'établissement (Amortissements et dépréciations) + {'load':['+:2801:S'], 'except':[]} + bavar2b + + + + + Immobilisations incorporelles : Frais de recherche et de développement + {'load':['+:203:S'], 'except':[]} + bavar3 + + + + + Immobilisations incorporelles : Frais de recherche et de développement (Amortissements et dépréciations) + {'load':['+:2803:S'], 'except':[]} + bavar3b + + + + + Immobilisations incorporelles : Concessions, brevets, licences, marques, droits et valeurs similaires + {'load':['+:205:S'], 'except':[]} + bavar4 + + + + + Immobilisations incorporelles : Concessions, brevets, licences, marques, droits et valeurs similaires (Amortissements et dépréciations) + {'load':['+:2805:S','+:2905:S'], 'except':[]} + bavar4b + + + + + Immobilisations incorporelles : Fonds commercial + {'load':['+:206:S','+:207:S'], 'except':[]} + bavar5 + + + + + Immobilisations incorporelles : Fonds commercial (Amortissements et dépréciations) + {'load':['+:2807:S','+:2907:S'], 'except':[]} + bavar5b + + + + + Immobilisations incorporelles : Autres + {'load':['+:208:S'], 'except':[]} + bavar6 + + + + + Immobilisations incorporelles : Autres (Amortissements et dépréciations) + {'load':['+:2808:S','+:2908:S'], 'except':[]} + bavar6b + + + + + Immobilisations incorporelles : Immobilisations incorporelles en cours + {'load':['+:232:S'], 'except':[]} + bavar7 + + + + + Immobilisations incorporelles : Immobilisations incorporelles en cours (Amortissements et dépréciations) + {'load':['+:2932:S'], 'except':[]} + bavar7b + + + + + Immobilisations incorporelles : Avances et acomptes + {'load':['+:237:S'], 'except':[]} + bavar8 + + + + + Immobilisations corporelles : Terrains + {'load':['+:211:S','+:212:S'], 'except':[]} + bavar9 + + + + + Immobilisations corporelles : Terrains (Amortissements et dépréciations) + {'load':['+:2811:S','+:2812:S','+:2911:S'], 'except':[]} + bavar9b + + + + + Immobilisations corporelles : Constructions + {'load':['+:213:S','+:214:S'], 'except':[]} + bavar10 + + + + + Immobilisations corporelles : Constructions (Amortissements et dépréciations) + {'load':['+:2813:S','+:2814:S'], 'except':[]} + bavar10b + + + + + Immobilisations corporelles : Installations techniques,matériel et outillage + {'load':['+:215:S'], 'except':[]} + bavar11 + + + + + Immobilisations corporelles : Installations techniques,matériel et outillage (Amortissements et dépréciations) + {'load':['+:2815:S'], 'except':[]} + bavar11b + + + + + Immobilisations corporelles : Autres + {'load':['+:218:S'], 'except':[]} + bavar12 + + + + + Immobilisations corporelles : Autres (Amortissements et dépréciations) + {'load':['+:2818:S','+:282:S'], 'except':[]} + bavar12b + + + + + Immobilisations corporelles : Immobilisations corporelles en cours + {'load':['+:231:S'], 'except':[]} + bavar13 + + + + + Immobilisations corporelles : Immobilisations corporelles : Immobilisations corporelles en cours (Amortissements et dépréciations) + {'load':['+:2931:S'], 'except':[]} + bavar13b + + + + + Immobilisations corporelles : Avances et acomptes + {'load':['+:238:S'], 'except':[]} + bavar14 + + + + + Immobilisations financiéres : Participations + {'load':['+:261:S','+:262:S','+:266:S'], 'except':[]} + bavar15 + + + + + Immobilisations financiéres : Participations (Amortissements et dépréciations) + {'load':['+:2961:S','+:2966:S'], 'except':[]} + bavar15b + + + + + Immobilisations financiéres : Créances rattachées à des participations + {'load':['+:267:S','+:268:S'], 'except':[]} + bavar16 + + + + + Immobilisations financiéres : Créances rattachées à des participations (Amortissements et dépréciations) + {'load':['+:2967:S'], 'except':[]} + bavar16b + + + + + Immobilisations financiéres : Titres immobilisés de l'activité de portefeuille + {'load':['+:273:S'], 'except':[]} + bavar17 + + + + + Immobilisations financiéres : Titres immobilisés de l'activité de portefeuille (Amortissements et dépréciations) + {'load':['+:2973:S'], 'except':[]} + bavar17b + + + + + Immobilisations financiéres : Autres titres immobilisés + {'load':['+:271:S','+:272:S','+:27682:S'], 'except':[]} + bavar18 + + + + + Immobilisations financiéres : Autres titres immobilisés (Amortissements et dépréciations) + {'load':['+:2971:S','+:2972:S'], 'except':[]} + bavar18b + + + + + Immobilisations financiéres : Prêts + {'load':['+:274:S','+:27684:S'], 'except':[]} + bavar19 + + + + + Immobilisations financiéres : Prêts (Amortissements et dépréciations) + {'load':['+:2974:S'], 'except':[]} + bavar19b + + + + + Immobilisations financiéres : Autres + {'load':['+:275:S','+:276:S'], 'except':['27682','27684']} + bavar20 + + + + + Immobilisations financiéres : Autres (Amortissements et dépréciations) + {'load':['+:2975:S','+:2976:S'], 'except':[]} + bavar20b + + + + + Stock en cours : Matières premières et autres approvisionnements + {'load':['+:31:S','+:32:S'], 'except':[]} + bavar21 + + + + + Stock en cours : Matières premières et autres approvisionnements (Amortissements et dépréciations) + {'load':['+:391:S','+:392:S'], 'except':[]} + bavar21b + + + + + Stock en cours : En-cours de production [biens et services] + {'load':['+:33:S','+:34:S'], 'except':[]} + bavar22 + + + + + Stock en cours : En-cours de production [biens et services] (Amortissements et dépréciations) + {'load':['+:393:S','+:394:S'], 'except':[]} + bavar22b + + + + + Stock en cours : Produits intermédiaires et finis + {'load':['+:35:S'], 'except':[]} + bavar23 + + + + + Stock en cours : Produits intermédiaires et finis (Amortissements et dépréciations) + {'load':['+:395:S'], 'except':[]} + bavar23b + + + + + Stock en cours : Marchandises + {'load':['+:37:S'], 'except':[]} + bavar24 + + + + + Stock en cours : Marchandises (Amortissements et dépréciations) + {'load':['+:397:S'], 'except':[]} + bavar24b + + + + + Stock en cours : Avances et acomptes versés sur commandes + {'load':['+:4091:S'], 'except':[]} + bavar25 + + + + + Créances : Créances clients et comptes rattachés + {'load':['+:411:S','+:413:S','+:416:S','+:418:S'], 'except':[]} + bavar26 + + + + + Créances : Créances clients et comptes rattachés (Amortissements et dépréciations) + {'load':['+:491:S'], 'except':[]} + bavar26b + + + + + Créances : Autres + {'load':['+:4096:S','+:4097:S','+:4098:S','+:425:S','+:441:S','+:462:S','+:465:S','+:428:D','+:438:D','+:443:D','+:444:D','+:445:D','+:448:D','+:451:D','+:455:D','+:456:D','+:458:D','+:467:D','+:468:D','+:478:D'], 'except':['4562']} + bavar27 + + + + + Créances : Autres (Amortissements et dépréciations) + {'load':['+:495:S','+:496:S'], 'except':[]} + bavar27b + + + + + Créances : Capital souscrit - appelé , non versé + {'load':['+:4562:S'], 'except':[]} + bavar28 + + + + + Valeurs mobilières de placement : Actions propres + {'load':['+:502:S'], 'except':[]} + bavar29 + + + + + Valeurs mobilières de placement : Actions propres (Amortissements et dépréciations) + {'load':['+:5903:S'], 'except':[]} + bavar29b + + + + + Valeurs mobilières de placement : Autres titres + {'load':['+:50:S'], 'except':['502','509']} + bavar30 + + + + + Valeurs mobilières de placement : Autres titres (Amortissements et dépréciations) + {'load':['+:590:S'], 'except':['5903']} + bavar30b + + + + + Actif circulant : Instruments de trésorerie + {'load':['+:52:S'], 'except':[]} + bavar31 + + + + + Actif circulant : Disponibilités + {'load':['+:51:D','+:53:S','+:54:S'], 'except':['5181','519']} + bavar32 + + + + + Actif circulant : Charges constatés d'avance + {'load':['+:486:S'], 'except':[]} + bavar33 + + + + + Actif : Charges à répartir sur plusieurs exercices + {'load':['+:481:S'], 'except':[]} + bavar34 + + + + + Actif : Primes de remboursement des emprunts + {'load':['+:169:S'], 'except':[]} + bavar35 + + + + + Actif : Écarts de conversion actif + {'load':['+:476:S'], 'except':[]} + bavar36 + + + + + Capitaux propres : Capital [dont versé...] + {'load':['-:101:S','-:108:S'], 'except':[]} + bpvar1 + + + + + Capitaux propres : Primes d'émission, de fusion, d'apport + {'load':['-:104:S'], 'except':[]} + bpvar2 + + + + + Capitaux propres : Écarts de réévaluation + {'load':['-:105:S'], 'except':[]} + bpvar3 + + + + + Capitaux propres : Écart d'équivalence + {'load':['-:107:S'], 'except':[]} + bpvar4 + + + + + Réserves : Réserve légale + {'load':['-:1061:S'], 'except':[]} + bpvar5 + + + + + Réserves : Réserves statutaires ou contractuelles + {'load':['-:1063:S'], 'except':[]} + bpvar6 + + + + + Réserves : Réserves réglementées + {'load':['-:1062:S','-:1064:S'], 'except':[]} + bpvar7 + + + + + Réserves : Autres réserves + {'load':['-:1068:S'], 'except':[]} + bpvar8 + + + + + Capitaux propres : Report à nouveau + {'load':['-:110:S','-:119:S'], 'except':[]} + bpvar9 + + + + + Capitaux propres : Résultat de l'exercice + + {'load':['-:7:S','-:6:S'], 'except':[]} + bpvar10 + + + + + Capitaux propres : Résultat de l'exercice (Vérification) + {'load':['-:120:S','-:129:S'], 'except':[]} + bpcheck + + + + + Capitaux propres : Subventions d'investissement + {'load':['-:13:S'], 'except':[]} + bpvar11 + + + + + Capitaux propres : Provisions réglementées + {'load':['-:14:S'], 'except':[]} + bpvar12 + + + + + Provisions : Provisions pour risques + {'load':['-:151:S'], 'except':[]} + bpvar13 + + + + + Provisions : Provisions pour charges + {'load':['-:15:S'], 'except':['151']} + bpvar14 + + + + + Dettes : Emprunts obligataires convertibles + {'load':['-:161:S','-:16881:S'], 'except':[]} + bpvar15 + + + + + Dettes : Autres emprunts obligataires + {'load':['-:163:S','-:16883:S'], 'except':[]} + bpvar16 + + + + + Dettes : Emprunts et dettes auprès des établissements de crédit + {'load':['-:164:S','-:16884:S','-:519:S','-:5181:S','-:512:C','-:514:C','-:517:C'], 'except':[]} + bpvar17 + + + + + Dettes : Emprunts et dettes financières diverses + {'load':['-:165:S','-:166:S','-:1675:S','-:168:S','-:17:S','-:426:S','-:45:C'], 'except':['16881','16883','16884','457']} + bpvar18 + + + + + Dettes : Avances et acomptes reçus sur commandes en cours + {'load':['-:4191:S'], 'except':[]} + bpvar19 + + + + + Dettes : Dettes fournisseurs et comptes rattachés + {'load':['-:401:S','-:403:S','-:4081:S','-:4088:S'], 'except':[]} + bpvar20 + + + + + Dettes : Dettes fiscales et sociales + {'load':['-:421:S','-:422:S','-:424:S','-:427:S','-:4282:S','-:4284:S','-:4286:S','-:43:S','-:442:S','-:4455:S','-:4457:S','-:44584:S','-:44587:S','-:446:S','-:447:S','-:4482:S','-:4486:S','-:457:S','-:443:C','-:444:C'],'except':['4387']} + bpvar21 + + + + + Dettes : Dettes sur immobilisations et comptes rattachés + {'load':['-:269:S','-:279:S','-:404:S','-:405:S','-:4084:S'], 'except':[]} + bpvar22 + + + + + Dettes : Autres dettes + {'load':['-:4196:S','-:4197:S','-:4198:S','-:464:S','-:467:C','-:4686:S','-:478:C','-:509:S'], 'except':[]} + bpvar23 + + + + + Dettes : Instruments de trésorerie + {'load':['-:52:S'], 'except':[]} + bpvar24 + + + + + Dettes : Produits constatés d'avance + {'load':['-:487:S'], 'except':[]} + bpvar25 + + + + + Passif : Écarts de conversion passif + {'load':['-:477:S'], 'except':[]} + bpvar26 + + + + + Charges d'exploitation : Achats de Marchandises + {'load':['+:607:S','+:6097:S'], 'except':[]} + cdrc1 + + + + + Charges d'exploitation : Achats de Marchandises, variation des stocks + {'load':['+:6037:S'], 'except':[]} + cdrc2 + + + + + Charges d'exploitation : Achats de matières premières et autres approvisionnements + {'load':['+:601:S','+:6091:S','+:602:S','+:6092:S','+:6081:S','+:6082:S'], 'except':[]} + cdrc3 + + + + + Charges d'exploitation : Achats de matières premières et autres approvisionnements, variation des stocks + {'load':['+:6031:S','+:6032:S'], 'except':[]} + cdrc4 + + + + + Charges d'exploitation : Autres achats et charges externes + {'load':['+:604:S','+:605:S','+:606:S','+:6094:S','+:6095:S','+:6096:S','+:61:S','+:62:S'], 'except':[]} + cdrc5 + + + + + Charges d'exploitation : Autres achats et charges externes, redevances de crédit-bail mobilier + {'load':['+:6122:S'], 'except':[]} + cdrc6 + + + + + Charges d'exploitation : Autres achats et charges externes, redevances de crédit-bail mobilier + {'load':['+:6125:S'], 'except':[]} + cdrc7 + + + + + Charges d'exploitation : Impôts, taxes et versements assimilés + {'load':['+:63:S'], 'except':[]} + cdrc8 + + + + + Charges d'exploitation : Salaires et traitements + {'load':['+:641:S','+:644:S','+:648:S'], 'except':[]} + cdrc9 + + + + + Charges d'exploitation : Charges sociales + {'load':['+:645:S','+:646:S','+:647:S'], 'except':[]} + cdrc10 + + + + + Charges d'exploitation : Dotation aux amortissements et aux dépréciations, sur immobilisations : dotations aux amortissements + {'load':['+:6811:S','+:6812:S'], 'except':[]} + cdrc11 + + + + + Charges d'exploitation : Dotation aux amortissements et aux dépréciations, sur immobilisations : dotations aux dépréciations + {'load':['+:6816:S'], 'except':[]} + cdrc12 + + + + + Charges d'exploitation : Dotation aux amortissements et aux dépréciations, sur actif circulant : dotations aux dépréciations + {'load':['+:6817:S'], 'except':[]} + cdrc13 + + + + + Charges d'exploitation : Dotations aux provisions + {'load':['+:6815:S'], 'except':[]} + cdrc14 + + + + + Charges d'exploitation : Autres charges + {'load':['+:65:S'], 'except':['655']} + cdrc15 + + + + + Charges : Quotes-parts de résultat sur opérations faites en commun + {'load':['+:655:S'], 'except':[]} + cdrc16 + + + + + Charges financières : Dotations aux amortissements, aux dépréciations et aux provisions + {'load':['+:686:S'], 'except':[]} + cdrc17 + + + + + Charges financières : Intérêts et charges assimilées + {'load':['+:66:S'], 'except':['666','667']} + cdrc18 + + + + + Charges financières : Différences négatives de change + {'load':['+:666:S'], 'except':[]} + cdrc19 + + + + + Charges financières : Charges nettes sur cessions de valeurs mobilières de placement + {'load':['+:667:S'], 'except':[]} + cdrc20 + + + + + Charges exceptionnelles : Sur opérations de gestion + {'load':['+:671:S'], 'except':[]} + cdrc21 + + + + + Charges exceptionnelles : Sur opérations en capital + {'load':['+:675:S','+:678:S'], 'except':[]} + cdrc22 + + + + + Charges exceptionnelles : Dotations aux amortissements, aux dépréciations et aux provisions + {'load':['+:687:S'], 'except':[]} + cdrc23 + + + + + Charges : Participation des salariés aux résultats + {'load':['+:691:S'], 'except':[]} + cdrc24 + + + + + Charges : Impôts sur les bénéfices + {'load':['+:69:S'], 'except':['691']} + cdrc25 + + + + + Produits d'exploitation : Vente de marchandises + {'load':['-:707:S','-:7097:S'], 'except':[]} + cdrp1 + + + + + Produits d'exploitation : Production vendue [biens et services] + {'load':['-:701:S','-:702:S','-:703:S','-:704:S','-:705:S','-:706:S','-:7091:S','-:7092:S','-:7093:S','-:7094:S','-:7095:S','-:7096:S','-:708:S'], 'except':[]} + cdrp2 + + + + + Produits d'exploitation : Production stockée + {'load':['-:713:S'], 'except':[]} + cdrp3 + + + + + Produits d'exploitation : Production immobilisée + {'load':['-:72:S'], 'except':[]} + cdrp4 + + + + + Produits d'exploitation : Subventions d'exploitation + {'load':['-:74:S'], 'except':[]} + cdrp5 + + + + + Produits d'exploitation : Reprises sur provisions, dépréciations (et amortissements) et transferts de charges + {'load':['-:781:S','-:791:S'], 'except':[]} + cdrp6 + + + + + Produits d'exploitation : Autres produits + {'load':['-:75:S'], 'except':['755']} + cdrp7 + + + + + Produits : Quotes-parts de résultat sur opérations faites en commun + {'load':['-:755:S'], 'except':[]} + cdrp8 + + + + + Produits financiers : De participation + {'load':['-:761:S'], 'except':[]} + cdrp9 + + + + + Produits financiers : D'autres valeurs mobilières et créances de l'actif immobilisé + {'load':['-:762:S'], 'except':[]} + cdrp10 + + + + + Produits financiers : Autres intérêts et produits assimilés + {'load':['-:763:S','-:764:S','-:765:S','-:768:S'], 'except':[]} + cdrp11 + + + + + Produits financiers : Reprises sur provisions, dépréciations et transferts de charges + {'load':['-:786:S','-:796:S'], 'except':[]} + cdrp12 + + + + + Produits financiers : Différences positives de change + {'load':['-:766:S'], 'except':[]} + cdrp13 + + + + + Produits financiers : Produits nets sur cessions de valeurs mobilières de placement + {'load':['-:767:S'], 'except':[]} + cdrp14 + + + + + Produits exceptionnels : Sur opérations de gestion + {'load':['-:771:S'], 'except':[]} + cdrp15 + + + + + Produits exceptionnels : Sur opérations en capital + {'load':['-:775:S','-:777:S','-:778:S'], 'except':[]} + cdrp16 + + + + + Produits exceptionnels : Reprises sur provisions, dépréciations et transferts de charges + {'load':['-:787:S','-:797:S'], 'except':[]} + cdrp17 + + + + + + diff --git a/addons/l10n_fr/l10n_fr.py b/addons/l10n_fr/l10n_fr.py new file mode 100644 index 00000000000..2654847aaee --- /dev/null +++ b/addons/l10n_fr/l10n_fr.py @@ -0,0 +1,57 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + +from mx import DateTime +import time + +from osv import fields, osv +import pooler + + +class l10n_fr_report(osv.osv): + _name = 'l10n.fr.report' + _description = 'Report for l10n_fr' + _columns = { + 'code': fields.char('Code', size=64), + 'name': fields.char('Name', size=128), + 'line_ids': fields.one2many('l10n.fr.line', 'report_id', 'Lines'), + } + _sql_constraints = [ + ('code_uniq', 'unique (code)','The code report must be unique !') + ] +l10n_fr_report() + +class l10n_fr_line(osv.osv): + _name = 'l10n.fr.line' + _description = 'Report Lines for l10n_fr' + _columns = { + 'code': fields.char('Variable Name', size=64), + 'definition': fields.char('Definition', size=512), + 'name': fields.char('Name', size=256), + 'report_id': fields.many2one('l10n.fr.report', 'Report'), + } + _sql_constraints = [ + ('code_uniq', 'unique (code)', 'The variable name must be unique !') + ] +l10n_fr_line() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_fr/l10n_fr_view.xml b/addons/l10n_fr/l10n_fr_view.xml new file mode 100644 index 00000000000..095b1714286 --- /dev/null +++ b/addons/l10n_fr/l10n_fr_view.xml @@ -0,0 +1,47 @@ + + + + + + + + Rapports + l10n.fr.report + + + + + + Entrées + l10n.fr.line + tree + + + + + l10n.fr.line + l10n.fr.line + tree + + + + + + + + + + + l10n.fr.report + l10n.fr.report + tree + + + + + + + + + + \ No newline at end of file From 272ffb10b5531defa3937b7e27dd196c5d8f77ef Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Mon, 29 Dec 2008 15:06:00 +0530 Subject: [PATCH 07/19] changes on quality module bzr revid: mra@tinyerp.com-20081229093600-9lc1o16njgguthr2 --- .../base_module_quality.py | 35 ++++++++++++++----- .../method_test/method_test.py | 15 ++++++-- .../pylint_test/pylint_test.py | 16 ++++++--- .../speed_test/speed_test.py | 14 ++++++-- .../wizard/module_quality_check.py | 30 ++++++---------- 5 files changed, 72 insertions(+), 38 deletions(-) diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py index 78e2b903495..1a84f35b67a 100644 --- a/addons/base_module_quality/base_module_quality.py +++ b/addons/base_module_quality/base_module_quality.py @@ -20,6 +20,8 @@ # ############################################################################## import pooler +import os +from tools import config class abstract_quality_check(object): ''' @@ -64,9 +66,20 @@ class abstract_quality_check(object): #False => the module can be uninstalled. self.bool_installed_only = True + self.tests = [] + self.list_folders = os.listdir(config['addons_path']+'/base_module_quality/') + for item in self.list_folders: + self.item = item + path = config['addons_path']+'/base_module_quality/'+item + if os.path.exists(path+'/'+item+'.py') and item not in ['report', 'wizard', 'security']: + item2 = 'base_module_quality.' + item +'.' + item + x = __import__(item2) + x2 = getattr(x, item) + x3 = getattr(x2, item) + self.tests.append(x3) # raise 'Not Implemented' - def run_test(self, cr, uid, module_path=""): + def run_test(self, cr, uid, module_path="", module_state=""): ''' this method should do the test and fill the score, result and result_details var ''' @@ -99,22 +112,26 @@ class abstract_quality_check(object): if test=='method': detail = "" detail += "\n===Method Test===\n" - 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 + 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] - res_format['detail'] = detail + '\n|}' elif test=='pylint': res_format['summary'] = data_list[0] res_format['detail'] = data_list[1] elif test=='speed': detail = "" detail += "\n===Speed Test===\n" - 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 + 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] - res_format['detail'] = detail + '\n|}\n' return res_format diff --git a/addons/base_module_quality/method_test/method_test.py b/addons/base_module_quality/method_test/method_test.py index 09dbdb3f30a..1da2e06ad97 100644 --- a/addons/base_module_quality/method_test/method_test.py +++ b/addons/base_module_quality/method_test/method_test.py @@ -40,13 +40,14 @@ class quality_test(base_module_quality.abstract_quality_check): self.bool_installed_only = True return None - def run_test(self, cr, uid, module_path): + def run_test(self, cr, uid, module_path, module_state): 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 + error = False for obj in obj_list: temp = [] try: @@ -77,12 +78,20 @@ class quality_test(base_module_quality.abstract_quality_check): # self.result += ('\n|-\n| %s \n| %s \n| %s \n| %s ') % (res, result[res][0],result[res][1], result[res][2]) # self.result += '\n|}' self.score = (ok_count + ex_count) and float(ok_count)/float(ok_count + ex_count) or 0.0 - summary = """\n ===Method Test===: + 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" - self.result = self.format_table(test='method', header=header_list, data_list=[summary,result]) + else: + summary =""" \n===Method Test===: + +The module has to be installed before running this test.\n\n """ + header_list = "" + error = True + self.result = self.format_table(test='method', header=header_list, data_list=[summary,result,error]) return None diff --git a/addons/base_module_quality/pylint_test/pylint_test.py b/addons/base_module_quality/pylint_test/pylint_test.py index d448cf1595a..333f73f50dc 100644 --- a/addons/base_module_quality/pylint_test/pylint_test.py +++ b/addons/base_module_quality/pylint_test/pylint_test.py @@ -40,7 +40,7 @@ class quality_test(base_module_quality.abstract_quality_check): self.bool_installed_only = False return None - def run_test(self, cr, uid, module_path): + def run_test(self, cr, uid, module_path, module_state): 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: @@ -53,6 +53,7 @@ class quality_test(base_module_quality.abstract_quality_check): score = 0.0 detail = "" detail = "\n===Pylint Test===\n" + error = False 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) @@ -75,13 +76,20 @@ class quality_test(base_module_quality.abstract_quality_check): detail += file + ": Unable to parse the result. Check the details.\n" self.result_details += res self.score = n and score / n or score - summary =""" + if not self.bool_installed_only or module_state=="installed": + summary =""" ===Pylint Test===: - This test checks if the module satisfy the current coding standard used by OpenERP. +This test checks if the module satisfy the current coding standard used by OpenERP. """ + "Score: " + str(self.score) + "/10\n" - self.result = self.format_table(test='pylint', data_list=[summary,detail]) + else: + summary =""" \n===Pylint Test===: + +The module has to be installed before running this test.\n\n """ + header_list = "" + error = True + self.result = self.format_table(test='pylint', data_list=[summary,detail,error]) return None diff --git a/addons/base_module_quality/speed_test/speed_test.py b/addons/base_module_quality/speed_test/speed_test.py index 5200bd2b4bd..248a500fa9c 100644 --- a/addons/base_module_quality/speed_test/speed_test.py +++ b/addons/base_module_quality/speed_test/speed_test.py @@ -43,7 +43,7 @@ class quality_test(base_module_quality.abstract_quality_check): #""" self.bool_installed_only = True return None - def run_test(self, cr, uid, module_path): + def run_test(self, cr, uid, module_path, module_state): pool = pooler.get_pool(cr.dbname) module_name = module_path.split('/')[-1] # self.result+=('{| border="1" cellspacing="0" cellpadding="5" align="left" \n! %-40s \n! %-10s \n! %-10s \n! %-10s \n! %-10s \n! %-20s') % ('Object Name'.ljust(40), 'Size-Number of Records (S)'.ljust(10), '1'.ljust(10), 'S/2'.ljust(10), 'S'.ljust(10), 'Complexity using query'.ljust(20)) @@ -54,6 +54,7 @@ class quality_test(base_module_quality.abstract_quality_check): obj_ids = self.get_ids(cr, uid, obj_list) detail = "" list1 = [] + error = False for obj in obj_ids: obj_counter += 1 ids = obj_ids[obj] @@ -96,13 +97,20 @@ class quality_test(base_module_quality.abstract_quality_check): list1.append(list) # self.result += '\n|}\n' self.score = obj_counter and score/obj_counter or 0.0 - summary = """ + if not self.bool_installed_only or module_state=="installed": + summary = """ ===Speed Test===: This test checks the speed of the module. """+ "Score: " + str(self.score) + "/10\n" - self.result = self.format_table(test='speed', header=header_list, data_list=[summary,list1]) + else: + summary =""" \n===Speed Test===: + +The module has to be installed before running this test.\n\n """ + header_list = "" + error = True + self.result = self.format_table(test='speed', header=header_list, data_list=[summary,list1, error]) return None # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_module_quality/wizard/module_quality_check.py b/addons/base_module_quality/wizard/module_quality_check.py index cda3a92dcbf..c0640d9a078 100644 --- a/addons/base_module_quality/wizard/module_quality_check.py +++ b/addons/base_module_quality/wizard/module_quality_check.py @@ -26,7 +26,7 @@ from osv import osv, fields import tools import os - +from base_module_quality import base_module_quality #TODO: (utiliser les nouveaux wizards pour heriter la vue et rajouter un onglet par test?) #TODO: implement the speed test #TODO: add cheks: do the class quality_check inherits the class abstract_quality_check? @@ -65,24 +65,16 @@ class wiz_quality_check(osv.osv_memory): module_data = pool.get('ir.module.module').browse(cr, uid, [data['ids']]) list_folders = os.listdir(config['addons_path']+'/base_module_quality/') module_name = module_data[0].name - for item in list_folders: - path = config['addons_path']+'/base_module_quality/'+item - if os.path.exists(path+'/'+item+'.py') and item not in ['report', 'wizard', 'security']: - ad = tools.config['addons_path'] - if module_data[0].name == 'base': - ad = tools.config['root_path']+'/addons' - module_path = os.path.join(ad, module_data[0].name) - item2 = 'base_module_quality.' + item +'.' + item - x = __import__(item2) - x2 = getattr(x, item) - x3 = getattr(x2, item) - val = x3.quality_test() - if (not val.bool_installed_only or module_data[0].state == "installed"): - val.run_test(cr, uid, str(module_path)) - else: - val.result += "The module has to be installed before running this test." - string_ret += val.result['summary'] - string_detail += val.result['detail'] + abstract_obj = base_module_quality.abstract_quality_check() + for test in abstract_obj.tests: + ad = tools.config['addons_path'] + if module_data[0].name == 'base': + ad = tools.config['root_path']+'/addons' + module_path = os.path.join(ad, module_data[0].name) + val = test.quality_test() + val.run_test(cr, uid, str(module_path), str(module_data[0].state)) + string_ret += val.result['summary'] + string_detail += val.result['detail'] self.string_detail = string_detail return string_ret From b86bfc4e61923526fd02c8ab80cf3224055155a4 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 29 Dec 2008 11:24:51 +0100 Subject: [PATCH 08/19] [FIX] all loggers are exclusives -> python 2.4 compatible bzr revid: christophe@cobalt-20081229102451-m9my1c0dezd7wk8q --- bin/netsvc.py | 31 ++++++++----------------------- bin/tools/config.py | 1 + 2 files changed, 9 insertions(+), 23 deletions(-) diff --git a/bin/netsvc.py b/bin/netsvc.py index bc0d5362468..c3450f86c26 100644 --- a/bin/netsvc.py +++ b/bin/netsvc.py @@ -154,22 +154,20 @@ def init_logger(): import os logger = logging.getLogger() + # create a format for log messages and dates + formatter = logging.Formatter('[%(asctime)s] %(levelname)s:%(name)s:%(message)s', '%a %b %d %Y %H:%M:%S') if tools.config['syslog']: # SysLog Handler if os.name == 'nt': - sysloghandler = logging.handlers.NTEventLogHandler("%s %s" % + handler = logging.handlers.NTEventLogHandler("%s %s" % (release.description, release.version)) else: - sysloghandler = logging.handlers.SysLogHandler('/dev/log') - formatter = logging.Formatter('%(application)s:%(uncoloredlevelname)s:%(name)s:%(message)s') - sysloghandler.setFormatter(formatter) - logger.addHandler(sysloghandler) + handler = logging.handlers.SysLogHandler('/dev/log') + formatter = logging.Formatter("%s %s" % (release.description, release.version) + ':%(levelname)s:%(name)s:%(message)s') - # create a format for log messages and dates - formatter = logging.Formatter('[%(asctime)s] %(levelname)s:%(name)s:%(message)s', '%a %b %d %Y %H:%M:%S') - if tools.config['logfile']: + elif tools.config['logfile']: # LogFile Handler logf = tools.config['logfile'] try: @@ -216,14 +214,6 @@ def init_logger(): class Logger(object): - def uncoloredlevelname(self, level): - # The level'names are globals to all loggers, so we must strip-off the - # color formatting for some specific logger (i.e: syslog) - levelname = logging.getLevelName(getattr(logging, level.upper(), 0)) - if levelname.startswith("\x1b["): - return levelname[10:-4] - return levelname - def notifyChannel(self, name, level, msg): log = logging.getLogger(name) @@ -231,19 +221,14 @@ class Logger(object): fct = lambda msg, *args, **kwargs: log.log(logging.DEBUG_RPC, msg, *args, **kwargs) setattr(log, LOG_DEBUG_RPC, fct) - extra = { - 'uncoloredlevelname': self.uncoloredlevelname(level), - 'application' : "%s %s" % (release.description, release.version), - } - level_method = getattr(log, level) result = tools.ustr(msg).strip().split('\n') if len(result)>1: for idx, s in enumerate(result): - level_method('[%02d]: %s' % (idx+1, s,), extra=extra) + level_method('[%02d]: %s' % (idx+1, s,)) elif result: - level_method(result[0], extra=extra) + level_method(result[0]) import tools init_logger() diff --git a/bin/tools/config.py b/bin/tools/config.py index d8d507dca03..5276fffdf0d 100644 --- a/bin/tools/config.py +++ b/bin/tools/config.py @@ -179,6 +179,7 @@ class configmanager(object): (opt, args) = parser.parse_args() + assert not (bool(opt.syslog) and bool(opt.logfile)), "the syslog and logfile options are exclusive" assert not (opt.translate_in and (not opt.language or not opt.db_name)), "the i18n-import option cannot be used without the language (-l) and the database (-d) options" assert not (opt.translate_out and (not opt.db_name)), "the i18n-export option cannot be used without the database (-d) option" From 907bbe31c98566b9fbacc8251da6d839dcd12563 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 29 Dec 2008 11:26:26 +0100 Subject: [PATCH 09/19] [FIX] Change the description bzr revid: stephane@tinyerp.com-20081229102626-s95ab0770aqdfp2s --- bin/release.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/release.py b/bin/release.py index 5f492e3d0ff..7a182f22e4c 100644 --- a/bin/release.py +++ b/bin/release.py @@ -30,7 +30,7 @@ OpenERP is a complete ERP and CRM. The main features are accounting (analytic and financial), stock management, sales and purchases management, tasks automation, marketing campaigns, help desk, POS, etc. Technical features include a distributed server, flexible workflows, an object database, a dynamic GUI, -customizable reports, and SOAP and XML-RPC interfaces. +customizable reports, and XML-RPC interfaces. ''' classifiers = """\ Development Status :: 5 - Production/Stable From 99c6070e3f2b10ab90e7142c739cf6b56f2edc91 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 29 Dec 2008 11:28:59 +0100 Subject: [PATCH 10/19] [FIX] Add the rpminstall_sh.txt script lp bug: https://launchpad.net/bugs/311981 fixed bzr revid: stephane@tinyerp.com-20081229102859-bgxe0btq1d315a6m --- MANIFEST.in | 1 + rpminstall_sh.txt | 14 ++++++++++++++ setup.cfg | 17 +++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 rpminstall_sh.txt create mode 100644 setup.cfg diff --git a/MANIFEST.in b/MANIFEST.in index 86edb9c56ac..9f3f31af1f1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ +include rpminstall_sh.txt include README include bin/import_xml.rng include bin/server.cert diff --git a/rpminstall_sh.txt b/rpminstall_sh.txt new file mode 100644 index 00000000000..0d88cc1dcf1 --- /dev/null +++ b/rpminstall_sh.txt @@ -0,0 +1,14 @@ +# +# This file is used by 'python setup.py bdist_rpm' +# You should not execute/call this file yourself. +# +# This script is used as the 'install' part of the RPM .spec file. +# +# Need to overwrite the install-part of the RPM to append the +# compression-suffix onto the filenames for the man-pages. +# +python setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES + +SUFFIX=gz +mv INSTALLED_FILES INSTALLED_FILES.orig +sed "s!\(/share/man/.*\)!\1.$SUFFIX!" INSTALLED_FILES.orig > INSTALLED_FILES diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000000..caf187e4c33 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,17 @@ +[sdist] +formats=gztar + +[bdist] +formats=rpm + +[bdist_rpm] +release=1 + +requires=python >= 2.3 +#build-requires=python-devel >= 2.3 + +#doc_files = doc/* + +# Need to overwrite the install-part of the RPM to patch +# the filenames of the man pages. +install_script=rpminstall_sh.txt From 10af1c94eaa5c4ab579ebbcd8155e25c9b4ee4c8 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 29 Dec 2008 16:14:24 +0530 Subject: [PATCH 11/19] Added Balance sheet and PnL reoprts for l10n_fr bzr revid: jvo@tinyerp.com-20081229104424-a8mcjvfjgut0zfst --- addons/l10n_fr/__init__.py | 1 + addons/l10n_fr/__terp__.py | 2 +- addons/l10n_fr/fr_wizard.xml | 28 +- addons/l10n_fr/report/__init__.py | 30 ++ addons/l10n_fr/report/base_report.py | 125 +++++ addons/l10n_fr/report/report_bilan.py | 36 ++ addons/l10n_fr/report/report_bilan.rml | 3 + addons/l10n_fr/report/report_cdr.py | 36 ++ addons/l10n_fr/report/report_cdr.rml | 655 +++++++++++++++++++++++++ addons/l10n_fr/wizard/__init__.py | 2 + addons/l10n_fr/wizard/wizard_bilan.py | 57 +++ addons/l10n_fr/wizard/wizard_cdr.py | 57 +++ 12 files changed, 1026 insertions(+), 6 deletions(-) create mode 100755 addons/l10n_fr/report/__init__.py create mode 100755 addons/l10n_fr/report/base_report.py create mode 100755 addons/l10n_fr/report/report_bilan.py create mode 100755 addons/l10n_fr/report/report_bilan.rml create mode 100755 addons/l10n_fr/report/report_cdr.py create mode 100755 addons/l10n_fr/report/report_cdr.rml create mode 100755 addons/l10n_fr/wizard/wizard_bilan.py create mode 100755 addons/l10n_fr/wizard/wizard_cdr.py diff --git a/addons/l10n_fr/__init__.py b/addons/l10n_fr/__init__.py index 747566bf5d1..db9b32b8027 100644 --- a/addons/l10n_fr/__init__.py +++ b/addons/l10n_fr/__init__.py @@ -22,6 +22,7 @@ import l10n_fr import wizard +import report # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_fr/__terp__.py b/addons/l10n_fr/__terp__.py index d632dbae9ff..4aed0b86471 100644 --- a/addons/l10n_fr/__terp__.py +++ b/addons/l10n_fr/__terp__.py @@ -48,7 +48,7 @@ """, "init_xml" : ["fr_data.xml"], "update_xml" : ["l10n_fr_view.xml","types.xml", "plan-99-03_societe.xml", - "taxes.xml","fr_wizard.xml"], + "taxes.xml","fr_wizard.xml",], "demo_xml" : [], "installable": True } diff --git a/addons/l10n_fr/fr_wizard.xml b/addons/l10n_fr/fr_wizard.xml index b6468872879..e84269fd279 100755 --- a/addons/l10n_fr/fr_wizard.xml +++ b/addons/l10n_fr/fr_wizard.xml @@ -7,11 +7,29 @@ - Generate Chart of Accounts from a Chart Template - Generate Chart of Accounts from a Chart Template. You will be asked to pass the name of the company, the chart template to follow, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated. -This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template. - - + Generate Chart of Accounts from a Chart Template + Generate Chart of Accounts from a Chart Template. You will be asked to pass the name of the company, the chart template to follow, the no. of digits to generate the code for your accounts and Bank account, currency to create Journals. Thus,the pure copy of chart Template is generated. + This is the same wizard that runs from Financial Management/Configuration/Financial Accounting/Financial Accounts/Generate Chart of Accounts from a Chart Template. + + + + + + + + + + diff --git a/addons/l10n_fr/report/__init__.py b/addons/l10n_fr/report/__init__.py new file mode 100755 index 00000000000..c9ddc4485e7 --- /dev/null +++ b/addons/l10n_fr/report/__init__.py @@ -0,0 +1,30 @@ +############################################################################## +# +# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import base_report +import report_bilan +import report_cdr diff --git a/addons/l10n_fr/report/base_report.py b/addons/l10n_fr/report/base_report.py new file mode 100755 index 00000000000..755dcfadaf4 --- /dev/null +++ b/addons/l10n_fr/report/base_report.py @@ -0,0 +1,125 @@ +############################################################################## +# +# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import time +from report import report_sxw + +class base_report(report_sxw.rml_parse): + def __init__(self, cr, uid, name, context): + super(base_report, self).__init__(cr, uid, name, context) + self.localcontext.update( { + 'time': time, + '_load': self._load, + '_get_variable': self._get_variable, + '_set_variable': self._set_variable, + }) + self.context = context + + def _load(self,name,form): + fiscalyear=self.pool.get('account.fiscalyear').browse(self.cr, self.uid, form['fiscalyear']) + + periods=self.pool.get('account.period').search(self.cr, self.uid,[('fiscalyear_id','=',form['fiscalyear'])]) + period_query_cond=str(tuple(periods)) + + query = "SELECT MIN(date_start) AS date_start, MAX(date_stop) AS date_stop FROM account_period WHERE id IN "+str(period_query_cond) + self.cr.execute(query) + dates =self.cr.dictfetchall() + self._set_variable('date_start', dates[0]['date_start']) + self._set_variable('date_stop', dates[0]['date_stop']) + + query = "SELECT l10n_fr_line.code,definition FROM l10n_fr_line LEFT JOIN l10n_fr_report ON l10n_fr_report.id=report_id WHERE l10n_fr_report.code='"+name+"'" + self.cr.execute(query) + datas =self.cr.dictfetchall() + + for line in datas: + self._load_accounts(form,line['code'],eval(line['definition']),fiscalyear,period_query_cond) + + def _set_variable(self,variable,valeur): + self.localcontext.update({variable:valeur}) + + def _get_variable(self,variable): + return self.localcontext[variable] + + def _load_accounts(self,form,code,definition,fiscalyear,period_query_cond): + + #self.context.copy() + accounts={} + for x in definition['load']: + p=x.split(":") + accounts[p[1]]=[p[0],p[2]] + + sum=0.0 + + if fiscalyear.state!='done' or not code.startswith('bpcheck'): + + query_cond="(" + for account in accounts: + query_cond += "aa.code LIKE '"+account+"%' OR " + query_cond = query_cond[:-4]+")" + + if len(definition['except'])>0: + query_cond = query_cond+" and (" + for account in definition['except']: + query_cond += "aa.code NOT LIKE '"+account+"%' AND " + query_cond = query_cond[:-5]+")" + + closed_cond="" + + if fiscalyear.state=='done': + closed_cond=" AND (aml.move_id NOT IN (SELECT account_move.id as move_id FROM account_move WHERE period_id IN "+str(period_query_cond)+" AND journal_id=(SELECT res_id FROM ir_model_data WHERE name='closing_journal' AND module='l10n_fr')) OR (aa.type != 'income' AND aa.type !='expense'))" + + query = "SELECT aa.code AS code, SUM(debit) as debit, SUM(credit) as credit FROM account_move_line aml LEFT JOIN account_account aa ON aa.id=aml.account_id WHERE "+query_cond+closed_cond+" AND aml.state='valid' AND aml.period_id IN "+str(period_query_cond)+" GROUP BY code" + + self.cr.execute(query) + + lines =self.cr.dictfetchall() + + for line in lines: + for account in accounts: + if(line["code"].startswith(account)): + operator=accounts[account][0] + type=accounts[account][1] + + value=0.0 + + if(type=="S"): + value=line["debit"]-line["credit"] + elif(type=="D"): + value=line["debit"]-line["credit"] + if(value<0.001): value=0.0 + elif(type=="C"): + value=line["credit"]-line["debit"] + if(value<0.001): value=0.0 + + if(operator=='+'): + sum+=value + else: + sum-=value + + break + + self._set_variable(code, sum) diff --git a/addons/l10n_fr/report/report_bilan.py b/addons/l10n_fr/report/report_bilan.py new file mode 100755 index 00000000000..290735e8ee7 --- /dev/null +++ b/addons/l10n_fr/report/report_bilan.py @@ -0,0 +1,36 @@ +############################################################################## +# +# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import base_report +from report import report_sxw + +class bilan(base_report.base_report): + def __init__(self, cr, uid, name, context): + super(bilan, self).__init__(cr, uid, name, context) + +report_sxw.report_sxw('report.l10n.fr.bilan', 'account.move.line','addons/l10n_fr/report/report_bilan.rml', parser=bilan, header=False) + diff --git a/addons/l10n_fr/report/report_bilan.rml b/addons/l10n_fr/report/report_bilan.rml new file mode 100755 index 00000000000..a462f61404e --- /dev/null +++ b/addons/l10n_fr/report/report_bilan.rml @@ -0,0 +1,3 @@ + +[[ _load('bilan',data['form'])]][[ _set_variable('at1a',bavar1+bavar2+bavar3+bavar4+bavar5+bavar6+bavar7+bavar8+bavar9+bavar10+bavar11+bavar12+bavar13+bavar14+bavar15+bavar16+bavar17+bavar18+bavar19+bavar20)]][[ _set_variable('at1b', bavar2b+bavar3b+bavar4b+bavar5b+bavar6b+bavar7b+bavar9b+bavar10b+bavar11b+bavar12b+bavar13b+bavar15b+ bavar16b+bavar17b+bavar18b+bavar19b+bavar20b)]][[ _set_variable('at1', at1a+at1b)]][[ _set_variable('at2a', bavar21+bavar22+bavar23+bavar24+bavar25+bavar26+bavar27+bavar28+bavar29+bavar30+bavar31+bavar32+bavar33)]][[ _set_variable('at2b', bavar21b+bavar22b+bavar23b+bavar24b+bavar26b+bavar27b+bavar29b+bavar30b)]][[ _set_variable('at2', at2a+at2b)]][[ _set_variable('actif', at1+at2+bavar34+bavar35+bavar36)]][[ _set_variable('pt1', bpvar1+bpvar2+bpvar3+bpvar4+bpvar5+bpvar6+bpvar7+bpvar8+bpvar9+bpvar10+bpvar11+bpvar12)]][[ _set_variable('pt2', bpvar13+bpvar14)]][[ _set_variable('pt3', bpvar15+bpvar16+bpvar17+bpvar18+bpvar19+bpvar20+bpvar21+bpvar22+bpvar23+bpvar24+bpvar25)]][[ _set_variable('passif', pt1+pt2+pt3+bpvar26)]][[ company.name ]]au [[ time.strftime('%d-%m-%Y',time.strptime(date_stop,'%Y-%m-%d'))]]BilanImprimé le : [[ time.strftime('%d-%m-%Y') ]] Tenue de Compte : [[ company.currency_id.name ]]ACTIF BrutAmortissements et dépréciationsNetCapital souscrit - non appelé[[bavar1]] [[bavar1]]ACTIF IMMOBILISÉ IMMOBILISATIONS INCORPORELLES Frais d'établissement[[bavar2]][[-bavar2b]][[bavar2+bavar2b]]Frais de recherche et de développement[[bavar3]][[-bavar3b]][[bavar3+bavar3b]]Concessions, brevets, licences,..., droits et valeurs similaires[[bavar4]][[-bavar4b]][[bavar4+bavar4b]]Fonds commercial[[bavar5]][[-bavar5b]][[bavar5+bavar5b]]Autres[[bavar6]][[-bavar6b]][[bavar6+bavar6b]]Immobilisations incorporelles en cours[[bavar7]][[-bavar7b]][[bavar7+bavar7b]]Avances et acomptes[[bavar8]] [[bavar8]]IMMOBILISATIONS CORPORELLES Terrains[[bavar9]][[-bavar9b]][[bavar9+bavar9b]]Constructions[[bavar10]][[-bavar10b]][[bavar10+bavar10b]]Installations techniques,matériel et outillage[[bavar11]][[-bavar11b]][[bavar11+bavar11b]]Autres [[bavar12]][[-bavar12b]][[bavar12+bavar12b]]Immobilisations corporelles en cours[[bavar13]][[-bavar13b]][[bavar13+bavar13b]]Avances et acomptes[[bavar14]] [[bavar14]]IMMOBILISATIONS FINANCIÉRES Participations[[bavar15]][[-bavar15b]][[bavar15+bavar15b]]Créances rattachées à des participations[[bavar16]][[-bavar16b]][[bavar16+bavar16b]]Titres immobilisés de l'activité de portefeuille[[bavar17]][[-bavar17b]][[bavar17+bavar17b]]Autres titres immobilisés[[bavar18]][[-bavar18b]][[bavar18+bavar18b]]Prêts[[bavar19]][[-bavar19b]][[bavar19+bavar19b]]Autres[[bavar20]][[-bavar20b]][[bavar20+bavar20b]]TOTAL I[[at1a]][[-at1b]][[at1]]ACTIF CIRCULANT STOCK EN COURS Matières premières et autres approvisionnements[[bavar21]][[-bavar21b]][[bavar21+bavar21b]]En-cours de production [biens et services][[bavar22]][[-bavar22b]][[bavar22+bavar22b]]Produits intermédiaires et finis[[bavar23]][[-bavar23b]][[bavar23+bavar23b]]Marchandises[[bavar24]][[-bavar24b]][[bavar24+bavar24b]]Avances et acomptes versés sur commandes[[bavar25]] [[bavar25]]CRÉANCES Créances clients et comptes rattachés[[bavar26]][[-bavar26b]][[bavar26+bavar26b]]Autres[[bavar27]][[-bavar27b]][[bavar27+bavar27b]]Capital souscrit - appelé , non versé[[bavar28]] [[bavar28]]VALEURS MOBILIÈRES DE PLACEMENT Actions propres[[bavar29]][[-bavar29b]][[bavar29+bavar29b]]Autres titres[[bavar30]][[-bavar30b]][[bavar30+bavar30b]]Instruments de trésorerie[[bavar31]] [[bavar31]]Disponibilités[[bavar32]] [[bavar32]]Charges constatés d'avance[[bavar33]] [[bavar33]]TOTAL II[[at2a]][[-at2b]][[at2]]Charges à répartir sur plusieurs exercices ( III )[[bavar34]] [[bavar34]]Primes de remboursement des emprunts ( IV )[[bavar35]] [[bavar35]]Écarts de conversion actif ( V )[[bavar36]] [[bavar36]]TOTAL ACTIF ( I + II + III + IV + V )[[at1a+at2a]][[-at1b-at2b]][[actif]]PASSIFCAPITAUX PROPRES Capital [dont versé...][[bpvar1]]Primes d'émission, de fusion, d'apport[[bpvar2]]Écarts de réévaluation[[bpvar3]]Écart d'équivalence[[bpvar4]]RÉSERVES Réserve légale[[bpvar5]]Réserves statutaires ou contractuelles[[bpvar6]]Réserves réglementées[[bpvar7]]Autres réserves[[bpvar8]]Report à nouveau[[bpvar9]]RÉSULTAT DE L'EXERCICE [bénéfice ou perte][[bpvar10]]Subventions d'investissement[[bpvar11]]Provisions réglementées[[bpvar12]]TOTAL I[[pt1]]PROVISIONS Provisions pour risques[[bpvar13]]Provisions pour charges[[bpvar14]]TOTAL II[[pt2]]DETTES Emprunts obligataires convertibles[[bpvar15]]Autres emprunts obligataires[[bpvar16]]Emprunts et dettes auprès des établissements de crédit[[bpvar17]]Emprunts et dettes financières diverses[[bpvar18]]Avances et acomptes reçus sur commandes en cours[[bpvar19]]Dettes fournisseurs et comptes rattachés [[bpvar20]]Dettes fiscales et sociales[[bpvar21]]Dettes sur immobilisations et comptes rattachés[[bpvar22]]Autres dettes[[bpvar23]]Instruments de trésorerie[[bpvar24]]Produits constatés d'avance[[bpvar25]]TOTAL III[[pt3]]Écarts de conversion passif ( IV )[[bpvar26]]TOTAL GÉNÉRAL (I + II + III + IV)[[passif]]ACTIF - PASSIF[[round(actif-passif,2)]] [[ abs(bpcheck)<0.0001 and removeParentNode('para') ]] Attention, pour que votre bilan soit correct, vous devez solder les comptes 120 ou 129 (Résultat de l'exercice précédant) dans un compte de report à nouveau (compte 110 ou 119) ou dans le compte 108. Renseignez vous sur votre structure juridique et son fonctionnement comptable. + diff --git a/addons/l10n_fr/report/report_cdr.py b/addons/l10n_fr/report/report_cdr.py new file mode 100755 index 00000000000..ac884c1fabb --- /dev/null +++ b/addons/l10n_fr/report/report_cdr.py @@ -0,0 +1,36 @@ +############################################################################## +# +# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import base_report +from report import report_sxw + +class cdr(base_report.base_report): + def __init__(self, cr, uid, name, context): + super(cdr, self).__init__(cr, uid, name, context) + +report_sxw.report_sxw('report.l10n.fr.cdr', 'account.move.line','addons/l10n_fr/report/report_cdr.rml', parser=cdr, header=False) + diff --git a/addons/l10n_fr/report/report_cdr.rml b/addons/l10n_fr/report/report_cdr.rml new file mode 100755 index 00000000000..a311556c7d5 --- /dev/null +++ b/addons/l10n_fr/report/report_cdr.rml @@ -0,0 +1,655 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +[[ _load('cdr',data['form'])]] +[[ _set_variable('ct1', cdrc1+cdrc2+cdrc3+cdrc4+cdrc5+cdrc6+cdrc7+cdrc8+cdrc9+cdrc10+cdrc11+cdrc12+cdrc13+cdrc14+cdrc15)]] +[[ _set_variable('ct3', cdrc17+cdrc18+cdrc19+cdrc20)]] +[[ _set_variable('ct4', cdrc21+cdrc22+cdrc23)]] +[[ _set_variable('charges', ct1+cdrc16+ct3+ct4+cdrc24+cdrc25)]] +[[ _set_variable('pta', cdrp1+cdrp2)]] +[[ _set_variable('ptb', cdrp3+cdrp4+cdrp5+cdrp6+cdrp7)]] +[[ _set_variable('pt1', pta+ptb)]] +[[ _set_variable('pt3', cdrp9+cdrp10+cdrp11+cdrp12+cdrp13+cdrp14)]] +[[ _set_variable('pt4', cdrp15+cdrp16+cdrp17)]] +[[ _set_variable('produits', pt1+cdrp8+pt3+pt4)]] + + + +[[ company.name ]] +période du [[ time.strftime('%d-%m-%Y',time.strptime(date_start,'%Y-%m-%d'))]] au [[ time.strftime('%d-%m-%Y',time.strptime(date_stop,'%Y-%m-%d'))]] + + +Compte de résultat + + +Imprimé le : [[ time.strftime('%d-%m-%Y') ]] + + + + + + + + + + + + + + +Tenue de Compte : [[ company.currency_id.name ]] + + + + + + + + + +CHARGES ( hors taxes ) + + + + + + + + + +CHARGES D'EXPLOITATION + + + + + + + + + +Achat de marchandises + + +[[ '%.2f' % cdrc1 ]] + + + + +Variation des stocks + + +[[cdrc2]] + + + + +Achats de matières premières et autres approvisionnements + + +[[cdrc3]] + + + + +Variation des stocks + + +[[cdrc4]] + + + + +Autres achats et charges externes + + +[[cdrc5]] + + + + +Redevances de crédit-bail mobilier + + +[[cdrc6]] + + + + +Redevances de crédit-bail immobilier + + +[[cdrc7]] + + + + +Impôts, taxes et versements assimilés + + +[[cdrc8]] + + + + +Salaires et traitements + + +[[cdrc9]] + + + + +Charges sociales + + +[[cdrc10]] + + + + +Dotation aux amortissements et aux dépréciations + + + + + + + + + +Sur immobilisations : dotations aux amortissements + + +[[cdrc11]] + + + + +Sur immobilisations : dotations aux dépréciations + + +[[cdrc12]] + + + + +Sur actif circulant : dotations aux dépréciations + + +[[cdrc13]] + + + + +Dotations aux provisions + + +[[cdrc14]] + + + + +Autres charges + + +[[cdrc15]] + + + + +TOTAL I + + +[[ct1]] + + + + +Quotes-parts de résultat sur opérations faites en commun ( II ) + + +[[cdrc16]] + + + + +CHARGES FINANCIÈRES + + + + + + + + + +Dotations aux amortissements, aux dépréciations et aux provisions + + +[[cdrc17]] + + + + +Intérêts et charges assimilées + + +[[cdrc18]] + + + + +Différences négatives de change + + +[[cdrc19]] + + + + +Charges nettes sur cessions de valeurs mobilières de placement + + +[[cdrc20]] + + + + +TOTAL III + + +[[ct3]] + + + + +CHARGES EXCEPTIONNELLES + + + + + + + + + +Sur opérations de gestion + + +[[cdrc21]] + + + + +Sur opérations en capital + + +[[cdrc22]] + + + + +Dotations aux amortissements, aux dépréciations et aux provisions + + +[[cdrc23]] + + + + +TOTAL IV + + +[[ct4]] + + + + +Participation des salariés aux résultats ( V ) + + + +[[cdrc24]] + + + + +Impôts sur les bénéfices ( VI ) + + + +[[cdrc25]] + + + + +TOTAL CHARGES ( I + II + III + IV+ V+ VI ) + + +[[charges]] + + + + + + + + + + + + + + + + +PRODUITS (hors taxes) + + + + + + + + + +PRODUITS D'EXPLOITATION + + + + + + + + + +Vente de marchandises + + +[[cdrp1]] + + + + +Production vendue [biens et services] + + +[[cdrp2]] + + + + +Sous-total A - Montant net du chiffre d'affaires + + +[[pta]] + + + + +Production stockée + + +[[cdrp3]] + + + + +Production immobilisée + + +[[cdrp4]] + + + + +Subventions d'exploitation + + +[[cdrp5]] + + + + +Reprises sur provisions, dépréciations (et amortissements) et transferts de charges + + +[[cdrp6]] + + + + +Autres produits + + +[[cdrp7]] + + + + +Sous-total B + + +[[ptb]] + + + + +TOTAL I ( A + B ) + + +[[pt1]] + + + + +Quotes-parts de résultat sur opérations faites en commun (II) + + +[[cdrp8]] + + + + +PRODUITS FINANCIERS + + + + + + + + + +De participation + + +[[cdrp9]] + + + + +D'autres valeurs mobilières et créances de l'actif immobilisé + + +[[cdrp10]] + + + + +Autres intérêts et produits assimilés + + +[[cdrp11]] + + + + +Reprises sur provisions, dépréciations et transferts de charges + + +[[cdrp12]] + + + + +Différences positives de change + + +[[cdrp13]] + + + + +Produits nets sur cessions de valeurs mobilières de placement + + +[[cdrp14]] + + + + +TOTAL III + + +[[pt3]] + + + + +PRODUITS EXCEPTIONNELS + + + + + + + + + +Sur opérations de gestion + + +[[cdrp15]] + + + + +Sur opérations en capital + + +[[cdrp16]] + + + + +Reprises sur provisions, dépréciations et transferts de charges + + +[[cdrp17]] + + + + +TOTAL IV + + +[[pt4]] + + + + +TOTAL DES PRODUITS ( I + II + III + IV ) + + +[[produits]] + + + + +PRODUITS - CHARGES + + +[[produits-charges]] + + + + + + + + + diff --git a/addons/l10n_fr/wizard/__init__.py b/addons/l10n_fr/wizard/__init__.py index 6d5ce39192d..baef99be2ee 100644 --- a/addons/l10n_fr/wizard/__init__.py +++ b/addons/l10n_fr/wizard/__init__.py @@ -21,6 +21,8 @@ ############################################################################## import wizard_chart_report +import wizard_bilan +import wizard_cdr # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_fr/wizard/wizard_bilan.py b/addons/l10n_fr/wizard/wizard_bilan.py new file mode 100755 index 00000000000..cec3bd9add4 --- /dev/null +++ b/addons/l10n_fr/wizard/wizard_bilan.py @@ -0,0 +1,57 @@ +############################################################################## +# +# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import wizard +import pooler + +dates_form = ''' +
+ +''' + +dates_fields = { + 'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear', 'required': True} +} + +class wizard_report(wizard.interface): + def _get_defaults(self, cr, uid, data, context): + fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear') + data['form']['fiscalyear'] =fiscalyear_obj.find(cr, uid) + return data['form'] + + states = { + 'init': { + 'actions': [_get_defaults], + 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('report','Print')]} + }, + 'report': { + 'actions': [], + 'result': {'type':'print', 'report':'l10n.fr.bilan', 'state':'end'} + } + } +wizard_report('l10n.fr.bilan.report') + diff --git a/addons/l10n_fr/wizard/wizard_cdr.py b/addons/l10n_fr/wizard/wizard_cdr.py new file mode 100755 index 00000000000..4ccfa908414 --- /dev/null +++ b/addons/l10n_fr/wizard/wizard_cdr.py @@ -0,0 +1,57 @@ +############################################################################## +# +# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +import wizard +import pooler + +dates_form = ''' +
+ +''' + +dates_fields = { + 'fiscalyear': {'string': 'Fiscal year', 'type': 'many2one', 'relation': 'account.fiscalyear', 'required': True} +} + +class wizard_report(wizard.interface): + def _get_defaults(self, cr, uid, data, context): + fiscalyear_obj = pooler.get_pool(cr.dbname).get('account.fiscalyear') + data['form']['fiscalyear'] = fiscalyear_obj.find(cr, uid) + return data['form'] + + states = { + 'init': { + 'actions': [_get_defaults], + 'result': {'type':'form', 'arch':dates_form, 'fields':dates_fields, 'state':[('end','Cancel'),('report','Print')]} + }, + 'report': { + 'actions': [], + 'result': {'type':'print', 'report':'l10n.fr.cdr', 'state':'end'} + } + } +wizard_report('l10n.fr.cdr.report') + From 9231286c7489c401d9138f3e0f710025a88aef23 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 29 Dec 2008 18:06:01 +0530 Subject: [PATCH 12/19] Bugfix on report :Added unicode method on browse_null bzr revid: jvo@tinyerp.com-20081229123601-y1bpr4syt2rtyu5d --- bin/osv/orm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 7641e6db8b6..2c41d7bcf43 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -94,6 +94,9 @@ class browse_null(object): def __nonzero__(self): return False + + def __unicode__(self): + return u'' # From 8e9f0e45ae8900aac12cf42424b28426a3981926 Mon Sep 17 00:00:00 2001 From: noz Date: Mon, 29 Dec 2008 19:24:55 +0530 Subject: [PATCH 13/19] * Fixed view problem in web-client. bzr revid: noz@tinyerp.com-20081229135455-7bmk5jzmm3v2nce5 --- addons/stock/stock_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index f8f3837e06b..1a55d855865 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -834,6 +834,7 @@ domain="[('product_id','=',product_id)]" on_change="onchange_lot_id(prodlot_id,product_qty, location_id)"/> +