Somesh Khare(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-382073-skh into 
lp:openobject-addons/6.0.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-382073-skh/+merge/92020

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
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-382073-skh/+merge/92020
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-382073-skh.
=== modified file 'account_analytic_plans/account_analytic_plans.py'
--- account_analytic_plans/account_analytic_plans.py	2011-09-27 06:02:10 +0000
+++ account_analytic_plans/account_analytic_plans.py	2012-02-08 12:30:28 +0000
@@ -118,9 +118,10 @@
         if context.get('journal_id', False):
             journal = journal_obj.browse(cr, user, [context['journal_id']], context=context)[0]
             analytic_journal = journal.analytic_journal_id and journal.analytic_journal_id.id or False
-            args.append('|')
-            args.append(('journal_id', '=', analytic_journal))
-            args.append(('journal_id', '=', False))
+            if analytic_journal:
+                args.append('|')
+                args.append(('journal_id', '=', analytic_journal))
+                args.append(('journal_id', '=', False))
         res = super(account_analytic_plan_instance, self).search(cr, user, args, offset=offset, limit=limit, order=order,
                                                                  context=context, count=count)
         return res

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to