-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
[ADD] product_internal_reference_generator #309
[ADD] product_internal_reference_generator #309
Conversation
096e10a
to
bab2b14
Compare
bcc0e9f
to
f9eba98
Compare
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.
Functional ok!
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, a few suggestions.
Thanks for your contribution, this must not have been easy to implement!
product_internal_reference_generator/models/product_template.py
Outdated
Show resolved
Hide resolved
product_internal_reference_generator/tests/test_product_internal_reference_generator.py
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,18 @@ | |||
{ | |||
"name": "Product Internal Reference Generator", |
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.
question: should this exclude
product_variant_default_code
?
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.
Thanks for review! Yes these modules makes no sence to be intalled together.
ece3380
to
6f7d75b
Compare
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.
Please fix my comments.
product_internal_reference_generator/models/product_template.py
Outdated
Show resolved
Hide resolved
product_internal_reference_generator/models/product_template.py
Outdated
Show resolved
Hide resolved
product_internal_reference_generator/tests/test_product_internal_reference_generator.py
Show resolved
Hide resolved
6f7d75b
to
f7e2203
Compare
f7e2203
to
1d70397
Compare
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. Nice refactor in the tests!
This PR has the |
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 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.
Functional is good!
@pedrobaeza can we proceed with this merge? thank you! |
What's the difference with https://github.com/OCA/product-attribute/tree/14.0/product_sequence and why here instead of OCA/product-attribute? |
Hi @pedrobaeza ,
I tested product_sequence and it has a similar approach, but with the following downsides compared to this module:
I agree that overall they are not very different, but also they're not the same. I think this could be merged and then see if there will be interest in future migrations to keep only one or both. What do you think? :) |
OK, as asking you to integrate the missing features into the other module, you should at least move it to product-attribute repo. This one is for features specific to handle product variant things. The other module you pointed is because the references are assigned to the variants. It's true that the |
@pedrobaeza thanks for your feedback, but it's not clear to me what's the next step: should we move this PR in product-attribute? Is it ok to keep this as a new module? I don't think it's worth the effort try and improve the old one. |
moved to OCA/product-attribute#1453 |
This module allows to generate internal references for Product templates and variants using sequences, setting codes as read-only.
In product template, it's possible to choose among different Internal Reference Templates related to a sequence, and then generate an internal reference with the following structure:
Internal Reference Prefix + progressive number for variant, eg: “Main0001001”, where:
"Main0001" is the prefix generated by sequence and assigned to product template, and
"001" the variant identifier.
Every time a new variant is created, a new internal reference is automatically assigned with progressive variant code.
A specific access rights allows specific users to change internal reference template for a product template once an internal reference has been generated, as well as editing existing ones.