Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Search within a period of date

Subscriure's

Get notified when there's activity on this post

This question has been flagged
filterdatev7search
22 Respostes
50291 Vistes
Avatar
Mohamed arif

How I can add option to search any record by period for a date/datetime field? User should able to select to date ranges to find records.

In previous versions we have to add date field in search view only, so that the user can select date and datetime ranges and easily find records.

Using Save Custom Filter, we can save filter for static or related date ranges only. I want to enter date ranges as user needs.

Have any suggestions please

8
Avatar
Descartar
Francesco OpenCode

What version of OpenERP are you using?

Mohamed arif
Autor

Version 7.

Avatar
Prakash
Best Answer

Search Date Range solved in openerp 7 using the below link:-

http://forum.openerp.com/forum/topic31468.html

In python, in "columns", add two dummy functional fields like this:

'due_date_from':fields.function(lambda *a,**k:{}, method=True, type='date',string="Due date from"),
'due_date_to':fields.function(lambda *a,**k:{}, method=True, type='date',string="Due date to"),

And in the search view:
<field name="due_date_from" filter_domain="[('date_due','&gt;=',self)]"/>
<field name="due_date_to" filter_domain="[('date_due','&lt;=',self)]"/>

The above code working in the [Normal Form] search view and also reports using SQL query

7
Avatar
Descartar
Ademola Oke

Nice workaround! Works very well. Also possible using the AND mode in advanced search. See http://help.openerp.com/question/1130/how-to-use-and-or-operators-in-advanced-filters/

evon_dun

I did same in my OpenErp v6.1 but can't understand how to use value of these in the reports... please help if anyone knows about it.

Prakash

The above same code also working in the report search date range.

evon_dun

Sorry I didn't get you. I tried adding these in the report but it returns [], since lamda can never return.

Prakash

In search box when typing date have you get auto suggestion From Date and To Date in the search box after adding the code?....

evon_dun

No, i don't. My searching is perfect but i just want to add this range on top of my invoice report like it does in other partner reports. From 'Date' to 'Date'. Got it??

Prakash

The above code working in the reports search view using Sql query. Are u using same?..

evon_dun

No, i just added these two fields in my report like we add other fields in openoffice, please guide how to use sql query for the same..

evon_dun

No, i just added these two fields in my report like we add other fields in openoffice, please guide how to use sql query for the same..

Prakash

using openoffice i not used date range or sql query. Date range and sql used in report For example Report --> Sales --> Sales Analysis. Actually data range working based on given input from the user.

evon_dun

Then what do you suggest me to get the range in my reports too any idea?

Prakash

I think in openoffice report there is no options wizard or select input to the user. so i suggest in openoffice report search view add date range and filter data and select print options to view report

Avatar
Francesco OpenCode
Best Answer

If you wanna search a date reange you must use the advanced filter.

  1. Open the filters popup and expand Andvanced Filters voice.
  2. Select your date (or datetime) field and select the greater or equal then parameter and insert the smallest data (smallest limit).
  3. Then apply the filter

image description

Use the some passes to insert another filter with the biggest limit but this time select less or equal then parameter. Apply this filter, too.

image description

Now you have your range limit with date values

image description

1
Avatar
Descartar
Mohamed arif
Autor

Thanks Francesco Apruzzese,

But this always will search with saved date only. If user wants search with another period, he have to select field, condition and date again twice. It is not user friendly.

Francesco OpenCode

This is the only way. If you insert the date field in filters, you can only search the precis date (only one day) for time. I know this is not user friendly but this is the way.

Mohamed arif
Autor

In the List view of Journal Items ( Accounting / Journal Entries / Journal Items ) , here we can see Filter option by 'Period' and 'Journal' in old version style. I checked and it is working fien. Can someone explain how these fields are added.?

Avatar
Nikunj Antala
Best Answer

There is app available in app store Its a Paid app.



https://apps.odoo.com/apps/modules/10.0/odoo_advance_search/

0
Avatar
Descartar
Avatar
Mohamed arif
Autor Best Answer

In the List view of Journal Items ( Accounting / Journal Entries / Journal Items ) , here we can see Filter option by 'Period' and 'Journal' in old version style. I checked and it is working fine.

image description

Can someone explain how these fields are added.?

0
Avatar
Descartar
Timothy Solomon

Periods are actually normal openERP objects, not dates. So the name of the period is "05/2013" in that case, so its not actually searching by date, its just searching by many2one type link. Prakash's solution is the best workaround in my opinion.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
How to use method search to get the ids from a date interval? Solved
date v7 search
Avatar
Avatar
Avatar
2
de març 15
4900
Customer: Advanced search filter not working?
filter v7 search
Avatar
Avatar
1
de març 15
10372
how get date from datetime field in domain of search view? Solved
filter date search datetime
Avatar
Avatar
Avatar
2
de gen. 23
14622
How to filter by dates (date between two dates)
filter date search domain_filter
Avatar
Avatar
1
de des. 20
21965
When do search filters get "AND"ed and when do they get "OR"ed?
development filter v7 search
Avatar
0
de març 15
4639
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now