[FIX] website_blog, *: allow more than 6 blog posts in dynamic snippet
*: website Commit [1] introduced the possibility to configure "website filters" used in the website to display some records dynamically via the "dynamic snippet" and its variants. One of their field is `limit` which is a max number of records the filter allows to show (so that the client side cannot ask for thousands of records). Users can configure the limit used by a snippet via the editor: they are allowed to choose up to 16, still safe-guarded by the internal limit configured on the website filter on the python side. The problem here was that [2] introduced website filters for the blog posts but set up a max limit of 6. Thus breaking the editor option if the user choose a limit between 7 and 16. This commit fixes the issue, for newly configured snippets (as a stable fix) or for users who would -u their blog application. Steps to reproduce: - Install blog application - Add a "Blog Posts" snippet - Set "Fetched Elements" to 10 (there are 7 records in demo data) => Only 6 are still shown - Save With the fix: - Restart your server => Only 6 are still shown - Enter edit mode, reset "Fetched Elements" to >6 => 7 records are now shown [1]: https://github.com/odoo/odoo/commit/0e7640b5f22d2bea04bbe22d3189cff7e03af545 [2]: https://github.com/odoo/odoo/commit/3c0d98bcd8adf9325ee3497eb8d25ec7f904d6a5 opw-2885948 closes odoo/odoo#106754 Signed-off-by:Romain Derie (rde) <rde@odoo.com>
Showing
- addons/website/models/website_snippet_filter.py 10 additions, 1 deletionaddons/website/models/website_snippet_filter.py
- addons/website/static/src/snippets/s_dynamic_snippet/000.js 7 additions, 0 deletionsaddons/website/static/src/snippets/s_dynamic_snippet/000.js
- addons/website/static/src/snippets/s_dynamic_snippet/options.js 3 additions, 0 deletions.../website/static/src/snippets/s_dynamic_snippet/options.js
- addons/website_blog/data/blog_snippet_template_data.xml 2 additions, 2 deletionsaddons/website_blog/data/blog_snippet_template_data.xml
Please register or sign in to comment