Bug in the tree view of the projects, when grouping by parent

Bug #697443 reported by Open Net Sàrl
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
High
OpenERP R&D Addons Team 1

Bug Description

Consider a hierarchical list of projects, with parent-child relation.
Try to group by "Parent" and you'll get an error such as:

Environment Information :
System : Windows-32bit
OS Name : nt
Operating System Release :
Operating System Version : 32bit
Operating System Architecture : 32bit
Operating System Locale : fr_CH.cp1252
Python Version : 2.5.2
OpenERP-Client Version : 6.0.0-rc2
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/netsvc.py", line 489, in dispatch
    result = ExportService.getService(service_name).dispatch(method, auth, params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/service/web_services.py", line 598, in dispatch
    res = fn(db, uid, *params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 2182, in read_group
    cr.execute('SELECT min(%s.id) AS id, count(%s.id) AS %s_count' % (self._table, self._table, group_count) + (flist and ',') + flist + ' FROM ' + from_clause + where_clause + gb + limit_str + offset_str, where_clause_params)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/sql_db.py", line 76, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/openerp-server/sql_db.py", line 129, in execute
    res = self._obj.execute(query, params)
ProgrammingError: ERREUR: la référence à la colonne « parent_id » est ambigu
LIGNE 1 : ... id, count(project_project.id) AS parent_id_count,parent_id,...
                                                               ^

I think there is an error while constructing the query while grouping by parent: the colun 'parent_id' may be related to more than one table

Grouping by "Partner" and/or by "Manager" is okay.

Best regards

Changed in openobject-server:
assignee: nobody → OpenERP's Framework R&D (openerp-dev-framework)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Azazahmed Saiyed (OpenERP) (saz-openerp) wrote :

Hello,

The problem occurs due to the ambiguous reference of the field parent_id in tables account_analytic_account and project_project.

Thanks.

affects: openobject-server → openobject-addons
Changed in openobject-addons:
assignee: OpenERP's Framework R&D (openerp-dev-framework) → OpenERP R&D Addons Team 1 (openerp-dev-addons1)
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Ujjvala Collins (uco-openerp) wrote :

Hello,

The fix has been committed to lp:~openerp-dev/openobject-addons/uco-dev-addons1 with revision 3519.

Soon, it'll be merged into main addons.

Thanks.

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
status: Fix Committed → Fix Released
Changed in openobject-addons:
milestone: none → 6.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.