Dear Cedric,
On Fri, Mar 17, 2017 at 1:41 PM, Khurram Shahzad <[email protected]>
wrote:

>
>
> 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!
>

I am able to create reports using 'select' and 'join' in my custom
table_query. I have also used 'where' clause with '==', '<=' and '>='
operators but I am unable to figure out how to use 'IN' operator. I tried:
where sale.state IN ('processing','done')

But failed. Can you please guide me the right syntax of using this
operator. Also, can I find some documentation on 'select', 'join' and
available operators?

Best 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/CAM3N3Czi7R-fn1998B4JZG6cFC23w%2B_pm%2BL1igtGR0x6aQSwLg%40mail.gmail.com.

Reply via email to