跳至内容
菜单
此问题已终结
1 回复
6999 查看

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

形象
丢弃
编写者 最佳答案

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>
形象
丢弃
相关帖文 回复 查看 活动
0
1月 17
3141
1
1月 17
4402
1
9月 16
56
0
3月 15
5275
0
3月 15
4895