← Back to team overview

c2c-oerpscenario team mailing list archive

Re: [Bug 721894] Re: [Trunk][survey] Matrix of Choices (Multiple Answers Per Row) broken; patch included

 

Hi, thanks xrg for requesting this.
Indeed, this is a principle of open source: many people receive no direct
money for bugfixing, the very least is then to mention authorship of the
work. I'm not saying that just for pleasure, but in fact at least my 10 last
bugfix where not authored to me. If you sum up the work during one year:
partner that don't give a shit about improving the product but provide more
money to OpenERP SA are rewarded while those that spend time on bugfixing
are disqualified; open source use to work differently. Regards.

On Mon, Feb 21, 2011 at 9:09 PM, xrg <xrg@xxxxxxxxx> wrote:

> On Monday 21 February 2011, you wrote:
> > Hello,
> >
> >          I have tested your patch and it works excellent, and i have
> > fixed the issue and committed to the https://code.launchpad.net
> > /~openerp-dev/openobject-addons/trunk-bug-721894-jam and proposed for
> > merging to lp:openobject-addons. Thank You for pointing the issue.
> >
>
> Still, when you apply patches from other people, I suggest that you copy
> them
> verbatim, including the author's name and the commit message.
>
> If partners or community members are helping OpenERP, we have to honor them
> and at least mention who wrote the patch.
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/721894
>
> Title:
>  [Trunk][survey] Matrix of Choices (Multiple Answers Per Row) broken;
>  patch included
>
> Status in OpenERP Modules (addons):
>  Fix Committed
>
> Bug description:
>  Hello, this is 6.0.1 with addons revno 4417
>  Create a survey with a question of kind "Matrix of Choices (Multiple
> Answers Per Row)"
>  When playing the survey you'll get this error:
>
>
>  [2011-02-19 17:41:14,815][survey] ERROR:db.cursor:Programming error: can't
> adapt type 'browse_record', in query SELECT
> survey_question_column_heading.in_visible_menu_choice,survey_question_column_heading.title,survey_question_column_heading.rating_weight,survey_question_column_heading.in_visible_rating_weight,survey_question_column_heading.menu_choice,survey_question_column_heading.question_id,
> survey_question_column_heading.id FROM "survey_question_column_heading"
> WHERE survey_question_column_heading.id IN %s ORDER BY id
>  [2011-02-19 17:41:14,815][survey] ERROR:web-services:Uncaught exception
>  Traceback (most recent call last):
>    File "/home/rvalyi/DEV/openerp/server/bin/osv/osv.py", line 122, in
> wrapper
>      return f(self, dbname, *args, **kwargs)
>    File "/home/rvalyi/DEV/openerp/server/bin/osv/osv.py", line 176, in
> execute
>      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
>    File "/home/rvalyi/DEV/openerp/server/bin/osv/osv.py", line 167, in
> execute_cr
>      return getattr(object, method)(cr, uid, *args, **kw)
>    File "/home/rvalyi/DEV/openerp/addons/survey/wizard/survey_answer.py",
> line 245, in fields_view_get
>      for col in que_col_head.read(cr, uid, que_rec.column_heading_ids):
>    File "/home/rvalyi/DEV/openerp/server/bin/osv/orm.py", line 2940, in
> read
>      result = self._read_flat(cr, user, select, fields, context, load)
>    File "/home/rvalyi/DEV/openerp/server/bin/osv/orm.py", line 2999, in
> _read_flat
>      cr.execute(query, (tuple(sub_ids),))
>    File "/home/rvalyi/DEV/openerp/server/bin/sql_db.py", line 78, in
> wrapper
>      return f(self, *args, **kwargs)
>    File "/home/rvalyi/DEV/openerp/server/bin/sql_db.py", line 131, in
> execute
>      res = self._obj.execute(query, params)
>    File "/usr/lib/python2.6/dist-packages/psycopg2/extensions.py", line
> 120, in getquoted
>      pobjs = [adapt(o) for o in self._seq]
>  ProgrammingError: can't adapt type 'browse_record'
>
>
>  This is solved by the first part of the patch that properly create the
> table of ids in the for.
>  If you continue to use read, you'll then get this error:
>
>
>  [2011-02-19 17:46:00,063][survey] ERROR:web-services:Uncaught exception
>  Traceback (most recent call last):
>    File "/home/rvalyi/DEV/openerp/server/bin/osv/osv.py", line 122, in
> wrapper
>      return f(self, dbname, *args, **kwargs)
>    File "/home/rvalyi/DEV/openerp/server/bin/osv/osv.py", line 176, in
> execute
>      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
>    File "/home/rvalyi/DEV/openerp/server/bin/osv/osv.py", line 167, in
> execute_cr
>      return getattr(object, method)(cr, uid, *args, **kw)
>    File "/home/rvalyi/DEV/openerp/addons/survey/wizard/survey_answer.py",
> line 246, in fields_view_get
>      etree.SubElement(xml_group, 'field', {'readonly' :str(readonly),
> 'name': tools.ustr(que.id) + "_" + tools.ustr(row.id) + "_" + tools.ustr(
> col.id), 'nolabel':"1"})
>  AttributeError: 'dict' object has no attribute 'id'
>
>
>  This is fixed by replacing read by browse in the same patch.
>
>  Guys I doubt this had ever been tested by who did it...
>
>  So please apply the attached patch. Aside from that kudos for that
>  wonderful survey module.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/openobject-addons/+bug/721894/+subscribe
>

-- 
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/721894

Title:
  [Trunk][survey] Matrix of Choices (Multiple Answers Per Row) broken;
  patch included

Status in OpenERP Modules (addons):
  Fix Released

Bug description:
  Hello, this is 6.0.1 with addons revno 4417
  Create a survey with a question of kind "Matrix of Choices (Multiple Answers Per Row)"
  When playing the survey you'll get this error:

  
  [2011-02-19 17:41:14,815][survey] ERROR:db.cursor:Programming error: can't adapt type 'browse_record', in query SELECT survey_question_column_heading.in_visible_menu_choice,survey_question_column_heading.title,survey_question_column_heading.rating_weight,survey_question_column_heading.in_visible_rating_weight,survey_question_column_heading.menu_choice,survey_question_column_heading.question_id,survey_question_column_heading.id FROM "survey_question_column_heading" WHERE survey_question_column_heading.id IN %s ORDER BY id
  [2011-02-19 17:41:14,815][survey] ERROR:web-services:Uncaught exception
  Traceback (most recent call last):
    File "/home/rvalyi/DEV/openerp/server/bin/osv/osv.py", line 122, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/home/rvalyi/DEV/openerp/server/bin/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/home/rvalyi/DEV/openerp/server/bin/osv/osv.py", line 167, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/home/rvalyi/DEV/openerp/addons/survey/wizard/survey_answer.py", line 245, in fields_view_get
      for col in que_col_head.read(cr, uid, que_rec.column_heading_ids):
    File "/home/rvalyi/DEV/openerp/server/bin/osv/orm.py", line 2940, in read
      result = self._read_flat(cr, user, select, fields, context, load)
    File "/home/rvalyi/DEV/openerp/server/bin/osv/orm.py", line 2999, in _read_flat
      cr.execute(query, (tuple(sub_ids),))
    File "/home/rvalyi/DEV/openerp/server/bin/sql_db.py", line 78, in wrapper
      return f(self, *args, **kwargs)
    File "/home/rvalyi/DEV/openerp/server/bin/sql_db.py", line 131, in execute
      res = self._obj.execute(query, params)
    File "/usr/lib/python2.6/dist-packages/psycopg2/extensions.py", line 120, in getquoted
      pobjs = [adapt(o) for o in self._seq]
  ProgrammingError: can't adapt type 'browse_record'

  
  This is solved by the first part of the patch that properly create the table of ids in the for.
  If you continue to use read, you'll then get this error:

  
  [2011-02-19 17:46:00,063][survey] ERROR:web-services:Uncaught exception
  Traceback (most recent call last):
    File "/home/rvalyi/DEV/openerp/server/bin/osv/osv.py", line 122, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "/home/rvalyi/DEV/openerp/server/bin/osv/osv.py", line 176, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "/home/rvalyi/DEV/openerp/server/bin/osv/osv.py", line 167, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "/home/rvalyi/DEV/openerp/addons/survey/wizard/survey_answer.py", line 246, in fields_view_get
      etree.SubElement(xml_group, 'field', {'readonly' :str(readonly), 'name': tools.ustr(que.id) + "_" + tools.ustr(row.id) + "_" + tools.ustr(col.id), 'nolabel':"1"})
  AttributeError: 'dict' object has no attribute 'id'

  
  This is fixed by replacing read by browse in the same patch.

  Guys I doubt this had ever been tested by who did it...

  So please apply the attached patch. Aside from that kudos for that
  wonderful survey module.



References