From 0d741b110be463a76215611bca0054cf4afaadf7 Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Wed, 23 Sep 2009 18:22:31 +0530 Subject: [PATCH 01/10] [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 02/10] [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 03/10] [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 04/10] [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 05/10] 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 06/10] [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 07/10] [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 08/10] [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 09/10] [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 10/10] [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 "\