Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
3988 Vistas

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
Descartar
Autor Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
mar 15
6795
1
dic 17
6427
4
sept 17
5520
1
mar 15
4930
2
mar 23
13450