[FIX] point_of_sale: create variant for single-value dynamic attribute#264134
Closed
pedrambiria wants to merge 1 commit into
Closed
[FIX] point_of_sale: create variant for single-value dynamic attribute#264134pedrambiria wants to merge 1 commit into
pedrambiria wants to merge 1 commit into
Conversation
Contributor
adgu-odoo
requested changes
May 13, 2026
| const result = await this.data.callRelated( | ||
| "product.template", | ||
| "create_product_variant_from_pos", | ||
| [productTemplate.id, attributeValueIds, this.config.id] |
Contributor
There was a problem hiding this comment.
Instead of attributeValueIds, you should put every attribute values of the product (even the no-variant ones). Something like
productTemplate.attribute_line_ids.flatMap((l) =>
l.product_template_value_ids.map((v) => v.id)
)
Otherwise you'll get an error in the backend if you try it with a product that has other attribute lines than dynamic attribute line
Contributor
Author
There was a problem hiding this comment.
Thanks for reviewing it. I modified it, and also added this case to the test.
a50555c to
06602cf
Compare
When a product template has a dynamic attribute with only one value, `isConfigurable()` returns `false` (correctly suppressing the configurator popup), but `create_product_variant_from_pos` was never called, leaving the order line without a proper variant and causing error when trying to add it to the order. opw-6213957
06602cf to
3fe40f6
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.

When a product template has a dynamic attribute with only one value,
isConfigurable()returnsfalse(correctly suppressing the configurator popup), butcreate_product_variant_from_poswas never called, leaving the order line without a proper variant and causing error when trying to add it to the order.opw-6213957
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr