Thanks Liyakat. There’s a bit of a mismatch here between accounts and Items, which I didn’t explain very well.
The child table in the Indirect Expense design is for splitting accounts. The child table in your design/ Vivek’s design is for Items. Items should be associated with an account by default but they don’t represent an account.
Using the electricity example from above, you may want to allocate some portion of the electric bill to a manufacturing expense and some portion to a general overhead type of expense. I find this to be a common use case for this interface. It is the default interface to pay bills in QuickBooks (which has no real concept of Items so it’s maybe not the best example).
One of the features that is “missing” from Purchase Invoice is the ability to book an Expense to more than one account head. (This can be done retroactively with Landed Cost Voucher, but it’s not designed for non-stock items and it just a gets to be a mess). Adding this feature would get you into an attribution problem (Items to Accounts) as soon as you have more than one item on the Purchase Invoice. In an SQL backed system there isn’t a great solution for a many-to-many relationship and it’s a very difficult thing to represent in a UI anyway. I think it’s better being sidestepped as often as possible, which has been the Frappe team’s solution.
I guess my larger point is that I see an Indirect Expense or Business Expense as more Journal-Entry-like than Purchase-Invoice-like and that that is a stronger start point to add this feature. Sorry for all the tangents; to me anyway, this is a deep, non-trivial problem.