title: could not serialize access due to concurrent update while creating pos picking from a job
body: <p>Impacted versions:
  12.0</p>
  <p>Steps to reproduce:
  I have made a customization to postpone the creation of pos order picking
  and delegate the task to a job
  some time i get the error below</p>
  <p>Current behavior:
  2020-06-18 17:49:24,588 1370 ERROR cafe9.rabeh.io odoo.addons.base.models.ir_cron: Call from cron POS Orders: Process Pending Orders for server action #610 failed in Job #24
  Traceback (most recent call last):</p>
  <p>File &quot;/opt/rabeh/odoo/odoo/addons/base/models/ir_cron.py&quot;, line 102, in _callback
  self.env['ir.actions.server'].browse(server_action_id).run()</p>
  <p>File &quot;/opt/rabeh/odoo/odoo/addons/base/models/ir_actions.py&quot;, line 569, in run
  res = func(action, eval_context=eval_context)</p>
  <p>File &quot;/opt/rabeh/odoo/odoo/addons/base/models/ir_actions.py&quot;, line 445, in run_action_code_multi
  safe_eval(action.sudo().code.strip(), eval_context, mode=&quot;exec&quot;, nocopy=True)  # nocopy
  allows to return 'action'</p>
  <p>File &quot;/opt/rabeh/odoo/odoo/tools/safe_eval.py&quot;, line 350, in safe_eval
  return unsafe_eval(c, globals_dict, locals_dict)</p>
  <p>File &quot;/opt/rabeh-12/rabeh_addons/pos_pending_session/models/pos_order.py&quot;, line 68, in pending_picking_creation
  po_order.create_picking()</p>
  <p>File &quot;/opt/rabeh-12/rabeh_addons/pos_pending_session/models/pos_order.py&quot;, line 36, in
  create_picking
  res = super(PosOrder, orders).create_picking()</p>
  <p>File &quot;/opt/rabeh/odoo/addons/point_of_sale/models/pos_order.py&quot;, line 841, in create_picking
  order._force_picking_done(order_picking)</p>
  <p>File &quot;/opt/rabeh/odoo/addons/point_of_sale/models/pos_order.py&quot;, line 856, in _force_picking_done
  picking.action_done()</p>
  <p>File &quot;/opt/rabeh/odoo/addons/stock/models/stock_picking.py&quot;, line 631, in action_done
  todo_moves._action_done()</p>
  <p>File &quot;/opt/rabeh/odoo/addons/purchase_stock/models/stock.py&quot;, line 96, in _action_done
  res = super(StockMove, self)._action_done()</p>
  <p>File &quot;/opt/rabeh/odoo/addons/stock_account/models/stock.py&quot;, line 389, in _action_done
  res = super(StockMove, self)._action_done()</p>
  <p>File &quot;/opt/rabeh/odoo/addons/stock/models/stock_move.py&quot;, line 1137, in _action_done
  moves_todo.mapped('move_line_ids')._action_done()</p>
  <p>File &quot;/opt/rabeh/odoo/addons/stock/models/stock_move_line.py&quot;, line 445, in _action_done
  Quant._update_available_quantity(ml.product_id, ml.location_dest_id, quantity, lot_id=ml.lot_id, package_id=ml.result_package_id, owner_id=ml.owner_id, in_date=in_date)</p>
  <p>File &quot;/opt/rabeh/odoo/addons/stock/models/stock_quant.py&quot;, line 216, in _update_available_quantity
  self._cr.execute(&quot;SELECT 1 FROM stock_quant WHERE id = %s FOR UPDATE NOWAIT&quot;, [quant.id], log_exceptions=False)</p>
  <p>File &quot;/opt/rabeh/odoo/odoo/sql_db.py&quot;, line 148, in wrapper
  return f(self, *args, **kwargs)</p>
  <p>File &quot;/opt/rabeh/odoo/odoo/sql_db.py&quot;, line 225, in execute
  res = self._obj.execute(query, params)</p>
  <p>psycopg2.errors.SerializationFailure: could not serialize access due to concurrent update</p>
  <p>Expected behavior:
  i think this line should generate could not obtain lock
  i was just wondering when it could generate &quot;could not serialize access due to concurrent update&quot;</p>