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

Support for Multi-Source Inventory (MSI) coming in 2.3.x #1196

Closed
rbayet opened this issue Nov 23, 2018 · 2 comments
Closed

Support for Multi-Source Inventory (MSI) coming in 2.3.x #1196

rbayet opened this issue Nov 23, 2018 · 2 comments
Assignees
Labels

Comments

@rbayet
Copy link
Collaborator

rbayet commented Nov 23, 2018

2.3.x introduces MSI (https://github.com/magento-engcom/msi/wiki) which allows to define different stock (stock_id) for different websites and inventory sources in (but probably not limited to) multi-websites environment.
When it is the case, it is not longer possible to rely purely on legacy tables cataloginventory_stock_* for indexing into ES the stock status of products, but there is a need to rely on new tables inventory_stock* (and probably inventory_sources*).

Preconditions

Magento Version : CE 2.3.0-beta32 + sample data

ElasticSuite Version : 2.6.x

Environment : Developer

Third party modules : N/A

Steps to reproduce

  1. On a multi-websites environment (named hereafter "website A" and "website B"), create a new Inventory source (Stores > Inventory > Sources) named "alternate" besides the "default" one, and create a new Inventory stock (Stores > Inventory > Stocks) using that newly created source and with "website B" as the stock Sales Channel
  2. On the catalog product grid, select from edition a simple product assigned to both "website A" and "website B"
  3. In the Sources fieldset, click the "Assign Sources" to assign the "alternate" source to the product (besides the "default" source already assigned) and save the product
  4. Edit the product again (if need be) and in the Sources fieldset
  • switch the "Source Item Status" select to "Out of stock" for the "alternate" source
  • switch if need be the "Source Item Status" select to "In Stock" (and assign some stock qty) for the "default" source
  • save the product
  1. Wait for cron reindexing or perform a full reindex via CLI
  2. Inspect the indexed documents in both ES indexes for the product

Step 2. and 3. can also be done directly from the catalog product grid with the mass action "Assign Inventory Source".

Expected result

  1. In the "Website A/Store A" document, "stock.is_in_stock" should be set to "true"
  2. In the "Website B/Store B" document, "stock.is_in_stock" should be set to "false"

Actual result

  1. In the "Website A/Store A" document, "stock.is_in_stock" is set to "true" (OK)
  2. In the "Website B/Store B" document, "stock.is_in_stock" is set to "true" (KO)
@romainruaud
Copy link
Collaborator

Let me know if it's doable directly on ElasticsuiteCatalog module.

Maybe something on the Stock Datasource that would be able to :

  • for a given website/store : be able to deduce how the stock is managed : legacy (it's unclear for me how relevant are legacy stock data & tables on Magento 2.3) or MSI
  • then compute stock information for the proper table
  • index it

If it's not possible to handle these different cases, we'll be forced to release a complementary module that could be called something like "smile/elasticsuite-msi" to deal with websites using MSI.

However, I'd prefer to handle it directly on the core to avoid bothering Elasticsuite users with an additional module in case of MSI usage.

In any cases, this one is high priority actually.

I let you dig more and propose a PR/solution.

rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 26, 2018
rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 27, 2018
rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 27, 2018
rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 27, 2018
rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 27, 2018
rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 27, 2018
rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 27, 2018
rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 27, 2018
rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 27, 2018
rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 27, 2018
rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 28, 2018
rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 28, 2018
rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 28, 2018
rbayet added a commit that referenced this issue Nov 28, 2018
@rbayet
Copy link
Collaborator Author

rbayet commented Nov 29, 2018

Fixed by PR #1202

@rbayet rbayet closed this as completed Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants