Search code examples
datefieldodoo-10

Odoo fields.Date error


I am using fields.Date to enter a particular date to a field. Lets suppose I do not use the date picker and instead choose to enter the date manually, I am encountering following error. Lets say I input 12/04/17 (mm/dd/yy) it takes it as 12/04/0017 instead of 12/04/2017.


Solution

  • If you want the date (year) to appear as 2 digits, you can change this in the Settings/Translations/Languages - Select Active Language - Date Format.

    Change %Y to %y.

    If the date is displayed as 2 digits, then entering it in manually as 2 digits appears to work.

    Personally, if I try to enter a date manually with the year as 17 (and year displaying as 4 digits) I get an error.