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

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

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-577781-skh/+merge/119522

Hello Sir,

[FIX] account_move_line: journal view on the journal form did not work.

Steps to Reproduce:
1. Create a Journal View "Test View" and select field as 
"move,ref,state,account" from menu "Accounting/Configuration/Financial 
Accounting/Journals/Journal Views".
2. Select any journal from "Accounting/Configuration/Financial 
Accounting/Journals/Journals" (eg: Sales Journal).
3. Now select the Display mode as "Test View" on the Journal form view.
4. From the action window select Journal Item. 

Your selected display mode's (Journal Views) fields are not visible on the 
journal items from here.

Expected result:
It should display only the fields those are defined into the Journal View "Test 
View".

This branch fixes this issue, Kindly review the branch and please share your 
views on it.

Thanks,
Somesh Khare
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-577781-skh/+merge/119522
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-577781-skh.
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py	2012-07-27 11:43:03 +0000
+++ account/account_move_line.py	2012-08-14 12:29:32 +0000
@@ -22,6 +22,7 @@
 import time
 from datetime import datetime
 from operator import itemgetter
+import sys
 
 from lxml import etree
 
@@ -1017,7 +1018,11 @@
         flds = []
         title = _("Accounting Entries") #self.view_header_get(cr, uid, view_id, view_type, context)
 
-        ids = journal_pool.search(cr, uid, [])
+        journal_id = context.get('active_model')=='account.journal' and context.get('active_id') or context.get('search_default_journal_id') or False
+        if journal_id:
+            ids = journal_pool.search(cr, uid, [('id','=',journal_id)])
+        else:
+            ids = journal_pool.search(cr, uid, [])
         journals = journal_pool.browse(cr, uid, ids, context=context)
         all_journal = [None]
         common_fields = {}
@@ -1035,8 +1040,10 @@
                     common_fields[field.field] = common_fields[field.field] + 1
         fld.append(('period_id', 3))
         fld.append(('journal_id', 10))
+        fld.append(('state',sys.maxint))
         flds.append('period_id')
         flds.append('journal_id')
+        flds.append('state')
         fields['period_id'] = all_journal
         fields['journal_id'] = all_journal
         fld = sorted(fld, key=itemgetter(1))

_______________________________________________
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