Merge lp:~openerp-dev/openobject-addons/6.1-bug-1033505-vba into lp:openobject-addons/6.1

Proposed by Vijaykumar Baladaniya (OpenERP)
Status: Approved
Approved by: Anto
Approved revision: 6976
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-bug-1033505-vba
Merge into: lp:openobject-addons/6.1
Diff against target: 14 lines (+2/-2)
1 file modified
analytic/analytic.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-bug-1033505-vba
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+124163@code.launchpad.net

Description of the change

Hello Sir,

    I have improve the code to account_analytic_account for select a parent project when create project. Kindly review the code.

Thanks,
Vijay Baladaniya

To post a comment you must log in.
Revision history for this message
Anto (abourguignon) wrote :

With this fix, we only fetch the analytic accounts that the current user has the right to read, avoiding an access error when calling name_get(). Seems ok !

Unmerged revisions

6976. By Vijaykumar Baladaniya (OpenERP)

[FIX] Create project while select parent project display its list proper.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'analytic/analytic.py'
--- analytic/analytic.py 2012-02-16 18:01:11 +0000
+++ analytic/analytic.py 2012-09-13 11:32:19 +0000
@@ -257,8 +257,8 @@
257 if context is None:257 if context is None:
258 context={}258 context={}
259 if context.get('current_model') == 'project.project':259 if context.get('current_model') == 'project.project':
260 cr.execute("select analytic_account_id from project_project")260 project_obj = self.pool.get("account.analytic.account")
261 project_ids = [x[0] for x in cr.fetchall()]261 project_ids = project_obj.search(cr, uid, args)
262 return self.name_get(cr, uid, project_ids, context=context)262 return self.name_get(cr, uid, project_ids, context=context)
263 if name:263 if name:
264 account = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context)264 account = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context)