-
-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[15.0][FIX] product_variant_default_code: recurrent prefix #338
[15.0][FIX] product_variant_default_code: recurrent prefix #338
Conversation
Hi @Kev-Roche, |
Do you have deterministic steps to reproduce the problem? Are they reflected in the test as regression case? |
Yes, it's stated in the description (non automatic mask template and a code prefix and having a trigger in the mask recomputation, like changing an attribute name) and a new test step is added to assert the fix |
Well, that are the conditions to trigger the problem, but not the steps in the sense of (create a product this way, do this and do that). Pre-commit is red. |
Thanks for the heads up @Kev-Roche I think in any case that those fixes could be problematic, as it could happen that the prefix could match with a part inside the reference_mask. That's why I used Moreover, what if the mask should be legitly updated? That case would be ignored! I'm going to add a test for such case Addressing @pedrobaeza request for steps: In a product template with variants (i.e.: Conference Chair):
--> The prefix is duplicated in the reference mask: cccc[Legs]
--> The mask computation is retriggered and we get a duplicated prefix again cccc[Legs]. An extra issue would be that the mask isn't recomputed with the new attribute name, although that would need some extra work. |
Please reflect that steps to reproduce in the commit message, and it's good to go. |
7d5324d
to
adbfa0e
Compare
Commit message amended |
With a non automatic reference mask that has a code prefix, when that reference mask is recomputed, we could be repeating the prefix without noticing it. For instance, when we change an product.attribute name and that triggers all the default codes recomputations. In a product template with variants (i.e.: Conference Chair) - You'll have a reference mask ([Legs]) - Add a prefix: cc --> The prefix is duplicated in the reference mask: cccc[Legs] - Now you can delete de prefix manually from the mask and the resulting mask will be right: cc[Legs] - Now change the name of the attribute Legs to something else. --> The mask computation is retriggered and we get a duplicated prefix again cccc[Legs]. An extra issue would be that the mask isn't recomputed with the new attribute name, although that would need some extra work. TT48322
adbfa0e
to
ed1c0e2
Compare
CI Green |
@Kev-Roche is it OK for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/ocabot merge patch |
On my way to merge this fine PR! |
@pedrobaeza The merge process could not be finalized, because command
|
Congratulations, your PR was merged at b632eb2. Thanks a lot for contributing to OCA. ❤️ |
With a non automatic reference mask that has a code prefix, when that reference mask is recomputed, we could be repeating the prefix without noticing it. For instance, when we change an product.attribute name and that triggers all the default codes recomputations.
cc @Tecnativa TT48322
please review @pedrobaeza @victoralmau