Skip to content
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

CLOSE #27048 add form to globally set "VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT" variable #27049

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

DaBootO
Copy link
Contributor

@DaBootO DaBootO commented Dec 11, 2023

CLOSE #27048 add form to globally set "VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT"

This commit adds another option to the variants module to set the global variable "VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT".
This variable allows the variant parent product to be used in stock movements.

The changes in langs/en_US are needed as a new string will be used to explain to the user what this option does.

The changes in variants/admin/admin.php are split into setting the global variable via the GETPOST (if it was sent) and into another selectyesno() form.

Both changes are oriented toward the same syntax used in both cases.

…VEMENT_ON_VARIANT_PARENT" variable

This commit adds another option to the variants module to set the global variable "VARIANT_ALLOW_STOCK_MOVEMENT_ON_VARIANT_PARENT".
This variable allows the variant parent product to be used in stock movements.
@eldy
Copy link
Member

eldy commented Dec 11, 2023

By definition, the parent of variants is not a real product. Can you provide a use case when we need to use the virtual parent product in stock change ?

@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label Dec 11, 2023
@DaBootO
Copy link
Contributor Author

DaBootO commented Dec 11, 2023

We are using the variants to keep track of products which do have different external part numbers. In essence the variant product is the same as the variant parent. So using the same BOM etc.

We could create another product with a new ref. Nr. etc. and assign the external ref. Nr. to it but we wanted to keep track of how many of our "base products" also have variants for specific customers and don't want to duplicate every BOM etc.

Therefore we sell our "variant parent" and the "variations" seperately (based on the customer) and need the stock movement on the variant parent. I Hope this made clear why allowing the stock movement on the variant parent can be useful (although I also see that our use of the variant module is atypical, but in our opinion a viable option)

Maybe to make things also a little clearer: Our products did have another attribute named "externalPN". Now we are using Variants for this. A product 1000001 can have the variant 1000001_1234567 when our customer has already created an internal product on their side they called "1234567" and give us orders for the "1234567". That way we can keep the external ref. Nr. assigned to the variant parent, bc they are the same product with different numbers.

P.S. Thank you for this awesome piece of open-source software!

@eldy eldy added PR OK to merge PR was analyzed by PR merger and seems ok to be validated. Merge may occurs soon... and removed Discussion Some questions or discussions are opened and wait answers of author or other people to be processed labels Feb 10, 2024
@eldy eldy merged commit 870395b into Dolibarr:develop Feb 12, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR OK to merge PR was analyzed by PR merger and seems ok to be validated. Merge may occurs soon...
Projects
None yet
2 participants