Skip to main content

Failed to create a record in Odoo ERP Self Hosted

Odoo API Error (session_id): Traceback (most recent call last): File "/home/odoo/src/odoo/19.0/addons/rpc/controllers/xmlrpc.py", line 147, in xmlrpc_1 response = self._xmlrpc(service) ^^^^^^^^^^^^^^^^^^^^^ File "/home/odoo/src/custom/trial/saas_trial/controllers/main.py", line 441, in _xmlrpc res = super()._xmlrpc(service) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/odoo/src/odoo/19.0/addons/rpc/controllers/xmlrpc.py", line 134, in _xmlrpc result = dispatch_rpc(service, method, params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/odoo/src/odoo/19.0/odoo/http.py", line 439, in dispatch_rpc return dispatch(method, params) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/odoo/src/odoo/19.0/odoo/service/model.py", line 129, in dispatch res = execute_cr(cr, uid, model, method_, args, kw) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/odoo/src/odoo/19.0/odoo/service/model.py", line 146, in execute_cr result = retrying(partial(call_kw, recs, method, args, kw), env) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/odoo/src/odoo/19.0/odoo/service/model.py", line 184, in retrying result = func() ^^^^^^ File "/home/odoo/src/odoo/19.0/odoo/service/model.py", line 93, in call_kw result = method(recs, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/odoo/src/odoo/19.0/odoo/orm/decorators.py", line 365, in create return method(self, vals_list) ^^^^^^^^^^^^^^^^^^^^^^^ File "/home/odoo/src/odoo/19.0/addons/point_of_sale/models/pos_order.py", line 534, in create session = self.env['pos.session'].browse(vals['session_id']) ~~~~^^^^^^^^^^^^^^ KeyError: 'session_id'

Hi ​@HeikeBSP, welcome to the Community! 🎉

I’m so sorry that you’re running into that error. Can you share a screenshot showing the setup of the Odoo action that’s erroring? That’ll help us to get more context on the current setup and allow us to check there’s nothing on setup that might be causing some trouble here. Remember to remove any personal info like names, emails etc. before sharing as this is a public space (you can use a tool like Zappy for that).

Thanks, looking forward to your reply! 🙂