[FIX] web_auto_paginate: servers can respond in their own time, don't rely on timeouts

This commit is contained in:
Jared Kipe
2021-01-07 04:13:06 -08:00
parent cfc95fdc2e
commit 534af07eb7
4 changed files with 38 additions and 5 deletions

25
web_auto_paginate/test.py Normal file
View File

@@ -0,0 +1,25 @@
# include this file and depend on 'stock' to test on cancel button
# This intentionally introduces a lot of delay around stock pickings
# to help test the UI's responsiveness.
from time import sleep
from odoo import api, models
import logging
_logger = logging.getLogger(__name__)
class StockPicking(models.Model):
_inherit = 'stock.picking'
def action_cancel(self):
super().action_cancel()
return {
'auto_paginate': True,
}
@api.multi
def read(self, fields=None, load='_classic_read'):
_logger.warn('sleeping')
sleep(1)
return super().read(fields=fields, load=load)