Customer Shipment without a reference to a Sales Order.

103 views
Skip to first unread message

reua...@gmail.com

unread,
Nov 25, 2022, 1:47:29 PM11/25/22
to iDempiere
Hello Community,
I am tasked with creating a material shipment document without a reference to a previous sales order.
This is required for modeling a subcontracting agreement where the customer material is delivered in push, processed and returned to the customer upon availability.
Dedicated document types for receiving and issuing the external material need to be equipped with the desired behavior.  
Since the order fulfillment is hard coded in the MInOut class, I am afraid that it won't be possible to change the default behavior of the document appropriately without modification of the core.
To implement the requirement, I can see a couple of ways, but they all are far from ideal:

(1) Rewrite the MInOut class to achieve the desired behavior.
(2) Modification of DefaultModelFactory, so that instead of MInOut a derived custom class is instantiated.
(3) Outsourcing the job fulfillment to an implementation class that is used as osgi service by Minout. The document type serves as the selection criterion.

(1) will blow up in my face with the next iDempiere update and is thus not considered.
I tend to way (2), because it seems to be the most suitable for the use case at hand in to get a maintainable solution with justifiable effort. The modification can be done in the context of a fork and be merged with updates without too much effort.
(3) would be generalizable and therefore ME is the preferable approach. However, I don't have the resources to work out the pull request needed for this in the required quality.

Perhaps I am on the wrong track and have once again overlooked that the elders have already provided a workable solution for this use case as well?
Probably there are better options available that I have not considered? 

As always, thank you for your ideas, comments, and criticisms.

Andreas 

Heng Sin Low

unread,
Nov 25, 2022, 6:02:12 PM11/25/22
to idem...@googlegroups.com
If possible, it is advisable not to model your use case that's fighting against the existing core model/structure. For e.g, order can be auto created/generated when you need to ship.

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/7974ac7c-b6b9-44dd-86d2-abd96bd6d17bn%40googlegroups.com.

reua...@gmail.com

unread,
Nov 26, 2022, 8:11:33 AM11/26/22
to iDempiere
Thanks Hengsin for your advice,
So this would involve using the eventhandler to
(1) create the missing order before the new shipment is saved.
(2) before prepare update that order to include eventual changes since the creation of the shipment, generate the orderlines and complete the order. 

Great! That sounds way less adventurous than what I had come up with.
I think I am going to use a dedicated document type for the autogenerated orders to keep them apart from the regular ones.
This should give me all that is needed without too much hassle and the chance of having any issues with updates is virtually none. 

Carlos Antonio Ruiz Gomez

unread,
Nov 27, 2022, 6:07:48 AM11/27/22
to idem...@googlegroups.com
Hi Andreas, we discussed a similar scenario in ticket IDEMPIERE-5029

If you add SysConfig VALIDATE_MATCHING_PRODUCT_ON_SHIPMENT=N, then you can ship a product different than ordered.

As you have a contract, you can create it as the order with a template line - even with a product or service with zero quantity.

And then ship everything against that line.

You need to check if the "reservations" are OK with your process, in the end there are no reservations, so, I think is not a big deal, but the sales order line shows quantities delivered.

Regards,

Carlos Ruiz



En 26/11/22 14:11, reua...@gmail.com escribió:

Martin Schönbeck

unread,
Nov 27, 2022, 2:20:36 PM11/27/22
to iDempiere
Hi Andreas,

another way to create both shipment and order together would be to create a warehouse order which will create the shipment automatically on completion. That's already present and wouldn't need any implementation.

Regards,
Martin

Steven Sackett

unread,
Nov 30, 2022, 11:53:07 PM11/30/22
to iDempiere
Hi Andreas,
I am interested to know if Martin's suggestion of using a Warehouse Order solved your requirement.
regards
steven
Reply all
Reply to author
Forward
0 new messages