Child Table of a child table

I have a use case . A pallet can have many boxes, a box have many products.

Pallet: Doctype
Pallet Box: Child Doctype of Pallet
Box Product: Child Doctype of PalletBox

Inside a pallet document (record) I click edit button in boxes grid, and i can’t edit it.
Pallet box has a Table field (that points to Box Product) when I delete that field it allow me to click on edit and form opens.

Is there a way to view a child doctype inside a form of another child doctype?

@nev-21 I believe that you need the following:

Doctypes

  1. Pallet
  2. Pallet Box

Child Tables

  1. Pallet Pallet Box as a Child Table in Pallet doctype to link between both of the above doctypes
  2. Box Product as a Child Table in Pallet Box doctype to link the doctype with the products

Process

  1. Create the Pallet Box entries and fill the table of Box Product for each entry with the products you want
  2. Create the Pallet entry and fill the table of Pallet Pallet Box with the entries you created in the first step

I hope that I was able to help.

1 Like

Thanks @kid1194

I did that already, but the problem is I can edit items (open sub-form by click on edit).

I post an issue, with a video:

@nev-21 Based on the JS trace that you posted on github, I can see that the error is about bulk edit. So try to edit Box doctype, edit products table, scroll to the bottom and check Allow Bulk Edit option then give it another try.

Thanks again @kid1194 for you help.

I tried it without success.

This is not supported.
Maintainers will tell you it is a bad design (which I wholeheartedly disagree with).
But they come up with even worse design to overcome this lack of feature; like having to duplicate stock entry line when consuming multiple different item batch. Or setup sibling lists in BOM to define Operations and Items, when it would be so much more user friendly to see Items required underneath each Operations…

2 Likes

Thanks for your reply @guimorin, I understand now.

I achive to connect to one-to-many doctypes ( withouth child table checkbox) using Link field, and connections, but the UX is bad because user has to make too much clicks to se the content of boxes and return to see what was the pallet he was seeing.

So I think I will not use frappe frontend (maybe the backend) this is a basic need for any system specially CRUD based ones. Appart from the fact that doctypes layouts have bugs and the lack of documentation of how to use them, and how to develop custom pages.

@nev-21 There is a way to do what you want and view the products of each box when you click on edit but you can’t modify the box products.

To do that you will need to create on doctype, besides the 3 you already have, to use as the child table for the Pallet doctype and you will also need a client script for this child table that gets the Box you have selected and list down the products in that box.

If that is OK with you, please let me know so I provide you with the child table doctype fields and the related client script.

1 Like