2013/7/8 Cédric Krier <[email protected]>

> On 08/07/13 10:23 +0200, Guillem Barba Domingo wrote:
> > Changes in products_by_location()
> > =========================
> > Add two more OPTIONAL params (maybe replacing the current product_ids
> > param):
> >
> > - grouping_filters: a dictionary with Grouping elements in keys and list
> of ID
> > in values. It's not required to have all the keys that are in 'grouping'
> > param.
>
> I propose to use a list of list instead of a dict:
>
>
> compute_quantities(cls, locations, grouping=('product',), filter=(),
>     with_childs=False)


Good point, I like it more.

>   The implementation will ensure that all grouping_filters keys are in
> grouping
> > and then, will do what currently do for product_ids param (only the part
> > where product_ids has values) but for all grouping_filters items.
>
> Here no need to ensure about keys.
>
> > - quantity_domain (or other name...): a 2-tuple with the operator in
> first item
> > and operand in second (if it is called from searcher of some quantity
> field,
> > it could be called using the searcher domain param as: domain[1:])
> >   The implementation will add a HAVING clause over SUM(quantity).
> > Previously, it ensure that supplied domain make sense to be applied to
> > quantity (like it is done in _search_quantity_eval_domain() function).
>
> I don't like too much having a kind of half domain here.
> I would prefer to use a SQL statement that will be changed into a
> python-sql instance in the future.


Absolutly agree.

Does anyone have more comments on that? Can I do a patch implementing this
change?

-- 
Guillem Barba
http://www.guillem.alcarrer.net

Reply via email to