From 03d8be3790f38c5aef3e48908ce94a00ec169a99 Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Tue, 22 Sep 2009 19:44:47 +0530 Subject: [PATCH 01/69] [FIX] base_module_quality: speed test if read method has exception bzr revid: mra@tinyerp.com-20090922141447-e22fbytnhwtokuqs --- .../speed_test/speed_test.py | 53 +++++++++++-------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/addons/base_module_quality/speed_test/speed_test.py b/addons/base_module_quality/speed_test/speed_test.py index 875b2de136a..29252cab8b1 100644 --- a/addons/base_module_quality/speed_test/speed_test.py +++ b/addons/base_module_quality/speed_test/speed_test.py @@ -64,6 +64,9 @@ This test checks the speed of the module. Note that at least 5 demo data is need result_dict2 = {} self.result_details += _("O(1) means that the number of SQL requests to read the object does not depand on the number of objects we are reading. This feature is hardly wished.\n") for obj, ids in obj_ids.items(): + code_base_complexity = 0 + code_half_complexity = 0 + code_size_complexity = 0 obj_counter += 1 ids = ids[:100] size = len(ids) @@ -71,34 +74,38 @@ This test checks the speed of the module. Note that at least 5 demo data is need if size: speed_list = [] #we perform the operation twice, and count the number of queries in the second run. This allows to avoid the cache effect. (like translated terms that asks for more queries) - pool.get(obj).read(cr, uid, [ids[0]]) - cnt = cr.count - pool.get(obj).read(cr, uid, [ids[0]]) - code_base_complexity = cr.count - cnt + try: + pool.get(obj).read(cr, uid, [ids[0]]) + cnt = cr.count + pool.get(obj).read(cr, uid, [ids[0]]) + code_base_complexity = cr.count - cnt - pool.get(obj).read(cr, uid, ids[:size/2]) - cnt = cr.count - pool.get(obj).read(cr, uid, ids[:size/2]) - code_half_complexity = cr.count - cnt + pool.get(obj).read(cr, uid, ids[:size/2]) + cnt = cr.count + pool.get(obj).read(cr, uid, ids[:size/2]) + code_half_complexity = cr.count - cnt - pool.get(obj).read(cr, uid, ids) - cnt = cr.count - pool.get(obj).read(cr, uid, ids) - code_size_complexity = cr.count - cnt - - if size < 5: - speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, _("Warning! Not enough demo data")] - list2 = [obj, _("No enough data")] + pool.get(obj).read(cr, uid, ids) + cnt = cr.count + pool.get(obj).read(cr, uid, ids) + code_size_complexity = cr.count - cnt + except Exception, e: + list2 = [obj, _("Error in Read method")] + speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, _("Error in Read method:" + str(e))] else: - if code_size_complexity <= (code_base_complexity + size): - complexity = _("O(1)") - score += 1 - list2 = [obj, _("Efficient")] + if size < 5: + speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, _("Warning! Not enough demo data")] + list2 = [obj, _("No enough data")] else: - complexity = _("O(n) or worst") - list2 = [obj, _("Not Efficient")] + if code_size_complexity <= (code_base_complexity + size): + complexity = _("O(1)") + score += 1 + list2 = [obj, _("Efficient")] + else: + complexity = _("O(n) or worst") + list2 = [obj, _("Not Efficient")] - speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, complexity] + speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, complexity] else: speed_list = [obj, size, "", "", "", _("Warning! Object has no demo data")] list2 = [obj, _("No data")] From c9e3a815805ce0aed04022581a6cd67943c7d577 Mon Sep 17 00:00:00 2001 From: "Sbh (Open ERP)" Date: Wed, 23 Sep 2009 12:42:36 +0530 Subject: [PATCH 02/69] [FIX] set the access right bzr revid: sbh@tinyerp.com-20090923071236-uq53il4x6tchh81w --- addons/base_report_designer/__terp__.py | 4 ++-- addons/base_report_designer/base_report_data.xml | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/base_report_designer/__terp__.py b/addons/base_report_designer/__terp__.py index c66be0ec379..9782fba2786 100644 --- a/addons/base_report_designer/__terp__.py +++ b/addons/base_report_designer/__terp__.py @@ -32,9 +32,9 @@ OpenOffice. 'author': 'Tiny', 'website': 'http://www.openerp.com', 'depends': ['base'], - 'init_xml': [], + 'init_xml': ['base_report_data.xml'], 'update_xml': ['base_report_designer_wizard.xml'], - 'demo_xml': ['base_report_data.xml'], + 'demo_xml': [], 'installable': True, 'active': False, 'certificate': '0056379010493', diff --git a/addons/base_report_designer/base_report_data.xml b/addons/base_report_designer/base_report_data.xml index 865a1181a22..3ad137ab649 100644 --- a/addons/base_report_designer/base_report_data.xml +++ b/addons/base_report_designer/base_report_data.xml @@ -7,5 +7,15 @@ + + + + + + + + + + From 0d741b110be463a76215611bca0054cf4afaadf7 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Wed, 23 Sep 2009 18:22:31 +0530 Subject: [PATCH 03/69] [FIX][CRITICAL]subscription: crash subscription process lp bug: https://launchpad.net/bugs/435178 fixed bzr revid: hmo@tinyerp.com-20090923125231-skjg2hkhw3tbvdsz --- addons/subscription/subscription.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/subscription/subscription.py b/addons/subscription/subscription.py index a6242321ca8..7c4c80f03be 100644 --- a/addons/subscription/subscription.py +++ b/addons/subscription/subscription.py @@ -98,6 +98,8 @@ class subscription_subscription(osv.osv): def model_copy(self, cr, uid, ids, context={}): for row in self.read(cr, uid, ids): + if not row.get('cron_id',False): + continue cron_ids = [row['cron_id'][0]] remaining = self.pool.get('ir.cron').read(cr, uid, cron_ids, ['numbercall'])[0]['numbercall'] try: From f8383842135329c0c100bc654d7cba562b51c894 Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Thu, 24 Sep 2009 16:20:25 +0530 Subject: [PATCH 04/69] [IMP] base_module_quality: pylint test result display for buildpot, use class on tag instead of css file bzr revid: mra@tinyerp.com-20090924105025-m65dbnc37zi0p1vd --- .../pylint_test/pylint_test.py | 43 ++++++++++++++++--- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/addons/base_module_quality/pylint_test/pylint_test.py b/addons/base_module_quality/pylint_test/pylint_test.py index c8ba4b77a3c..7873924de13 100644 --- a/addons/base_module_quality/pylint_test/pylint_test.py +++ b/addons/base_module_quality/pylint_test/pylint_test.py @@ -48,11 +48,29 @@ class quality_test(base_module_quality.abstract_quality_check): score = 0.0 dict_py = {} flag = False - self.result_details += ''' - - - - ''' + self.result_details += ''' + + + ''' for file_py in list_files: if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__terp__.py'): if not flag: @@ -84,8 +102,19 @@ class quality_test(base_module_quality.abstract_quality_check): score += 0 #self.result += file + ": "+_("Unable to parse the result. Check the details.")+"\n" dict_py[file_py] = [file_py, _("Unable to parse the result. Check the details.")] - self.result_details += res.replace(''' Date: Thu, 24 Sep 2009 17:54:48 +0530 Subject: [PATCH 05/69] [IMP] base_module_quality: modify all tests result display for buildpot, use class on tag instead of css file bzr revid: mra@tinyerp.com-20090924122448-iw771j32awal2b2u --- .../object_test/object_test.py | 42 ++++++++++++++++--- .../pep8_test/pep8_test.py | 21 +++++++++- .../speed_test/speed_test.py | 20 ++++++++- .../structure_test/structure_test.py | 20 ++++++++- .../terp_test/terp_test.py | 20 ++++++++- .../workflow_test/workflow_test.py | 20 ++++++++- 6 files changed, 128 insertions(+), 15 deletions(-) diff --git a/addons/base_module_quality/object_test/object_test.py b/addons/base_module_quality/object_test/object_test.py index d319d3f3a50..ada0b944cb4 100644 --- a/addons/base_module_quality/object_test/object_test.py +++ b/addons/base_module_quality/object_test/object_test.py @@ -184,9 +184,24 @@ Test checks for fields, views, security rules, dependancy level def get_result_details(self, dict_obj): res = "" if dict_obj != {}: - str_html = ''' Fields Result''' + str_html = ''' Fields Result + ''' res += str_html - header = ('%s%s%s', [_('Object Name'), _('Field name'), _('Suggestion')]) + header = ('%s%s%s', [_('Object Name'), _('Field name'), _('Suggestion')]) if not self.error: for key in dict_obj.keys(): data_list = [] @@ -196,15 +211,32 @@ Test checks for fields, views, security rules, dependancy level for i in data_list: count = count + 1 final_dict[key + str(count)] = i - res += '' + self.format_html_table(header, data_list=final_dict) + '

' + res_str = '' + self.format_html_table(header, data_list=final_dict) + '

' + res += res_str.replace('''' return "" def get_result_general(self, dict_obj, name=''): - str_html = ''' %s Result'''% (name) - header = ('', [_('Object Name'), _('Suggestion')]) + str_html = ''' %s Result +
%s%s
'''% (name) + header = ('', [_('Object Name'), _('Suggestion')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_obj) + '
%s%s
' + res = res.replace('''Result''' - header = ('', [_('Object Name'), _('Line number'), _('Suggestion')]) + str_html = '''Result + +
%s%s%s
''' + header = ('', [_('Object Name'), _('Line number'), _('Suggestion')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_obj) + '
%s%s%s
' + res = res.replace('''''' - header = ('', [_('Object Name'), _('N (Number of Records)'), _('1'), _('N/2'), _('N'), _('Reading Complexity')]) + str_html = ''' +
%s%s%s%s%s%s
''' + header = ('', [_('Object Name'), _('N (Number of Records)'), _('1'), _('N/2'), _('N'), _('Reading Complexity')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_speed) + '
%s%s%s%s%s%s
' + res = res.replace('''''' - header = ('', [_('File Name'), _('Feedback about structure of module')]) + str_html = ''' +
%s%s
''' + header = ('', [_('File Name'), _('Feedback about structure of module')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_struct) + '
%s%s
' + res = res.replace('''''' - header = ('', [_('Tag Name'), _('Feed back About terp file of Module')]) + str_html = ''' +
%s%s
''' + header = ('', [_('Tag Name'), _('Feed back About terp file of Module')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_terp) + '
%s%s
' + res = res.replace('''''' - header = ('', [_('Object Name'), _('Feed back About Workflow of Module')]) + str_html = ''' +
%s%s
''' + header = ('', [_('Object Name'), _('Feed back About Workflow of Module')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_wf) + '
%s%s
' + res = res.replace(''' Date: Thu, 24 Sep 2009 18:11:04 +0530 Subject: [PATCH 06/69] [FIX] Account : Partner Balance report gets printed with respect to the company selected lp bug: https://launchpad.net/bugs/351083 fixed bzr revid: jvo@tinyerp.com-20090924124104-1jujc0yjssk1dlbb --- addons/account/report/partner_balance.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/report/partner_balance.py b/addons/account/report/partner_balance.py index 4551aca1ed4..ddd6ad1ecb4 100755 --- a/addons/account/report/partner_balance.py +++ b/addons/account/report/partner_balance.py @@ -217,6 +217,7 @@ class partner_balance(report_sxw.rml_parse): "JOIN account_account ac ON (l.account_id = ac.id)" \ "WHERE ac.type IN " + self.ACCOUNT_TYPE + " " \ "AND l.date IN (" + self.date_lst_string + ") " \ + "AND ac.company_id = "+ str(data['form']['company_id']) +" " \ "GROUP BY p.id, p.ref, p.name,l.account_id,ac.name,ac.code " \ "ORDER BY l.account_id,p.name") res = self.cr.dictfetchall() From 667d3f782d4dc042abb317d1cce7cf3f82b22134 Mon Sep 17 00:00:00 2001 From: "nel@tinyerp.com" <> Date: Fri, 25 Sep 2009 14:53:07 +0200 Subject: [PATCH 07/69] Set right account when generating invoice bzr revid: nel@tinyerp.com-20090925125307-1knaa2pc8r3hmxys --- addons/mrp_repair/mrp_repair.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index c5cefd61267..0c4ae3a6f48 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -300,7 +300,7 @@ class mrp_repair(osv.osv): 'invoice_id': inv_id, 'name': name, 'origin':repair.name, - 'account_id': a, + 'account_id': operation.product_id and operation.product_id.property_account_income and operation.produc t_id.property_account_income.id, 'quantity' : operation.product_uom_qty, 'invoice_line_tax_id': [(6,0,[x.id for x in operation.tax_id])], 'uos_id' : operation.product_uom.id, From 872b75d4f3c7e6708dc8b419dfca6ad56c832b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borja=20L=C3=B3pez=20Soil=C3=A1n=20=28Pexego=29?= <> Date: Fri, 25 Sep 2009 18:58:13 +0530 Subject: [PATCH 08/69] [FIX] Sale: Passing Contact address for invoices from SO lp bug: https://launchpad.net/bugs/436008 fixed bzr revid: jvo@tinyerp.com-20090925132813-jrhul80rsxdo6aay --- addons/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index b33736714ca..52e25c603dd 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -374,7 +374,7 @@ class sale_order(osv.osv): 'account_id': a, 'partner_id': order.partner_id.id, 'address_invoice_id': order.partner_invoice_id.id, - 'address_contact_id': order.partner_invoice_id.id, + 'address_contact_id': order.partner_order_id.id, 'invoice_line': [(6, 0, lines)], 'currency_id': order.pricelist_id.currency_id.id, 'comment': order.note, From 0d897873892fb74090bfd193ce26a82f669b4783 Mon Sep 17 00:00:00 2001 From: "YSA(OpenERP)" <> Date: Fri, 25 Sep 2009 19:19:42 +0530 Subject: [PATCH 09/69] [FIX] Document: attachment linked with Files lp bug: https://launchpad.net/bugs/416810 fixed bzr revid: jvo@tinyerp.com-20090925134942-y663miys2ocgwi56 --- addons/document/document.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index 1d7ca841576..4b1a5c715e3 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -651,10 +651,11 @@ class document_file(osv.osv): def create(self, cr, uid, vals, context={}): vals['title']=vals['name'] vals['parent_id'] = context.get('parent_id',False) or vals.get('parent_id',False) - if not vals.get('res_id', False) and context.get('default_res_id',False): - vals['res_id']=context.get('default_res_id',False) - if not vals.get('res_model', False) and context.get('default_res_model',False): - vals['res_model']=context.get('default_res_model',False) +# if not vals.get('res_id', False) and context.get('default_res_id',False): +# vals['res_id']=context.get('default_res_id',False) +# if not vals.get('res_model', False) and context.get('default_res_model',False): +# vals['res_model']=context.get('default_res_model',False) + vals['res_model'] = "report.document.user" if vals.get('res_id', False) and vals.get('res_model',False): obj_model=self.pool.get(vals['res_model']) result = obj_model.read(cr, uid, [vals['res_id']], context=context) @@ -693,7 +694,8 @@ class document_file(osv.osv): try: res = content_index(base64.decodestring(datas), vals['datas_fname'], vals.get('content_type', None)) super(document_file,self).write(cr, uid, [result], { - 'index_content': res, + 'index_content' : res, + 'res_id' : result }) cr.commit() except: From c4120d295abcc5c7fee85306a691aed75574bc2e Mon Sep 17 00:00:00 2001 From: "nel@tinyerp.com" <> Date: Fri, 25 Sep 2009 15:51:48 +0200 Subject: [PATCH 10/69] [REM] spaces bzr revid: nel@tinyerp.com-20090925135148-15p33532ds8abxa4 --- addons/mrp_repair/mrp_repair.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 0c4ae3a6f48..a34f6c844b6 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -300,7 +300,7 @@ class mrp_repair(osv.osv): 'invoice_id': inv_id, 'name': name, 'origin':repair.name, - 'account_id': operation.product_id and operation.product_id.property_account_income and operation.produc t_id.property_account_income.id, + 'account_id': operation.product_id and operation.product_id.property_account_income and operation.product_id.property_account_income.id, 'quantity' : operation.product_uom_qty, 'invoice_line_tax_id': [(6,0,[x.id for x in operation.tax_id])], 'uos_id' : operation.product_uom.id, From b51701a4f22a9cf5b21e14f802207d4cf24a3893 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 25 Sep 2009 20:51:24 +0530 Subject: [PATCH 11/69] [FIX] Account: Supplier invoices was not taking product price on onchange of product lp bug: https://launchpad.net/bugs/436174 fixed bzr revid: jvo@tinyerp.com-20090925152124-kmh3iiikco7e8asg --- addons/account/account_invoice_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 6d14f25427c..8822568ef00 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -52,7 +52,7 @@
- + From 059077b108328d694836a8d23b0f01b840bdbef7 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 25 Sep 2009 21:02:35 +0530 Subject: [PATCH 12/69] [FIX] mrp : workcentre load report had a query malformed lp bug: https://launchpad.net/bugs/436651 fixed bzr revid: jvo@tinyerp.com-20090925153235-4mihi5g1gesfx5us --- addons/mrp/report/workcenter_load.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/report/workcenter_load.py b/addons/mrp/report/workcenter_load.py index 2bb1572d170..48a94bbff02 100644 --- a/addons/mrp/report/workcenter_load.py +++ b/addons/mrp/report/workcenter_load.py @@ -101,7 +101,7 @@ class report_custom(report_int): colors = choice_colors(len(ids)) ids_str = ','.join(map(str, ids)) cr.execute( - "SELECT MAX(date_planned) AS stop "\ + "SELECT MAX(mrp_production.date_planned) AS stop "\ "FROM mrp_workcenter, mrp_production, mrp_production_workcenter_line "\ "WHERE mrp_production_workcenter_line.production_id=mrp_production.id "\ "AND mrp_production_workcenter_line.workcenter_id=mrp_workcenter.id "\ From 570e8dbc4b762d97e7e00762a67e03737d4091bf Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 28 Sep 2009 16:24:06 +0200 Subject: [PATCH 13/69] [FIX] workcenter load graph bzr revid: fp@tinyerp.com-20090928142406-bzvef0e2afweq4u9 --- addons/mrp/report/workcenter_load.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/addons/mrp/report/workcenter_load.py b/addons/mrp/report/workcenter_load.py index 2bb1572d170..46d0d34628a 100644 --- a/addons/mrp/report/workcenter_load.py +++ b/addons/mrp/report/workcenter_load.py @@ -35,7 +35,7 @@ theme.use_color = 1 random.seed(0) # -# Pinky: Bad code, seems buggy, TO CHECK ! +# TODO: Bad code, seems buggy, TO CHECK ! # class external_pdf(render): @@ -101,7 +101,7 @@ class report_custom(report_int): colors = choice_colors(len(ids)) ids_str = ','.join(map(str, ids)) cr.execute( - "SELECT MAX(date_planned) AS stop "\ + "SELECT MAX(mrp_production.date_planned) AS stop,MIN(mrp_production.date_planned) AS start "\ "FROM mrp_workcenter, mrp_production, mrp_production_workcenter_line "\ "WHERE mrp_production_workcenter_line.production_id=mrp_production.id "\ "AND mrp_production_workcenter_line.workcenter_id=mrp_workcenter.id "\ @@ -109,8 +109,10 @@ class report_custom(report_int): "AND mrp_workcenter.id IN (%s)" % ids_str) res = cr.dictfetchone() if not res['stop']: - res['stop'] = time.strftime('%Y-%m-%d') - dates = self._compute_dates(datas['form']['time_unit'], time.strftime('%Y-%m-%d'), res['stop'][:10]) + res['stop'] = time.strftime('%Y-%m-%d %H:%M:%S') + if not res['start']: + res['start'] = time.strftime('%Y-%m-%d %H:%M:%S') + dates = self._compute_dates(datas['form']['time_unit'], res['start'][:10], res['stop'][:10]) dates_list = dates.keys() dates_list.sort() x_index = [] @@ -174,8 +176,8 @@ class report_custom(report_int): workcenter_num += 1 #plot = bar_plot.T(label=workcenter['name'], data=data, hcol=1, fill_style=fill_style.white, cluster=(color_index,len(ids))) - if (len(data[0]) <= 1): - ar = self._empty_graph(data[0][0]) + if (not data) or (len(data[0]) <= 1): + ar = self._empty_graph(time.strftime('%Y-%m-%d')) ar.draw(can) # close canvas so that the file is written to "disk" can.close() From 6898b2230a2eb1a837dc0c349d0cc4f332344e49 Mon Sep 17 00:00:00 2001 From: "nel@tinyerp.com" <> Date: Tue, 29 Sep 2009 13:58:04 +0200 Subject: [PATCH 14/69] set product id on move lines bzr revid: nel@tinyerp.com-20090929115804-9we1ivhac1ayzbuk --- addons/stock/stock.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 039dfdd99fd..1d7b69c6b3a 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1266,6 +1266,7 @@ class stock_move(osv.osv): (0, 0, { 'name': move.name, 'quantity': move.product_qty, + 'product_id': move.product_id and move.product_id.id or False, 'credit': amount, 'account_id': acc_src, 'ref': ref, @@ -1273,6 +1274,7 @@ class stock_move(osv.osv): 'partner_id': partner_id}), (0, 0, { 'name': move.name, + 'product_id': move.product_id and move.product_id.id or False, 'quantity': move.product_qty, 'debit': amount, 'account_id': acc_dest, From 34645503b72e0e7196f98f0ebca0902009afddba Mon Sep 17 00:00:00 2001 From: "mra (Open ERP)" Date: Tue, 29 Sep 2009 17:50:27 +0530 Subject: [PATCH 15/69] [IMP] base_module_quality: styles on different tests bzr revid: mra@tinyerp.com-20090929122027-8e01uw61dwax00h3 --- .../base_module_quality.py | 32 +++++++++++++ .../object_test/object_test.py | 48 ++++--------------- .../pep8_test/pep8_test.py | 22 ++------- .../pylint_test/pylint_test.py | 36 +++----------- .../speed_test/speed_test.py | 21 ++------ .../structure_test/structure_test.py | 26 ++-------- .../terp_test/terp_test.py | 23 ++------- addons/base_module_quality/wizard/__init__.py | 2 - .../workflow_test/workflow_test.py | 21 ++------ 9 files changed, 65 insertions(+), 166 deletions(-) diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py index d584177a993..70568090439 100644 --- a/addons/base_module_quality/base_module_quality.py +++ b/addons/base_module_quality/base_module_quality.py @@ -161,6 +161,38 @@ class abstract_quality_check(object): def add_quatation(self, x_no, y_no): return x_no/y_no + def get_style(self): + # This function return style tag with specified styles for html pages + style = ''' + ''' + return style + + class module_quality_check(osv.osv): _name = 'module.quality.check' _columns = { diff --git a/addons/base_module_quality/object_test/object_test.py b/addons/base_module_quality/object_test/object_test.py index ada0b944cb4..87329b480c7 100644 --- a/addons/base_module_quality/object_test/object_test.py +++ b/addons/base_module_quality/object_test/object_test.py @@ -40,7 +40,6 @@ Test checks for fields, views, security rules, dependancy level return None def run_test(self, cr, uid, module_path): - pool = pooler.get_pool(cr.dbname) module_name = module_path.split('/')[-1] obj_list = self.get_objects(cr, uid, module_name) @@ -184,24 +183,9 @@ Test checks for fields, views, security rules, dependancy level def get_result_details(self, dict_obj): res = "" if dict_obj != {}: - str_html = ''' Fields Result - ''' + str_html = ''' Fields Result%s'''%(self.get_style()) res += str_html - header = ('%s%s%s', [_('Object Name'), _('Field name'), _('Suggestion')]) + header = ('%s%s%s', [_('Object Name'), _('Field name'), _('Suggestion')]) if not self.error: for key in dict_obj.keys(): data_list = [] @@ -211,34 +195,18 @@ Test checks for fields, views, security rules, dependancy level for i in data_list: count = count + 1 final_dict[key + str(count)] = i - res_str = '' + self.format_html_table(header, data_list=final_dict) + '

' - res += res_str.replace('''
' + res += res_str.replace('''' return "" def get_result_general(self, dict_obj, name=''): - str_html = ''' %s Result - '''% (name) - header = ('', [_('Object Name'), _('Suggestion')]) + str_html = ''' %s Result%s
%s%s
'''% (name, self.get_style()) + header = ('', [_('Object Name'), _('Suggestion')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_obj) + '
%s%s
' - res = res.replace('''Result - - ''' - header = ('', [_('Object Name'), _('Line number'), _('Suggestion')]) + str_html = '''Result%s
%s%s%s
'''%(self.get_style()) + header = ('', [_('Object Name'), _('Line number'), _('Suggestion')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_obj) + '
%s%s%s
' - res = res.replace(''' - - - ''' + self.result_details += '''%s'''%(self.get_style()) for file_py in list_files: if file_py.split('.')[-1] == 'py' and not file_py.endswith('__init__.py') and not file_py.endswith('__terp__.py'): if not flag: @@ -104,17 +82,18 @@ class quality_test(base_module_quality.abstract_quality_check): dict_py[file_py] = [file_py, _("Unable to parse the result. Check the details.")] replace_string = '' replace_string += res - replace_string = replace_string.replace(''' - ''' - header = ('', [_('Object Name'), _('N (Number of Records)'), _('1'), _('N/2'), _('N'), _('Reading Complexity')]) + str_html = '''%s
%s%s%s%s%s%s
'''%(self.get_style()) + header = ('', [_('Object Name'), _('N (Number of Records)'), _('1'), _('N/2'), _('N'), _('Reading Complexity')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_speed) + '
%s%s%s%s%s%s
' - res = res.replace(''' - ''' - header = ('', [_('File Name'), _('Feedback about structure of module')]) + str_html = '''%s
%s%s
'''%(self.get_style()) + header = ('', [_('File Name'), _('Feedback about structure of module')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_struct) + '
%s%s
' - res = res.replace(''' - ''' - header = ('', [_('Tag Name'), _('Feed back About terp file of Module')]) + str_html = '''%s
%s%s
'''%(self.get_style()) + header = ('', [_('Tag Name'), _('Feed back About terp file of Module')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_terp) + '
%s%s
' - res = res.replace(''' - ''' - header = ('', [_('Object Name'), _('Feed back About Workflow of Module')]) + str_html = '''%s
%s%s
'''%(self.get_style()) + header = ('', [_('Object Name'), _('Feed back About Workflow of Module')]) if not self.error: res = str_html + self.format_html_table(header, data_list=dict_wf) + '
%s%s
' - res = res.replace(''' Date: Tue, 29 Sep 2009 19:26:59 +0530 Subject: [PATCH 16/69] [REVERT] Document : BAD Fix jvo@tinyerp.com-20090925134942-y663miys2ocgwi56 bzr revid: jvo@tinyerp.com-20090929135659-3zf9j2m8a8py2qvx --- addons/document/document.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index 4b1a5c715e3..460c52a9698 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -651,11 +651,11 @@ class document_file(osv.osv): def create(self, cr, uid, vals, context={}): vals['title']=vals['name'] vals['parent_id'] = context.get('parent_id',False) or vals.get('parent_id',False) -# if not vals.get('res_id', False) and context.get('default_res_id',False): -# vals['res_id']=context.get('default_res_id',False) -# if not vals.get('res_model', False) and context.get('default_res_model',False): -# vals['res_model']=context.get('default_res_model',False) - vals['res_model'] = "report.document.user" + if not vals.get('res_id', False) and context.get('default_res_id',False): + vals['res_id']=context.get('default_res_id',False) + if not vals.get('res_model', False) and context.get('default_res_model',False): + vals['res_model']=context.get('default_res_model',False) + if vals.get('res_id', False) and vals.get('res_model',False): obj_model=self.pool.get(vals['res_model']) result = obj_model.read(cr, uid, [vals['res_id']], context=context) @@ -695,7 +695,6 @@ class document_file(osv.osv): res = content_index(base64.decodestring(datas), vals['datas_fname'], vals.get('content_type', None)) super(document_file,self).write(cr, uid, [result], { 'index_content' : res, - 'res_id' : result }) cr.commit() except: From 4cedadb41522d5db5a1db27dd8c20e43161e44c6 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 29 Sep 2009 20:22:09 +0530 Subject: [PATCH 17/69] [FIX] Stock : Stock move lines on Production Order well-structured lp bug: https://launchpad.net/bugs/438705 fixed bzr revid: jvo@tinyerp.com-20090929145209-yfkyl3z7ot5rpyus --- 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 17a0de03be6..4dd89b614aa 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -1245,6 +1245,7 @@ + Date: Wed, 30 Sep 2009 12:57:07 +0530 Subject: [PATCH 18/69] [FIX] Report_project :wrong average of closing days counting lp bug: https://launchpad.net/bugs/439041 fixed bzr revid: jvo@tinyerp.com-20090930072707-japt0gv7zj8v6s5b --- addons/report_project/report_project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/report_project/report_project.py b/addons/report_project/report_project.py index b87961e9ee7..933af3e5a46 100644 --- a/addons/report_project/report_project.py +++ b/addons/report_project/report_project.py @@ -47,7 +47,7 @@ class report_project_task_user(osv.osv): t.user_id, t.project_id, sum(planned_hours) as hours_planned, - to_char(avg(date_close::abstime-t.create_date::timestamp), 'DD"d" HH12:MI:SS') as closing_days, + to_char(avg(date_close::abstime-t.create_date::timestamp), 'DD"d" HH24:MI:SS') as closing_days, sum(w.hours) as hours_effective, ((sum(planned_hours)-sum(w.hours))/count(distinct t.id))::decimal(16,2) as hours_delay from project_task t From 777942a9ba67e889dfe57757498668b2c2f52eaf Mon Sep 17 00:00:00 2001 From: "SME(OpenERP)" <> Date: Thu, 1 Oct 2009 17:02:20 +0530 Subject: [PATCH 19/69] [FIX] Product : Pricelist types getting translated on Pricelist lp bug: https://launchpad.net/bugs/439469 fixed bzr revid: jvo@tinyerp.com-20091001113220-v5j8aaop9y560yen --- addons/product/pricelist.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index a1bec9c74ba..3170a7662a1 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -81,8 +81,18 @@ product_pricelist_type() class product_pricelist(osv.osv): def _pricelist_type_get(self, cr, uid, context={}): - cr.execute('select key,name from product_pricelist_type order by name') - return cr.fetchall() + pricelist_type_obj = self.pool.get('product.pricelist.type') + pricelist_type_ids = pricelist_type_obj.search(cr, uid, [], order='name') + pricelist_types = pricelist_type_obj.read(cr, uid, pricelist_type_ids, ['key','name'], context=context) + + res = [] + + for type in pricelist_types: + res.append((type['key'],type['name'])) + + return res +# cr.execute('select key,name from product_pricelist_type order by name') +# return cr.fetchall() _name = "product.pricelist" _description = "Pricelist" _columns = { From a91bea57dacb2d4b0832b0ddabf88f6c83ae4ac3 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 1 Oct 2009 19:06:32 +0530 Subject: [PATCH 20/69] [FIX] Base_report_creator : Calendar view problems on custom report bzr revid: jvo@tinyerp.com-20091001133632-xjfiek5rrob854ok --- addons/base_report_creator/base_report_creator.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/addons/base_report_creator/base_report_creator.py b/addons/base_report_creator/base_report_creator.py index af7049bd894..bcca40a153e 100644 --- a/addons/base_report_creator/base_report_creator.py +++ b/addons/base_report_creator/base_report_creator.py @@ -107,7 +107,16 @@ class report_creator(osv.osv): else: temp_list.append('''''' % {'name':'field'+str(i)}) i+=1 - arch += '''<%(view_type)s string="%(string)s" date_start="%(date_start)s" date_delay="%(date_delay)s" color="%(color)s">''' %set_dict + arch += '''<%(view_type)s string="%(string)s" date_start="%(date_start)s" ''' %set_dict + if set_dict.get('date_delay',False): + arch +=''' date_delay="%(date_delay)s" '''%set_dict + + if set_dict.get('date_stop',False): + arch +=''' date_stop="%(date_stop)s" '''%set_dict + + if set_dict.get('color',False): + arch +=''' color="%(color)s"'''%set_dict + arch += '''>''' arch += ''.join(temp_list) else: arch += '<%s string="%s">\n' % (view_type, report.name) @@ -375,7 +384,7 @@ class report_creator_field(osv.osv): 'report_id': fields.many2one('base_report_creator.report','Report', on_delete='cascade'), 'group_method': fields.selection([('group','Grouped'),('sum','Sum'),('min','Minimum'),('count','Count'),('max','Maximum'),('avg','Average')], 'Grouping Method', required=True), 'graph_mode': fields.selection([('','/'),('x','X Axis'),('y','Y Axis')], 'Graph Mode'), - 'calendar_mode': fields.selection([('','/'),('date_start','Starting Date'),('date_end','Ending Date'),('date_delay','Delay'),('color','Uniq Colors')], 'Calendar Mode'), + 'calendar_mode': fields.selection([('','/'),('date_start','Starting Date'),('date_end','Ending Date'),('date_delay','Delay'),('date_stop','End Date'),('color','Unique Colors')], 'Calendar Mode'), } _defaults = { 'group_method': lambda *args: 'group', From 585c8ab6bd7ffdfb4d34fa24ed30de72c1692097 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 1 Oct 2009 19:44:25 +0530 Subject: [PATCH 21/69] [FIX] Hr_timesheet : Allowing user to enter Analytic Journal if not linked with employee(Working hours tree view) lp bug: https://launchpad.net/bugs/439208 fixed bzr revid: jvo@tinyerp.com-20091001141425-ebe4oz4p5kzgcumo --- addons/hr_timesheet/hr_timesheet_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_timesheet/hr_timesheet_view.xml b/addons/hr_timesheet/hr_timesheet_view.xml index e6769788cbb..add70579c66 100644 --- a/addons/hr_timesheet/hr_timesheet_view.xml +++ b/addons/hr_timesheet/hr_timesheet_view.xml @@ -16,6 +16,7 @@ + From f04d6c24c99ebdad9d12f9ba72e5307de19d2ab5 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Sat, 3 Oct 2009 15:45:23 +0530 Subject: [PATCH 22/69] [FIX] Purchase : POL had a wrong tree view which is unused till now lp bug: https://launchpad.net/bugs/440557 fixed bzr revid: jvo@tinyerp.com-20091003101523-udaqx36d3tkmx0f4 --- addons/purchase/purchase_view.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 972d91206f3..2d020bd6180 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -215,10 +215,8 @@ tree - - + - From ecad1e7e6c58e53be1710c33d390f518080dddb9 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Sat, 3 Oct 2009 16:23:53 +0530 Subject: [PATCH 23/69] [FIX] Purchase : Setting the value of payment term while creatying invoice from PO lp bug: https://launchpad.net/bugs/438725 fixed bzr revid: jvo@tinyerp.com-20091003105353-4153l3coj3g30bvn --- addons/purchase/purchase.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index f5bb716f9d1..5661deedeee 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -329,7 +329,8 @@ class purchase_order(osv.osv): 'journal_id': len(journal_ids) and journal_ids[0] or False, 'origin': o.name, 'invoice_line': il, - 'fiscal_position': o.partner_id.property_account_position.id + 'fiscal_position': o.partner_id.property_account_position.id, + 'payment_term':o.partner_id.property_payment_term and o.partner_id.property_payment_term.id or False, } inv_id = self.pool.get('account.invoice').create(cr, uid, inv, {'type':'in_invoice'}) self.pool.get('account.invoice').button_compute(cr, uid, [inv_id], {'type':'in_invoice'}, set_total=True) From 1f4ef0a39dbcbc908825e24de749f3b3bf4d7b09 Mon Sep 17 00:00:00 2001 From: Albert Cervera i Areny <> Date: Sat, 3 Oct 2009 19:07:16 +0530 Subject: [PATCH 24/69] [FIX] Purchase : PO with different pricelists should not be merged lp bug: https://launchpad.net/bugs/440711 fixed bzr revid: jvo@tinyerp.com-20091003133716-zkd40gb4x8hlbtfb --- addons/purchase/wizard/wizard_group.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/purchase/wizard/wizard_group.py b/addons/purchase/wizard/wizard_group.py index 6add3ad99f8..fdacf955d82 100644 --- a/addons/purchase/wizard/wizard_group.py +++ b/addons/purchase/wizard/wizard_group.py @@ -37,6 +37,7 @@ merge_form = """ * their status is draft * they belong to the same partner * are going to the same location + * have the same pricelist - lines will only be merged if: * they are exactly the same except for the quantity and unit @@ -76,7 +77,7 @@ def _merge_orders(self, cr, uid, data, context): # compute what the new orders should contain new_orders = {} for porder in [order for order in order_obj.browse(cr, uid, data['ids']) if order.state == 'draft']: - order_key = make_key(porder, ('partner_id', 'location_id')) + order_key = make_key(porder, ('partner_id', 'location_id', 'pricelist_id')) new_order = new_orders.setdefault(order_key, ({}, [])) new_order[1].append(porder.id) From 2909fc06b6bd5f97786fda3269151ec854605827 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 5 Oct 2009 12:35:13 +0530 Subject: [PATCH 25/69] [FIX] Account : Fiscal Position Template was missing a requireed field in form view lp bug: https://launchpad.net/bugs/441609 fixed bzr revid: jvo@tinyerp.com-20091005070513-30xzzzhy6ffzl71a --- addons/account/account_view.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 8353695f76e..97c50abdea8 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1709,6 +1709,7 @@
+ From c739c90870fb4686a6d3184d70da5c5b8215d5a2 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 5 Oct 2009 14:42:56 +0530 Subject: [PATCH 26/69] [FIX] Stock : Picking did not have 'type' field on display(inconsistent behavior from eTiny,koo) to work upon domain. lp bug: https://launchpad.net/bugs/440734 fixed bzr revid: jvo@tinyerp.com-20091005091256-8bwsqs9j5pnif4ah --- addons/stock/stock_view.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 4dd89b614aa..6281d2dd1cc 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -620,6 +620,7 @@ + @@ -811,6 +812,7 @@ + @@ -991,6 +993,7 @@ + From 9429a72800a3b1e822751476a8bee8b3e8ff99e7 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 5 Oct 2009 14:27:07 +0200 Subject: [PATCH 27/69] [FIX] typo bzr revid: fp@tinyerp.com-20091005122707-6phxdg1kx4n7skqg --- addons/sale/sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 52e25c603dd..0f13e8051d9 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -736,7 +736,7 @@ class sale_order_line(osv.osv): 'order_id': fields.many2one('sale.order', 'Order Ref', required=True, ondelete='cascade', select=True), 'name': fields.char('Description', size=256, required=True, select=True), 'sequence': fields.integer('Sequence'), - 'delay': fields.float('Delivery Delay', required=True), + 'delay': fields.float('Delivery Lead Time', required=True, help="Number of days between the order confirmation the the shipping of the products to the customer"), 'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], change_default=True), 'invoice_lines': fields.many2many('account.invoice.line', 'sale_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True), 'invoiced': fields.boolean('Invoiced', readonly=True), From c3189af4e9c55418a12982faaf8f12e21d36b10a Mon Sep 17 00:00:00 2001 From: "Niels(Red15)" <> Date: Mon, 5 Oct 2009 18:35:27 +0530 Subject: [PATCH 28/69] [FIX] Project: wrong domain for 'Tasks in Progress' menuitem lp bug: https://launchpad.net/bugs/443069 fixed bzr revid: jvo@tinyerp.com-20091005130527-6q6grbeo0vq2ppvo --- addons/project/project_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index 29c67ee640a..029e7c48d9e 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -492,7 +492,7 @@ project.task form tree,form,calendar,graph,gantt - [('state', '=', 'progress')] + [('state','=','open')] From 3b60f632f14668b8b3e031111c08314335b41cb9 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 5 Oct 2009 19:46:55 +0200 Subject: [PATCH 29/69] [FIX] default context bzr revid: fp@tinyerp.com-20091005174655-cq9b2q92ww4onets --- bin/osv/orm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index cf215adf12e..b4ceeed1342 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1535,7 +1535,7 @@ class orm_memory(orm_template): # get the default values from the context for key in context or {}: - if key.startswith('default_'): + if key.startswith('default_') and (key[8:] in fieds_list): value[key[8:]] = context[key] return value From 91c19a813ff688c21daf604041b5ce02312f5ba9 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 6 Oct 2009 17:11:00 +0530 Subject: [PATCH 30/69] [FIX] Account :Invoice report had Partner name displayed at wrong position bzr revid: jvo@tinyerp.com-20091006114100-xox6rw1e03dqcwkq --- addons/account/report/invoice.rml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index 902a9db3e06..1f29782b7ea 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -233,7 +233,6 @@ [[ repeatIn(objects,'o') ]] - [[ o.partner_id.name ]] [[ setLang(o.partner_id.lang) ]] From 1996f293d8808e54084380af47cba8458fc21872 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 7 Oct 2009 17:34:53 +0530 Subject: [PATCH 31/69] [FIX] Audittrail : Assigned Access Rights to non-admin user. lp bug: https://launchpad.net/bugs/401035 fixed bzr revid: jvo@tinyerp.com-20091007120453-2zp66ob2ria9r9tc --- addons/audittrail/security/ir.model.access.csv | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/audittrail/security/ir.model.access.csv b/addons/audittrail/security/ir.model.access.csv index 90895f202c4..ac367182f26 100644 --- a/addons/audittrail/security/ir.model.access.csv +++ b/addons/audittrail/security/ir.model.access.csv @@ -2,3 +2,6 @@ "access_audittrail_rule_group_system","audittrail rule system","model_audittrail_rule","base.group_system",1,1,1,1 "access_audittrail_log_group_system","audittrail log system","model_audittrail_log","base.group_system",1,1,1,1 "access_audittrail_logline_group_system","audittrail log line system","model_audittrail_log_line","base.group_system",1,1,1,1 +"access_audittrail_rule_all_users","audittrail rule all","model_audittrail_rule","base.group_user",1,0,0,0 +"access_audittrail_log_all_users","audittrail log all","model_audittrail_log","base.group_user",1,0,1,0 +"access_audittrail_log_line_all_users","audittrail log line all","model_audittrail_log_line","base.group_user",1,0,1,0 From 7b6f176319214ceb1070eacb56785abab14371c8 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 7 Oct 2009 20:08:23 +0530 Subject: [PATCH 32/69] [FIX] Stock-MRP : Split production wizard made individual to mrp if mrp is not installed lp bug: https://launchpad.net/bugs/383057 fixed bzr revid: jvo@tinyerp.com-20091007143823-l2hx2mjzth33hv1z --- addons/mrp/mrp_wizard.xml | 7 ++ addons/mrp/wizard/__init__.py | 1 + addons/mrp/wizard/wizard_track_line.py | 131 +++++++++++++++++++++++ addons/stock/wizard/wizard_track_line.py | 24 +++-- 4 files changed, 152 insertions(+), 11 deletions(-) create mode 100644 addons/mrp/wizard/wizard_track_line.py diff --git a/addons/mrp/mrp_wizard.xml b/addons/mrp/mrp_wizard.xml index 94d7f663e01..d88ea321ac9 100644 --- a/addons/mrp/mrp_wizard.xml +++ b/addons/mrp/mrp_wizard.xml @@ -27,6 +27,13 @@ name="product.product.procurement" keyword="client_action_multi" id="product_procurement_wizard"/> + + diff --git a/addons/mrp/wizard/__init__.py b/addons/mrp/wizard/__init__.py index 232b4f9f00b..1fcb7406959 100644 --- a/addons/mrp/wizard/__init__.py +++ b/addons/mrp/wizard/__init__.py @@ -28,6 +28,7 @@ import wizard_workcenter_load import wizard_track_prod import wizard_change_production_qty import make_procurement +import wizard_track_line # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/wizard/wizard_track_line.py b/addons/mrp/wizard/wizard_track_line.py new file mode 100644 index 00000000000..26236c55e13 --- /dev/null +++ b/addons/mrp/wizard/wizard_track_line.py @@ -0,0 +1,131 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 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 . +# +############################################################################## + +import wizard +import netsvc +import pooler + +import time +from osv import osv +from tools.translate import _ + +track_form = ''' + + + + + +''' +fields = { + 'tracking_prefix': { + 'string': 'Tracking prefix', + 'type': 'char', + 'size': 64, + }, + 'quantity': { + 'string': 'Quantity per lot', + 'type': 'float', + 'default': 1, + } +} + +def _track_lines(self, cr, uid, data, context): + move_id = data['id'] + + pool = pooler.get_pool(cr.dbname) + prodlot_obj = pool.get('stock.production.lot') + move_obj = pool.get('stock.move') + production_obj = pool.get('mrp.production') + ir_sequence_obj = pool.get('ir.sequence') + + sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial') + if not sequence: + raise wizard.except_wizard(_('Error!'), _('No production sequence defined')) + if data['form']['tracking_prefix']: + sequence=data['form']['tracking_prefix']+'/'+(sequence or '') + + move = move_obj.browse(cr, uid, [move_id])[0] + quantity=data['form']['quantity'] + if quantity <= 0 or move.product_qty == 0: + return {} + uos_qty=quantity/move.product_qty*move.product_uos_qty + + quantity_rest = move.product_qty%quantity + uos_qty_rest = quantity_rest/move.product_qty*move.product_uos_qty + + update_val = { + 'product_qty': quantity, + 'product_uos_qty': uos_qty, + } + new_move = [] + production_ids = [] + for idx in range(int(move.product_qty//quantity)): + if idx: + current_move = move_obj.copy(cr, uid, move.id, {'state': move.state, 'production_id': move.production_id.id}) + new_move.append(current_move) + else: + current_move = move.id + new_prodlot = prodlot_obj.create(cr, uid, {'name': sequence, 'ref': '%d'%idx}, {'product_id': move.product_id.id}) + update_val['prodlot_id'] = new_prodlot + move_obj.write(cr, uid, [current_move], update_val) + production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])]) + + if quantity_rest > 0: + idx = int(move.product_qty//quantity) + update_val['product_qty']=quantity_rest + update_val['product_uos_qty']=uos_qty_rest + if idx: + current_move = move_obj.copy(cr, uid, move.id, {'state': move.state, 'production_id': move.production_id.id}) + current_move = move_obj.copy(cr, uid, move.id, {'state': move.state}) + new_move.append(current_move) + else: + current_move = move.id + new_prodlot = prodlot_obj.create(cr, uid, {'name': sequence, 'ref': '%d'%idx}, {'product_id': move.product_id.id}) + update_val['prodlot_id'] = new_prodlot + move_obj.write(cr, uid, [current_move], update_val) + + products = production_obj.read(cr, uid, production_ids, ['move_lines']) + for p in products: + for new in new_move: + if new not in p['move_lines']: + p['move_lines'].append(new) + production_obj.write(cr, uid, [p['id']], {'move_lines': [(6, 0, p['move_lines'])]}) + + return {} + +class wizard_track_move(wizard.interface): + states = { + 'init': { + 'actions': [], + 'result': {'type': 'form', 'arch': track_form, 'fields': fields, 'state': [('end', 'Cancel', 'gtk-cancel'), ('track', 'Ok', 'gtk-ok')]}, + }, + 'track': { + 'actions': [_track_lines], + 'result': {'type':'state', 'state':'end'} + } + } + +wizard_track_move('mrp.stock.move.track') + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + diff --git a/addons/stock/wizard/wizard_track_line.py b/addons/stock/wizard/wizard_track_line.py index 1aeeb0ad215..79c105b962b 100644 --- a/addons/stock/wizard/wizard_track_line.py +++ b/addons/stock/wizard/wizard_track_line.py @@ -54,7 +54,7 @@ def _track_lines(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) prodlot_obj = pool.get('stock.production.lot') move_obj = pool.get('stock.move') - production_obj = pool.get('mrp.production') +# production_obj = pool.get('mrp.production') ir_sequence_obj = pool.get('ir.sequence') sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial') @@ -77,24 +77,26 @@ def _track_lines(self, cr, uid, data, context): 'product_uos_qty': uos_qty, } new_move = [] - production_ids = [] +# production_ids = [] for idx in range(int(move.product_qty//quantity)): if idx: - current_move = move_obj.copy(cr, uid, move.id, {'state': move.state, 'production_id': move.production_id.id}) +# current_move = move_obj.copy(cr, uid, move.id, {'state': move.state, 'production_id': move.production_id.id}) + current_move = move_obj.copy(cr, uid, move.id, {'state': move.state}) new_move.append(current_move) else: current_move = move.id new_prodlot = prodlot_obj.create(cr, uid, {'name': sequence, 'ref': '%d'%idx}, {'product_id': move.product_id.id}) update_val['prodlot_id'] = new_prodlot move_obj.write(cr, uid, [current_move], update_val) - production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])]) +# production_ids = production_obj.search(cr, uid, [('move_lines', 'in', [move.id])]) if quantity_rest > 0: idx = int(move.product_qty//quantity) update_val['product_qty']=quantity_rest update_val['product_uos_qty']=uos_qty_rest if idx: - current_move = move_obj.copy(cr, uid, move.id, {'state': move.state, 'production_id': move.production_id.id}) +# current_move = move_obj.copy(cr, uid, move.id, {'state': move.state, 'production_id': move.production_id.id}) + current_move = move_obj.copy(cr, uid, move.id, {'state': move.state}) new_move.append(current_move) else: current_move = move.id @@ -102,12 +104,12 @@ def _track_lines(self, cr, uid, data, context): update_val['prodlot_id'] = new_prodlot move_obj.write(cr, uid, [current_move], update_val) - products = production_obj.read(cr, uid, production_ids, ['move_lines']) - for p in products: - for new in new_move: - if new not in p['move_lines']: - p['move_lines'].append(new) - production_obj.write(cr, uid, [p['id']], {'move_lines': [(6, 0, p['move_lines'])]}) +# products = production_obj.read(cr, uid, production_ids, ['move_lines']) +# for p in products: +# for new in new_move: +# if new not in p['move_lines']: +# p['move_lines'].append(new) +# production_obj.write(cr, uid, [p['id']], {'move_lines': [(6, 0, p['move_lines'])]}) return {} From bebd7fd223a96b390558211ce92b753ab8dff955 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 8 Oct 2009 11:03:44 +0530 Subject: [PATCH 33/69] [FIX] Improved Previous bad commit for pagelayout error bzr revid: jvo@tinyerp.com-20091008053344-rkh1m6oaxw2kjlwd --- bin/report/render/rml2pdf/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/report/render/rml2pdf/utils.py b/bin/report/render/rml2pdf/utils.py index 8e747f5b02a..07bbbbcd05e 100644 --- a/bin/report/render/rml2pdf/utils.py +++ b/bin/report/render/rml2pdf/utils.py @@ -137,7 +137,7 @@ def unit_get(size): if size.find('.') == -1: decimal_point = '.' try: - decimal_point = locale.RADIXCHAR + decimal_point = locale.nl_langinfo(locale.RADIXCHAR) except: decimal_point = locale.localeconv()['decimal_point'] From 7b7c6250cdb222963f886da6e89b6fbe95882af8 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 8 Oct 2009 11:33:06 +0530 Subject: [PATCH 34/69] [FIX] Stock: Picking report correction lp bug: https://launchpad.net/bugs/445547 fixed bzr revid: jvo@tinyerp.com-20091008060306-ppamofraaq3hlr3b --- addons/stock/report/picking.rml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/stock/report/picking.rml b/addons/stock/report/picking.rml index 8de93045b84..1540357c590 100644 --- a/addons/stock/report/picking.rml +++ b/addons/stock/report/picking.rml @@ -132,7 +132,9 @@ [[ (picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.title) or '' ]] [[ picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.name ]] - [[ picking.address_id and picking.address_id.street or '' ]][[ picking.address_id and picking.address_id.zip or '' ]] + [[ picking.address_id and picking.address_id.street or '' ]] + [[ picking.address_id and picking.address_id.zip or '' ]] [[ picking.address_id and picking.address_id.city or '']] + @@ -190,7 +192,7 @@ Expected Shipping Date - weight + Weight From 3de195d3730638334f30e9d665f903ccad28a417 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 8 Oct 2009 11:49:24 +0530 Subject: [PATCH 35/69] [FIX] Base_vat : Spanish numbers validation corrected lp bug: https://launchpad.net/bugs/366944 fixed bzr revid: jvo@tinyerp.com-20091008061924-3malnmzjrtc44ryn --- addons/base_vat/partner.py | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/addons/base_vat/partner.py b/addons/base_vat/partner.py index ca91ab33562..e470244e5e4 100644 --- a/addons/base_vat/partner.py +++ b/addons/base_vat/partner.py @@ -378,10 +378,10 @@ class res_partner(osv.osv): 22: 'K', 23: 'E', } - - if vat[0] in ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'): + #Legal persons with profit aim + if vat[0] in ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'U', 'V'): try: - int(vat[1:]) + int(vat[1:8]) except: return False sum = mult_add(2, int(vat[1])) + int(vat[2]) + \ @@ -391,10 +391,11 @@ class res_partner(osv.osv): check = 10 - (sum % 10) if check == 10: check = 0 - if check != int(vat[8]): - return False +# if check != int(vat[8]): +# return False return True - elif vat[0] in ('N', 'P', 'Q', 'S'): + #Legal persons with non-profit aim + elif vat[0] in ('N', 'P', 'Q', 'R', 'S', 'W'): try: int(vat[1:8]) except: @@ -408,17 +409,26 @@ class res_partner(osv.osv): if check != vat[8]: return False return True - elif vat[0] in ('K', 'L', 'M', 'X'): + #Foreign natural persons, under age 14 or non-residents + elif vat[0] in ('K', 'L', 'M', 'X', 'Y', 'Z'): + if vat[0] == 'Y': + check_value = '1' + vat[1:8] + elif vat[0] == 'Z': + check_value = '2' + vat[1:8] + else: + check_value = vat[1:8] + try: - int(vat[1:8]) + int(check_value) except: return False - check = 1 + (int(vat[1:8]) % 23) + check = 1 + (int(check_value) % 23) check = conv[check] if check != vat[8]: return False return True + #Spanish natural persons else: try: int(vat[:8]) From 90d81da72bf57b7ed2acfb750ddc32cf27c76afb Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 8 Oct 2009 13:23:35 +0530 Subject: [PATCH 36/69] [FIX] Domain was getting failed when trying to work upon M2M,O2M field of object lp bug: https://launchpad.net/bugs/420507 fixed bzr revid: jvo@tinyerp.com-20091008075335-obo9xs9usni3ey4n --- bin/osv/expression.py | 93 +++++++++++++++++++++++++++++++++---------- 1 file changed, 71 insertions(+), 22 deletions(-) diff --git a/bin/osv/expression.py b/bin/osv/expression.py index 3c330aaaa1a..23ac071e6dd 100644 --- a/bin/osv/expression.py +++ b/bin/osv/expression.py @@ -44,14 +44,25 @@ class expression(object): and (((not internal) and element[1] in OPS) \ or (internal and element[1] in INTERNAL_OPS)) - def __execute_recursive_in(self, cr, s, f, w, ids): + def __execute_recursive_in(self, cr, s, f, w, ids, op, type): res = [] - for i in range(0, len(ids), cr.IN_MAX): - subids = ids[i:i+cr.IN_MAX] - cr.execute('SELECT "%s"' \ - ' FROM "%s"' \ - ' WHERE "%s" in (%s)' % (s, f, w, ','.join(['%s']*len(subids))), - subids) + if ids: + if op in ['<','>','>=','<=']: + cr.execute('SELECT "%s"' \ + ' FROM "%s"' \ + ' WHERE "%s" %s %s' % (s, f, w, op, ids[0])) + res.extend([r[0] for r in cr.fetchall()]) + else: + for i in range(0, len(ids), cr.IN_MAX): + subids = ids[i:i+cr.IN_MAX] + cr.execute('SELECT "%s"' \ + ' FROM "%s"' \ + ' WHERE "%s" in (%s)' % (s, f, w, ','.join(['%s']*len(subids))), + subids) + res.extend([r[0] for r in cr.fetchall()]) + else: + cr.execute('SELECT distinct("%s")' \ + ' FROM "%s" where "%s" is not null' % (s, f, s)), res.extend([r[0] for r in cr.fetchall()]) return res @@ -101,7 +112,6 @@ class expression(object): if self._is_operator(e) or e == self.__DUMMY_LEAF: continue left, operator, right = e - working_table = table main_table = table fargs = left.split('.', 1) @@ -154,14 +164,32 @@ class expression(object): elif field._type == 'one2many': - if isinstance(right, basestring): - ids2 = [x[0] for x in field_obj.name_search(cr, uid, right, [], operator, limit=None)] - else: - ids2 = list(right) - if not ids2: - self.__exp[i] = ('id', '=', '0') - else: - self.__exp[i] = ('id', 'in', self.__execute_recursive_in(cr, field._fields_id, field_obj._table, 'id', ids2)) + call_null = True + + if right: + if isinstance(right, basestring): + ids2 = [x[0] for x in field_obj.name_search(cr, uid, right, [], operator, limit=None)] + operator = 'in' + else: + if not isinstance(right,list): + ids2 = [right] + else: + ids2 = right + if not ids2: + call_null = True + operator = 'in' # operator changed because ids are directly related to main object + else: + call_null = False + o2m_op = 'in' + if operator in ['not like','not ilike','not in','<>','!=']: + o2m_op = 'not in' + self.__exp[i] = ('id', o2m_op, self.__execute_recursive_in(cr, field._fields_id, field_obj._table, 'id', ids2, operator, field._type)) + + if call_null: + o2m_op = 'not in' + if operator in ['not like','not ilike','not in','<>','!=']: + o2m_op = 'in' + self.__exp[i] = ('id', o2m_op, self.__execute_recursive_in(cr, field._fields_id, field_obj._table, 'id', [], operator, field._type) or [0]) elif field._type == 'many2many': #FIXME @@ -174,17 +202,38 @@ class expression(object): def _rec_convert(ids): if field_obj == table: return ids - return self.__execute_recursive_in(cr, field._id1, field._rel, field._id2, ids) + return self.__execute_recursive_in(cr, field._id1, field._rel, field._id2, ids, operator, field._type) dom = _rec_get(ids2, field_obj) ids2 = field_obj.search(cr, uid, dom, context=context) self.__exp[i] = ('id', 'in', _rec_convert(ids2)) else: - if isinstance(right, basestring): - res_ids = [x[0] for x in field_obj.name_search(cr, uid, right, [], operator)] - else: - res_ids = list(right) - self.__exp[i] = ('id', 'in', self.__execute_recursive_in(cr, field._id1, field._rel, field._id2, res_ids) or [0]) + call_null_m2m = True + if right: + if isinstance(right, basestring): + res_ids = [x[0] for x in field_obj.name_search(cr, uid, right, [], operator)] + operator = 'in' + else: + if not isinstance(right, list): + res_ids = [right] + else: + res_ids = right + if not res_ids: + call_null_m2m = True + operator = 'in' # operator changed because ids are directly related to main object + else: + call_null_m2m = False + m2m_op = 'in' + if operator in ['not like','not ilike','not in','<>','!=']: + m2m_op = 'not in' + + self.__exp[i] = ('id', m2m_op, self.__execute_recursive_in(cr, field._id1, field._rel, field._id2, res_ids, operator, field._type) or [0]) + if call_null_m2m: + m2m_op = 'not in' + if operator in ['not like','not ilike','not in','<>','!=']: + m2m_op = 'in' + self.__exp[i] = ('id', m2m_op, self.__execute_recursive_in(cr, field._id1, field._rel, field._id2, [], operator, field._type) or [0]) + elif field._type == 'many2one': if operator == 'child_of': if isinstance(right, basestring): From bf46b6e10585084c9393c3113afac9b03453c69e Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 8 Oct 2009 14:20:16 +0530 Subject: [PATCH 37/69] [FIX] Mrp_subproduct : Wrong calculation of QTYs corrected(Product qty,UOS qty) lp bug: https://launchpad.net/bugs/445267 fixed bzr revid: jvo@tinyerp.com-20091008085016-6s9tgo0qejtpxq1q --- addons/mrp_subproduct/mrp_subproduct.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mrp_subproduct/mrp_subproduct.py b/addons/mrp_subproduct/mrp_subproduct.py index b45d3e6424a..92622845818 100644 --- a/addons/mrp_subproduct/mrp_subproduct.py +++ b/addons/mrp_subproduct/mrp_subproduct.py @@ -68,9 +68,9 @@ class mrp_production(osv.osv): qty2 = production.product_uos and production.product_uos_qty or False if sub_product.subproduct_type=='variable': if production.product_qty: - qty1 *= production.product_qty / (sub_product.product_qty or 1.0) + qty1 *= production.product_qty / (production.bom_id.product_qty or 1.0) if production.product_uos_qty: - qty2 *= production.product_uos_qty / (sub_product.product_qty or 1.0) + qty2 *= production.product_uos_qty / (production.bom_id.product_uos_qty or 1.0) data = { 'name':'PROD:'+production.name, 'date_planned': production.date_planned, From fbee346b9261dc633c438e1335656f5f7cfd43f6 Mon Sep 17 00:00:00 2001 From: "YSA(OpenERP)" <> Date: Thu, 8 Oct 2009 15:14:57 +0530 Subject: [PATCH 38/69] [FIX] Import made successful when field is O2M and it has relation under that. lp bug: https://launchpad.net/bugs/430805 fixed bzr revid: jvo@tinyerp.com-20091008094457-3ta5gkrhqspiiqyr --- bin/osv/orm.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index f9a62a02f18..8c87b1bccf1 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -579,6 +579,9 @@ class orm_template(object): continue field = fields[i] + if prefix and not prefix[0] in field: + continue + if (len(field)==len(prefix)+1) and field[len(prefix)].endswith(':db_id'): # Database ID res = False @@ -635,7 +638,7 @@ class orm_template(object): id = ir_model_data_obj._get_id(cr, uid, module, xml_id) res_id = ir_model_data_obj.read(cr, uid, [id], ['res_id'])[0]['res_id'] - row[field[0][:-3]] = res_id or False + row[field[-1][:-3]] = res_id or False continue if (len(field) == len(prefix)+1) and \ len(field[len(prefix)].split(':lang=')) == 2: @@ -671,7 +674,7 @@ class orm_template(object): try: _check_db_id(self, model_name, line[i]) data_res_id = is_db_id = int(line[i]) - except Exception,e: + except Exception,e: warning += [tools.exception_to_unicode(e)] logger.notifyChannel("import", netsvc.LOG_ERROR, tools.exception_to_unicode(e)) From 9a0d6aa9471287f7e43b567eb2de560587fc0e4d Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Thu, 8 Oct 2009 15:30:57 +0200 Subject: [PATCH 39/69] [MERGE] Backport: http://bazaar.launchpad.net/~openobject-training/+junk/server/revision/1821 [FIX] Workflow button desactivation regarding user roles bzr revid: stephane@openerp.com-20091008133057-3htx9jwebv9pprgd --- bin/osv/orm.py | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 8c87b1bccf1..7c2c6718915 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1062,19 +1062,37 @@ class orm_template(object): buttons = (n for n in node.getElementsByTagName('button') if n.getAttribute('type') != 'object') for button in buttons: - ok = True + can_click = True if user != 1: # admin user has all roles user_roles = usersobj.read(cr, user, [user], ['roles_id'])[0]['roles_id'] - cr.execute("select role_id from wkf_transition where signal=%s", (button.getAttribute('name'),)) + # TODO handle the case of more than one workflow for a model + cr.execute("""SELECT DISTINCT t.role_id + FROM wkf + INNER JOIN wkf_activity a ON a.wkf_id = wkf.id + INNER JOIN wkf_transition t ON (t.act_to = a.id) + WHERE wkf.osv = %s + AND t.signal = %s + """, (self._name, button.getAttribute('name'),)) roles = cr.fetchall() - for role in roles: - if role[0]: - ok = ok and rolesobj.check(cr, user, user_roles, role[0]) + + # draft -> valid = signal_next (role X) + # draft -> cancel = signal_cancel (no role) + # + # valid -> running = signal_next (role Y) + # valid -> cancel = signal_cancel (role Z) + # + # running -> done = signal_next (role Z) + # running -> cancel = signal_cancel (role Z) + - if not ok: - button.setAttribute('readonly', '1') - else: - button.setAttribute('readonly', '0') + # As we don't know the object state, in this scenario, + # the button "signal_cancel" will be always shown as there is no restriction to cancel in draft + # the button "signal_next" will be show if the user has any of the roles (X Y or Z) + # The verification will be made later in workflow process... + if roles: + can_click = any((not role) or rolesobj.check(cr, user, user_roles, role) for (role,) in roles) + + button.setAttribute('readonly', str(int(not can_click))) arch = node.toxml(encoding="utf-8").replace('\t', '') fields = self.fields_get(cr, user, fields_def.keys(), context) From 1052e1213dd405fb9050ac6e9e3b5e25d68b4e61 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Thu, 8 Oct 2009 15:32:35 +0200 Subject: [PATCH 40/69] [MERGE] Backport: http://bazaar.launchpad.net/~openobject-training/+junk/server/revision/1822 [IMP] Allow to specify the view via the context bzr revid: stephane@openerp.com-20091008133235-3ogpljqem67ae032 --- bin/osv/orm.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 7c2c6718915..73015dffbde 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1230,6 +1230,15 @@ class orm_template(object): model = True sql_res = False while ok: + view_ref = context.get(view_type + '_view_ref', False) + if view_ref: + if '.' in view_ref: + module, view_ref = view_ref.split('.', 1) + cr.execute("SELECT res_id FROM ir_model_data WHERE model='ir.ui.view' AND module=%s AND name=%s", (module, view_ref)) + view_ref_res = cr.fetchone() + if view_ref_res: + view_id = view_ref_res[0] + if view_id: where = (model and (" and model='%s'" % (self._name,))) or '' cr.execute('SELECT arch,name,field_parent,id,type,inherit_id FROM ir_ui_view WHERE id=%s'+where, (view_id,)) From f895d6718c6ff02fc98c455011f5af4484913ddc Mon Sep 17 00:00:00 2001 From: "Niels(Red15)" <> Date: Thu, 8 Oct 2009 19:10:36 +0530 Subject: [PATCH 41/69] [FIX] CRM : Mailgate script has host as parameter now onwards lp bug: https://launchpad.net/bugs/446205 fixed bzr revid: jvo@tinyerp.com-20091008134036-7y5iplbsauwp3f0v --- addons/crm/scripts/openerp-mailgate/openerp-mailgate.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py b/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py index 6901fde7a14..f363d6f7df6 100755 --- a/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py +++ b/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py @@ -62,8 +62,8 @@ class rpc_proxy(object): return self.rpc.execute(self.dbname, self.user_id, self.passwd, *request) class email_parser(object): - def __init__(self, uid, password, section, email, email_default, dbname): - self.rpc = rpc_proxy(uid, password, dbname=dbname) + def __init__(self, uid, password, section, email, email_default, dbname, host): + self.rpc = rpc_proxy(uid, password, host=host, dbname=dbname) try: self.section_id = int(section) except: @@ -315,9 +315,11 @@ if __name__ == '__main__': parser.add_option("-s", "--section", dest="section", help="ID or code of the case section", default="support") parser.add_option("-m", "--default", dest="default", help="Default eMail in case of any trouble.", default=None) parser.add_option("-d", "--dbname", dest="dbname", help="Database name (default: terp)", default='terp') + parser.add_option("-h", "--host", dest="host", help="Hostname of the Open ERP Server", default="localhost") + (options, args) = parser.parse_args() - parser = email_parser(options.userid, options.password, options.section, options.email, options.default, dbname=options.dbname) + parser = email_parser(options.userid, options.password, options.section, options.email, options.default, dbname=options.dbname, host=options.host) msg_txt = email.message_from_file(sys.stdin) From 829dee02d85ed51c4d2203a8cdc658e0296323e4 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 9 Oct 2009 10:51:00 +0530 Subject: [PATCH 42/69] [FIX] CRM : Mailgate script added option -he was conflicting,improved bzr revid: jvo@tinyerp.com-20091009052100-sh7y0361763v6th8 --- addons/crm/scripts/openerp-mailgate/openerp-mailgate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py b/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py index f363d6f7df6..e0bb8c2eae7 100755 --- a/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py +++ b/addons/crm/scripts/openerp-mailgate/openerp-mailgate.py @@ -315,7 +315,7 @@ if __name__ == '__main__': parser.add_option("-s", "--section", dest="section", help="ID or code of the case section", default="support") parser.add_option("-m", "--default", dest="default", help="Default eMail in case of any trouble.", default=None) parser.add_option("-d", "--dbname", dest="dbname", help="Database name (default: terp)", default='terp') - parser.add_option("-h", "--host", dest="host", help="Hostname of the Open ERP Server", default="localhost") + parser.add_option("--host", dest="host", help="Hostname of the Open ERP Server", default="localhost") (options, args) = parser.parse_args() From 811dea54b48b2830c2d001b0385b03dee4793f92 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Fri, 9 Oct 2009 13:12:53 +0530 Subject: [PATCH 43/69] [FIX]: [account_followup] wrong sender for email lp bug: https://launchpad.net/bugs/446520 fixed bzr revid: mga@tinyerp.com-20091009074253-8he22w5jhgx529e0 --- addons/account_followup/wizard/wizard_followup_print.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_followup/wizard/wizard_followup_print.py b/addons/account_followup/wizard/wizard_followup_print.py index 7729d267365..54e8f4a0eb7 100644 --- a/addons/account_followup/wizard/wizard_followup_print.py +++ b/addons/account_followup/wizard/wizard_followup_print.py @@ -162,7 +162,7 @@ class followup_all_print(wizard.interface): if (not dest) and adr.type=='default': if adr.email: dest = [adr.email] - src = tools.config.options['smtp_user'] + src = tools.config.options['email_from'] if not data['form']['partner_lang']: body = data['form']['email_body'] else: From 58a4fff0dd2af0561fe7c731e2b8d0ed631e995c Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Fri, 9 Oct 2009 14:29:36 +0530 Subject: [PATCH 44/69] [FIX] Account : Refund wuzard malfunctioned with modify invoice option lp bug: https://launchpad.net/bugs/446681 fixed bzr revid: jvo@tinyerp.com-20091009085936-dn97fmq2jpw9zhdi --- addons/account/wizard/wizard_refund.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/wizard/wizard_refund.py b/addons/account/wizard/wizard_refund.py index 39d92b58a35..2f93b0e3459 100644 --- a/addons/account/wizard/wizard_refund.py +++ b/addons/account/wizard/wizard_refund.py @@ -152,10 +152,10 @@ class wiz_refund(wizard.interface): invoice = invoice[0] del invoice['id'] invoice_lines = pool.get('account.invoice.line').read(cr, uid, invoice['invoice_line']) - invoice_lines = pool.get('account.invoice')._refund_cleanup_lines(invoice_lines) + invoice_lines = pool.get('account.invoice')._refund_cleanup_lines(cr, uid, invoice_lines) tax_lines = pool.get('account.invoice.tax').read( cr, uid, invoice['tax_line']) - tax_lines = pool.get('account.invoice')._refund_cleanup_lines(tax_lines) + tax_lines = pool.get('account.invoice')._refund_cleanup_lines(cr, uid, tax_lines) invoice.update({ 'type': inv.type, From dcf275be04ff1c1733cca09613fda61e6d241e32 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Fri, 9 Oct 2009 16:03:54 +0530 Subject: [PATCH 45/69] [FIX]: problem Report Engine bzr revid: nch@tinyerp.com-20091009103354-u2z9v03jc864yekh --- bin/report/render/rml2pdf/trml2pdf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/report/render/rml2pdf/trml2pdf.py b/bin/report/render/rml2pdf/trml2pdf.py index f4b70a2da27..b3585254eb3 100644 --- a/bin/report/render/rml2pdf/trml2pdf.py +++ b/bin/report/render/rml2pdf/trml2pdf.py @@ -455,10 +455,10 @@ class _rml_flowable(object): if key in ('rml_except', 'rml_loop', 'rml_tag'): del txt_n.attrib[key] if True or not self._textual(n).isspace(): - txt_n.text = utils.xml2str(self._textual(n)) - txt_n.tail = '' + if not n.tag == 'bullet': + txt_n.text = utils.xml2str(self._textual(n)) + txt_n.tail = n.tail and utils._process_text(self, n.tail.replace('\n','')) or '' rc1 += etree.tostring(txt_n) - #rc1 += utils._process_text(self, node.tail or '') return rc1 def _table(self, node): From efc0d3b001b9252b367d1b1f1dd7b088ff6395d7 Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Fri, 9 Oct 2009 16:15:47 +0530 Subject: [PATCH 46/69] [REF]:notified channel when there is an exception in eval() bzr revid: nch@tinyerp.com-20091009104547-t88ktqax7p5q57bz --- bin/report/render/rml2pdf/utils.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/report/render/rml2pdf/utils.py b/bin/report/render/rml2pdf/utils.py index 07bbbbcd05e..abc421a0f2f 100644 --- a/bin/report/render/rml2pdf/utils.py +++ b/bin/report/render/rml2pdf/utils.py @@ -43,6 +43,8 @@ from lxml import etree import copy import tools import locale +import netsvc +import traceback, sys _regex = re.compile('\[\[(.+?)\]\]') @@ -108,9 +110,13 @@ def _process_text(self, txt): result += self.localcontext.get('translate', lambda x:x)(sps.pop(0)) if sps: try: - txt = eval(sps.pop(0),self.localcontext) - except: - pass + expr = sps.pop(0) + txt = eval(expr,self.localcontext) + except Exception,e: + tb_s = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback)) + netsvc.Logger().notifyChannel('report', netsvc.LOG_ERROR, + 'report :\n%s\n%s\nexpr: %s' % (tb_s, str(e), + expr.encode('utf-8'))) if type(txt)==type('') or type(txt)==type(u''): txt2 = str2xml(txt) result += tools.ustr(txt2) @@ -173,7 +179,7 @@ def attr_get(node, attrs, dict={}): res[key] = int(node.get(key)) elif dict[key]=='unit': res[key] = unit_get(node.get(key)) - elif dict[key] == 'float' : + elif dict[key] == 'float' : res[key] = float(node.get(key)) return res From 3d08c9c6f049ffce39bd91382cb096e846e90b18 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Fri, 9 Oct 2009 13:48:16 +0200 Subject: [PATCH 47/69] [FIX] Specify the name of the argument for the context, to avoir a critical bug bzr revid: stephane@openerp.com-20091009114816-5n518p74cm1k2pj1 --- bin/addons/base/module/report/ir_module_reference_print.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/addons/base/module/report/ir_module_reference_print.py b/bin/addons/base/module/report/ir_module_reference_print.py index 92029014bac..69de9ab9a09 100644 --- a/bin/addons/base/module/report/ir_module_reference_print.py +++ b/bin/addons/base/module/report/ir_module_reference_print.py @@ -25,7 +25,7 @@ from report import report_sxw class ir_module_reference_print(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(ir_module_reference_print, self).__init__(cr, uid, name, context) + super(ir_module_reference_print, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'findobj': self._object_find, From 25f727dd7b2d3e4917a3bc1816fa5e131c88890f Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Fri, 9 Oct 2009 13:49:00 +0200 Subject: [PATCH 48/69] [FIX] Specify the name of the argument for the context, to avoir a critical bug bzr revid: stephane@openerp.com-20091009114900-r4j49l7dmmw5sze5 --- addons/account/project/report/account_journal.py | 2 +- addons/account/project/report/analytic_balance.py | 2 +- addons/account/project/report/analytic_check.py | 2 +- addons/account/project/report/analytic_journal.py | 2 +- addons/account/project/report/cost_ledger.py | 2 +- addons/account/project/report/inverted_analytic_balance.py | 2 +- addons/account/project/report/quantity_cost_ledger.py | 3 +-- addons/account/report/account_balance.py | 2 +- addons/account/report/account_journal.py | 2 +- addons/account/report/account_tax_code.py | 2 +- addons/account/report/aged_trial_balance.py | 2 +- addons/account/report/central_journal.py | 2 +- addons/account/report/general_journal.py | 2 +- addons/account/report/general_ledger.py | 2 +- addons/account/report/general_ledger_landscape.py | 2 +- addons/account/report/invoice.py | 2 +- addons/account/report/partner_balance.py | 2 +- addons/account/report/rml_parse.py | 2 +- addons/account/report/tax_report.py | 2 +- addons/account/report/third_party_ledger.py | 2 +- addons/account_analytic_plans/report/crossovered_analytic.py | 2 +- addons/account_balance/report/account_balance.py | 2 +- addons/account_balance/report/account_balance_landscape.py | 2 +- addons/account_balance/report/rml_parse.py | 2 +- .../account_budget/report/analytic_account_budget_report.py | 2 +- addons/account_budget/report/budget_report.py | 2 +- addons/account_budget/report/crossovered_budget_report.py | 2 +- addons/account_followup/report/report_followup_print.py | 2 +- .../report/report_account_invoice_layout.py | 2 +- .../account_invoice_layout/report/special_message_invoice.py | 2 +- addons/account_payment/report/payment_order.py | 2 +- addons/account_report/report/accounting_report.py | 2 +- addons/account_report/report/print_indicator.py | 2 +- addons/account_reporting/report/account_report_bs.py | 2 +- addons/account_voucher/report/report_voucher.py | 2 +- addons/account_voucher/report/report_voucher_amount.py | 4 ++-- addons/account_voucher/report/rml_parse.py | 2 +- addons/auction/report/auction_artists.py | 2 +- addons/auction/report/auction_bids.py | 2 +- addons/auction/report/auction_buyer_result.py | 2 +- addons/auction/report/auction_catelog.py | 2 +- addons/auction/report/auction_objects.py | 2 +- addons/auction/report/auction_result.py | 2 +- addons/auction/report/auction_total_rml.py | 2 +- addons/auction/report/bids_lots.py | 2 +- addons/auction/report/bids_phones_details.py | 2 +- addons/auction/report/buyer_form_report.py | 2 +- addons/auction/report/buyer_list.py | 2 +- addons/auction/report/catelogwithpictures.py | 2 +- addons/auction/report/deposit_seller.py | 2 +- addons/auction/report/lots_list.py | 2 +- addons/auction/report/lots_list_inventory.py | 2 +- addons/auction/report/lots_list_landscape.py | 2 +- addons/auction/report/report_lot_bar_code.py | 2 +- addons/auction/report/seller_form_report.py | 2 +- addons/hr_attendance/report/attendance_errors.py | 2 +- addons/hr_expense/report/expense.py | 2 +- addons/hr_timesheet_invoice/report/account_analytic_profit.py | 2 +- addons/hr_timesheet_invoice/report/cost_ledger.py | 2 +- addons/l10n_ch/report/bvr.py | 2 +- addons/l10n_fr/report/base_report.py | 2 +- addons/mrp/report/order.py | 2 +- addons/mrp_operations/report/mrp_code_barcode.py | 2 +- addons/mrp_operations/report/mrp_wc_barcode.py | 2 +- addons/mrp_repair/report/order.py | 2 +- addons/point_of_sale/report/pos_details.py | 2 +- addons/point_of_sale/report/pos_details_summary.py | 2 +- addons/point_of_sale/report/pos_invoice.py | 2 +- addons/point_of_sale/report/pos_lines.py | 2 +- addons/point_of_sale/report/pos_receipt.py | 2 +- addons/product/report/product_pricelist.py | 2 +- addons/purchase/report/order.py | 2 +- addons/purchase/report/request_quotation.py | 2 +- addons/report_intrastat/report/invoice.py | 2 +- addons/sale/report/order.py | 2 +- addons/sale/report/sale_prepare_allot.py | 2 +- addons/sale_delivery_report/report/shipping.py | 2 +- addons/stock/report/lot_location.py | 2 +- addons/stock/report/lot_overview.py | 2 +- addons/stock/report/lot_overview_all.py | 2 +- addons/stock/report/picking.py | 2 +- 81 files changed, 82 insertions(+), 83 deletions(-) diff --git a/addons/account/project/report/account_journal.py b/addons/account/project/report/account_journal.py index 2f46abaceda..a732c88a969 100644 --- a/addons/account/project/report/account_journal.py +++ b/addons/account/project/report/account_journal.py @@ -37,7 +37,7 @@ class journal_print(report_sxw.rml_parse): self.cr.execute('select sum(amount) from account_analytic_line where journal_id=%s', (journal_id,)) return self.cr.fetchone()[0] or 0.0 def __init__(self, cr, uid, name, context): - super(journal_print, self).__init__(cr, uid, name, context) + super(journal_print, self).__init__(cr, uid, name, context=context) self.localcontext = { 'time': time, 'lines': self.lines, diff --git a/addons/account/project/report/analytic_balance.py b/addons/account/project/report/analytic_balance.py index 0c7b0cda761..9e96dfdd1bd 100644 --- a/addons/account/project/report/analytic_balance.py +++ b/addons/account/project/report/analytic_balance.py @@ -27,7 +27,7 @@ from report import report_sxw class account_analytic_balance(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_analytic_balance, self).__init__(cr, uid, name, context) + super(account_analytic_balance, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'get_objects': self._get_objects, diff --git a/addons/account/project/report/analytic_check.py b/addons/account/project/report/analytic_check.py index 6e794b35d87..5a300966840 100644 --- a/addons/account/project/report/analytic_check.py +++ b/addons/account/project/report/analytic_check.py @@ -26,7 +26,7 @@ from report import report_sxw class account_analytic_analytic_check(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_analytic_analytic_check, self).__init__(cr, uid, name, context) + super(account_analytic_analytic_check, self).__init__(cr, uid, name, context=context) self.sum_gen_deb = 0.0 self.sum_gen_cred = 0.0 self.sum_ana_deb = 0.0 diff --git a/addons/account/project/report/analytic_journal.py b/addons/account/project/report/analytic_journal.py index 30faa18fecc..621d6139ab5 100644 --- a/addons/account/project/report/analytic_journal.py +++ b/addons/account/project/report/analytic_journal.py @@ -28,7 +28,7 @@ from report import report_sxw # class account_analytic_journal(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_analytic_journal, self).__init__(cr, uid, name, context) + super(account_analytic_journal, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'lines': self._lines, diff --git a/addons/account/project/report/cost_ledger.py b/addons/account/project/report/cost_ledger.py index 0641cfe2ba3..5c18b51d113 100644 --- a/addons/account/project/report/cost_ledger.py +++ b/addons/account/project/report/cost_ledger.py @@ -26,7 +26,7 @@ from report import report_sxw class account_analytic_cost_ledger(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_analytic_cost_ledger, self).__init__(cr, uid, name, context) + super(account_analytic_cost_ledger, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'lines_g': self._lines_g, diff --git a/addons/account/project/report/inverted_analytic_balance.py b/addons/account/project/report/inverted_analytic_balance.py index 345f60619d0..ada30ef567e 100644 --- a/addons/account/project/report/inverted_analytic_balance.py +++ b/addons/account/project/report/inverted_analytic_balance.py @@ -26,7 +26,7 @@ from report import report_sxw class account_inverted_analytic_balance(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_inverted_analytic_balance, self).__init__(cr, uid, name, context) + super(account_inverted_analytic_balance, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'lines_g': self._lines_g, diff --git a/addons/account/project/report/quantity_cost_ledger.py b/addons/account/project/report/quantity_cost_ledger.py index 5e79e16c1ed..9942bb96b26 100644 --- a/addons/account/project/report/quantity_cost_ledger.py +++ b/addons/account/project/report/quantity_cost_ledger.py @@ -26,8 +26,7 @@ from report import report_sxw class account_analytic_quantity_cost_ledger(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_analytic_quantity_cost_ledger, self).__init__(cr, uid, - name, context) + super(account_analytic_quantity_cost_ledger, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'lines_g': self._lines_g, diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index ebf12dd9b08..49910b086a9 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -30,7 +30,7 @@ from report import report_sxw class account_balance(report_sxw.rml_parse): _name = 'report.account.account.balance' def __init__(self, cr, uid, name, context): - super(account_balance, self).__init__(cr, uid, name, context) + super(account_balance, self).__init__(cr, uid, name, context=context) self.sum_debit = 0.00 self.sum_credit = 0.00 self.date_lst = [] diff --git a/addons/account/report/account_journal.py b/addons/account/report/account_journal.py index f3c87ca1603..869b04b5dfd 100644 --- a/addons/account/report/account_journal.py +++ b/addons/account/report/account_journal.py @@ -29,7 +29,7 @@ from report import report_sxw # class journal_print(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(journal_print, self).__init__(cr, uid, name, context) + super(journal_print, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'lines': self.lines, diff --git a/addons/account/report/account_tax_code.py b/addons/account/report/account_tax_code.py index 773e9541d79..f3c3fb75e47 100644 --- a/addons/account/report/account_tax_code.py +++ b/addons/account/report/account_tax_code.py @@ -30,7 +30,7 @@ class account_tax_code_report(rml_parse.rml_parse): #_name = 'report.account.tax.code.entries' def __init__(self, cr, uid, name, context): - super(account_tax_code_report, self).__init__(cr, uid, name, context) + super(account_tax_code_report, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'get_line':self.get_line, diff --git a/addons/account/report/aged_trial_balance.py b/addons/account/report/aged_trial_balance.py index 652929e187d..4477e2a1561 100644 --- a/addons/account/report/aged_trial_balance.py +++ b/addons/account/report/aged_trial_balance.py @@ -28,7 +28,7 @@ from report import report_sxw class aged_trial_report(rml_parse.rml_parse): def __init__(self, cr, uid, name, context): - super(aged_trial_report, self).__init__(cr, uid, name, context) + super(aged_trial_report, self).__init__(cr, uid, name, context=context) self.line_query = '' self.total_account = [] diff --git a/addons/account/report/central_journal.py b/addons/account/report/central_journal.py index 2db5c6fe971..762282a3f90 100644 --- a/addons/account/report/central_journal.py +++ b/addons/account/report/central_journal.py @@ -28,7 +28,7 @@ from report import report_sxw # class journal_print(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(journal_print, self).__init__(cr, uid, name, context) + super(journal_print, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'lines': self.lines, diff --git a/addons/account/report/general_journal.py b/addons/account/report/general_journal.py index 926c3603e49..eb330134873 100644 --- a/addons/account/report/general_journal.py +++ b/addons/account/report/general_journal.py @@ -29,7 +29,7 @@ from report import report_sxw # class journal_print(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(journal_print, self).__init__(cr, uid, name, context) + super(journal_print, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'lines': self.lines, diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py index 534b4d52e67..f8712ea4863 100644 --- a/addons/account/report/general_ledger.py +++ b/addons/account/report/general_ledger.py @@ -53,7 +53,7 @@ class general_ledger(rml_parse.rml_parse): super(general_ledger, self).set_context(objects, data, new_ids, report_type) def __init__(self, cr, uid, name, context): - super(general_ledger, self).__init__(cr, uid, name, context) + super(general_ledger, self).__init__(cr, uid, name, context=context) self.date_borne = {} self.query = "" self.child_ids = "" diff --git a/addons/account/report/general_ledger_landscape.py b/addons/account/report/general_ledger_landscape.py index c63c4281173..0879a464f26 100644 --- a/addons/account/report/general_ledger_landscape.py +++ b/addons/account/report/general_ledger_landscape.py @@ -52,7 +52,7 @@ class general_ledger_landscape(rml_parse.rml_parse): super(general_ledger_landscape, self).set_context(objects, data, new_ids,report_type) def __init__(self, cr, uid, name, context): - super(general_ledger_landscape, self).__init__(cr, uid, name, context) + super(general_ledger_landscape, self).__init__(cr, uid, name, context=context) self.date_borne = {} self.query = "" self.child_ids = "" diff --git a/addons/account/report/invoice.py b/addons/account/report/invoice.py index 3ca850a148b..f125ab47b8b 100644 --- a/addons/account/report/invoice.py +++ b/addons/account/report/invoice.py @@ -25,7 +25,7 @@ from report import report_sxw class account_invoice(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_invoice, self).__init__(cr, uid, name, context) + super(account_invoice, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) diff --git a/addons/account/report/partner_balance.py b/addons/account/report/partner_balance.py index ddd6ad1ecb4..78067a3346a 100755 --- a/addons/account/report/partner_balance.py +++ b/addons/account/report/partner_balance.py @@ -28,7 +28,7 @@ from report import report_sxw class partner_balance(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(partner_balance, self).__init__(cr, uid, name, context) + super(partner_balance, self).__init__(cr, uid, name, context=context) self.date_lst = [] self.date_lst_string = '' self.account_ids = '' diff --git a/addons/account/report/rml_parse.py b/addons/account/report/rml_parse.py index e0c41e8f286..02a5a266236 100644 --- a/addons/account/report/rml_parse.py +++ b/addons/account/report/rml_parse.py @@ -32,7 +32,7 @@ import sys class rml_parse(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(rml_parse, self).__init__(cr, uid, name, context=None) + super(rml_parse, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'comma_me': self.comma_me, 'format_date': self._get_and_change_date_format_for_swiss, diff --git a/addons/account/report/tax_report.py b/addons/account/report/tax_report.py index 1f0332d2906..c4f8fdeb1f3 100644 --- a/addons/account/report/tax_report.py +++ b/addons/account/report/tax_report.py @@ -31,7 +31,7 @@ import re class tax_report(rml_parse.rml_parse): _name = 'report.account.vat.declaration' def __init__(self, cr, uid, name, context): - super(tax_report, self).__init__(cr, uid, name, context) + super(tax_report, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'get_period': self._get_period, diff --git a/addons/account/report/third_party_ledger.py b/addons/account/report/third_party_ledger.py index 9828fdfbd63..47407a31392 100644 --- a/addons/account/report/third_party_ledger.py +++ b/addons/account/report/third_party_ledger.py @@ -31,7 +31,7 @@ class third_party_ledger(rml_parse.rml_parse): def __init__(self, cr, uid, name, context): self.date_lst = [] self.date_lst_string = '' - super(third_party_ledger, self).__init__(cr, uid, name, context) + super(third_party_ledger, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'lines': self.lines, diff --git a/addons/account_analytic_plans/report/crossovered_analytic.py b/addons/account_analytic_plans/report/crossovered_analytic.py index 2fab914fb64..951e147d7a8 100644 --- a/addons/account_analytic_plans/report/crossovered_analytic.py +++ b/addons/account_analytic_plans/report/crossovered_analytic.py @@ -26,7 +26,7 @@ from report import report_sxw class crossovered_analytic(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(crossovered_analytic, self).__init__(cr, uid, name, context) + super(crossovered_analytic, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, 'lines': self._lines, diff --git a/addons/account_balance/report/account_balance.py b/addons/account_balance/report/account_balance.py index 4fe498ac147..d67efab75a2 100644 --- a/addons/account_balance/report/account_balance.py +++ b/addons/account_balance/report/account_balance.py @@ -35,7 +35,7 @@ parents = { class account_balance(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_balance, self).__init__(cr, uid, name, context) + super(account_balance, self).__init__(cr, uid, name, context=context) self.flag=1 self.dr_total= 0.00 self.cr_total= 0.00 diff --git a/addons/account_balance/report/account_balance_landscape.py b/addons/account_balance/report/account_balance_landscape.py index 372fdf2c441..925494f6021 100644 --- a/addons/account_balance/report/account_balance_landscape.py +++ b/addons/account_balance/report/account_balance_landscape.py @@ -36,7 +36,7 @@ parents = { class account_balance_landscape(rml_parse.rml_parse): def __init__(self, cr, uid, name, context): - super(account_balance_landscape, self).__init__(cr, uid, name, context) + super(account_balance_landscape, self).__init__(cr, uid, name, context=context) self.flag=1 self.dr_total= 0.00 self.cr_total= 0.00 diff --git a/addons/account_balance/report/rml_parse.py b/addons/account_balance/report/rml_parse.py index c5eceb5bcd1..37bb0add89e 100644 --- a/addons/account_balance/report/rml_parse.py +++ b/addons/account_balance/report/rml_parse.py @@ -32,7 +32,7 @@ import sys class rml_parse(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(rml_parse, self).__init__(cr, uid, name, context=None) + super(rml_parse, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'comma_me': self.comma_me, 'format_date': self._get_and_change_date_format_for_swiss, diff --git a/addons/account_budget/report/analytic_account_budget_report.py b/addons/account_budget/report/analytic_account_budget_report.py index a22195cfc76..a35fc3b15f4 100644 --- a/addons/account_budget/report/analytic_account_budget_report.py +++ b/addons/account_budget/report/analytic_account_budget_report.py @@ -26,7 +26,7 @@ import datetime class analytic_account_budget_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(analytic_account_budget_report, self).__init__(cr, uid, name, context) + super(analytic_account_budget_report, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'funct': self.funct, 'funct_total': self.funct_total, diff --git a/addons/account_budget/report/budget_report.py b/addons/account_budget/report/budget_report.py index 102707a14c7..c9c6c0750e4 100644 --- a/addons/account_budget/report/budget_report.py +++ b/addons/account_budget/report/budget_report.py @@ -27,7 +27,7 @@ import operator class budget_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(budget_report, self).__init__(cr, uid, name, context) + super(budget_report, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'lines': self.lines, 'budget_total': self.budget_total, diff --git a/addons/account_budget/report/crossovered_budget_report.py b/addons/account_budget/report/crossovered_budget_report.py index 3e46c1196f5..8b607e98cf1 100644 --- a/addons/account_budget/report/crossovered_budget_report.py +++ b/addons/account_budget/report/crossovered_budget_report.py @@ -29,7 +29,7 @@ import osv class budget_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(budget_report, self).__init__(cr, uid, name, context) + super(budget_report, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'funct': self.funct, 'funct_total': self.funct_total, diff --git a/addons/account_followup/report/report_followup_print.py b/addons/account_followup/report/report_followup_print.py index 53ad5ce2572..0c9768f45de 100644 --- a/addons/account_followup/report/report_followup_print.py +++ b/addons/account_followup/report/report_followup_print.py @@ -28,7 +28,7 @@ from report import report_sxw class report_rappel(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(report_rappel, self).__init__(cr, uid, name, context) + super(report_rappel, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time' : time, 'ids_to_objects': self._ids_to_objects, diff --git a/addons/account_invoice_layout/report/report_account_invoice_layout.py b/addons/account_invoice_layout/report/report_account_invoice_layout.py index a577f7d656a..77221a54e81 100644 --- a/addons/account_invoice_layout/report/report_account_invoice_layout.py +++ b/addons/account_invoice_layout/report/report_account_invoice_layout.py @@ -25,7 +25,7 @@ from report import report_sxw class account_invoice_1(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_invoice_1, self).__init__(cr, uid, name, context) + super(account_invoice_1, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'invoice_lines': self.invoice_lines, diff --git a/addons/account_invoice_layout/report/special_message_invoice.py b/addons/account_invoice_layout/report/special_message_invoice.py index 38fe8739142..94dff32a54e 100644 --- a/addons/account_invoice_layout/report/special_message_invoice.py +++ b/addons/account_invoice_layout/report/special_message_invoice.py @@ -26,7 +26,7 @@ import pooler class account_invoice_with_message(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_invoice_with_message, self).__init__(cr, uid, name, context) + super(account_invoice_with_message, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'spcl_msg': self.spcl_msg, diff --git a/addons/account_payment/report/payment_order.py b/addons/account_payment/report/payment_order.py index 4767c63ba31..dec5c031f98 100644 --- a/addons/account_payment/report/payment_order.py +++ b/addons/account_payment/report/payment_order.py @@ -26,7 +26,7 @@ from report import report_sxw class payment_order(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(payment_order, self).__init__(cr, uid, name, context) + super(payment_order, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, diff --git a/addons/account_report/report/accounting_report.py b/addons/account_report/report/accounting_report.py index c489d99ca62..52f1a02221d 100644 --- a/addons/account_report/report/accounting_report.py +++ b/addons/account_report/report/accounting_report.py @@ -28,7 +28,7 @@ from report import report_sxw class accounting_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(accounting_report, self).__init__(cr, uid, name, context) + super(accounting_report, self).__init__(cr, uid, name, context=context) self.ret_list = [] self.localcontext.update({ 'time': time, diff --git a/addons/account_report/report/print_indicator.py b/addons/account_report/report/print_indicator.py index 9d4fa4673f4..53f59919b91 100644 --- a/addons/account_report/report/print_indicator.py +++ b/addons/account_report/report/print_indicator.py @@ -76,7 +76,7 @@ import os class accounting_report_indicator(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(accounting_report_indicator, self).__init__(cr, uid, name, context) + super(accounting_report_indicator, self).__init__(cr, uid, name, context=context) self.ret_list = [] self.localcontext.update({ 'time': time, diff --git a/addons/account_reporting/report/account_report_bs.py b/addons/account_reporting/report/account_report_bs.py index 955e4c12c6f..c741b0d2ff0 100644 --- a/addons/account_reporting/report/account_report_bs.py +++ b/addons/account_reporting/report/account_report_bs.py @@ -36,7 +36,7 @@ parents = { class account_report_bs(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_report_bs, self).__init__(cr, uid, name, context) + super(account_report_bs, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'lines': self.lines, diff --git a/addons/account_voucher/report/report_voucher.py b/addons/account_voucher/report/report_voucher.py index 27ba2efd488..9f40c6ad920 100755 --- a/addons/account_voucher/report/report_voucher.py +++ b/addons/account_voucher/report/report_voucher.py @@ -32,7 +32,7 @@ from tools import amount_to_text_en class report_voucher(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(report_voucher, self).__init__(cr, uid, name, context) + super(report_voucher, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'convert':self.convert, diff --git a/addons/account_voucher/report/report_voucher_amount.py b/addons/account_voucher/report/report_voucher_amount.py index 3b67ff7a9ac..246782e433e 100755 --- a/addons/account_voucher/report/report_voucher_amount.py +++ b/addons/account_voucher/report/report_voucher_amount.py @@ -32,7 +32,7 @@ from tools import amount_to_text_en class report_voucher_amount(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(report_voucher_amount, self).__init__(cr, uid, name, context) + super(report_voucher_amount, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'convert':self.convert @@ -48,4 +48,4 @@ report_sxw.report_sxw( 'account.voucher', 'addons/account_voucher/report/report_voucher_amount.rml', parser=report_voucher_amount,header=False -) \ No newline at end of file +) diff --git a/addons/account_voucher/report/rml_parse.py b/addons/account_voucher/report/rml_parse.py index 31bd26617cd..9f4b8e6bfb9 100644 --- a/addons/account_voucher/report/rml_parse.py +++ b/addons/account_voucher/report/rml_parse.py @@ -32,7 +32,7 @@ import sys class rml_parse(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(rml_parse, self).__init__(cr, uid, name, context=None) + super(rml_parse, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'comma_me': self.comma_me, 'format_date': self._get_and_change_date_format_for_swiss, diff --git a/addons/auction/report/auction_artists.py b/addons/auction/report/auction_artists.py index 91843906dff..c66531938f4 100644 --- a/addons/auction/report/auction_artists.py +++ b/addons/auction/report/auction_artists.py @@ -28,7 +28,7 @@ from report import report_sxw class auction_artists(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(auction_artists, self).__init__(cr, uid, name, context) + super(auction_artists, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, diff --git a/addons/auction/report/auction_bids.py b/addons/auction/report/auction_bids.py index 560160ac008..2153d246428 100644 --- a/addons/auction/report/auction_bids.py +++ b/addons/auction/report/auction_bids.py @@ -28,7 +28,7 @@ from report import report_sxw class auction_bids(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(auction_bids, self).__init__(cr, uid, name, context) + super(auction_bids, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) diff --git a/addons/auction/report/auction_buyer_result.py b/addons/auction/report/auction_buyer_result.py index 97ab54cc056..017f62eb5d0 100644 --- a/addons/auction/report/auction_buyer_result.py +++ b/addons/auction/report/auction_buyer_result.py @@ -28,7 +28,7 @@ from report import report_sxw class auction_buyer_result(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(auction_buyer_result, self).__init__(cr, uid, name, context) + super(auction_buyer_result, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, diff --git a/addons/auction/report/auction_catelog.py b/addons/auction/report/auction_catelog.py index 70b2b6db917..b9b8dad2dc7 100644 --- a/addons/auction/report/auction_catelog.py +++ b/addons/auction/report/auction_catelog.py @@ -28,7 +28,7 @@ from report import report_sxw class auction_catelog(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(auction_catelog, self).__init__(cr, uid, name, context) + super(auction_catelog, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, diff --git a/addons/auction/report/auction_objects.py b/addons/auction/report/auction_objects.py index 879b407c184..0879c7770e5 100644 --- a/addons/auction/report/auction_objects.py +++ b/addons/auction/report/auction_objects.py @@ -26,7 +26,7 @@ from report import report_sxw class auction_objects(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(auction_objects, self).__init__(cr, uid, name, context) + super(auction_objects, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, #'lines': self.lines diff --git a/addons/auction/report/auction_result.py b/addons/auction/report/auction_result.py index 48f21d73669..77ba88b9486 100644 --- a/addons/auction/report/auction_result.py +++ b/addons/auction/report/auction_result.py @@ -28,7 +28,7 @@ from report import report_sxw class auction_result(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(auction_result, self).__init__(cr, uid, name, context) + super(auction_result, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, diff --git a/addons/auction/report/auction_total_rml.py b/addons/auction/report/auction_total_rml.py index cc103e7c250..82c068bce26 100644 --- a/addons/auction/report/auction_total_rml.py +++ b/addons/auction/report/auction_total_rml.py @@ -29,7 +29,7 @@ from report import report_sxw class auction_total_rml(report_sxw.rml_parse): total_obj=[] def __init__(self, cr, uid, name, context): - super(auction_total_rml, self).__init__(cr, uid, name, context) + super(auction_total_rml, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'sum_taxes':self.sum_taxes, diff --git a/addons/auction/report/bids_lots.py b/addons/auction/report/bids_lots.py index 8358e76ea2a..e77d7948c92 100644 --- a/addons/auction/report/bids_lots.py +++ b/addons/auction/report/bids_lots.py @@ -28,7 +28,7 @@ from report import report_sxw class bids_lots(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(bids_lots, self).__init__(cr, uid, name, context) + super(bids_lots, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) diff --git a/addons/auction/report/bids_phones_details.py b/addons/auction/report/bids_phones_details.py index bf5e5343074..73899f957cd 100644 --- a/addons/auction/report/bids_phones_details.py +++ b/addons/auction/report/bids_phones_details.py @@ -28,7 +28,7 @@ from report import report_sxw class bids_phones_details(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(bids_phones_details, self).__init__(cr, uid, name, context) + super(bids_phones_details, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) diff --git a/addons/auction/report/buyer_form_report.py b/addons/auction/report/buyer_form_report.py index 20d93cef754..291be748930 100644 --- a/addons/auction/report/buyer_form_report.py +++ b/addons/auction/report/buyer_form_report.py @@ -30,7 +30,7 @@ class buyer_form_report(report_sxw.rml_parse): count=0 c=0 def __init__(self, cr, uid, name, context): - super(buyer_form_report, self).__init__(cr, uid, name, context) + super(buyer_form_report, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'sum_taxes': self.sum_taxes, diff --git a/addons/auction/report/buyer_list.py b/addons/auction/report/buyer_list.py index eaa44f22c0c..83799ba5169 100644 --- a/addons/auction/report/buyer_list.py +++ b/addons/auction/report/buyer_list.py @@ -34,7 +34,7 @@ class buyer_list(report_sxw.rml_parse): sum_buyer_price_val=0.0 sum_lot_val=0.0 def __init__(self, cr, uid, name, context): - super(buyer_list, self).__init__(cr, uid, name, context) + super(buyer_list, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'lines_lots_from_auction' : self.lines_lots_from_auction, diff --git a/addons/auction/report/catelogwithpictures.py b/addons/auction/report/catelogwithpictures.py index f3f954a2908..4063f884ad2 100644 --- a/addons/auction/report/catelogwithpictures.py +++ b/addons/auction/report/catelogwithpictures.py @@ -26,7 +26,7 @@ from report import report_sxw class catelogwithpictures(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(catelogwithpictures, self).__init__(cr, uid, name, context) + super(catelogwithpictures, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, diff --git a/addons/auction/report/deposit_seller.py b/addons/auction/report/deposit_seller.py index 4e0a184ffc7..f39fd6b5596 100644 --- a/addons/auction/report/deposit_seller.py +++ b/addons/auction/report/deposit_seller.py @@ -28,7 +28,7 @@ from report import report_sxw class deposit_seller(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(deposit_seller, self).__init__(cr, uid, name, context) + super(deposit_seller, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, diff --git a/addons/auction/report/lots_list.py b/addons/auction/report/lots_list.py index 32d23accb90..ad5e678c2f3 100644 --- a/addons/auction/report/lots_list.py +++ b/addons/auction/report/lots_list.py @@ -26,7 +26,7 @@ from report import report_sxw class lots_list(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(lots_list, self).__init__(cr, uid, name, context) + super(lots_list, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'bid_line' : self.bid_line diff --git a/addons/auction/report/lots_list_inventory.py b/addons/auction/report/lots_list_inventory.py index 42a993ccc7a..329591cf3ac 100644 --- a/addons/auction/report/lots_list_inventory.py +++ b/addons/auction/report/lots_list_inventory.py @@ -26,7 +26,7 @@ from report import report_sxw class lots_list_inventory(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(lots_list_inventory, self).__init__(cr, uid, name, context) + super(lots_list_inventory, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'bid_line' : self.bid_line diff --git a/addons/auction/report/lots_list_landscape.py b/addons/auction/report/lots_list_landscape.py index b638c6e54c4..99760d78715 100644 --- a/addons/auction/report/lots_list_landscape.py +++ b/addons/auction/report/lots_list_landscape.py @@ -26,7 +26,7 @@ from report import report_sxw class lots_list_llandscape(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(lots_list_landscape, self).__init__(cr, uid, name, context) + super(lots_list_landscape, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, diff --git a/addons/auction/report/report_lot_bar_code.py b/addons/auction/report/report_lot_bar_code.py index 3d9f8df4330..4767fe68c28 100644 --- a/addons/auction/report/report_lot_bar_code.py +++ b/addons/auction/report/report_lot_bar_code.py @@ -26,7 +26,7 @@ from report import report_sxw class auction_code_produit(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(auction_code_produit, self).__init__(cr, uid, name, context) + super(auction_code_produit, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) diff --git a/addons/auction/report/seller_form_report.py b/addons/auction/report/seller_form_report.py index a64759b2547..d0febfde712 100644 --- a/addons/auction/report/seller_form_report.py +++ b/addons/auction/report/seller_form_report.py @@ -28,7 +28,7 @@ from osv import osv class seller_form_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(seller_form_report, self).__init__(cr, uid, name, context) + super(seller_form_report, self).__init__(cr, uid, name, context=context) lot=self.pool.get('auction.lots').browse(cr,uid,uid) #address=lot.bord_vnd_id.address_get(self.cr,self.uid,[partner.id]) # partner=lot.bord_vnd_id.partner_id diff --git a/addons/hr_attendance/report/attendance_errors.py b/addons/hr_attendance/report/attendance_errors.py index ef3317e27da..58553cd5e83 100644 --- a/addons/hr_attendance/report/attendance_errors.py +++ b/addons/hr_attendance/report/attendance_errors.py @@ -28,7 +28,7 @@ import datetime class attendance_print(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(attendance_print, self).__init__(cr, uid, name, context) + super(attendance_print, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'lst': self._lst, diff --git a/addons/hr_expense/report/expense.py b/addons/hr_expense/report/expense.py index 0c35a035a38..376b5e6c16a 100644 --- a/addons/hr_expense/report/expense.py +++ b/addons/hr_expense/report/expense.py @@ -26,7 +26,7 @@ import datetime class expense(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(expense, self).__init__(cr, uid, name, context) + super(expense, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, }) diff --git a/addons/hr_timesheet_invoice/report/account_analytic_profit.py b/addons/hr_timesheet_invoice/report/account_analytic_profit.py index a767eba946a..600535ee027 100644 --- a/addons/hr_timesheet_invoice/report/account_analytic_profit.py +++ b/addons/hr_timesheet_invoice/report/account_analytic_profit.py @@ -25,7 +25,7 @@ import pooler class account_analytic_profit(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_analytic_profit, self).__init__(cr, uid, name, context) + super(account_analytic_profit, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'lines': self._lines, 'user_ids': self._user_ids, diff --git a/addons/hr_timesheet_invoice/report/cost_ledger.py b/addons/hr_timesheet_invoice/report/cost_ledger.py index 5e588f11e06..584ea3c6acd 100644 --- a/addons/hr_timesheet_invoice/report/cost_ledger.py +++ b/addons/hr_timesheet_invoice/report/cost_ledger.py @@ -27,7 +27,7 @@ from report import report_sxw class account_analytic_cost_ledger(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_analytic_cost_ledger, self).__init__(cr, uid, name, context) + super(account_analytic_cost_ledger, self).__init__(cr, uid, name, context=context) self.sum_revenue={} self.account_sum_revenue={} self.localcontext.update( { diff --git a/addons/l10n_ch/report/bvr.py b/addons/l10n_ch/report/bvr.py index c71c62a0da2..8804f6c876a 100755 --- a/addons/l10n_ch/report/bvr.py +++ b/addons/l10n_ch/report/bvr.py @@ -39,7 +39,7 @@ from mx.DateTime import * class account_invoice_bvr(report_sxw.rml_parse): """Report class that Allows to print BVR payement vector""" def __init__(self, cr, uid, name, context): - super(account_invoice_bvr, self).__init__(cr, uid, name, context) + super(account_invoice_bvr, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'user':self.pool.get("res.users").browse(cr,uid,uid), diff --git a/addons/l10n_fr/report/base_report.py b/addons/l10n_fr/report/base_report.py index 488f36304c5..52eb99154a6 100644 --- a/addons/l10n_fr/report/base_report.py +++ b/addons/l10n_fr/report/base_report.py @@ -31,7 +31,7 @@ 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) + super(base_report, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'time': time, '_load': self._load, diff --git a/addons/mrp/report/order.py b/addons/mrp/report/order.py index 5fc82b9f7f0..02526d88a64 100644 --- a/addons/mrp/report/order.py +++ b/addons/mrp/report/order.py @@ -27,7 +27,7 @@ import pooler class order(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(order, self).__init__(cr, uid, name, context) + super(order, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) diff --git a/addons/mrp_operations/report/mrp_code_barcode.py b/addons/mrp_operations/report/mrp_code_barcode.py index a4431e55b57..336a46ba546 100755 --- a/addons/mrp_operations/report/mrp_code_barcode.py +++ b/addons/mrp_operations/report/mrp_code_barcode.py @@ -26,7 +26,7 @@ from report import report_sxw class code_barcode(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(code_barcode, self).__init__(cr, uid, name, context) + super(code_barcode, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) diff --git a/addons/mrp_operations/report/mrp_wc_barcode.py b/addons/mrp_operations/report/mrp_wc_barcode.py index bc4fe4976ee..6725f95a95d 100755 --- a/addons/mrp_operations/report/mrp_wc_barcode.py +++ b/addons/mrp_operations/report/mrp_wc_barcode.py @@ -26,7 +26,7 @@ from report import report_sxw class workcenter_code(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(workcenter_code, self).__init__(cr, uid, name, context) + super(workcenter_code, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) diff --git a/addons/mrp_repair/report/order.py b/addons/mrp_repair/report/order.py index be6897d8c2e..b7f3d0bc19d 100644 --- a/addons/mrp_repair/report/order.py +++ b/addons/mrp_repair/report/order.py @@ -27,7 +27,7 @@ import pooler class order(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(order, self).__init__(cr, uid, name, context) + super(order, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'total': self.total, diff --git a/addons/point_of_sale/report/pos_details.py b/addons/point_of_sale/report/pos_details.py index 1e5962c6586..6a6b9420255 100644 --- a/addons/point_of_sale/report/pos_details.py +++ b/addons/point_of_sale/report/pos_details.py @@ -112,7 +112,7 @@ class pos_details(report_sxw.rml_parse): return '%s - %s' % (min_date, max_date) def __init__(self, cr, uid, name, context): - super(pos_details, self).__init__(cr, uid, name, context) + super(pos_details, self).__init__(cr, uid, name, context=context) self.total = 0.0 self.localcontext.update({ 'time': time, diff --git a/addons/point_of_sale/report/pos_details_summary.py b/addons/point_of_sale/report/pos_details_summary.py index 826844effd6..dc625aee62e 100644 --- a/addons/point_of_sale/report/pos_details_summary.py +++ b/addons/point_of_sale/report/pos_details_summary.py @@ -109,7 +109,7 @@ class pos_details_summary(report_sxw.rml_parse): return '%s - %s' % (min_date, max_date) def __init__(self, cr, uid, name, context): - super(pos_details_summary, self).__init__(cr, uid, name, context) + super(pos_details_summary, self).__init__(cr, uid, name, context=context) self.total = 0.0 self.localcontext.update({ 'time': time, diff --git a/addons/point_of_sale/report/pos_invoice.py b/addons/point_of_sale/report/pos_invoice.py index 54423775614..1d2749b46ef 100644 --- a/addons/point_of_sale/report/pos_invoice.py +++ b/addons/point_of_sale/report/pos_invoice.py @@ -29,7 +29,7 @@ from tools.translate import _ class pos_invoice(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(pos_invoice, self).__init__(cr, uid, name, context) + super(pos_invoice, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) diff --git a/addons/point_of_sale/report/pos_lines.py b/addons/point_of_sale/report/pos_lines.py index 1abec66dc80..66f9754f412 100644 --- a/addons/point_of_sale/report/pos_lines.py +++ b/addons/point_of_sale/report/pos_lines.py @@ -27,7 +27,7 @@ from report import report_sxw class pos_lines(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(pos_lines, self).__init__(cr, uid, name, context) + super(pos_lines, self).__init__(cr, uid, name, context=context) self.total = 0.0 self.localcontext.update({ 'time': time, diff --git a/addons/point_of_sale/report/pos_receipt.py b/addons/point_of_sale/report/pos_receipt.py index 69f4bd706c2..15d8f177582 100644 --- a/addons/point_of_sale/report/pos_receipt.py +++ b/addons/point_of_sale/report/pos_receipt.py @@ -29,7 +29,7 @@ import pooler class order(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(order, self).__init__(cr, uid, name, context) + super(order, self).__init__(cr, uid, name, context=context) user = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid) partner = user.company_id.partner_id diff --git a/addons/product/report/product_pricelist.py b/addons/product/report/product_pricelist.py index 3e232f7413c..dc3a1c3512c 100644 --- a/addons/product/report/product_pricelist.py +++ b/addons/product/report/product_pricelist.py @@ -27,7 +27,7 @@ import pooler class product_pricelist(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(product_pricelist, self).__init__(cr, uid, name, context) + super(product_pricelist, self).__init__(cr, uid, name, context=context) self.pricelist=False self.quantity=[] self.localcontext.update({ diff --git a/addons/purchase/report/order.py b/addons/purchase/report/order.py index 52aaa1ae865..66ba383141d 100644 --- a/addons/purchase/report/order.py +++ b/addons/purchase/report/order.py @@ -27,7 +27,7 @@ import pooler class order(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(order, self).__init__(cr, uid, name, context) + super(order, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'get_line_tax': self._get_line_tax, diff --git a/addons/purchase/report/request_quotation.py b/addons/purchase/report/request_quotation.py index 9acf4309264..0e920e2039d 100644 --- a/addons/purchase/report/request_quotation.py +++ b/addons/purchase/report/request_quotation.py @@ -27,7 +27,7 @@ import pooler class request_quotation(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(request_quotation, self).__init__(cr, uid, name, context) + super(request_quotation, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, 'user': self.pool.get('res.users').browse(cr, uid, uid, context) diff --git a/addons/report_intrastat/report/invoice.py b/addons/report_intrastat/report/invoice.py index 692b33d0095..7afdd1c180e 100644 --- a/addons/report_intrastat/report/invoice.py +++ b/addons/report_intrastat/report/invoice.py @@ -26,7 +26,7 @@ import pooler class account_invoice_intrastat(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(account_invoice_intrastat, self).__init__(cr, uid, name, context) + super(account_invoice_intrastat, self).__init__(cr, uid, name, context=context) self.total=0 self.localcontext.update({ 'time': time, diff --git a/addons/sale/report/order.py b/addons/sale/report/order.py index cb239b62f2a..ef33a9509f8 100644 --- a/addons/sale/report/order.py +++ b/addons/sale/report/order.py @@ -26,7 +26,7 @@ from osv import osv class order(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(order, self).__init__(cr, uid, name, context) + super(order, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) diff --git a/addons/sale/report/sale_prepare_allot.py b/addons/sale/report/sale_prepare_allot.py index ef59da50d7d..30f643d63f3 100644 --- a/addons/sale/report/sale_prepare_allot.py +++ b/addons/sale/report/sale_prepare_allot.py @@ -25,7 +25,7 @@ from report import report_sxw class sale_prepare(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(sale_prepare, self).__init__(cr, uid, name, context) + super(sale_prepare, self).__init__(cr, uid, name, context=context) self.localcontext.update( { 'allotment': self._allotment, }) diff --git a/addons/sale_delivery_report/report/shipping.py b/addons/sale_delivery_report/report/shipping.py index 63aeba6c10c..13ea8e754da 100644 --- a/addons/sale_delivery_report/report/shipping.py +++ b/addons/sale_delivery_report/report/shipping.py @@ -27,7 +27,7 @@ import pooler class shipping(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(shipping, self).__init__(cr, uid, name, context) + super(shipping, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, # 'get_address': self._get_address, diff --git a/addons/stock/report/lot_location.py b/addons/stock/report/lot_location.py index e20f89bb81f..a44ae876a9e 100644 --- a/addons/stock/report/lot_location.py +++ b/addons/stock/report/lot_location.py @@ -25,7 +25,7 @@ from report import report_sxw class lot_location(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(lot_location, self).__init__(cr, uid, name, context) + super(lot_location, self).__init__(cr, uid, name, context=context) self.grand_total = 0.0 self.localcontext.update({ diff --git a/addons/stock/report/lot_overview.py b/addons/stock/report/lot_overview.py index 3ecd26476df..f8442d7f3f6 100644 --- a/addons/stock/report/lot_overview.py +++ b/addons/stock/report/lot_overview.py @@ -25,7 +25,7 @@ from report import report_sxw class lot_overview(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(lot_overview, self).__init__(cr, uid, name, context) + super(lot_overview, self).__init__(cr, uid, name, context=context) self.price_total = 0.0 self.grand_total = 0.0 self.localcontext.update({ diff --git a/addons/stock/report/lot_overview_all.py b/addons/stock/report/lot_overview_all.py index 2f349d9bd93..addd7a9009f 100644 --- a/addons/stock/report/lot_overview_all.py +++ b/addons/stock/report/lot_overview_all.py @@ -25,7 +25,7 @@ from report import report_sxw class lot_overview_all(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(lot_overview_all, self).__init__(cr, uid, name, context) + super(lot_overview_all, self).__init__(cr, uid, name, context=context) self.price_total = 0.0 self.grand_total = 0.0 self.localcontext.update({ diff --git a/addons/stock/report/picking.py b/addons/stock/report/picking.py index 5a0746b80e8..0182ef3ba54 100644 --- a/addons/stock/report/picking.py +++ b/addons/stock/report/picking.py @@ -27,7 +27,7 @@ import pooler class picking(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): - super(picking, self).__init__(cr, uid, name, context) + super(picking, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, }) From 6f68bf76ff2e7c669c0afecb41ec7dc78b70adc3 Mon Sep 17 00:00:00 2001 From: "HDA (OpenERP)" Date: Mon, 12 Oct 2009 15:53:33 +0530 Subject: [PATCH 49/69] Module:account_voucher Removed (tlh_TLH)Klingon translation file bzr revid: hda@tinyerp.com-20091012102333-tcvpvl11p43skegs --- addons/account_voucher/i18n/tlh_TLH.po | 598 ------------------------- 1 file changed, 598 deletions(-) delete mode 100644 addons/account_voucher/i18n/tlh_TLH.po diff --git a/addons/account_voucher/i18n/tlh_TLH.po b/addons/account_voucher/i18n/tlh_TLH.po deleted file mode 100644 index 40cccd6da7f..00000000000 --- a/addons/account_voucher/i18n/tlh_TLH.po +++ /dev/null @@ -1,598 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_voucher -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 5.0.0\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2009-05-19 14:36+0000\n" -"PO-Revision-Date: 2009-05-19 17:10+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-08-28 11:00+0000\n" -"X-Generator: Launchpad (build Unknown)\n" - -#. module: account_voucher -#: model:ir.actions.act_window,name:account_voucher.act_account_acount_move_line_open1 -msgid "Opening Balance Entry" -msgstr "" - -#. module: account_voucher -#: model:ir.ui.menu,name:account_voucher.menu_action_receipt_bakreceipt_voucher_list -msgid "Bank Receipts" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Particulars" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "State :" -msgstr "" - -#. module: account_voucher -#: constraint:ir.actions.act_window:0 -msgid "Invalid model name in the action definition." -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Ref. :" -msgstr "" - -#. module: account_voucher -#: selection:account.move,voucher_type:0 -#: selection:account.voucher,type:0 -#: selection:account.voucher.open,init,type:0 -#: model:ir.actions.act_window,name:account_voucher.action_view_cont_voucher_form -#: model:ir.ui.menu,name:account_voucher.menu_action_view_cont_voucher_form -msgid "Contra Voucher" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,company_id:0 -msgid "Company" -msgstr "" - -#. module: account_voucher -#: selection:account.move,voucher_type:0 -#: selection:account.voucher,type:0 -#: model:ir.actions.act_window,name:account_voucher.action_view_jour_voucher_form -#: model:ir.ui.menu,name:account_voucher.menu_action_view_jour_voucher_form -msgid "Journal Voucher" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_receipt.drcr:0 -msgid "," -msgstr "" - -#. module: account_voucher -#: view:account.voucher:0 -msgid "Set to Draft" -msgstr "" - -#. module: account_voucher -#: wizard_button:account.voucher.open,init,open:0 -msgid "Open Voucher Entries" -msgstr "" - -#. module: account_voucher -#: model:ir.model,name:account_voucher.model_account_voucher_line -msgid "Voucher Line" -msgstr "" - -#. module: account_voucher -#: view:account.move:0 -msgid "Total Credit" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,account_id:0 -#: field:account.voucher.line,account_id:0 -msgid "Account" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -msgid "D" -msgstr "" - -#. module: account_voucher -#: field:account.account,level:0 -msgid "Level" -msgstr "" - -#. module: account_voucher -#: view:account.move:0 -msgid "Account Entry Line" -msgstr "" - -#. module: account_voucher -#: view:account.move:0 -msgid "Total Debit" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,amount:0 -#: field:account.voucher.line,amount:0 -#: rml:voucher.cash_amount:0 -msgid "Amount" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Receiver's Signature" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "No." -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Amount (in words) :" -msgstr "" - -#. module: account_voucher -#: field:account.voucher.line,account_analytic_id:0 -msgid "Analytic Account" -msgstr "" - -#. module: account_voucher -#: selection:account.move,voucher_type:0 -#: selection:account.voucher,type:0 -#: selection:account.voucher.open,init,type:0 -#: model:ir.actions.act_window,name:account_voucher.action_view_jour_sale_voucher_form -#: model:ir.ui.menu,name:account_voucher.menu_action_view_jour_sale_voucher_form -msgid "Journal Sale Voucher" -msgstr "" - -#. module: account_voucher -#: model:ir.actions.act_window,name:account_voucher.action_receipt_vou_voucher_list -#: model:ir.ui.menu,name:account_voucher.menu_action_receipt_vou_voucher_list -msgid "Receipt Vouchers" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -msgid "Account :" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "On Account of :" -msgstr "" - -#. module: account_voucher -#: model:ir.actions.act_window,name:account_voucher.action_payments_bankpay_voucher_list -#: model:ir.actions.act_window,name:account_voucher.action_payments_cashpay_voucher_list -#: model:ir.actions.act_window,name:account_voucher.action_payments_voucher_list -#: model:ir.ui.menu,name:account_voucher.menu_action_payments_voucher_list -msgid "Payment Vouchers" -msgstr "" - -#. module: account_voucher -#: view:account.voucher:0 -msgid "Create" -msgstr "" - -#. module: account_voucher -#: selection:account.account,type1:0 -#: selection:account.account.template,type1:0 -msgid "None" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,number:0 -msgid "Number" -msgstr "" - -#. module: account_voucher -#: view:account.move:0 -#: field:account.voucher,state:0 -#: wizard_field:account.voucher.open,init,state:0 -msgid "State" -msgstr "" - -#. module: account_voucher -#: selection:account.account,type1:0 -#: selection:account.account.template,type1:0 -#: selection:account.voucher.line,type:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Debit" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,type:0 -#: field:account.voucher.line,type:0 -msgid "Type" -msgstr "" - -#. module: account_voucher -#: model:ir.ui.menu,name:account_voucher.menu_action_voucher_list -msgid "Voucher Entries" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Authorised Signatory" -msgstr "" - -#. module: account_voucher -#: view:account.voucher:0 -#: model:ir.actions.act_window,name:account_voucher.action_voucher_list -msgid "Vouchers" -msgstr "" - -#. module: account_voucher -#: view:account.voucher:0 -#: field:account.voucher.line,voucher_id:0 -#: model:res.request.link,name:account_voucher.req_link_voucher -msgid "Voucher" -msgstr "" - -#. module: account_voucher -#: wizard_view:account.voucher.open,init:0 -#: model:ir.ui.menu,name:account_voucher.menu_wizard_account_voucher_open -msgid "Open Vouchers" -msgstr "" - -#. module: account_voucher -#: constraint:ir.ui.view:0 -msgid "Invalid XML for View Architecture!" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Dated :" -msgstr "" - -#. module: account_voucher -#: model:ir.ui.menu,name:account_voucher.menu_action_receipt_cashreceipt_voucher_list -msgid "Cash Receipts" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,partner_id:0 -#: field:account.voucher.line,partner_id:0 -msgid "Partner" -msgstr "" - -#. module: account_voucher -#: model:ir.ui.menu,name:account_voucher.menu_action_view_bank_pay_voucher_form -msgid "New Bank Payment" -msgstr "" - -#. module: account_voucher -#: view:account.voucher:0 -#: field:account.voucher,payment_ids:0 -msgid "Voucher Lines" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,currency_id:0 -msgid "Currency" -msgstr "" - -#. module: account_voucher -#: view:account.move:0 -#: field:account.move,narration:0 -#: view:account.voucher:0 -#: field:account.voucher,narration:0 -msgid "Narration" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,reference:0 -msgid "Voucher Reference" -msgstr "" - -#. module: account_voucher -#: model:ir.ui.menu,name:account_voucher.menu_action_view_cash_rec_voucher_form -msgid "New Cash Receipt" -msgstr "" - -#. module: account_voucher -#: model:ir.actions.report.xml,name:account_voucher.report_account_voucher_amt -msgid "Voucher Report" -msgstr "" - -#. module: account_voucher -#: field:account.account,open_bal:0 -msgid "Opening Balance" -msgstr "" - -#. module: account_voucher -#: selection:account.voucher,state:0 -#: selection:account.voucher.open,init,state:0 -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Draft" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "PRO-FORMA" -msgstr "" - -#. module: account_voucher -#: model:ir.actions.act_window,name:account_voucher.action_receipt_cashreceipt_voucher_list -msgid "Cash Receipt" -msgstr "" - -#. module: account_voucher -#: model:ir.ui.menu,name:account_voucher.menu_action_view_cash_pay_voucher_form -msgid "New Cash Payment" -msgstr "" - -#. module: account_voucher -#: view:account.move:0 -msgid "Optional Information" -msgstr "" - -#. module: account_voucher -#: view:account.voucher:0 -msgid "General Entries" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,date:0 -msgid "Date" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid ":" -msgstr "" - -#. module: account_voucher -#: field:account.account,type1:0 -#: field:account.account.template,type1:0 -msgid "Dr/Cr" -msgstr "" - -#. module: account_voucher -#: model:ir.actions.report.xml,name:account_voucher.report_account_voucher -msgid "Voucher Report (Cr/Dr)" -msgstr "" - -#. module: account_voucher -#: field:account.move,voucher_type:0 -#: wizard_field:account.voucher.open,init,type:0 -msgid "Voucher Type" -msgstr "" - -#. module: account_voucher -#: selection:account.account,type1:0 -#: selection:account.account.template,type1:0 -#: selection:account.voucher.line,type:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Credit" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Through :" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,reference_type:0 -msgid "Reference Type" -msgstr "" - -#. module: account_voucher -#: model:ir.model,name:account_voucher.model_account_voucher -msgid "Accounting Voucher" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,period_id:0 -msgid "Period" -msgstr "" - -#. module: account_voucher -#: model:ir.ui.menu,name:account_voucher.menu_action_payments_bankpay_voucher_list -msgid "Bank Payments" -msgstr "" - -#. module: account_voucher -#: view:account.move:0 -msgid "General Information" -msgstr "" - -#. module: account_voucher -#: wizard_field:account.voucher.open,init,period_ids:0 -msgid "Periods" -msgstr "" - -#. module: account_voucher -#: view:account.voucher:0 -#: selection:account.voucher,state:0 -#: wizard_button:account.voucher.open,init,end:0 -#: selection:account.voucher.open,init,state:0 -msgid "Cancel" -msgstr "" - -#. module: account_voucher -#: view:account.voucher:0 -#: selection:account.voucher,state:0 -#: selection:account.voucher.open,init,state:0 -msgid "Pro-forma" -msgstr "" - -#. module: account_voucher -#: constraint:ir.model:0 -msgid "" -"The Object name must start with x_ and not contain any special character !" -msgstr "" - -#. module: account_voucher -#: view:account.voucher:0 -msgid "Other Info" -msgstr "" - -#. module: account_voucher -#: model:ir.module.module,shortdesc:account_voucher.module_meta_information -msgid "Accounting Voucher Entries" -msgstr "" - -#. module: account_voucher -#: field:res.currency,sub_name:0 -msgid "Sub Currency" -msgstr "" - -#. module: account_voucher -#: model:ir.actions.act_window,name:account_voucher.action_other_voucher_list -#: model:ir.ui.menu,name:account_voucher.menu_action_other_voucher_list -msgid "Other Vouchers" -msgstr "" - -#. module: account_voucher -#: field:account.voucher.line,name:0 -msgid "Description" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Canceled" -msgstr "" - -#. module: account_voucher -#: selection:account.move,voucher_type:0 -#: selection:account.voucher,type:0 -#: selection:account.voucher.open,init,type:0 -#: model:ir.actions.act_window,name:account_voucher.action_view_cash_pay_voucher_form -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Cash Payment Voucher" -msgstr "" - -#. module: account_voucher -#: model:ir.actions.act_window,name:account_voucher.action_receipt_bakreceipt_voucher_list -msgid "Bank Receipt" -msgstr "" - -#. module: account_voucher -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "-" -msgstr "" - -#. module: account_voucher -#: selection:account.move,voucher_type:0 -#: selection:account.voucher,type:0 -#: selection:account.voucher.open,init,type:0 -#: model:ir.actions.act_window,name:account_voucher.action_view_jour_pur_voucher_form -#: model:ir.ui.menu,name:account_voucher.menu_action_view_jour_pur_voucher_form -msgid "Journal Purchase Voucher" -msgstr "" - -#. module: account_voucher -#: view:account.account:0 -msgid "Closing Balance" -msgstr "" - -#. module: account_voucher -#: field:account.voucher.line,ref:0 -msgid "Ref." -msgstr "" - -#. module: account_voucher -#: selection:account.voucher,state:0 -#: selection:account.voucher.open,init,state:0 -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Posted" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,name:0 -msgid "Name" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,move_ids:0 -msgid "Real Entry" -msgstr "" - -#. module: account_voucher -#: model:ir.actions.wizard,name:account_voucher.wizard_account_voucher_open -msgid "Open a Voucher Entry" -msgstr "" - -#. module: account_voucher -#: field:account.voucher,move_id:0 -msgid "Account Entry" -msgstr "" - -#. module: account_voucher -#: view:account.voucher:0 -msgid "Entry Lines" -msgstr "" - -#. module: account_voucher -#: model:ir.ui.menu,name:account_voucher.menu_action_view_bank_rec_voucher_form -msgid "New Bank Receipt" -msgstr "" - -#. module: account_voucher -#: model:ir.ui.menu,name:account_voucher.menu_action_payments_cashpay_voucher_list -msgid "Cash Payments" -msgstr "" - -#. module: account_voucher -#: selection:account.move,voucher_type:0 -#: selection:account.voucher,type:0 -#: selection:account.voucher.open,init,type:0 -#: model:ir.actions.act_window,name:account_voucher.action_view_cash_rec_voucher_form -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Cash Receipt Voucher" -msgstr "" - -#. module: account_voucher -#: selection:account.move,voucher_type:0 -#: selection:account.voucher,type:0 -#: selection:account.voucher.open,init,type:0 -#: model:ir.actions.act_window,name:account_voucher.action_view_bank_pay_voucher_form -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Bank Payment Voucher" -msgstr "" - -#. module: account_voucher -#: selection:account.move,voucher_type:0 -#: selection:account.voucher,type:0 -#: selection:account.voucher.open,init,type:0 -#: model:ir.actions.act_window,name:account_voucher.action_view_bank_rec_voucher_form -#: rml:voucher.cash_amount:0 -#: rml:voucher.cash_receipt.drcr:0 -msgid "Bank Receipt Voucher" -msgstr "" - -#. module: account_voucher -#: field:account.account,journal_id:0 -#: field:account.voucher,journal_id:0 -msgid "Journal" -msgstr "" From 2a2bb45c5e57a950258887422c637e06a6d2e368 Mon Sep 17 00:00:00 2001 From: "GPA(OpenERP)" <> Date: Mon, 12 Oct 2009 18:03:10 +0530 Subject: [PATCH 50/69] [FIX] Project_timesheet : Wrong synchro on analytic line creation fro tasks(for name). lp bug: https://launchpad.net/bugs/447402 fixed bzr revid: jvo@tinyerp.com-20091012123310-gih8iz51zuxmlxs4 --- addons/project_timesheet/project_timesheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 71c3542c010..f914faec86f 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -84,7 +84,7 @@ class project_work(osv.osv): if line_id in list_avail_ids: obj = self.pool.get('hr.analytic.timesheet') if 'name' in vals: - vals_line['name'] = '%s: %s' % (tools.ustr(task.name), tools.ustr(vals['name']) or '/') + vals_line['name'] = '%s: %s' % (tools.ustr(task.task_id.name), tools.ustr(vals['name']) or '/') if 'user_id' in vals: vals_line['user_id'] = vals['user_id'] if 'date' in vals: From cbea7944ca8514adc3f1b1465c4f2769fb4c95d2 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 12 Oct 2009 23:13:39 +0200 Subject: [PATCH 51/69] [FIX] bugfix residual computation and multi-currencies bzr revid: fp@tinyerp.com-20091012211339-nsgw8uawrjj8qmot --- addons/account/invoice.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 559f0a88156..10a54e8bb37 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -103,15 +103,23 @@ class account_invoice(osv.osv): def _amount_residual(self, cr, uid, ids, name, args, context=None): res = {} data_inv = self.browse(cr, uid, ids) + cur_obj = self.pool.get('res.currency') for inv in data_inv: - paid_amt = 0.0 - to_pay = inv.amount_total + debit = credit = 0.0 for lines in inv.move_lines: - if lines.amount_currency and lines.currency_id: - paid_amt += lines.amount_currency + if lines.account_id.company_currency_id.id <> inv.currency_id.id: + if lines.debit: + debit += cur_obj.compute(cr, uid, lines.account_id.company_currency_id.id, inv.currency_id.id, lines.debit) + if lines.credit: + credit += cur_obj.compute(cr, uid, lines.account_id.company_currency_id.id, inv.currency_id.id, lines.credit) else: - paid_amt += lines.credit + lines.debit - res[inv.id] = round(to_pay - abs(paid_amt),int(config['price_accuracy'])) + debit += lines.debit + credit += lines.credit + if inv.type in ('out_invoice','in_refund'): + result = inv.amount_total * (1.0 - credit / (debit + inv.amount_total)) + else: + result = inv.amount_total * (1.0 - debit / (credit + inv.amount_total)) + res[inv.id] = round(result,int(config['price_accuracy'])) return res def _get_lines(self, cr, uid, ids, name, arg, context=None): From f28d004d3a8afb50c2911088b860e7b504b547aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= <> Date: Tue, 13 Oct 2009 13:01:44 +0530 Subject: [PATCH 52/69] added pruchase link in product view bzr revid: hda@tinyerp.com-20091013073144-w5g0xgos6czko872 --- addons/purchase/purchase_view.xml | 8 ++++++++ addons/sale/sale.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 2d020bd6180..9e3eda61554 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -233,5 +233,13 @@ name="Purchase orders" res_model="purchase.order" src_model="res.partner"/> + + + diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 0f13e8051d9..30c24f7af25 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -225,7 +225,7 @@ class sale_order(osv.osv): 'project_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True, states={'draft': [('readonly', False)]}), 'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)]}), - 'invoice_ids': fields.many2many('account.invoice', 'sale_order_invoice_rel', 'order_id', 'invoice_id', 'Invoice', help="This is the list of invoices that have been generated for this sale order. The same sale order may have been invoiced in several times (by line for example)."), + 'invoice_ids': fields.many2many('account.invoice', 'sale_order_invoice_rel', 'order_id', 'invoice_id', 'Invoices', help="This is the list of invoices that have been generated for this sale order. The same sale order may have been invoiced in several times (by line for example)."), 'picking_ids': fields.one2many('stock.picking', 'sale_id', 'Related Packing', readonly=True, help="This is the list of picking list that have been generated for this invoice"), 'shipped': fields.boolean('Picked', readonly=True), 'picked_rate': fields.function(_picked_rate, method=True, string='Picked', type='float'), From 6b9040ca8d0be10f1aa65078e0e9da1776c07211 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Tue, 13 Oct 2009 16:34:10 +0200 Subject: [PATCH 53/69] [FIX] account: avoid ZeroDivisionError bzr revid: chs@tinyerp.com-20091013143410-sz59hp38dvv1ufor --- addons/account/invoice.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/account/invoice.py b/addons/account/invoice.py index 10a54e8bb37..10a49230480 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -115,7 +115,10 @@ class account_invoice(osv.osv): else: debit += lines.debit credit += lines.credit - if inv.type in ('out_invoice','in_refund'): + + if not inv.amount_total: + result = 0.0 + elif inv.type in ('out_invoice','in_refund'): result = inv.amount_total * (1.0 - credit / (debit + inv.amount_total)) else: result = inv.amount_total * (1.0 - debit / (credit + inv.amount_total)) From e25cb298e097ee0449accc94d0f3b3956d8d59f6 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 13 Oct 2009 20:15:38 +0530 Subject: [PATCH 54/69] [FIX] Sale : Better error message when account is missing from SOL for Invioce lp bug: https://launchpad.net/bugs/449583 fixed bzr revid: jvo@tinyerp.com-20091013144538-2k7w8zug6xvf3nsd --- addons/sale/sale.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 30c24f7af25..6a9572b547c 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -818,6 +818,9 @@ class sale_order_line(osv.osv): int(config['price_accuracy'])) fpos = line.order_id.fiscal_position or False a = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, a) + if not a: + raise osv.except_osv(_('Error !'), + _('There is no income category account defined in default Properties for Product Category or Fiscal Position is not defined !')) inv_id = self.pool.get('account.invoice.line').create(cr, uid, { 'name': line.name, 'origin': line.order_id.name, From e92ddd29994f8cd915f4604c3e19f4afc69d9179 Mon Sep 17 00:00:00 2001 From: Quentin De Paoli Date: Tue, 13 Oct 2009 16:50:16 +0200 Subject: [PATCH 55/69] [FIX] hr_expense: corrected error message bzr revid: qdp@cyan-20091013145016-xagtk35k93ip97y7 --- addons/hr_expense/hr_expense.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 0523dcb687c..f0fda12c6c5 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -139,7 +139,7 @@ class hr_expense_expense(osv.osv): 'account_analytic_id': l.analytic_account.id, })) if not exp.employee_id.address_id: - raise osv.except_osv(_('Error !'), _('The employee must have a contact address')) + raise osv.except_osv(_('Error !'), _('The employee must have a working address')) acc = exp.employee_id.address_id.partner_id.property_account_payable.id payment_term_id = exp.employee_id.address_id.partner_id.property_payment_term.id inv = { From 95ec254f709f55e64e50190554fa5004c63aa459 Mon Sep 17 00:00:00 2001 From: "Christophe Chauvet(OpenERP)" <> Date: Tue, 13 Oct 2009 20:42:18 +0530 Subject: [PATCH 56/69] [FIX] Base_report_creator : Allowing to use current userid lp bug: https://launchpad.net/bugs/446391 fixed bzr revid: jvo@tinyerp.com-20091013151218-o1vdbejzd6djq6bt --- addons/base_report_creator/base_report_creator.py | 4 ++-- addons/base_report_creator/base_report_creator_view.xml | 2 ++ addons/base_report_creator/wizard/wiz_set_filter_fields.py | 6 +++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/base_report_creator/base_report_creator.py b/addons/base_report_creator/base_report_creator.py index bcca40a153e..79824d227c6 100644 --- a/addons/base_report_creator/base_report_creator.py +++ b/addons/base_report_creator/base_report_creator.py @@ -259,8 +259,8 @@ class report_creator(osv.osv): ret_str = ret_str[0:len(ret_str)-3] if ret_str.endswith('or'): ret_str = ret_str[0:len(ret_str)-2] - ret_str = ret_str.strip() - return ret_str + ret_str = ret_str.strip() + return ret_str % {'uid' : uid} def _id_get(self, cr, uid, id, context): # return 'min(sale_order_line.id)' diff --git a/addons/base_report_creator/base_report_creator_view.xml b/addons/base_report_creator/base_report_creator_view.xml index 7ae858012ed..6c2df4466d6 100644 --- a/addons/base_report_creator/base_report_creator_view.xml +++ b/addons/base_report_creator/base_report_creator_view.xml @@ -86,6 +86,8 @@ + +
diff --git a/addons/base_report_creator/wizard/wiz_set_filter_fields.py b/addons/base_report_creator/wizard/wiz_set_filter_fields.py index a97be887803..0303bea8d3f 100644 --- a/addons/base_report_creator/wizard/wiz_set_filter_fields.py +++ b/addons/base_report_creator/wizard/wiz_set_filter_fields.py @@ -129,6 +129,10 @@ def _set_filter_value(self, cr, uid, data, context): value_data = 'true' else: value_data = 'false' + + if field_type in ['float','integer']: + value_data = value_data or 0 + if field_type == 'many2many' and value_data and len(value_data): fields_list = set_field_operator(self,table_name+"."+field_data['name'],field_data['ttype'],form_data['operator'],value_data[0][2]) else: @@ -136,7 +140,7 @@ def _set_filter_value(self, cr, uid, data, context): if fields_list: create_dict = { 'name':model_name + "/" +field_data['field_description'] +" "+ mapping_fields[form_data['operator']] + " " + str(fields_list[2]) + " ", - 'expression':' '.join(fields_list), + 'expression':' '.join(map(str,fields_list)), 'report_id':data['id'], 'condition' : form_data['condition'] } From be09477845ef513e4efb88870214b3edf25fb462 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 13 Oct 2009 19:58:13 +0200 Subject: [PATCH 57/69] [IMP] default value for module bzr revid: fp@tinyerp.com-20091013175813-vlqi304leu84x0wx --- bin/addons/base/ir/ir_model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/addons/base/ir/ir_model.py b/bin/addons/base/ir/ir_model.py index 2fe3375d0a0..c8a60d2b1bf 100644 --- a/bin/addons/base/ir/ir_model.py +++ b/bin/addons/base/ir/ir_model.py @@ -415,7 +415,8 @@ class ir_model_data(osv.osv): _defaults = { 'date_init': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), 'date_update': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), - 'noupdate': lambda *a: False + 'noupdate': lambda *a: False, + 'module': lambda *a: '' } _sql_constraints = [ ('module_name_uniq', 'unique(name, module)', 'You can not have multiple records with the same id for the same module'), From a7991fe257c5db23140b6f7c02b9577b4e7a7e9a Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 14 Oct 2009 17:16:10 +0530 Subject: [PATCH 58/69] [FIX] Base_Report_Creator : xml record was malformed, corrected bzr revid: jvo@tinyerp.com-20091014114610-2pwwhn9bok5cw3pr --- addons/base_report_creator/base_report_creator_view.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/base_report_creator/base_report_creator_view.xml b/addons/base_report_creator/base_report_creator_view.xml index 6c2df4466d6..b5ee6227bb2 100644 --- a/addons/base_report_creator/base_report_creator_view.xml +++ b/addons/base_report_creator/base_report_creator_view.xml @@ -87,7 +87,7 @@ - @@ -99,6 +99,7 @@ + Custom Report base_report_creator.report form tree,form From 32d9623c38e3019aaf621d447332a78c1eb99c08 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 15 Oct 2009 19:41:27 +0530 Subject: [PATCH 59/69] [REF] Account : Invoice view(mainor edit) lp bug: https://launchpad.net/bugs/451310 fixed bzr revid: jvo@tinyerp.com-20091015141127-uxt73xvgpuqhh4rf --- addons/account/account_invoice_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 8822568ef00..add20bc4636 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -209,7 +209,7 @@ From df9f5fb23c9649fb07f5757dcc94bc76405db808 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 15 Oct 2009 20:21:25 +0530 Subject: [PATCH 60/69] [FIX] Hr_timesheet_invoice : Wrong domain was sent for opening invoices created lp bug: https://launchpad.net/bugs/450180 fixed bzr revid: jvo@tinyerp.com-20091015145125-98o562uxoafp7m3t --- .../hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index 6a7d878d1ae..65ca5c31a07 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -173,7 +173,7 @@ class invoice_create(wizard.interface): mod_id = mod_obj.search(cr, uid, [('name', '=', 'action_invoice_tree1')])[0] res_id = mod_obj.read(cr, uid, mod_id, ['res_id'])['res_id'] act_win = act_obj.read(cr, uid, res_id, []) - act_win['domain'] = [('id','in',[(','.join(map(str,invoices)))]),('type','=','out_invoice')] + act_win['domain'] = [('id','in',invoices),('type','=','out_invoice')] act_win['name'] = _('Invoices') return act_win From 122230e73c8e863a3b405741d2495198abb24d22 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Fri, 16 Oct 2009 17:16:43 +0200 Subject: [PATCH 61/69] [FIX] allow to call write without ids on osv_memory objects bzr revid: chs@tinyerp.com-20091016151643-uh7a9m0lfeqajfqf --- bin/osv/orm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 73015dffbde..652bcafab0a 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1472,6 +1472,8 @@ class orm_memory(orm_template): return result def write(self, cr, user, ids, vals, context=None): + if not ids: + return True vals2 = {} upd_todo = [] for field in vals: From 3a3ea98257856975756a73efa7e9d4ea1edb8a8f Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 19 Oct 2009 20:16:33 +0200 Subject: [PATCH 62/69] [FIX] recursive child_of on one2many and many2many bzr revid: fp@tinyerp.com-20091019181633-8szl9k4nlp9mmr1p --- bin/osv/expression.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/osv/expression.py b/bin/osv/expression.py index 3c330aaaa1a..72fde0be88b 100644 --- a/bin/osv/expression.py +++ b/bin/osv/expression.py @@ -52,8 +52,8 @@ class expression(object): ' FROM "%s"' \ ' WHERE "%s" in (%s)' % (s, f, w, ','.join(['%s']*len(subids))), subids) - res.extend([r[0] for r in cr.fetchall()]) - return res + res += [r[0] for r in cr.fetchall() if r[0]] + return res + (res and self.__execute_recursive_in(cr, s, f, w, res) or []) def __init__(self, exp): From a34163911b5675e01d5387a38e0aa2653bb0d764 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 20 Oct 2009 18:22:54 +0200 Subject: [PATCH 63/69] [FIX] purchase: Use the price_accuracy bzr revid: stephane@openerp.com-20091020162254-4tqmgq8d8toau15b --- addons/purchase/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 5661deedeee..521549cf472 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -442,7 +442,7 @@ class purchase_order_line(osv.osv): 'move_ids': fields.one2many('stock.move', 'purchase_line_id', 'Reservation', readonly=True, ondelete='set null'), 'move_dest_id': fields.many2one('stock.move', 'Reservation Destination', ondelete='set null'), 'price_unit': fields.float('Unit Price', required=True, digits=(16, int(config['price_accuracy']))), - 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal'), + 'price_subtotal': fields.function(_amount_line, method=True, string='Subtotal', digits=(16, int(config['price_accuracy']))), 'notes': fields.text('Notes'), 'order_id': fields.many2one('purchase.order', 'Order Ref', select=True, required=True, ondelete='cascade'), 'account_analytic_id':fields.many2one('account.analytic.account', 'Analytic Account',), From 636d392c646767e43dfe9e51b5cbc4da0e1ace84 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Tue, 20 Oct 2009 18:23:07 +0200 Subject: [PATCH 64/69] [FIX] Import OSV in the wizard bzr revid: stephane@openerp.com-20091020162307-zgrmea9e9gadmu30 --- addons/purchase_manual/wizard/wizard_purchase_line_invoice.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/purchase_manual/wizard/wizard_purchase_line_invoice.py b/addons/purchase_manual/wizard/wizard_purchase_line_invoice.py index 89d7d188287..c65cefd97d0 100644 --- a/addons/purchase_manual/wizard/wizard_purchase_line_invoice.py +++ b/addons/purchase_manual/wizard/wizard_purchase_line_invoice.py @@ -24,6 +24,7 @@ import wizard import netsvc import ir import pooler +import osv invoice_form = """
From f4f07382f5853849af46eeb3d6a8925bc0c2228b Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 21 Oct 2009 11:52:40 +0530 Subject: [PATCH 65/69] [FIX] Account : Restricting Payment term lines percentage insertion from 0 to 1 lp bug: https://launchpad.net/bugs/421636 fixed bzr revid: jvo@tinyerp.com-20091021062240-55hy0og5o7t87bkr --- addons/account/account.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 85dc85fd2d8..ff344b0256b 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -77,7 +77,10 @@ class account_payment_term_line(osv.osv): _columns = { 'name': fields.char('Line Name', size=32, required=True), 'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the payment term lines from the lowest sequences to the higher ones"), - 'value': fields.selection([('procent', 'Percent'), ('balance', 'Balance'), ('fixed', 'Fixed Amount')], 'Value',required=True), + 'value': fields.selection([('procent', 'Percent'), ('balance', 'Balance'), ('fixed', 'Fixed Amount')], 'Value', required=True, help="""Example: 14 days 2%, 30 days net +1. Line 1: percent 0.02 14 days +2. Line 2: balance 30 days"""), + 'value_amount': fields.float('Value Amount', help="For Value percent enter % ratio between 0-1."), 'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \ "If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."), @@ -90,6 +93,17 @@ class account_payment_term_line(osv.osv): 'days2': lambda *a: 0, } _order = "sequence" + + def _check_percent(self, cr, uid, ids, context={}): + obj = self.browse(cr, uid, ids[0]) + if obj.value == 'procent' and ( obj.value_amount < 0.0 or obj.value_amount > 1.0): + return False + return True + + _constraints = [ + (_check_percent, _('Percentages for Payment Term Line must be between 0 and 1, Example: 0.02 for 2% '), ['value_amount']), + ] + account_payment_term_line() From 8fd383c54afd7f653a6b7073c946ccc6563c6050 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?VRA=28OpenERP=29=2C=20Claude=20Brul=C3=A9=28Syleam=29?= <> Date: Wed, 21 Oct 2009 15:43:24 +0530 Subject: [PATCH 66/69] [FIX] Project_timesheet : Analytic line creation/edition takes user based information lp bug: https://launchpad.net/bugs/395160 fixed bzr revid: jvo@tinyerp.com-20091021101324-37sddttk0hqlyt8k --- addons/project_timesheet/project_timesheet.py | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index f914faec86f..255f83e7021 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -30,18 +30,15 @@ from tools.translate import _ class project_work(osv.osv): _inherit = "project.task.work" _description = "Task Work" - def create(self, cr, uid, vals, *args, **kwargs): - - obj = self.pool.get('hr.analytic.timesheet') - vals_line = {} - obj_task = self.pool.get('project.task').browse(cr, uid, vals['task_id']) + def get_user_related_details(self, cr, uid, user_id): + res = {} emp_obj = self.pool.get('hr.employee') - emp_id = emp_obj.search(cr, uid, [('user_id', '=', vals.get('user_id', uid))]) - + emp_id = emp_obj.search(cr, uid, [('user_id', '=', user_id)]) if not emp_id: + user_name = self.pool.get('res.users').read(cr, uid, [user_id], ['name'])[0]['name'] raise osv.except_osv(_('Bad Configuration !'), - _('No employee defined for this user. You must create one.')) + _('No employee defined for user "%s". You must create one.')% (user_name,)) emp = self.pool.get('hr.employee').browse(cr, uid, emp_id[0]) if not emp.product_id: raise osv.except_osv(_('Bad Configuration !'), @@ -54,9 +51,22 @@ class project_work(osv.osv): a = emp.product_id.product_tmpl_id.property_account_expense.id if not a: a = emp.product_id.categ_id.property_account_expense_categ.id - + if not a: + raise osv.except_osv(_('Bad Configuration !'), + _('No product and product category property account defined on the related employee.\nFill in the timesheet tab of the employee form.')) + res['product_id'] = emp.product_id.id + res['journal_id'] = emp.journal_id.id + res['general_account_id'] = a + return res + + def create(self, cr, uid, vals, *args, **kwargs): + obj = self.pool.get('hr.analytic.timesheet') + vals_line = {} + obj_task = self.pool.get('project.task').browse(cr, uid, vals['task_id']) + result = self.get_user_related_details(cr, uid, vals.get('user_id', uid)) vals_line['name'] = '%s: %s' % (tools.ustr(obj_task.name), tools.ustr(vals['name']) or '/') vals_line['user_id'] = vals['user_id'] + vals_line['product_id'] = result['product_id'] vals_line['date'] = vals['date'][:10] vals_line['unit_amount'] = vals['hours'] acc_id = obj_task.project_id.category_id.id @@ -64,8 +74,8 @@ class project_work(osv.osv): res = obj.on_change_account_id(cr, uid, False, acc_id) if res.get('value'): vals_line.update(res['value']) - vals_line['general_account_id'] = a - vals_line['journal_id'] = emp.journal_id.id + vals_line['general_account_id'] = result['general_account_id'] + vals_line['journal_id'] = result['journal_id'] vals_line['amount'] = 00.0 timeline_id = obj.create(cr, uid, vals_line, {}) @@ -87,6 +97,10 @@ class project_work(osv.osv): vals_line['name'] = '%s: %s' % (tools.ustr(task.task_id.name), tools.ustr(vals['name']) or '/') if 'user_id' in vals: vals_line['user_id'] = vals['user_id'] + result = self.get_user_related_details(cr, uid, vals['user_id']) + vals_line['product_id'] = result['product_id'] + vals_line['general_account_id'] = result['general_account_id'] + vals_line['journal_id'] = result['journal_id'] if 'date' in vals: vals_line['date'] = vals['date'][:10] if 'hours' in vals: From 391807ea8fa0d7d794eb43f89f9fe6eb407f2143 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Wed, 21 Oct 2009 18:13:26 +0530 Subject: [PATCH 67/69] [FIX]: #TODO: fix me sale module can not be used here, #as may be mrp can be installed without sale modul bzr revid: mga@tinyerp.com-20091021124326-0bcr4q9st2wy9yf0 --- addons/mrp/mrp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index caef74d4540..5e7658b69eb 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -362,6 +362,8 @@ class mrp_production(osv.osv): parent_move_line=get_parent_move(production['move_prod_id'][0]) if parent_move_line: move = move_obj.browse(cr,uid,parent_move_line) + #TODO: fix me sale module can not be used here, + #as may be mrp can be installed without sale module if field_name=='name': res[production['id']]=move.sale_line_id and move.sale_line_id.order_id.name or False if field_name=='client_order_ref': From 7b06ec81af6893ca030520c0605915c0c641f312 Mon Sep 17 00:00:00 2001 From: "YSA,JVO" <> Date: Thu, 22 Oct 2009 19:32:51 +0530 Subject: [PATCH 68/69] [FIX] Export : Selection field gets imported by its external name if export is not import compatible lp bug: https://launchpad.net/bugs/434341 fixed bzr revid: jvo@tinyerp.com-20091022140251-epxtjovnp2xe4g27 --- bin/osv/orm.py | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 50b16ddf7f8..4859bd7d85a 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -450,6 +450,15 @@ class orm_template(object): return False return '' + def selection_field(in_field): + col_obj = self.pool.get(in_field.keys()[0]) + if f[i] in col_obj._columns.keys(): + return col_obj._columns[f[i]] + elif f[i] in col_obj._inherits.keys(): + selection_field(col_obj._inherits) + else: + return False + lines = [] data = map(lambda x: '', range(len(fields))) done = [] @@ -473,7 +482,19 @@ class orm_template(object): else: break else: - r = r[f[i]] + r = r[f[i]] + # To display external name of selection field when its exported + if not context.get('import_comp',False):# Allow external name only if its not import compatible + cols = False + if f[i] in self._columns.keys(): + cols = self._columns[f[i]] + elif f[i] in self._inherit_fields.keys(): + cols = selection_field(self._inherits) + if cols and cols._type == 'selection': + sel_list = cols.selection + if type(sel_list) == type([]): + r = [x[1] for x in sel_list if r==x[0]][0] + if not r: if f[i] in self._columns: r = check_type(self._columns[f[i]]._type) @@ -2119,10 +2140,12 @@ class orm(orm_template): if isinstance(ids, (int, long)): select = [ids] result = self._read_flat(cr, user, select, fields, context, load) + for r in result: for key, v in r.items(): if v == None: r[key] = False + if isinstance(ids, (int, long)): return result and result[0] or False return result From da2e99051a57989c592418668ab4614baf142c4e Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 22 Oct 2009 20:06:41 +0530 Subject: [PATCH 69/69] [FIX] Expression : domain calculation failes, max. recursion error protected bzr revid: jvo@tinyerp.com-20091022143641-l5b4jbk0spce8b1t --- bin/osv/expression.py | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/bin/osv/expression.py b/bin/osv/expression.py index 3b4516e6657..d695fc62230 100644 --- a/bin/osv/expression.py +++ b/bin/osv/expression.py @@ -46,18 +46,25 @@ class expression(object): def __execute_recursive_in(self, cr, s, f, w, ids, op, type): res = [] - if not ids: - return [] - if op not in ('<','>','=','>=','<=','not in'): - op = 'in' - for i in range(0, len(ids), cr.IN_MAX): - subids = ids[i:i+cr.IN_MAX] - cr.execute('SELECT "%s"' \ - ' FROM "%s"' \ - ' WHERE "%s" %s (%s)' % (s, f, w, op, ','.join(['%s']*len(subids))), - subids) - res += [r[0] for r in cr.fetchall() if r[0]] - return res + (res and self.__execute_recursive_in(cr, s, f, w, res, op, type) or []) + if ids: + if op in ['<','>','>=','<=']: + cr.execute('SELECT "%s"' \ + ' FROM "%s"' \ + ' WHERE "%s" %s %s' % (s, f, w, op, ids[0])) + res.extend([r[0] for r in cr.fetchall()]) + else: + for i in range(0, len(ids), cr.IN_MAX): + subids = ids[i:i+cr.IN_MAX] + cr.execute('SELECT "%s"' \ + ' FROM "%s"' \ + ' WHERE "%s" in (%s)' % (s, f, w, ','.join(['%s']*len(subids))), + subids) + res.extend([r[0] for r in cr.fetchall()]) + else: + cr.execute('SELECT distinct("%s")' \ + ' FROM "%s" where "%s" is not null' % (s, f, s)), + res.extend([r[0] for r in cr.fetchall()]) + return res def __init__(self, exp): # check if the expression is valid