Skip to content

[19.0][ADD] website_sale_product_multiple_qty#1172

Open
yankinmax wants to merge 2 commits into
OCA:19.0from
camptocamp:add-website_sale_product_multiple_qty
Open

[19.0][ADD] website_sale_product_multiple_qty#1172
yankinmax wants to merge 2 commits into
OCA:19.0from
camptocamp:add-website_sale_product_multiple_qty

Conversation

@yankinmax

Copy link
Copy Markdown
Contributor

This module extends the eCommerce flow to support Sales Multiples
(packaging quantities) directly on the product page, in the cart,
and in the product configurator.

When a product (or variant) has a Sales Multiple configured,
the quantity entered by the customer on the website is automatically
rounded to a valid multiple according to the interaction type.

The rounding logic is applied dynamically when the customer:

  • Opens the product page
  • Changes the product variant
  • Clicks the "+" (increase) button
  • Clicks the "–" (decrease) button
  • Manually enters a quantity
  • Presses Enter inside the quantity input
  • Changes quantities in the cart

@yankinmax
yankinmax force-pushed the add-website_sale_product_multiple_qty branch 3 times, most recently from 54974cd to e48fbcc Compare February 27, 2026 12:28
@yankinmax

Copy link
Copy Markdown
Contributor Author

This PR is moved from OCA/sale-workflow:

Hello @alexey-pelykh, I address your suggestions on the closed PR here.
Thanks again

@yankinmax
yankinmax force-pushed the add-website_sale_product_multiple_qty branch from e48fbcc to 8395a93 Compare March 2, 2026 09:41

@ivantodorovich ivantodorovich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @yankinmax !

@vvrossem vvrossem left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work.
Note: I overlooked the JS part.

@yankinmax
yankinmax force-pushed the add-website_sale_product_multiple_qty branch from 8395a93 to 44f50a5 Compare March 4, 2026 14:43
@yankinmax
yankinmax force-pushed the add-website_sale_product_multiple_qty branch from 44f50a5 to c3252e3 Compare March 6, 2026 13:26
@ivantodorovich

Copy link
Copy Markdown
Contributor

@BhaveshHeliconia BhaveshHeliconia left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@alexey-pelykh alexey-pelykh left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for moving this over and working through the feedback from OCA/sale-workflow#4165, @yankinmax — I went back through each of my earlier points against the current diff:

  • _get_sale_multiple_vals duplication — resolved. controllers/product_configurator.py now calls self.env["product.template"]._get_sale_multiple_vals(...) instead of carrying its own copy, so there's a single source of truth.
  • Tests — resolved. tests/test_website_sale_product_multiple_qty.py plus the two tours (website_shop_product_multiple_qty / website_shop_checkout_product_multiple_qty) cover page load, +/- buttons and manual-input rounding.
  • int(multiple_uom.factor) as the step — this was my main open question, and it's correct for 19.0. The UoM refactor made factor the absolute quantity (uom.uom._compute_factor: relative_factor * relative_uom_id.factor), so a "Pack of 5" yields factor == 5 and int(multiple_uom.factor) is the right step. My original concern was against the pre-18.0 semantics where factor was the inverse ratio (0.002 for a pack of 500) — that no longer applies here.
  • Rounding epsilon — good: step * 1e-9 is now scaled to the step and carries an explanatory comment.
  • _get_additionnal_combination_info spelling — matches the upstream super() name, so nothing to change.

The only outstanding item is the one you already flagged: Detect unreleased dependencies is red because test-requirements.txt pins sale_product_multiple_qty to refs/pull/4143/head. That clears once OCA/sale-workflow#4143 lands — nothing to do on your side until then.

Nice work.

Co-Reviewed-By: Claude Opus 4.8 noreply@anthropic.com

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants