Creating a custom Item

Hi,
I am trying to create a specific ‘Raw Material’ with some additional properties. For example I need to handle the raw material ‘Paper’ with additional attributes like GSM and BF. Ideally I am looking at creating a new ‘Item Group’ called ‘Papers’ under ‘Raw materials’ in my app. However not sure whether that is feasible with the current design. If that is not possible, could someone please let me know
a) The best way of handling these kind of usecases
b) How to create a new ‘Item Group’ in the App so that it doesn’t have to be customised for every instance

Regards
Sathish

@spoojary
Perhaps you can try Item variants. Refer the link to learn more.
https://frappe.github.io/erpnext/user/manual/en/stock/item/item-variants

Thanks @ArundhatiS.

I have looked at item variants, evaluated it and rejected it as not suitable. However, taking another look, I might have overlooked its potential. So I will take another look at the same and update the thread.

Hello @ArundhatiS,

I have created the variants by adding custom attributes. I need to access those attributes in the code to make certain decisions. Could you please let me know how to do the same? Also, I need to create the attributes and variant as part of my app. Any idea how I can achieve the same?

Regards
Sathish

By code, are you referring to Item Code? If it is a template item, you can select Attributes in the relevant section, and then create variants using that Attribute.

If we are talking about customization here, please share your usecase and requirement, may be with mockups, so that one can support you better.

Sorry for the confusion. I wasn’t referring to the item code. I am working on an app for our box manufacturing factory. Paper rolls are mandatory raw materials, so I don’t want to create that individually on every installation. Instead, I want that automatically created when the app is installed. In addition, I need to access the paper attributes in the app for making certain decisions. So, my question is:

  1. How do I create the item template within a custom app?
  2. How do I access the custom attributes of variants from the custom app?

Regards
Sathish

Please check the following video to learn how to link a custom application with core ERPNext.

1 Like

Thanks @umair.

I will go through that and check whether it helps with my problem.

Hi @umair,

Pardon my ignorance. I assume you are referring to the ‘export customisation’ concept mentioned in the video. However it looks like that is applicable only to the doctype changes, and not for the values. In this case, I have created an Item template and want that to be exported to my app. I am not sure how that can be done using ‘export customization’. Similarly, I would like to create few new ‘ItemGroup’ elements would like them available in my app. Any idea how that can be achieved?

Btw, I realised quite late that this doesn’t need any special provision. Item doctype already has the child table ‘attributes’, which I believe can be traversed to get the individual attribute values. So only thing I need to do is exporting the item template with those attributes to my app.

I have now managed to get this done by adding a custom script for before_install hook. Thanks for the help.