Comment 5 for bug 646350

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

What if we specified a special group_operator to compute the average price column of this analysis view?

Imagine we use a column that gives the total price for the line (i.e. qt * unit_price), and we specify a group_operator along these lines (keeping in mind that OpenERP will add the braces after the operator): group_operator="(1.0/sum(product_qty))*sum"

This way when the grouping is done it should execute this:
    SELECT (1.0/sum(product_qty))*sum(total_price) FROM ...

Would it work?