Closed (fixed)
Project:
Commerce Stock
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Feb 2016 at 17:52 UTC
Updated:
27 Mar 2017 at 18:29 UTC
Jump to comment: Most recent
Create an admin screen this should be using a similar url structure to the 7 stock with a default overview tab and this screen as a tab.
We need to be able to:
* Create stock locations.
* Edit the location name.
* Delete ?? if no transaction - this probably needs thinking about so maybe for a later stage.
This does not need to be a part of the API so no need to update the interfaces and the storage API class
Comments
Comment #2
steveoliver commentedComment #3
guy_schneerson commentedHi @steveoliver that will be a great help. If you got the time would be good sorting out the menu routs and menu entries for the two other pages alongside this one:
Notes: the transactions1 page is the first part of a two step form. step one chose a product. step two create a transaction. Step 2 can now also be called directly from the stock edit widget.
Comment #4
steveoliver commentedComment #5
guy_schneerson commentedI have create a related issue #2838050: Add further possibilities to filter stock locations available for stock allocation
Comment #6
olafkarsten commentedShould we not implement a more sophisticated location solution, a content entity type to be more clear?
I would bet one will soon need a fieldable thing to add adresses or some other stuff. A Drupal entity gives us much of the ui stuff and all the handling for free. I we do it with bundles, we can even have location types (car, store, warehouse) if one need it. Though commerce_stock should only provide a default one.
Comment #7
guy_schneerson commentedHi @olafkarsten I agree an entity would make sense and I know people would like to create whorehouses as locations. Got three comments:
1) Not high priority in my mind, but useful just the same.
2) Can we archive the same thing with a reference field to the schema table? ()
3) If we go with entities we need to make sure this does not impact on performance. currently queries are light and officiant. This should only involve getLocationList() and we can cache the result of this function.
Comment #8
olafkarsten commented1) As an feature is it not prio A, I agree. But I guess it is easier and faster to create the entity, get all the ui and drupal integration for free, than implement an own solution.
2) +3) I'm not a database guru. Do you have any actual number/experience in drupal db performance? I would expect, the drupal core entity system, db-layer and caching stuff is highly omptimized. Especially in cases like "locations", that won't change that often. I would think any own solution will end in lower performance.
And last but not least - multilingual. Own solution means, you have only single language implementation or have to implement you own translation stuff.
Comment #9
steveoliver commentedI know olaf is working on this, and he has shown that loading entities is going to be just as performant as hitting the db directly. I think the benefits of locations as content entities cannot be overstated.
Comment #10
guy_schneerson commentedThanks both, I am conviced Entity are the way to go. It will be impossible for entities to perform better then the code we currently have as it is a single select, however it is unlikely to be an issue and as I was saying the only place it is currently used is getLocationList() and we can add caching to the function if needed.
Comment #11
steveoliver commentedOlaf is working on the location as entity approach at https://github.com/olafkarsten/commerce_stock/commits/2671372-location
Comment #12
olafkarsten commentedlets make it official ;)
Comment #13
steveoliver commentedComment #14
steveoliver commentedComment #15
steveoliver commentedNice work, @olaf. Just needs a rebase and I think it looks good to me. @BBGuy this is ready for your review -- https://github.com/BBGuy/commerce_stock/pull/9
Comment #16
guy_schneerson commentedGreat work.
Mostly happy. My only worry is that the PR is making some changes that don't look to me like directly related to this task, see my comment on github If that is the case we should separate those changes to another issue.
Comment #17
olafkarsten commentedNew PR with all things removed, not essentially related to that issue
https://github.com/BBGuy/commerce_stock/pull/25
Comment #19
guy_schneerson commentedThanks @olafkarsten great work.
I have separated some of the code cleanup changes that was not directly related to this task and will push in another commit.
Comment #20
steveoliver commentedUnfortunately this is not done yet -- see https://github.com/BBGuy/commerce_stock/pull/25#issuecomment-286162743. Also, we should commit only after we have a passing build. :/
Comment #21
steveoliver commentedOK, I spoke too soon! Technically, this works (on a fresh install). But there are a few cleanups and an upgrade path (from previous -dev versions) I'll propose in new child issues.