← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 666781] [NEW] useless list comprehension and browse in split_moves

 

Public bug reported:

Nothing important, but stock/stock_split_move.py has a portion that read like this:
        move_ids = [m.id for m in [line for line in pick.move_lines]]
        for move in move_obj.browse(cr, uid, move_ids, context=context):

I think [line for line in X] just makes a copy of X. Then we do it just to get ids and browse again.
So I suppose it should just read:
        for move in move_lines:
Lionel

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

** Summary changed:

- useless list comprehension
+ useless list comprehension and browse in split_moves

** Description changed:

  Nothing important, but stock/stock_split_move.py has a portion that read like this:
          move_ids = [m.id for m in [line for line in pick.move_lines]]
- but I think [line for line in X] just makes a copy of the list, so it's useless here, so the following would be better:
-         move_ids = [m.id for m in move_lines]
+         for move in move_obj.browse(cr, uid, move_ids, context=context):
+ 
+ I think [line for line in X] just makes a copy of X. Then we do it just to get ids and browse again.
+ So I suppose it should just read:
+         for move in move_lines:
  Lionel

-- 
useless list comprehension and browse in split_moves
https://bugs.launchpad.net/bugs/666781
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Addons Modules: New

Bug description:
Nothing important, but stock/stock_split_move.py has a portion that read like this:
        move_ids = [m.id for m in [line for line in pick.move_lines]]
        for move in move_obj.browse(cr, uid, move_ids, context=context):

I think [line for line in X] just makes a copy of X. Then we do it just to get ids and browse again.
So I suppose it should just read:
        for move in move_lines:
Lionel







Follow ups

References