We need to simplify the setup process and use all possibilities to make the complex setup manageable by the avarage user. Issue queue will explode otherwise. One step is to add the stock level field automatically.
Sure, you could totally use local stock without the stock level field. But I guess the main use case is - you need it.
I think there are two places, where wo could do it:
1) We could use a trait on the variations type edit form, like the shippable thing.

2) We could do it automatically if the user select "local stock" as the stock service to use for a certain variation type.

I strongly prefer 2) as no further user action is needed.
This won't work automatically for other purchasable entities, like product bundles. But again - as long as it helps the majority of users I'm for it.
Feedback appreciated.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | stock_settings_checkbox.png | 8.75 KB | olafkarsten |
| stock_settings.png | 14.93 KB | olafkarsten | |
| stockable.png | 11.83 KB | olafkarsten |
Comments
Comment #2
olafkarsten commentedWe could even add a setting and ask the user.

But if we agree, that we need the field in the majority of use cases, I'm not sure we should do that. Every additional option adds a mental burden to the user.
Comment #3
olafkarsten commentedHmm,
with FieldDefinition landing in core we could use another approach
Instead of using a configurable field, we could add a bundle field now. This would give us the support for configurable base/bundlefields in core. I think we could remove a lot of stuff from the stocklevel implementation and react on entity events instead. No need for users to add a field. I think it would solve us tons of UX Problems, too, since users should be able to enter a initial stock level without saving the entity first. No problems with required, cardinality and adding the field to other entities than purchasables, as we can lock the field. In short: It seems, this would solve us a lot of problems. Of course this needs to be testet, but it looks promising.
BUT, its late in the game. Theoretically we could break BC als we are in alpha. And as this seems to solve a lot of fu### problems, we may want to go this way. But - @guy_schneerson what are your thought on it.
Comment #4
olafkarsten commentednevermind #3 - It breaks to much BC. We should keep that for the next major release.
Comment #5
olafkarsten commented