Odoo Help


How to get record before a specified date ?

on 5/3/16, 4:43 AM 526 views

hello , i m searching how to return a list of invoices before a specifique month example:

we are in 05/2016

i want a domain or a filter on dates to get all invoices before this date

thank you in advance 

P.S : this is a technical question


Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--

| 6 5 6
Baroda, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 5/4/16, 8:01 AM

Hello MouBou,

As per my understand, You need all invoice as per date wise not month wise right.

So you need to

1. Create one new character field

2. Update value in new char field with date which you set the filter .

3. Now set new character field group by in search view.


I have delivered date and I am getting all records as per month. Now I want to all records as per date wise. 

In python file

def _get_delivered_date(self, cr, uid, ids, fields, arg, context=None):

    result = {}

    for record in self.browse(cr, uid, ids, context=context):

        result[record.id] = record.date_delivered

    return result

_columns = {

     'new_date_delivered': fields.function(_get_delivered_date, type='char', string='New Delivered Date', store=True),


In xml file

<filter string="Date Delivered" name='new_date_delivered' icon="terp-personal" domain="[]" context="{'group_by':'new_date_delivered'}"/>

Hope above code help for you !!!


Ankit H Gandhi.


michel Guénard

--michel Guénard--

| 5 5 8
--michel Guénard--

VP operations & finance Social entrepreneur Certified Public Accountant Past Chief internal auditor

michel Guénard
On 5/4/16, 3:03 AM

use the advanced search options; and set up the "creation date" to less than "the day after the required date"

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 5/3/16, 4:43 AM
Seen: 526 times
Last updated: 5/4/16, 5:19 PM