You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
When order is 10 parts and 5 are available, we would need to ship 5 immediatly and 5 later if needed, that's not possible at the moment :
Suggested solution
Do not close the order when partial delivery, consider beeing allowed to ship in multiple batchs, like build order can be.
Describe alternatives you've considered
Not Applicable
Examples of other systems
Every commercial or industrial inventory system can do that, this is a "MUST HAVE"
Do you want to develop this?
If I can, I'd like to try, but please assign a more experimented contributor to help me :-)
When I'm familiar to Inventree I will be able to contribute alone :-)
Yes would definitely support implementation of this feature. This has also been raised in a previous issue.
Working out how to implement this cleanly would be the major impediment.
I think that this would require the addition of a "Shipment" model. Multiple shipments can reference the same SalesOrder instance.
Then, instead of stock items being allocated against a SalesOrder directly, they are allocated against a shipment.
We would need to migrate any existing SalesOrder, so a single shipment would be created for any existing SalesOrder in the database.
Shipments can then be "shipped" with any amount of stock. User simply has to select "add new shipment" on the sales order page.
I'd like to stipulate that the implementation used only the API forms interface, rather than the (old) Django server side forms. Happy to provide pointers on this as the client side forms code is pretty complex.
Feel free to ping me for any implementation discussions! I'd be really keen to see this feature added.
Just wondering if someone noticed that there seems to be an inconsistency with the prices in the table. The unit price uses a comma separator and the total price a dot as separator.
Well, allocating stock to a shipment should be OK, but I think shipment for sale order should be treated as batch for build orders, I mean multiple shipments are however all linked to a sale order.
So just let me know if I remain assigned to this as it seems a little bit tricky for a 1rst one :-)
About dot or comas, as for excel and CSV it is not so easy maybe this could be part of parameters ?
I don't know if it's a database parameter or just a display parameter ? using comas for separators in CSV is often a problem
@tse-tarn-france I would simply add a Shipment model with ShipmentLines as a second model (just like Orders / OrderLines). An order (BO/SO) could just be extended to contain shipment information. Maybe as an own tab for orders.
I have been considering an implementation of this for a while - we would make good use of this at my work too.
Some details below:
Current Structure
Here is a diagram of the current model structure related to the concept of a sales order:
Models
Sales Order
The SalesOrder model represents a single order of items going to a customer
SalesOrderLineItem
The SalesOrderLineItem model links a certain quantity of a Part instance to the outgoing SalesOrder
SalesOrderAllocation
The SalesOrderAllocation model allocates a certain quantity of a particular StockItem to a single SalesOrderLineItem
Note that multiple SalesOrderAllocations can be made against a single SalesOrderLineItem
Desired Structure
The following implementation represents what I think would be the "simplest" structure that allows for multiple partial shipments and also retains the current workflow (as closely as possible).
Shipment Model
First, we add a new model Shipment which references the SalesOrder.
When a new SalesOrder instance is created, a new Shipment instance is also created, and points to the new SalesOrder
Multiple Shipment can point to the same SalesOrder
Or, the SalesOrder can be fulfilled in a single Shipment
Allocation
Then, stock is allocated against a shipment, in addition to the line item:
There would be some back-end changes required, and a fair bit of work with the front-end allocation tables, but the end result would (I think) be pretty simple, and if the users did not want to split a sales order across multiple shipments then the process would not really change much from the current process.
Required Steps
Add a new Shipment model
Add a "Shipment" field to the SalesOrderAllocation model
Create data migrations for existing sales orders, creating default shipments and updating existing allocations
Refactor functions for determination of whether a line item is completed
Update REST API
Re-write the sales order allocation table code (front-end javascript)
Rather than charge ahead and implement this as above, I'd like to receive some input on whether this suggested approach makes sense to everyone. There may be some parts I have not explained exceptionally well, also.
@SchrodingersGat looks great! This would also allow us to add fulfillment tracking etc. in the future. The model should scale pretty well if implemented like this. We should def. test that this does not hit performance due to lookups.
I do not know if hobbyists need shipments so maybe we should hide UI for this with a default False flag?
Activity
matmair commentedon Oct 20, 2021
@SchrodingersGat would this be merged? I volunteer to assist @tse-tarn-france with the implementation.
SchrodingersGat commentedon Oct 21, 2021
Yes would definitely support implementation of this feature. This has also been raised in a previous issue.
Working out how to implement this cleanly would be the major impediment.
I think that this would require the addition of a "Shipment" model. Multiple shipments can reference the same SalesOrder instance.
Then, instead of stock items being allocated against a SalesOrder directly, they are allocated against a shipment.
We would need to migrate any existing SalesOrder, so a single shipment would be created for any existing SalesOrder in the database.
Shipments can then be "shipped" with any amount of stock. User simply has to select "add new shipment" on the sales order page.
I'd like to stipulate that the implementation used only the API forms interface, rather than the (old) Django server side forms. Happy to provide pointers on this as the client side forms code is pretty complex.
Feel free to ping me for any implementation discussions! I'd be really keen to see this feature added.
afkiwers commentedon Oct 21, 2021
Just wondering if someone noticed that there seems to be an inconsistency with the prices in the table. The unit price uses a comma separator and the total price a dot as separator.
SchrodingersGat commentedon Oct 21, 2021
@afkiwers well at least one person has ;) please split this out as a separate issue :)
afkiwers commentedon Oct 21, 2021
Will do!
tse-tarn-france commentedon Oct 21, 2021
Well, allocating stock to a shipment should be OK, but I think shipment for sale order should be treated as batch for build orders, I mean multiple shipments are however all linked to a sale order.
So just let me know if I remain assigned to this as it seems a little bit tricky for a 1rst one :-)
About dot or comas, as for excel and CSV it is not so easy maybe this could be part of parameters ?
I don't know if it's a database parameter or just a display parameter ? using comas for separators in CSV is often a problem
tse-tarn-france commentedon Oct 21, 2021
Just to say, in some other implementation, 2nd and following shipments of a sale order are called "child of" 1rts shipment.
So maybe it's not the sale order data to duplicate but the shipment data ? I think you best known Inventree achitecture to decide.
Regards.
matmair commentedon Oct 23, 2021
@tse-tarn-france I would simply add a Shipment model with ShipmentLines as a second model (just like Orders / OrderLines). An order (BO/SO) could just be extended to contain shipment information. Maybe as an own tab for orders.
SchrodingersGat commentedon Oct 24, 2021
I have been considering an implementation of this for a while - we would make good use of this at my work too.
Some details below:
Current Structure
Here is a diagram of the current model structure related to the concept of a sales order:
Models
Sales Order
The
SalesOrdermodel represents a single order of items going to a customerSalesOrderLineItem
The
SalesOrderLineItemmodel links a certain quantity of aPartinstance to the outgoingSalesOrderSalesOrderAllocation
The
SalesOrderAllocationmodel allocates a certain quantity of a particularStockItemto a singleSalesOrderLineItemNote that multiple
SalesOrderAllocationscan be made against a singleSalesOrderLineItemDesired Structure
The following implementation represents what I think would be the "simplest" structure that allows for multiple partial shipments and also retains the current workflow (as closely as possible).
Shipment Model
First, we add a new model
Shipmentwhich references theSalesOrder.SalesOrderinstance is created, a newShipmentinstance is also created, and points to the newSalesOrderShipmentcan point to the sameSalesOrderSalesOrdercan be fulfilled in a singleShipmentAllocation
Then, stock is allocated against a shipment, in addition to the line item:
There would be some back-end changes required, and a fair bit of work with the front-end allocation tables, but the end result would (I think) be pretty simple, and if the users did not want to split a sales order across multiple shipments then the process would not really change much from the current process.
Required Steps
Rather than charge ahead and implement this as above, I'd like to receive some input on whether this suggested approach makes sense to everyone. There may be some parts I have not explained exceptionally well, also.
matmair commentedon Oct 24, 2021
@SchrodingersGat looks great! This would also allow us to add fulfillment tracking etc. in the future. The model should scale pretty well if implemented like this. We should def. test that this does not hit performance due to lookups.
I do not know if hobbyists need shipments so maybe we should hide UI for this with a default False flag?
SchrodingersGat commentedon Oct 24, 2021
@tse-tarn-france this one will actually be pretty complex. I'll start a new PR for this myself and tag you so you can follow along!
matmair commentedon Dec 4, 2021
@tse-tarn-france changes are in master