← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 845528] [NEW] invalid domain expression evaluation

 

Public bug reported:

In bin/osv/expression.py:153, the left operand should be fargs[0], not
"id", the resulting SQL query being otherwise incorrect.

    152                     if right == []:
    153                         self.__exp[i] = (fargs[0], '=', 0 )
    154                     else:
    155                         self.__exp[i] = (fargs[0], 'in', right)

instead of:

    152                     if right == []:
    153                         self.__exp[i] = ( 'id', '=', 0 )
    154                     else:
    155                         self.__exp[i] = (fargs[0], 'in', right)

test:
  * write a domain [('some_field.id','in',some_calculation_resulting_in_an_empty_array_at_runtime)]
  * actual result after parsing: [('id','=',0)] (SQL: id IS NULL)
  * expected result after parsing: [('some_field','=',0)] (SQL: some_field IS NULL)

** Affects: openobject-server
     Importance: Undecided
         Status: New

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

Title:
  invalid domain expression evaluation

Status in OpenERP Server:
  New

Bug description:
  In bin/osv/expression.py:153, the left operand should be fargs[0], not
  "id", the resulting SQL query being otherwise incorrect.

      152                     if right == []:
      153                         self.__exp[i] = (fargs[0], '=', 0 )
      154                     else:
      155                         self.__exp[i] = (fargs[0], 'in', right)

  instead of:

      152                     if right == []:
      153                         self.__exp[i] = ( 'id', '=', 0 )
      154                     else:
      155                         self.__exp[i] = (fargs[0], 'in', right)

  test:
    * write a domain [('some_field.id','in',some_calculation_resulting_in_an_empty_array_at_runtime)]
    * actual result after parsing: [('id','=',0)] (SQL: id IS NULL)
    * expected result after parsing: [('some_field','=',0)] (SQL: some_field IS NULL)

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


Follow ups

References