Priyesh (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.0-opw-50786-pso into 
lp:openobject-addons/6.0.

Requested reviews:
  nel (nel-tinyerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-50786-pso/+merge/84217

Hello,

I have improved search method of move lines to fix this issue:

To reproduce:
1. Open a chart of account filtered from january 2011 to March 2011 for example
2. Double click on a regular account (containing move lines)
3. The journal items view do not filter on january 2011 to March 2011. 
4. It should show only move lines from these periods and not all move lines 
from any periods.

Can you please share your views on this ?

Thanks,
Priyesh
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-50786-pso/+merge/84217
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.0-opw-50786-pso.
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py	2011-11-22 10:49:26 +0000
+++ account/account_move_line.py	2011-12-02 06:38:24 +0000
@@ -681,6 +681,12 @@
     def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
         if context is None:
             context = {}
+        if context and context.get('fiscalyear', False):
+            periods = self.pool.get('account.fiscalyear').browse(cr, uid, context.get('fiscalyear'), context=context).period_ids
+            period_ids = [period.id for period in periods]
+            args.append(('period_id', 'in', period_ids))
+        if context and context.get('periods', False):
+            args.append(('period_id', 'in', context.get('periods')))
         if context and context.get('next_partner_only', False):
             if not context.get('partner_id', False):
                 partner = self.get_next_partner_only(cr, uid, offset, context)

_______________________________________________
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