Merge lp:~openerp-dev/openobject-addons/6.0-opw-382073-skh into lp:openobject-addons/6.0

Proposed by Somesh Khare
Status: Rejected
Rejected by: Xavier ALT
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-382073-skh
Merge into: lp:openobject-addons/6.0
Diff against target: 17 lines (+4/-3)
1 file modified
account_analytic_plans/account_analytic_plans.py (+4/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-382073-skh
Reviewer Review Type Date Requested Status
Xavier ALT (community) Disapprove
Naresh(OpenERP) (community) Approve
Review via email: mp+92020@code.launchpad.net

Description of the change

Hello Sir,

Scenario:
when the Journal (eg: Sales Journal) has a Analytic Journal and the Analytic Distribution's also has the "Analytic Journal" (eg: Sales), Here in the sale invoice line when you search for the Analytic Distribution, It shows all the Distribution (those have Sales as Analytic Journal + no Analytic journal defined).

If Journal (eg: Sales Journal) do not have "Analytic Journal" then in that case when you select the Analytic Distribution It shows all Distribution which has no "Analytic journal" set.

This branch will fix the issue for showing all Distributions when no analytic journal defined on the journal as in the bug description.

Please review the branch and share your view on it.

Thanks
Somesh Khare

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve
Revision history for this message
Xavier ALT (dex-phx) wrote :

Hello,

I technically agree with the MP, but this doesn't solve the problem - the "analytic journal" is *required* on financial journal in multiple locations:

account_analytic_plans/account_analytic_plans.py-339-
account_analytic_plans/account_analytic_plans.py:340:
--
account_analytic_plans/account_analytic_plans.py-481-
account_analytic_plans/account_analytic_plans.py:482:
--
account/wizard/account_use_model.py-80-
account/wizard/account_use_model.py:81:
--
account/account_move_line.py-168-
account/account_move_line.py:169:
--
account/invoice.py-681-
account/invoice.py:682:
--
account/account_bank_statement.py-349-
account/account_bank_statement.py:350:
--
account/account.py-2154-
account/account.py:2155:

The distribution is basically a template, which will help generating analytic entries, on bank statement confirmation, account.move validation, etc... So, even if we allow user to choose another distribution, when the user want to create analytic entries, it have to set an analytic journal.

review: Disapprove

Unmerged revisions

5040. By Somesh Khare

[FIX]: account_analytic_plans, no distributions shown if the journal has no analytic journal set (Ref: Case 382073)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_analytic_plans/account_analytic_plans.py'
2--- account_analytic_plans/account_analytic_plans.py 2011-09-27 06:02:10 +0000
3+++ account_analytic_plans/account_analytic_plans.py 2012-02-08 12:30:28 +0000
4@@ -118,9 +118,10 @@
5 if context.get('journal_id', False):
6 journal = journal_obj.browse(cr, user, [context['journal_id']], context=context)[0]
7 analytic_journal = journal.analytic_journal_id and journal.analytic_journal_id.id or False
8- args.append('|')
9- args.append(('journal_id', '=', analytic_journal))
10- args.append(('journal_id', '=', False))
11+ if analytic_journal:
12+ args.append('|')
13+ args.append(('journal_id', '=', analytic_journal))
14+ args.append(('journal_id', '=', False))
15 res = super(account_analytic_plan_instance, self).search(cr, user, args, offset=offset, limit=limit, order=order,
16 context=context, count=count)
17 return res