Repository navigation
Conversation
cvinh
force-pushed
the
18.0-add_pos_order_line_change_variant
branch
from
August 18, 2026 20:05
8600b11 to
099e785
Compare
cvinh
marked this pull request as draft
August 18, 2026 20:14
cvinh
force-pushed
the
18.0-add_pos_order_line_change_variant
branch
4 times, most recently
from
August 20, 2026 20:26
b4664b0 to
8b6a52d
Compare
Contributor
Author
|
tests fail because of pos_user_restriction |
cvinh
marked this pull request as ready for review
August 20, 2026 20:53
…g order line Lets the user click an already-selected cart line whose product is configurable a second time to reopen the variant configurator, pre-filled with the line's current attribute selection. PosStore.changeOrderlineVariant(line) reuses the same variant resolution logic addLineToOrder already uses when adding a configurable product, then: - splits off the confirmed unit onto its own line first when the line's quantity is more than 1, so only that unit is affected; - updates the line in place if it was never sent to the kitchen printer, or removes it and adds a fresh line with the new variant otherwise, so the change is correctly reported to the kitchen as a cancellation and a new addition. Note, customer note and discount are carried over when a line is split or replaced. Pre-filling covers every attribute type: values that define a real variant, no_variant/custom values on the line, and multi-select values, via a defaultValues.multi sub-key and a MultiProductAttribute patch (core never passes defaultValues to that component at all). The change is refused, with an explanatory dialog, when the line already has lot/serial numbers assigned. A Python HttpCase + tour test covers the full flow: add a variant to the cart, select the line, click it again, switch to another variant, check the line was updated in place rather than duplicated. Assisted-by: Claude (Anthropic)
cvinh
force-pushed
the
18.0-add_pos_order_line_change_variant
branch
from
August 24, 2026 07:01
8b6a52d to
2518060
Compare
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.
…g order line
In standard Point of Sale, once a product with variants has been added to the cart, there is no way to switch it to a different variant: the line has to be removed and the new variant re-added as a separate line. Clicking a cart line only lets you edit quantity, discount or price through the numpad; double-clicking a line currently does nothing beyond cancelling the line's pending auto-deselection timeout (
OrderSummary.clickLine,ev.detail === 2branch), so this event was free to repurpose.This module lets the user double-click a cart line whose product is configurable (
product.isConfigurable()) to reopen the variant configurator, pre-filled with the line's current attribute values, and apply the newly picked variant on that same line instead of creating a new one.PosStore.changeOrderlineVariant(line)reuses the same variant resolution logicaddLineToOrderalready uses when adding a configurable product (matchingproduct_template_variant_value_idsagainst the confirmedattribute_value_ids), then updates the line'sproduct_id,attribute_value_ids,custom_attribute_value_ids,price_extra, unit price and full product name in place.The change is refused, with an explanatory dialog, when:
A Python HttpCase + tour test covers the full flow: add a variant, add it to the cart, double-click the line, switch to another variant, check the line was updated in place rather than duplicated.
Assisted-by: Claude (Anthropic)