Changes between Initial Version and Version 1 of Ticket #27498


Ignore:
Timestamp:
Nov 16, 2016, 1:37:43 PM (8 years ago)
Author:
Tim Düllmann
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27498 – Description

    initial v1  
    88}}}
    99
     10This translates to the following Query, which returns the correct results, when run natively:
     11
     12{{{
     13SELECT "testapp_product"."id", "testapp_product"."name", "testapp_product"."qty_target", CAST(SUM("testapp_stock"."qty_available") AS NUMERIC) AS "qty_available_sum", ("testapp_product"."qty_target" - CAST(SUM("testapp_stock"."qty_available") AS NUMERIC)) AS "qty_needed"
     14FROM "testapp_product"
     15LEFT OUTER JOIN "testapp_stock" ON ("testapp_product"."id" = "testapp_stock"."product_id")
     16GROUP BY "testapp_product"."id", "testapp_product"."name", "testapp_product"."qty_target"
     17HAVING ("testapp_product"."qty_target" - CAST(SUM("testapp_stock"."qty_available") AS NUMERIC)) > 0
     18}}}
     19
     20Using the QuerySet, it does not respect the filter condition. For details see the test below.
     21
    1022Here is a simple App with a test that shows the difference. The complete files with imports are attached.
    11 
    1223
    1324{{{
Back to Top