I am playing with a local installation of ERPNext for a few months now for testing and I want to ask the community what would be a good approach for the following problem: I need to keep a tree-like structure of orders, units and sub-units coming from the customers. (Please ignore the fact that these are called “orders” or “units” etc.; thay could be called anyway you want.). The Orders would contain Units and each unit would contain SubUnits like in the structure below:
Each leaf from the tree structure above has to have also other properties; for example an Order would have a name, a date; a Unit would have a name, a version number, a status, etc.
My first approach was to create inside the manufacturing module three different doc types: Orders, Units (as a child table of orders) and SubUnits (as a child table of units).
The Units doc type was intended to be displayed as a table inside the Orders and the SubUnits as a table inside the Units table. As you may already guessed it did not quite worked. Displaying a doct type as a table inside another doc type works but going deeper than one level does not. Makes sense.
The second approach was to create the same three different doc types but, instead of displaying them as nested tables, I thought of creating links from SubUnits to Units and from Units to Orders. This approach kinda works but I feel it is a little harder to find the information and to maintain it throughout the doc types.
To put the cherry on top I would have liked to have the tree structure displayed in ERPNext displayed in the left (like in the windows explorer) but I couldn’t find a way. I also tried to play a little bit with the tree structure from the Chart of Accounts and to find a way to adapt it somehow to my needs but with no avail.
Could you please guide me on how would be the best way to accomplish the tree-like structure I need?
I would need this for a new concept / not for the standard orders.
Hopefully the solution wouldn’t involve coding (I am a very good python programmer but I haven’t had the time to dig into the ERPNext’s code). I also read your answer in this thread: Warehouse hierarchy [Tree/Nested Set] - #4 by rmehta
Let me put the problem in another way (3rd approach): take the Project, Project Task and Task doc types.
I saw that while creating a new task in the Project it will also be visible in Task (and I presume that behind the scenes it is actually initially created in Project Task which has the is child table check-box checked.).
In the same way I would need to create an Unit inside Order but I would need the Units to be editable also from outside the Orders page (like tasks can be edited both inside the projects and outside the projects page). I think that this approach requires 3 doc types one of which would be a child table (not editable directtly).
4th approach: suppose we have the following (logical) structure:
Orders: (doc type)
title (data)
number (data)
date (date)
units list (???)
Units: (doc type)
name (data)
type (data)
status (data)
order id (link)
subunits list (???)
SubUnits: (doc type)
name (data)
type (data)
unit id (link)
So, the SubUnits would have a link to Unit id and the Units would have a link to Order id. Is there a way to have the Orders display a list of linked Units and the Units display a list of linked SubUnits?