Fetch Child Table Data In Another Child table

I Create a doctype that has different sizes for different types of products. For example, we have four types: child, men’s, ladies’s, and child ladies’s. Each type has its own size range. For instance, child sizes start from 20/1 to 20/20, while men’s sizes start from 33/1 to 33/40. To manage this, I created a doctype for product types and assigned in the Item master. example if a item is related child then the product type is a child, if a item is related men then the product type is a men. So far, everything is working, but the problem is that when we create a sales order or add an item, we need to show the size of the assigned product type in the sales order item table.

screen shot of product type doctype

Screen shot of the item master where the product type is assigned to the item

Screen shot of the Sales order item.

If anyone knows please help me.
Thank You.

Hi @falah123:

There is not direct support for this in Frappe Framework.
IMHO it would be a really good feature.

You can try to customize with something like this:

Hope this helps.

I’m not that good at coding,
can you please help me.

Hello @falah123

I think you can create different fields for all sizes in Doctype Sales Order Item and set Display Depends On (JS) for every field.

Create custom field 20/1 and 20/20 and set Display Depends On (JS) as eval:doc.custom_product_type == "Child"

Create custom field 33/1 and 33/40, set Display Depends On (JS) as eval:doc.custom_product_type == "Men"

custom_product_type is your custom field where respective Product Type will get fetch through Item.


1 Like

Have you tried Item Variants?