← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 722882] Re: ProgrammingError more than one row returned subquery

 

On Tuesday 22 February 2011, you wrote:
> Also I noticed that if I stripped the query to only this
> SELECT id FROM account_invoice_report WHERE year = '2011'
> it returns the same error. I believe the table is either improperly
> configured or the data is corrupt. But again, I didnt change or alter any
> data.

Please issue the following query:
SELECT category_id,  COUNT(name) FROM product_uom WHERE uom_type='reference' 
GROUP BY category_id; -- HAVING count(name) > 1

If it has any row where count(name) > 1, that might be your problem.

It is in addons/account/report/account_invoice_report.py:92, where a "LIMIT 1" 
added to that sub-query would provide a _dirty_ solution. (note, you would 
need to re-load the view)

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/722882

Title:
  ProgrammingError more than one row returned subquery

Status in OpenERP Web Client:
  New

Bug description:
  When I installed the web client about a month ago it worked great. But
  all of the sudden now whenever it gets to a view page it does this

  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 599, 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 1736, in search
      return self._search(cr, user, args, offset=offset, limit=limit, order=order, context=context, count=count)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/osv/orm.py", line 3990, in _search
      cr.execute('SELECT "%s".id FROM ' % self._table + from_clause + where_str + order_by + limit_str + offset_str, where_clause_params)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/sql_db.py", line 78, in wrapper
      return f(self, *args, **kwargs)
    File "/usr/local/lib/python2.6/dist-packages/openerp-server/sql_db.py", line 131, in execute
      res = self._obj.execute(query, params)
  ProgrammingError: more than one row returned by a subquery used as an expression

  I didnt do anything extra or modify anything it does this every single
  time. Right now the web client is not usable to us and we dont know
  why



References