← Back to team overview

openerp-india team mailing list archive

[Bug 1275464] [NEW] Useless loop in Budget code

 

Public bug reported:

I noticed something weird in the code of Account Budget Lines.
It seems like no-op proxy functions have been introduced in this revision ages ago : revid:jvo@xxxxxxxxxxx-20080925130210-bmi3uuq26zit9ke3

Here is the first (the other read mostly the same):
    def _prac(self, cr, uid, ids, name, args, context=None):
        res={}
        for line in self.browse(cr, uid, ids, context=context):
            res[line.id] = self._prac_amt(cr, uid, [line.id], context=context)[line.id]
        return res

Am I missing something, or is this just returning the exact same value as _prac_amt in a totally inefficient way?
Using browse() to get the ids is strange. And it's just rebuilding a dictionary it already has isn't it?

** Affects: openobject-addons
     Importance: Undecided
         Status: New

** Description changed:

  I noticed something weird in the code of Account Budget Lines.
  It seems like no-op proxy functions have been introduced in this revision ages ago : revid:jvo@xxxxxxxxxxx-20080925130210-bmi3uuq26zit9ke3
  
  Here is the first (the other read mostly the same):
-     def _prac(self, cr, uid, ids, name, args, context=None):
-         res={}
-         for line in self.browse(cr, uid, ids, context=context):
-             res[line.id] = self._prac_amt(cr, uid, [line.id], context=context)[line.id]
-         return res
+     def _prac(self, cr, uid, ids, name, args, context=None):
+         res={}
+         for line in self.browse(cr, uid, ids, context=context):
+             res[line.id] = self._prac_amt(cr, uid, [line.id], context=context)[line.id]
+         return res
  
- Am I missing something, is this just return exact same value as
- _prac_amt in a totally inefficient way? Using browse() to get the ids is
- strange. And it's just rebuilding a dictionary it already has isn't it?
+ Am I missing something, or is this just returning the exact same value as _prac_amt in a totally inefficient way?
+ Using browse() to get the ids is strange. And it's just rebuilding a dictionary it already has isn't it?

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1275464

Title:
  Useless loop in Budget code

Status in OpenERP Addons (modules):
  New

Bug description:
  I noticed something weird in the code of Account Budget Lines.
  It seems like no-op proxy functions have been introduced in this revision ages ago : revid:jvo@xxxxxxxxxxx-20080925130210-bmi3uuq26zit9ke3

  Here is the first (the other read mostly the same):
      def _prac(self, cr, uid, ids, name, args, context=None):
          res={}
          for line in self.browse(cr, uid, ids, context=context):
              res[line.id] = self._prac_amt(cr, uid, [line.id], context=context)[line.id]
          return res

  Am I missing something, or is this just returning the exact same value as _prac_amt in a totally inefficient way?
  Using browse() to get the ids is strange. And it's just rebuilding a dictionary it already has isn't it?

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/1275464/+subscriptions


Follow ups

References