Odoo Help


This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Expected singleton

Ajeng Shilvie
on 12/20/14, 5:28 AM 10,993 views

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 :
            print "adaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",x
        return True

it said


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).

on 12/20/14, 7:10 AM

Just an idea: def self.browse() ...

Med Said BARA
on 12/20/14, 10:09 AM

i suppose you are using V8 ?

Med Said BARA
on 12/20/14, 10:17 AM

Hi, please let me know if my answer helps you to solve the problem?

on 12/22/14, 3:09 AM


| 5 4 8
Kochi, India
ODOO technical and functional

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

On 12/21/14, 10:40 AM


here you have to itereate line because it contains more than one record. Thats reason for Error

On 2/25/16, 2:07 PM

Hola resolvi el problema para esto dirigete a mi pagina ahi explico como hacer algo similar.


def onchange_get_organizer_account(self,auxType):

if auxType:

ids=self.env['gol.organizer.account'].search([['organizerType', '=', auxType]])


for item in ids:


print ids

print auxIds

return {'domain':{'organizerAccount':[('id','in',auxIds)]}}


def getCode(self):

if self.organizerAccount:


Para mayor informacion accede ami pagina eln la cual descrivo con mayor detenimiento


WHAT ? govorish pa Angliski tovorishch ?

Dr Obx
on 3/31/16, 4:30 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

6 follower(s)


Asked: 12/20/14, 5:28 AM
Seen: 10993 times
Last updated: 3/31/16, 3:11 AM