[Ilugc] Python error starting OpenERP 6.1 RC1 on Centos 6.2

  • From: vkslist@xxxxxxxxx (VK Sameer)
  • Date: Tue, 24 Jan 2012 12:23:56 +0000 (UTC)

On 2012-01-24 at 07:59:28 GMT kenneth gonsalves <lawgon at ...> writes:

On Tue, 2012-01-24 at 07:46 +0000, VK Sameer wrote:
return sorted([(k,k) for k,v in fields.__dict__.iteritems()

should this not be:

return sorted([(k,v) for k,v in fields.__dict__.iteritems()

I honestly don't know the code and am operating at a syntactic-correctness level
rather than semantic-correctness level.

But, yes, return (k,k) does seem to be throwing away the value part of the
dictionary after iterating through it.

The return value of _get_fields_type() is used thus:

class ir_model_fields(osv.osv):
  ...
  _columns = {
  ...
    'ttype': fields.selection(_get_fields_type, 'Field Type',size=64,
required=True),
  ...

and a sample use of ttype in turn is:

if vals.get('ttype', False) == 'selection':

Not sure if that gives any clues?

An older version of _get_fields_type() has:

cr.execute('select distinct ttype,ttype from ir_model_fields')

so maybe return (k,k) is OK?

Thanks,
Sameer



Other related posts: