← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-server/total_reqest_count into lp:openobject-server

 

Ysa(Open ERP) has proposed merging lp:~openerp-dev/openobject-server/total_reqest_count into lp:openobject-server.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/total_reqest_count/+merge/45810

[FIX] Count total number of request but doesnot count closed request.
https://bugs.launchpad.net/openobject-server/+bug/698039
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/total_reqest_count/+merge/45810
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-server/total_reqest_count.
=== modified file 'bin/addons/base/res/res_request.py'
--- bin/addons/base/res/res_request.py	2010-12-21 20:06:35 +0000
+++ bin/addons/base/res/res_request.py	2011-01-11 05:27:52 +0000
@@ -54,9 +54,9 @@
         return True
 
     def request_get(self, cr, uid):
-        cr.execute('select id from res_request where act_to=%s and (trigger_date<=%s or trigger_date is null) and active=True', (uid,time.strftime('%Y-%m-%d')))
+        cr.execute('select id from res_request where act_to=%s and (trigger_date<=%s or trigger_date is null) and active=True and state != %s', (uid,time.strftime('%Y-%m-%d'), 'closed'))
         ids = map(lambda x:x[0], cr.fetchall())
-        cr.execute('select id from res_request where act_from=%s and (act_to<>%s) and (trigger_date<=%s or trigger_date is null) and active=True', (uid,uid,time.strftime('%Y-%m-%d')))
+        cr.execute('select id from res_request where act_from=%s and (act_to<>%s) and (trigger_date<=%s or trigger_date is null) and active=True and state != %s', (uid,uid,time.strftime('%Y-%m-%d'), 'closed'))
         ids2 = map(lambda x:x[0], cr.fetchall())
         return (ids, ids2)
 


Follow ups