On Fri, Mar 17, 2017 at 1:10 PM, Cédric Krier <[email protected]> wrote:

> On 2017-03-17 12:38, Khurram Shahzad wrote:
> > Dear All,
> >
> > I want to create a report which will show the summary of sales grouped by
> > the product category. The user will input the date range i.e. 'Date From'
> > and 'Date To'.
> >
> > I have tried to use the search method of model but I think it does not
> > support the 'group by' clause. Any ideas or best practices of achieving
> > this?
>
> Create a ModelSQL with a custom table_query [1] like that you will be
> free to use the full features of SQL to make your group by.
> Also for Date encoding, you can use the new context_model on
> ir.action.act_window to get fast responsiveness to change dates.
>
> An example of that is the GeneralLedger report:
> http://hg.tryton.org/modules/account/file/3f86af1e9ebd/account.py#l1197
>
>
> [1] http://doc.tryton.org/4.2/trytond/doc/ref/models/models.
> html?highlight=table_query#trytond.model.ModelSQL.table_query
>
>
Thank you so much for such a prompt and effective response!
-- 

Regards,
Khurram.

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/CAM3N3CxcSifkY%2BJ6zKMgntFpjuWz5qVNDDzDPHoBmR7_TEx6ww%40mail.gmail.com.

Reply via email to