i want to update my field depend on current user's group , but when i execute the method it update all the record even it has the other group .
here's the code :
def wtc_approval(self, cr, uid, ids,vals, context=None):
user = self.pool.get("res.users").browse(cr, uid, uid)['groups_id']
data = self.pool.get("wtc.approval.line").browse(cr,uid,user)
line = self.browse(cr, uid, ids, context=context)
for user in line.app_line:
line.app_line.write({
'sts':'2',
'pelaksana':uid,
'tanggal':datetime.today()
})
return True
i don't know how to get current user group , the code always catch all group ..
anybody know how to resolve it ?
Thanks in advance