We use several assets that are combined in what we call a set. For example, we have a case containing several devices and their accessories like cables and power supplies. The idea is to make an asset called “set x” with an extra button in the connections field that brings us a list of all containing assets.
I’m thinking about using a virtual DocType that would be shown as a table containing basic information like name, asset_name, and gross_purchase_amount. If needed I could click a link on a particular asset to get the individual information.
Adding the connection to the custom (virtual) doctype should not be a big thing, but as I’m completely new to programming I would need to add a button to that list that lets me search and select an asset from the complete asset inventory to ‘attach’ to the given asset.
Is there anyone that could help or guide me in this?
Thank you glz for this tip, but this solution kind of locks the assets into the set. Over here we need to be able to change the contents of a set on quite a regular base.
Based on your suggestion it started me thinking that another solution for the connection-knob could be a child-table in the Asset DocType, shown or hidden by a simple check-box called “Is Set”…
The disadvantage of this solution is that it does not work recursively, as I can’t see in the ‘child-asset’ to what ‘set-asset’ it is linked. This would be very handy.
You can have a separate doctype, like say asset movement, or asset repair, and use Document Links, from customize form to link to it. This new doctype can have a child table of linked items/assets.
Currently, we are going for a basic Child Table in the Asset DocType called Asset Set (asset_set)
It contains 3 fields:
a mandatory linked field to Asset by using asset_name - this selects the child-asset
a read-only field that displays the Asset Description (based on asset_code) (*)
a Note-field that is Simple Text
(*) This is where I run into trouble with my limited coding skills:
In the Asset Name field, I can select an Asset, which is displayed by its Naming Series. In our case, this is an Equipment number. So to make it more human-readable I wanted to add an extra field that should be auto-populated with the full description that is found in the standard Asset field that is called asset_code.
based on some research I’ve written a custom script that is active for the Asset-DocType:
The custom script I was using did not work. Going deeper in to the issue I’ve found this ** Fetch fields from another DocType into a child table** on Community Developed Custom Scripts · frappe/erpnext Wiki · GitHub and I’ve reworked my Custom script like this: