-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
[16.0][IMP] barcodes_generator_abstract: Avoid double iteration on base generation #619
[16.0][IMP] barcodes_generator_abstract: Avoid double iteration on base generation #619
Conversation
Hi @legalsylvain, |
43d3c16
to
04daac1
Compare
self.user_fake.generate_base() | ||
self.assertEqual(self.user_fake.barcode_base, 2) | ||
self.user_fake.generate_barcode() | ||
self.assertEqual(self.user_fake.barcode, "2000002000006") | ||
|
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.
Why do you remove this test. It looks valid ?
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.
Hi! Because it will be the same base and barcode. With this change if the product already has a base, it will not generate a new one
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.
If the code is called two times, It should be fixed. But this change is not desired.
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.
I don't undestand really well, it make sense that it doesn't change because you can't change the base two times in UI
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.
Maybe I did'nt understood the point. I'll investigate a little.
Thanks for your time.
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.
I just investigated a little. the problem exists.
I permit me to fix it with #651.
@dalonsofl : could you review it ?
thanks !
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.
Hi @legalsylvain !
I checked the PR and it looks great!
I change my test like yours and it seems to work great too.
I get the same value with your PR as mine, so both of them are correct.
What do you think with the new changes?
Thanks!!
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.
Hi @dalonsofl. Thanks for reviewing the other PR.
Well, I prefer to have explicit text that explain what does the generate_base() function, and to avoid to double check if barcode_base is defined.
I so merged the other PR.
thanks for raising the issue.
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.
I agree, the result is the same, so if you think it's better to have comments on generate_base() , I'm fine with that.
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.
I merged the other PR, you can close this one.
thanks for the investigation.
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!
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
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.
Code review LGTM!
04daac1
to
9ac97b1
Compare
9ac97b1
to
cf04f74
Compare
Module
barcodes_generator_abstract
Describe the bug
The base is changed when it is generated by having the ‘Automatic generation’ marked in the barcode nomenclature.
To Reproduce
(image from runboat OCA)
Affected versions:
16.0
Additional context
The problem is that when going through this function inside the barcodes_generator_product it goes back through the generate_base() and a recalculation of the base incorrectly, as it already has one before. With this change it would be solved