Skip to Content
Menu
This question has been flagged
2 Replies
3216 Views

Hello

I have a problem with a create :

self.pool.get('stock.production.lot').create(self._cr,self._uid,{'name': 'X2988','product_id': 2581,'life_date' : '2022-05-31'})


This returns :

Traceback (most recent call last):
File "/odoo/odoo-server/openerp/http.py", line 659, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/odoo/odoo-server/openerp/http.py", line 696, in dispatch
result = self._call_function(**self.params)
File "/odoo/odoo-server/openerp/http.py", line 332, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/odoo/odoo-server/openerp/service/model.py", line 118, in wrapper
return f(dbname, *args, **kwargs)
File "/odoo/odoo-server/openerp/http.py", line 325, in checked_call
result = self.endpoint(*a, **kw)
File "/odoo/odoo-server/openerp/http.py", line 975, in __call__
return self.method(*args, **kw)
File "/odoo/odoo-server/openerp/http.py", line 525, in response_wrap
response = f(*args, **kw)
File "/odoo/odoo-server/addons/web/controllers/main.py", line 897, in call_kw
return self._call_kw(model, method, args, kwargs)
File "/odoo/odoo-server/addons/web/controllers/main.py", line 889, in _call_kw
return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
File "/odoo/odoo-server/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/odoo/odoo-server/openerp/api.py", line 380, in old_api
recs = self.browse(cr, uid, ids, context)
File "/odoo/odoo-server/openerp/api.py", line 250, in wrapper
return old_api(self, *args, **kwargs)
File "/odoo/odoo-server/openerp/models.py", line 5397, in browse
return self._browse(Environment(cr, uid, context or {}), ids)
File "/odoo/odoo-server/openerp/models.py", line 5390, in _browse
env.prefetch[cls._name].update(ids)
TypeError: unhashable type: 'list'

Avatar
Discard
Author Best Answer

Hello, 

Thanks for your reply, but I still have the error showing. However, from the beginning the create is done well, that is to say that the batch is well created. 

Best regards,

Zappone Arthur.


Avatar
Discard
Best Answer

Hi,


Try with the below code and check.

self.pool['stock.production.lot'].create(self._cr,self._uid,{'name': 'X2988','product_id': 2581,'life_date' : '2022-05-31'}, self._context)


Thanks & Regards,

Sunny Sheth

Avatar
Discard
Related Posts Replies Views Activity
2
Mar 15
5860
1
Dec 17
5460
4
Sep 17
4763
1
Mar 15
4251
2
Mar 23
11998