def hrm_programme_hours_month(row):
 try:
  thisdate = row['hrm_programme_hours.date']
 except AttributeError:
  return current.messages['NONE']
 if (not thisdate):
  return current.messages['NONE']
 month = thisdate.month
 year = thisdate.year
 first = datetime.date(year, month, 1)
 return first.strftime('%y-%m')

def hrm_programme_hours_month ( row ) : try : thisdate = row [ 'hrm_programme_hours.date' ] except AttributeError : return current . messages [ 'NONE' ] if ( not thisdate ) : return current . messages [ 'NONE' ] month = thisdate . month year = thisdate . year first = datetime . date ( year , month , 1 ) return first . strftime ( '%y-%m' )
virtual field for hrm_programme_hours - returns the date of the first day of the month of this entry .