← Back to team overview

openerp-india team mailing list archive

[Bug 922198] Re: [trunk 6.1] res_users request to read field 'group_id' can generates twice same SQL request in read_flat

 

Thanks,  this could be improved indeed.

** Changed in: openobject-server
   Importance: Undecided => Wishlist

** Changed in: openobject-server
       Status: New => Confirmed

** Changed in: openobject-server
     Assignee: (unassigned) => OpenERP's Framework R&D (openerp-dev-framework)

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

Title:
  [trunk 6.1] res_users request to read field 'group_id' can generates
  twice same SQL request in read_flat

Status in OpenERP Server:
  Fix Released

Bug description:
  Hi,

  In read, there is no check if the fields argument doesn't contain
  multiple times the same field to read. It's not an issue if you are
  careful and don't ask to request twice the same field otherwise 2 SQL
  queries will be triggered.

  The issue is in the read method of res.users (base/res/res_users.py
  line 853). You append the field 'groups_id' in the fields list even if
  it is already in the list. When you request to read 'groups_id', it
  results in two SQL requests to read that field in DB.

  self.pool.get('res.users').read(cr, 1, uid, ['groups_id'])
  [2012-01-26 17:01:46,143][?] DEBUG_SQL:db.cursor:query: SELECT res_groups_users_rel.gid, res_groups_users_rel.uid                    FROM res_groups_users_rel, "res_groups"                   WHERE res_groups_users_rel.uid IN (17)                     AND res_groups_users_rel.gid = res_groups.id                                                                         OFFSET 0
  [2012-01-26 17:01:46,144][?] DEBUG_SQL:db.cursor:query: SELECT res_groups_users_rel.gid, res_groups_users_rel.uid                    FROM res_groups_users_rel, "res_groups"                   WHERE res_groups_users_rel.uid IN (17)                     AND res_groups_users_rel.gid = res_groups.id                                                                         OFFSET 0

  kr,
  J-E

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


References