Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking sibling rows in Child table #44929

Open
ruthra-kumar opened this issue Dec 27, 2024 · 1 comment
Open

Linking sibling rows in Child table #44929

ruthra-kumar opened this issue Dec 27, 2024 · 1 comment
Assignees
Labels

Comments

@ruthra-kumar
Copy link
Member

ruthra-kumar commented Dec 27, 2024

Issue

Consider a Pricing Rule where Item B is setup as a free item for Item A. When user added Item A system automatically adds Item B to the document. Currently there is no reliable way to identify which row in the Items table triggered the addition of the free item

Possible Solution

Adding a new field in child table that holds the name attribute of the row that triggered the free item.

Limitations

On an unsaved new Sales Invoice, Items have auto-generated temporary names (ex: new-sales-invoice-item-sdjkfg).

Before save

| name                          | Item Code | ... | Linked to                     | context                    |
|-------------------------------+-----------+-----+-------------------------------+----------------------------|
| new-sales-invoice-item-sdjkfg | Item A    |     |                               | Primary Item added by user |
| new-sales-invoice-item-eirwhn | Item B    |     | new-sales-invoice-item-sdjkfg | free item added by system  |

This gets overridden by upon first save with an hash name, due to which the link becomes invalid on first save.

After save

| name   | Item Code | ... | Linked to                     | context                    |
|--------+-----------+-----+-------------------------------+----------------------------|
| erutfg | Item A    |     |                               | Primary Item added by user |
| lkdfjg | Item B    |     | new-sales-invoice-item-sdjkfg | free item added by system  |
@ruthra-kumar ruthra-kumar self-assigned this Dec 27, 2024
@ruthra-kumar
Copy link
Member Author

ruthra-kumar commented Dec 31, 2024

Even for a partially working solution, changes in Framework will be required. With the moving of Item selection reactivity to server-side, my hunch is there would be 2 different possible solutions for v15 and v16+ respectively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant