Odoo Help


argument 2 to map() must support iteration

shashank verma
on 6/20/13, 6:46 AM 3,883 views


iam working on crm_claim_rma module i create PICKING IN and process it. i go to warehouse -> incoming shipment and select "Product to stock" button, it gives following error

server-6.1/openerp/osv/orm.py", line 3415, in read select = map(lambda x: isinstance(x, dict) and x['id'] or x, select)

code :

def _get_dest_loc(self, cr, uid, context):

    if context is None: context = {}
    warehouse_obj = self.pool.get('stock.warehouse')
    warehouse_id = context.get('warehouse_id')
    if context.get('picking_type'):
        context_loc = context.get('picking_type')[8:]
        loc_field = 'lot_%s_id' %context.get('picking_type')[8:]
        loc_id = warehouse_obj.read(cr, uid, warehouse_id, [loc_field], context=context)[loc_field][0]     # on this line i get error  " TypeError: 'argument 2 to map() must support iteration' "

    return loc_id

iam not able to figure out how to resolve this error please help


--Ahmed M.Elmubarak--

Ahmed M.Elmubarak
On 6/20/13, 9:13 AM

hello, I couldn't find this function on the stock module, is it customized?

just try to omit [loc_field][0] and check is it works?

yes its a customized module. anyways i have resolved this issue thanks for responding Ahmed

shashank verma
on 6/20/13, 1:02 PM

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 6/20/13, 6:46 AM
Seen: 3883 times
Last updated: 3/16/15, 8:10 AM