Odoo Help


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.


How to get record before a specified date ?

on 5/3/16, 4:43 AM 243 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)--
| 5 3 6
Gandhinagar, 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"

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)


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