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.


  File "/usr/lib/python3/dist-packages/odoo/", line 515, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/addons/payment_paypal/controllers/", line 108, in paypal_dpn
  File "/usr/lib/python3/dist-packages/odoo/addons/payment_paypal/controllers/", 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/", line 34, in form_feedback
  File "/usr/lib/python3/dist-packages/odoo/addons/website_sale/models/", line 24, in _confirm_so
  File "/usr/lib/python3/dist-packages/odoo/addons/sale_payment/models/", line 103, in _generate_and_pay_invoice
  File "/usr/lib/python3/dist-packages/odoo/addons/account/models/", line 779, in action_invoice_open
  File "/usr/lib/python3/dist-packages/odoo/addons/account/models/", line 1149, in action_move_create
  File "/usr/lib/python3/dist-packages/odoo/addons/account/models/", line 160, in post
    new_name = sequence.with_context(
  File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/", line 263, in next_by_id
    return self._next()
  File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/", 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/", line 351, in _next
    number_next = _update_nogap(self, self.sequence_id.number_increment)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/", line 52, in _update_nogap
    self._cr.execute("SELECT number_next FROM %s WHERE id=%s FOR UPDATE NOWAIT" % (self._table,
  File "/usr/lib/python3/dist-packages/odoo/", line 155, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/", 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.