콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
214 화면

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)

아바타
취소
관련 게시물 답글 화면 활동
2
8월 25
2589
1
7월 25
996
1
8월 25
1151
0
5월 25
1448
2
4월 25
3610