Product Specs section

Hi,
i want to specify some product specs on Item card, but there is no space/field for this, what i want to do is, there should be a module under stock like item attributes, lets call it item specs, i want to create some specs like i create attributes, then i should choose those specs on item card. and i want to use table field for that.
Where should i start to do this, customizing ERPNext is confusing to me, any help would be great.

PS: i am in different time zone, i may not reply that fast, but i will. inshallah.

Hi,

i need a flow of action, like start by this next do this next, next and next.

Any help is appreciated.

Have you examine the variants?

Hi Turker,

Thank you for reply,
i did not examine the variants, it should be changeable.
there should be n number of variants, i will decide their names when i use, so each variants may have n numbers of items.

If you can provide solid examples it would be better.

Imageine there is a Item Specs. Module like there is Item Attributes,
You create Spec headers
SPEC HEADER

Then you can create Spec Items for Spec Headers
SPEC ITEMS
Do Not think exactly like on this spreadsheet, each header must be accessed individually. this represents the database.

Later You can Choose on Item Card like below (Barcode Table Manipulated)

And the reason why we can’t use the variants?

Hi Turker,

Thank you for your interest, Our variant definition is different and simple, these are specs for us, and an item has many specs, so we can not create that much variants, we want to use it like this, if this is possible can you guide me?

thanks.

Hi @avc,
i want to continue from here, did not want to ruin @hello1 's post more.
Thank you for trying to dispelling the fog! but still it is complicated, if you have time can you check the customization i want, and guide me!?
i need something like; do this first then this then this etc. etc. This will help me to understand the concept.
i am not sure when to use deveopment mode, when to use server script, how to use custom fields etc.
Thank you.

Hi:

First of all … my humble point of view as non developer, just a consultant with some technical knowlegde. FrappeFramework and ERPNext is, simply, the best tool I’ve found to develop, deploy and maintain business applications.

Some customizations are simple; just add some field, maybe a simple client script with logic … , etc … and it’s done.

But other ones are not so easy. Will need to understand database concepts, Javascript, HTML, Python programming, etc … and … some experience with the framework. You will need some weeks to understand concepts like apps, sites, hooks, fixtures, etc … Probably you will need a short way, but sorry … there isn’t a short way. Read the docs, this forum, the tutorials, videos , awesome Youtube streamings with @buildwithhussain … Frappe offers high level training too ( Frappe Developer Certification) .

I was exactly in the same point 2 years ago, If you need to develop business apps … I just can say … just do it!. :slight_smile: But if you need help just for one customization … maybe you can hire someone for this.

So, about your specific requirement, there are many possible approachs … one would be this:

  1. Create a custom app
  2. Create a doctype called “Specs” containing all the possible specs (WATT, JOINT TYPE, SERIES …)
  3. Create a doctype called “Specs template” with a child table. This child table contains one field (Spec, will be linked to Specs doctype)
  4. Create a custom field on Item doctype, type Link, called “Specs template”
  5. Create a custom field on Item doctype, type table, called “Item specs”, and a child doctype with 2 fields (Spec and Value)
  6. Create a client script for Item doctype … when user select Specs template, system will fill the specs table with the “preloaded” specs of template. User must sets the value for each spec.

After that … where do you need to show specs data? Maybe you will need customize some views, documents, etc …

This is a simple solution … perhaps it’s needed more deeply customization … i.e. … if you need to predefine data (for JOINT TYPE a list with prefixed values … or something like that). As I wrote above … there are many possibilities.

Hope this helps (and fog dissapears :slight_smile: )

2 Likes

Hi,
@avc thank you very much for clarifying things, i appreciated your time and effort, this is very helpful, at least i see where to start now. (Fog did not disappear but i can see couple of meters far through it :slight_smile: thank you.)

2 Likes

@avc @TurkerTunali @meraki
Hello, I would like to talk to you about a problem I have. I would be very happy if you could help. I would like to create something very similar to yours through ERPNext. I will proceed by explaining what I do step by step.
Firstly, I created a “Doctype” named “Product Specs Value” consisting of two fields of type “data,” namely “Specs Value” and “Specs Value Abbreviation,” and marked it as “Is Child Table.”

In the second step, I created a “Doctype” named “Product Specs Type.” I added a “data” field named “Product Specs Name” and a “Table” field named “Product Specs Table” to it. Then, I included the “Product Specs Value” “Doctype” from the first step within this table. This is not a “Child Table.”

In the third step, I created a “Doctype” named “Product Specs” and marked it as “Is Child.” I added a “Link” field named “Product Specs Name” and entered “Product Specs Type” in the “Options” field, as I want it to link to that data. Below, I added a “Product Specs Value” field, and this is where I encountered the issue. The problem arose because I want this field to display the “Specs Values” from the “Child Table” within the “Product Specs Type” “Doctype” as a “Select” type.

As you can see in the screenshot above, the values of “Product Specs Name” are automatically appearing as options. I also want the same thing for the “Product Specs Value.”

The screenshot below shows the “Product Specs Type List” items.

The screenshot below is an example of the “Resistance” entry in the “Product Specs Type List.”

I hope I have explained my problem clearly enough. Can you help mea bout this?

Hi:

Please, don’t mention specific people … This way, other people can help you too :wink:

I think you should create a new doctype called “Specs Value” with 2 fields, “Spec” and “Value”.
“Products spec value” field of your “Product Specs” doctype linked to the new doctype. This way, all the possible values will be listed. The hint is “limit” the query to the values related to the current spec … this way, if you specify “Resistance” spec, the query just should show resistance values, right?

Your friend is set_query method … You should create a client script, triggered on spec chosen.

frappe.ui.form.on('Item Spec Table', {
	item_spec(frm) {
		//console.log("Here I am!");
		frm.set_query("item_spec_value", "item_spec_table", function (doc, cdt, cdn) {
            
            let row = locals[cdt][cdn];
            
            return {
                filters: {spec: row.item_spec}
            }
        }) 
	}
})

Where:
‘Item Spec Table’ → The name of the child doctype added to Item Doctype
‘item_spec’ → The field on the child doctype where you choose the spec.
‘item_spec_value’ → The field on the child doctype where you store the value
‘item_spec_table’ → The field that contains the table (the child doctype) (the field name, not the name of child doctype …)
‘spec’ → The field name on the Doctype Values that contains the spec related

Play!

Hope this helps.

"Thank you for your response. There’s one thing, though: the ‘Resistance’ type will have multiple values. How can I create these values based on your explanation?

Also, as far as I know, a ‘Client Script’ can only be added to ‘Doctypes’ that are not marked as ‘Is Child’. :frowning:

As I said above … one approach is create a new doctype, called Values, with 2 fields

Spec → Link to Specs doctype
Value → Data (Store the value)

Something like this …

Actually, you can define client script on “parent” doctype, but this will work on parent or child doctypes …

frappe.ui.form.on('Parent or child', {

Read the docs, it will helpful :wink:
https://frappeframework.com/docs/user/en/api/form

Thank you for your answers :slightly_smiling_face:
Is there any method that will retrieve ‘Values’ data from a ‘Child Table’ as in my example?

Hi:

Spec linked to Specs Doctype and Value linked to the Values Doctype, filtering that with the spec.
When you select “Material” on the Spec field, the Value field will only retrieve values of “Material” … This is that client script does … “filter” the data.

1 Like

Hi @eatlc,
What are you trying to do is what i want to accomplish, but it is complicated to me so couldn’t achive, i am waiting for you to solve it, i am sorry, i can’t help you. i hope you solve it.

1 Like

Hi @eatlc,
did you solve it? if you so, can you share?

Hi @meraki
I couldn’t solve it the way I wanted. I did it using the method you suggested. Thank you again.