Skip to content
Snippets Groups Projects
  • qsm-odoo's avatar
    67abc6c8
    [FIX] website_blog, *: allow more than 6 blog posts in dynamic snippet · 67abc6c8
    qsm-odoo authored
    *: 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: default avatarRomain Derie (rde) <rde@odoo.com>
    67abc6c8
    History
    [FIX] website_blog, *: allow more than 6 blog posts in dynamic snippet
    qsm-odoo authored
    *: 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: default avatarRomain Derie (rde) <rde@odoo.com>