Hi,
I have the follow functional field
date = fields.Function(fields.Date('Date'),
'get_month_date')
def get_month_date(self, name=None):
date_str = self.description
if not date_str:
return None
try:
date_obj = get_date_from_str(date_str)
return date_obj
except ValueError:
return None
It works fine, now I need to order this field, The idea I have is to get the column of the string and after it pass it to date and then return to the result. Any suggest is welcome.
@staticmethod
def order_month_date(tables):
pool = Pool()
table, _ = tables[None]
#date_str= table.date_str
#date = get_date_from_str(date_str)
return [date]