-
- Downloads
[FIX] pos_restaurant: random fails when transferring order to other table
To transfer an order from one table to another, we first select the order, then we click the 'transfer button', then we are shown the table selection. The moment we click the 'transfer button', two simultaneous rpc's are made for the same method (`create_from_ui`). This method deletes and recreates the orderlines in database. The 2nd request fails because of the deletion. But despite the failure, the server retries the rpc after a random amount of time in sec: `wait_time = random.uniform(0.0, 2 ** tries)`. If the user immediately (within the `wait_time`) clicks the new table where the order is to be placed, the problem happens - the transfer of order to the new table fails. This is because of the 3rd rpc whose result is used for the actual order transfer. If the 3rd rpc happens before the retry of the second, the transfer fails. The randomness of `wait_time` (time-to-retry rpc) results to the random runbot error. The solution is to prevent the 2nd (redundant) request because it is not actually needed. This commit tries to accomplish that. closes odoo/odoo#57365 X-original-commit: af7e7899124d2d8e3d4526d7de1c93158878f6e6 Signed-off-by:Christophe Monniez (moc) <moc@odoo.com> Signed-off-by:
Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
Please register or sign in to comment