I have some problem with my project:
def get_timein(self, cr, uid, ids, context={}):
obj = self.browse(cr, uid, ids, context=context)[0]
timein = str(datetime.now())
self.write(cr, uid, ids, {'time_in':timein }, context=context)
return 1
def get_timeout(self, cr, uid, ids, context={}):
obj=self.browse(cr, uid, ids, context=context)[0]
timeout=str(datetime.now())
self.write(cr, uid, ids, {'time_out':timeout }, context=context)
return 1
def cho_dangnhap(self, cr, uid, ids, context={}):
self.pool.get('x_luong').write(cr, uid, ids, {'state':'dangnhap'})
get_timein(cr,uid,ids)
return 1
def cho_rave(self, cr, uid, ids, context={}):
self.pool.get('x_luong').write(cr, uid, ids, {'state':'rave'})
get_timeout(cr, uid, ids)
I am getting this error:
NameError: global name 'get_timeout' is not defined
The
self.before method functions is required.