Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Guest House
    • Drankenhandelaar
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Solar Energy Systems
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC Services
    Others
    • Nonprofit Organization
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

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

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

How to group by day?

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
treeviewsearchview
8 Antwoorden
36958 Weergaven
Avatar
Felipe

In the search view in a tree view, when I group by date, it always group by month, there is any way to specify to group by day, year or even hour?

8
Avatar
Annuleer

Have you found a solution?

Avatar
Ildar
Beste antwoord

It's better do it this way:

<filter string="Day" domain="[ ]" context="{'group_by': 'create_date:day'}" />
16
Avatar
Annuleer
Avatar
Felipe
Auteur Beste antwoord

I made a workaround, the idea is that you create a function field(store=True) of type char that copy the date string detail to the function field, the level of detail is determined by that you want to group, if you want to group by day copy the datetime till the day.

Then you add that new field in your groupby filters in the searchview you want

2
Avatar
Annuleer
Vivekrajan Rayappan

Hey Felipe, Your idea will work for him. This is the way used in most official addons of OpenERP out of the box. This idea works. Just check code of Sales Analysis or Invoice analysis, you will find more useful techniques

PT SIVI

What are the name of directories and files that you pointed out? Thanks

Avatar
Alex Gallien
Beste antwoord

This is an old question, but I thought I would add some code in case anyone is trying to do this. Mine was adding a sort by day field to account_voucher, so you may need to adjust yours to whatever you are trying to inherit. I am not putting the whole code, just the relevant snippets.

your_module.py

class ec_account_voucher(osv.osv):
_inherit = 'account.voucher'
_name = 'account.voucher'
def _get_string_date(self, cr, uid, ids, name, args, context=None):
res = {}
for voucher in self.browse(cr, uid, ids, context=context):
res[voucher.id] = str(voucher.date)
return res
_columns = {
'x_string_date': fields.function(_get_string_date, type='char', string='Date (String)', store=True)
}

your_module_view.xml

       <record model="ir.ui.view" id="voucher_form_ec">
<field name="name">account.voucher.tree.inherit</field>
<field name="model">account.voucher</field>
<field name="inherit_id" ref="account_voucher.view_voucher_tree"/>
<field name="arch" type="xml">
<field name="date" position="after">
<field name="x_string_date" invisible="1"/>
</field>
</field>
</record>
<record id="ec_view_voucher_filter" model="ir.ui.view">
<field name="name">account.voucher.select.inherit</field>
<field name="model">account.voucher</field>
<field name="inherit_id" ref="account_voucher.view_voucher_filter_vendor_pay"/>
<field name="arch" type="xml">
<xpath expr="//filter[@string='Status']" position="before">
<filter string="Day" icon="terp-go-month" domain="[]" context="{'group_by':'x_string_date'}"/>
</xpath>
</field>
</record>

Hope that helps someone!

1
Avatar
Annuleer
Gustavo

Thank you so much :D

Alex Gallien

No problem - glad it helped!

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
How to Align Left [float, integer] Fields in Tree View in Odoo
treeview
Avatar
Avatar
Avatar
Avatar
3
apr. 25
5853
How to change column width in tree view one2many,many2many Opgelost
treeview
Avatar
Avatar
Avatar
Avatar
Avatar
5
nov. 23
44287
Create dynamic tree view Opgelost
treeview
Avatar
Avatar
Avatar
3
sep. 23
10243
How to put two fields under same column in tree view
treeview
Avatar
Avatar
1
sep. 22
4536
How to disable create row in tree view?
treeview
Avatar
Avatar
1
jun. 22
13379
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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