Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Error:
- Odoo Server Error
- Traceback (most recent call last):
- File "/opt/odoo12/odoo/tools/safe_eval.py", line 350, in safe_eval
- return unsafe_eval(c, globals_dict, locals_dict)
- File "", line 11, in <module>
- File "/opt/odoo12/odoo/sql_db.py", line 148, in wrapper
- return f(self, *args, **kwargs)
- File "/opt/odoo12/odoo/sql_db.py", line 225, in execute
- res = self._obj.execute(query, params)
- psycopg2.IntegrityError: update or delete on table "saloka_pos_session" violates foreign key constraint "saloka_sale_session_id_fkey" on table "saloka_sale"
- DETAIL: Key (id)=(320) is still referenced from table "saloka_sale".
- During handling of the above exception, another exception occurred:
- Traceback (most recent call last):
- File "/opt/odoo12/odoo/http.py", line 653, in _handle_exception
- return super(JsonRequest, self)._handle_exception(exception)
- File "/opt/odoo12/odoo/http.py", line 312, in _handle_exception
- raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
- File "/opt/odoo12/odoo/tools/pycompat.py", line 87, in reraise
- raise value
- File "/opt/odoo12/odoo/http.py", line 695, in dispatch
- result = self._call_function(**self.params)
- File "/opt/odoo12/odoo/http.py", line 344, in _call_function
- return checked_call(self.db, *args, **kwargs)
- File "/opt/odoo12/odoo/service/model.py", line 97, in wrapper
- return f(dbname, *args, **kwargs)
- File "/opt/odoo12/odoo/http.py", line 337, in checked_call
- result = self.endpoint(*a, **kw)
- File "/opt/odoo12/odoo/http.py", line 938, in __call__
- return self.method(*args, **kw)
- File "/opt/odoo12/odoo/http.py", line 517, in response_wrap
- response = f(*args, **kw)
- File "/opt/odoo12/addons/web/controllers/main.py", line 966, in call_button
- action = self._call_kw(model, method, args, {})
- File "/opt/odoo12/addons/web/controllers/main.py", line 954, in _call_kw
- return call_kw(request.env[model], method, args, kwargs)
- File "/opt/odoo12/odoo/api.py", line 749, in call_kw
- return _call_kw_multi(method, model, args, kwargs)
- File "/opt/odoo12/odoo/api.py", line 736, in _call_kw_multi
- result = method(recs, *args, **kwargs)
- File "/opt/odoo12/odoo/addons/base/models/ir_cron.py", line 76, in method_direct_trigger
- self.sudo(user=cron.user_id.id).ir_actions_server_id.run()
- File "/opt/odoo12/odoo/addons/base/models/ir_actions.py", line 565, in run
- res = func(action, eval_context=eval_context)
- File "/opt/odoo12/odoo/addons/base/models/ir_actions.py", line 441, in run_action_code_multi
- safe_eval(action.sudo().code.strip(), eval_context, mode="exec", nocopy=True) # nocopy allows to return 'action'
- File "/opt/odoo12/odoo/tools/safe_eval.py", line 373, in safe_eval
- pycompat.reraise(ValueError, ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr)), exc_info[2])
- File "/opt/odoo12/odoo/tools/pycompat.py", line 86, in reraise
- raise value.with_traceback(tb)
- File "/opt/odoo12/odoo/tools/safe_eval.py", line 350, in safe_eval
- return unsafe_eval(c, globals_dict, locals_dict)
- File "", line 11, in <module>
- File "/opt/odoo12/odoo/sql_db.py", line 148, in wrapper
- return f(self, *args, **kwargs)
- File "/opt/odoo12/odoo/sql_db.py", line 225, in execute
- res = self._obj.execute(query, params)
- ValueError: <class 'psycopg2.IntegrityError'>: "update or delete on table "saloka_pos_session" violates foreign key constraint "saloka_sale_session_id_fkey" on table "saloka_sale"
- DETAIL: Key (id)=(320) is still referenced from table "saloka_sale".
- " while evaluating
- '# Available variables:\n# - env: Odoo Environment on which the action is triggered\n# - model: Odoo Model of the record on which the action is triggered; is a void recordset\n# - record: record on which the action is triggered; may be void\n# - records: recordset of all records on which the action is triggered in multi-mode; may be void\n# - time, datetime, dateutil, timezone: useful Python libraries\n# - log: log(message, level=\'info\'): logging function to record debug information in ir.logging table\n# - Warning: Warning Exception to use with raise\n# To return an action, assign: action = {...}\n\nenv.cr.execute("DELETE FROM saloka_pos_session WHERE pos_id = (SELECT id FROM saloka_pos WHERE name = \'192.168.1.18\' LIMIT 1) AND state = \'opened\'")\nenv.cr.commit()'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement