Skip to content

[20.0][ADD] website_sale_variant_published - #1417

Open
BhaveshHeliconia wants to merge 1 commit into
OCA:20.0from
HeliconiaIO:20.0-add-website_sale_variant_published
Open

BhaveshHeliconia wants to merge 1 commit into
OCA:20.0from
HeliconiaIO:20.0-add-website_sale_variant_published

Conversation

@BhaveshHeliconia

Copy link
Copy Markdown

Adds the website_sale_variant_published module to control website visibility per product variant (product.product).

Why

Odoo only lets you publish/unpublish at the product.template level. If a template has multiple variants and you only want to sell some of them on the website while keeping all variants active and sellable in the backend (Sales, POS, Inventory), archiving the variant isn't an option.

What this module does

  • Adds a website_published_variant boolean toggle (default True) on product.product form and list views.
  • Filters out unpublished variants on the website (website_id in context) from:
    • _is_combination_possible() and _is_published()
    • _only_active() on product.template.attribute.value (hiding attribute values with no published variants from the product page)
    • /shop variant preview swatches (_get_previewed_attribute_values)
    • Product specifications table (website_sale.specifications_table & _prepare_single_value_for_display)
    • Attribute exclusion metadata (_get_attribute_exclusions, _get_mapped_attribute_names) and JSON-LD hasVariant (_prepare_jsonld_vals)
  • Keeps all variants active and usable in backend flows.
  • Includes unit and HTTP tests covering backend vs. website behavior.

@OCA-git-bot OCA-git-bot added series:20.0 mod:website_sale_variant_published Module website_sale_variant_published labels Dec 4, 2026
@BhaveshHeliconia

Copy link
Copy Markdown
Author

@ivantodorovich @Ricardoalso @AungKoKoLin1997 @cristina-hidalgo-tecnativa @dreispt @adasatorres-tecnativa Could you please review this PR whenever you have a chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:website_sale_variant_published Module website_sale_variant_published series:20.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants