Merge lp:~openerp-dev/openobject-addons/6.1-opw-577762-bth into lp:openobject-addons/6.1

Proposed by Bhumi Thakkar (Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-577762-bth
Merge into: lp:openobject-addons/6.1
Diff against target: 24 lines (+9/-5)
1 file modified
account_analytic_plans/report/crossovered_analytic.py (+9/-5)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-577762-bth
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+119508@code.launchpad.net

Description of the change

Hello,

[Cust : CYM - Choose Your Model] open any contract and print the report with necessory info,"Crossovered Analytic" GOT ERROR:

1. Sales => Sales => Contracts
2. Open any record and open report 'Crossovered Analytic' and print the report.

Observed: (<type 'exceptions.IndexError'>, IndexError('list index out of range',),
<traceback object at 0xc8ddf04>)
Expected: Print report successfully.

Put condition before use on browse record if to_return_ids: also for if ref_ids:

Thanks.

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Not Relevant on Trunk (means that architecture on trunk has changed and so this bug has no meaning anymore). If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6947. By Bhumi Thakkar (Open ERP)

[FIX] Put condition before use.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_analytic_plans/report/crossovered_analytic.py'
2--- account_analytic_plans/report/crossovered_analytic.py 2011-01-14 00:11:01 +0000
3+++ account_analytic_plans/report/crossovered_analytic.py 2012-08-14 11:01:24 +0000
4@@ -44,11 +44,15 @@
5 # to avoid duplicate entries
6 if id not in to_return_ids:
7 to_return_ids.append(analytic_obj.search(self.cr,self.uid,[('parent_id','child_of',[id])]))
8- data_accnt = analytic_obj.browse(self.cr,self.uid,to_return_ids[0])
9- for data in data_accnt:
10- if data.parent_id and data.parent_id.id == ref_ids[0]:
11- parent_list.append(data.id)
12- final_list.append(ref_ids[0])
13+
14+ if to_return_ids:
15+ data_accnt = analytic_obj.browse(self.cr,self.uid,to_return_ids[0])
16+
17+ for data in data_accnt:
18+ if data.parent_id and data.parent_id.id == ref_ids[0]:
19+ parent_list.append(data.id)
20+ if ref_ids:
21+ final_list.append(ref_ids[0])
22 set_list = self.set_account(parent_list)
23 final_list.extend(set_list)
24 return final_list #to_return_ids[0]