Hello everybody!!!
Please who can help me how to convert DATETIME field in odoo v8 to TIMESTAMP.
Thanks a lot in advance
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello everybody!!!
Please who can help me how to convert DATETIME field in odoo v8 to TIMESTAMP.
Thanks a lot in advance
Here is what i have done.
But it doesnt work.
Help please
def _totimestamp(self, cr, uid, ids, field_name, arg, context=None):
res = {}
for record in self.browse(cr, uid, ids, context=context):
res[record.id] = datetime.datetime.fromtimestamp(date_start)
return res
class project_cdr(osv.osv):
_name = 'project.cdr'
_description = 'Recuperation'
_columns = {
'project': fields.many2one('callity_project', string= 'Project_Name'),
'date_start': fields.datetime( 'Date Start', help='Date Start'),
'date_change': fields.function( _totimestamp,'Date change'),
'date_stop': fields.datetime( 'Date Stop', help='Date Stop'),
}
May be this will help you.
import datetime
datetime.datetime.fromtimestamp(SPECIFY FLOAT VALUE OF DATE)
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
2
sie 25
|
2538 | ||
|
1
lip 25
|
954 | ||
|
1
sie 25
|
1151 | ||
|
0
maj 25
|
1400 | ||
|
2
kwi 25
|
3591 |