psycopg2.OperationalError: could not obtain lock on row in relation “ir_sequence_date_range,  LOCK_NOT_AVAILABLE, maximum number of tries reached. This official odoo bug, but odoo or fabian community or enterprise team did not react, as well we personally experienced on community team of odoo in github they without testing just force to close ticket. Don’t any hope from odoo-team on community bugs.

Odoo: Bug with LOCK_NOT_AVAILABLE.

  File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/addons/payment_paypal/controllers/main.py", line 108, in paypal_dpn
    self.paypal_validate_data(**post)
  File "/usr/lib/python3/dist-packages/odoo/addons/payment_paypal/controllers/main.py", line 86, in paypal_validate_data
    res = request.env['payment.transaction'].sudo().form_feedback(post, 'paypal')
  File "/usr/lib/python3/dist-packages/odoo/addons/sale_payment/models/payment.py", line 34, in form_feedback
    tx._confirm_so()
  File "/usr/lib/python3/dist-packages/odoo/addons/website_sale/models/payment.py", line 24, in _confirm_so
    self._generate_and_pay_invoice()
  File "/usr/lib/python3/dist-packages/odoo/addons/sale_payment/models/payment.py", line 103, in _generate_and_pay_invoice
    created_invoice.action_invoice_open()
  File "/usr/lib/python3/dist-packages/odoo/addons/account/models/account_invoice.py", line 779, in action_invoice_open
    to_open_invoices.action_move_create()
  File "/usr/lib/python3/dist-packages/odoo/addons/account/models/account_invoice.py", line 1149, in action_move_create
    move.post()
  File "/usr/lib/python3/dist-packages/odoo/addons/account/models/account_move.py", line 160, in post
    new_name = sequence.with_context(ir_sequence_date=move.date).next_by_id()
  File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_sequence.py", line 263, in next_by_id
    return self._next()
  File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_sequence.py", line 257, in _next
    return seq_date.with_context(ir_sequence_date_range=seq_date.date_from)._next()
  File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_sequence.py", line 351, in _next
    number_next = _update_nogap(self, self.sequence_id.number_increment)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_sequence.py", line 52, in _update_nogap
    self._cr.execute("SELECT number_next FROM %s WHERE id=%s FOR UPDATE NOWAIT" % (self._table, self.id))
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 232, in execute
    res = self._obj.execute(query, params)
psycopg2.OperationalError: could not obtain lock on row in relation "ir_sequence_date_range"

We face similar issues with may our international customers, they raise ticket to us. as our team found issue and detected due to concurrency management, crash happen to process order or online orders.

SnippetBucket Odoo Expert team optimize parameters, we able to stabilise this issue. Official odoo code concurrency not prorperly establised in odoo with highly resources allowcation system.

Feel free to contact us, we are happy to assist you.