← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 654118] Re: Selection does not work for (stored) function fields

 

we at camptocamp have included a patch in
https://code.launchpad.net/~c2c/openobject-server/6.0-c2c-official
please read blog entry
http://www.camptocamp.com/fr/component/wordpress/?author=87

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

Title:
  Selection does not work for (stored) function fields

Status in OpenERP Server:
  Confirmed

Bug description:
  *A definition for field "period_id" in table "xxx.yyy"
  *
  [.xml]:
      <record model="ir.ui.view" id="xxx_yyy_list">
        <field name="name"xxx.yyy.list</field>
        <field name="model">xxx.yyy</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
          <tree string="blah blah">
            <field name="period_id" readonly="1" select="1"/>
          </tree>
        </field>
      </record>

  [.py]:
      _columns  = \
          {  'period_id' : fields.function
              ( _func
              , method   = True
              , string   = 'Period'
              , type     = 'many2one'
              , obj      = 'account.period'
              , store    = True
              , select   = True
              , required = True
              )
          }

  *results in a traceback ("operator does not exist" in sql_db.py) when a 
  search is filtered with a "period_id":
  *
  ProgrammingError: FEHLER:  Operator existiert nicht: integer ~~* unknown
  ZEILE 1: ...ne" where (xxx_yyy.period_id ilike E'%...

  *The SQL-snippet shows that the system tries a string-comparison 
  ("ilike") on the reference to the other table - which ist wrong!

  The server log shows the following message:
  *TIP:  Kein Operator stimmt mit dem angegebenen Namen und den 
  Argumenttypen überein. Sie müssen möglicherweise ausdrückliche 
  Typumwandlungen hinzufügen.
  *("Operator does not match argument-type. Try a type-cast.")

  When the definition is changed to
  *
      _columns  = \
          {  'period_id' : fields.many2one
               ( 'account.period'
               , 'Period'
               , select   = True
               , required = True
               , readonly = True
               )
          }

  *it works flawlessly

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