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 · 2 comments · May be fixed by #45290
Open

Linking sibling rows in Child table #44929

ruthra-kumar opened this issue Dec 27, 2024 · 2 comments · May be fixed by #45290
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 primary key (name) 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, change in Framework will be required.

@ruthra-kumar
Copy link
Member Author

ruthra-kumar commented Jan 14, 2025

part of: #42195

@ruthra-kumar ruthra-kumar linked a pull request Jan 16, 2025 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant