erp5_trade: use shorter cache for resource list
erp5_ui_long is too long for user to use fast input for the following scenario: 1. user create purchase order 2. user use fast input to enter product with reference 324214(a missing product) 3. user type 324214 in fast input, it found nothing in Product or Service 4. then user create such product 324214 5. then user go back to purchase order and type again 324214 since previous result is still cached for one hour and user still can't find it. in one hour, user is not available to add such product
-
Developer
-
Owner
I don't know this code well, but have you considered completly dropping the
CachingMethod
?I see that
cell
is always passed, so if I understand correctly we always search with title/reference. Cache parameter also include the delivery id, so there should almost never be cache hits.I think this is used only for this dialog:
( ie. it's a kind of "workaround widget" because dialogs does not support relation field )
With this change, it's surely better, but in the described scenario, there's still that the problem that in step 5 from the scenario in the commit message, the product is not listed.
-
I fully agree, I would just remove the cache for a script just used for fast inputs. And like written by Jérôme, cache hits would be rare. So there is no benefit, and we just have extra complexity. It might just be needed to set some limit at 20 or so in the searchResult to avoid getting thouzands of values.
-
Developer
-
mentioned in commit f1bbc5aa
-
mentioned in commit cedric.leninivin/erp5@fa4ca0c5