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

Possible Issue with setting part master to not track inventory #134

Open
jkelleyj opened this issue Feb 29, 2016 · 1 comment
Open

Possible Issue with setting part master to not track inventory #134

jkelleyj opened this issue Feb 29, 2016 · 1 comment

Comments

@jkelleyj
Copy link

In assemblies_part.rb, there is a after_create callback that disables inventory tracking for the master of the part.
https://github.com/spree-contrib/spree-product-assembly/blame/master/app/models/spree/assemblies_part.rb#L27

Is this the correct behavior, or should it actually be removing tracking of inventory on the assembly's master? I don't understand why we would want to turn tracking off for the part's master, because it could also be individually sold and need its own tracking. The guard means it will only occur for parts that have multiple variants, so it seems the intent was to turn off tracking on the part, I just don't understand why and thought I'd see if someone more knowledgeable with the project could look at this to see if this is the correct behavior.

@jkelleyj
Copy link
Author

I've run across this issue again in some work I'm doing. From what I've seen, undoing this step causes issues with the AvailabilityValidator since the inventory units are pulled for the master variant when a deferred variant selection is present. It basically fails to validate as a result, so we need to keep this in place. I'm going to look into the availability validator to figure out why it is validating inventory units that contain the master variant instead of the "deferred selection" for those products. If we can fix that, I believe this step of turning off inventory tracking on the master will be unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant