'date': '2013-01-01'  #固定值

'date': time.strftime('%Y-%m-%d')  #启动时候的值

'date': lambda *a: time.strftime('%Y-%m-%d')  #当前日期

 

6.1后,官方建议date/datetime的默认值的写法是(能解决时区问题):

'birthdate': fields.date.context_today, 
'create_at': fields.datetime.now,

相关文章:

  • 2021-11-08
  • 2021-11-13
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-18
猜你喜欢
  • 2022-01-13
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
  • 2021-07-15
相关资源
相似解决方案