Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
7533 Vizualizări


Odoo V12. In fields.date, is it possible to display month and year only?

ex. 01-2020


Imagine profil
Abandonează
Autor Cel mai bun răspuns


# Outside the model

def get_years(): year_list = [] for i in range(2019, 2030): year_list.append((i, str(i))) return year_list


# Inside the model

month = fields.Selection([(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'),(5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'),(9, 'September'), (10, 'October'), (11, 'November'), (12, 'December'), ], string='Month')

year = fields.Selection(get_years(), string='Year')

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
3
iun. 25
1065
1
ian. 25
17953
2
mai 22
16516
2
feb. 22
29598
1
ian. 20
3932