[19.0][ADD] website_sale_category_show_empty - #1286
Open
MarcGForgeFlow wants to merge 1 commit into
Open
Conversation
…ublished product website_sale hides eCommerce categories holding no published product from public and portal visitors, and the shop route turns the resulting access error into a 404. Add a per-category flag for pages that should stay reachable regardless, such as a manufacturer page kept for its own content. Group record rules are OR-ed together, so this ships a second rule on the same groups instead of editing the core one, which leaves it untouched on uninstall.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Odoo hides eCommerce category pages that hold no published product from public and portal visitors, through the record rule website_sale.empty_public_categories_rule, and the shop route turns the resulting access error into a 404. That is the right default for a catalogue that mirrors stock, but not for pages carrying editorial content of their own, such as a manufacturer or brand page a shop wants to keep reachable while nothing of that brand is published.
This module adds a Show When Empty flag on the category. Flagged categories stay readable for public and portal visitors whatever their product count.
Record rules bound to groups are OR-ed together, so the module ships a second rule on the same groups rather than editing the core one. The core record is left untouched and the module uninstalls cleanly.
The flag governs access to the page only. Shop sidebars and mega menus filter on has_published_products directly rather than through the record rule, so a flagged empty category is reachable by its URL but stays out of those navigation blocks. This is documented in the usage notes.