Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to group invoice with a filter with 'group_by':'date_invoice' ???

By
Pascal Tremblay
on 12/7/15, 2:41 PM 767 views

Hello all,

I'm in Odoo 8. Here is the XML for a filter. This filter displays invoice from the current year.


If I use :

    <field name="context">{'group_by':'period_id'}</field>

    Invoices are grouped by period (monthly) correctly.


If I use 'date_invoice' instead, invoice are ALSO grouped monthly. Same thing than 'period_id'.

<record id="filters_lapagept.ventes_annuelles_cf" model="ir.filters">

<field name="name">Ventes annuelles - CF</field>

<field name="model_id">account.invoice</field>

<field name="is_default" eval="False" />

<field name="user_id" ref="" />

            <field name="domain">[['invoice_year','=',time.strftime('%Y')]]</field>

<field name="context">{'group_by':'date_invoice'}</field>

</record>


Do you know I could group my invoice by date_invoice instead of by period (month)?

Idea?

Thanks

1

Pascal Tremblay

--Pascal Tremblay--
1312
| 5 2 7
Alma, Canada
--Pascal Tremblay--


Pascal Tremblay
On 12/7/15, 7:26 PM

I have found my answer here : https://www.odoo.com/fr_FR/forum/help-1/question/how-to-group-by-day-25139

When I think about my question, it's true that the field 'date_invoice' contents himself a day, a month and a year...

So, these lines work well :

    <field name="context">{'group_by':'date_invoice:day'}</field>

or

    <field name="context">{'group_by':'date_invoice:week'}</field>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/7/15, 2:41 PM
Seen: 767 times
Last updated: 12/7/15, 7:45 PM