i have a problem when executing a method ,
def wtc_approval(self, cr, uid, ids,vals, context=None):
user = self.pool.get("res.users").browse(cr, uid, uid)['groups_id']
line = self.browse(cr, uid, ids, context=context)
for x in user:
if line.app_line.group_id == x :
line.app_line.write({
'sts':'2',
'pelaksana':uid,
'tanggal':datetime.today()
})
print "adaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",x
return True
it said
ValueError
Expected singleton: wtc.approval.line(166, 167, 168, 169)
what should i do ?
If you use the list of Objects or List in the place of single value python will raise the error. Try use x.id instead of x. Also ensure that print line.app_line.group_id & print x.id should be single values(Not Links or Pointer).
Just an idea: def self.browse() ...
i suppose you are using V8 ?
Hi, please let me know if my answer helps you to solve the problem?