-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
fix: Correctly update fields on doctype form #22860
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just updating frm.doc object doesn't update the underlying model. In Frappe `frm.doc` is NOT the primary representation or source of truth for better or worse.
215e2a0
to
cd2b2ff
Compare
mergify bot
pushed a commit
that referenced
this pull request
Oct 23, 2023
Just updating frm.doc object doesn't update the underlying model. In Frappe `frm.doc` is NOT the primary representation or source of truth for better or worse. (cherry picked from commit a3db75e)
ankush
added a commit
that referenced
this pull request
Oct 23, 2023
Just updating frm.doc object doesn't update the underlying model. In Frappe `frm.doc` is NOT the primary representation or source of truth for better or worse. (cherry picked from commit a3db75e)
ankush
added a commit
that referenced
this pull request
Oct 23, 2023
Just updating frm.doc object doesn't update the underlying model. In Frappe `frm.doc` is NOT the primary representation or source of truth for better or worse. (cherry picked from commit a3db75e) Co-authored-by: Ankush Menat <ankush@frappe.io>
frappe-pr-bot
pushed a commit
that referenced
this pull request
Oct 23, 2023
## [15.0.1](v15.0.0...v15.0.1) (2023-10-23) ### Bug Fixes * use frm.set_value for updating fields ([#22860](#22860)) ([89b5ea9](89b5ea9))
frappe-pr-bot
pushed a commit
that referenced
this pull request
Oct 31, 2023
## [15.0.2](v15.0.1...v15.0.2) (2023-10-31) ### Bug Fixes * Add translation to "Not Saved" state in print format builder ([#22920](#22920)) ([#22995](#22995)) ([8e8274e](8e8274e)) * developer mode in website theme ([#22958](#22958)) ([#22998](#22998)) ([138e679](138e679)) * don't encode `/` in html escaping ([#22871](#22871)) ([#22875](#22875)) ([2e456f8](2e456f8)) * escape print format code field([#22852](#22852)) ([#22866](#22866)) ([82d8809](82d8809)) * font loading on custom website theme (backport [#22967](#22967)) ([#22992](#22992)) ([3984214](3984214)) * Footer should show up once at end if not repeating header/footer ([#22902](#22902)) ([#22910](#22910)) ([e7ce38a](e7ce38a)) * group by didn't work for the frappe.client.get_value ([#22969](#22969)) ([#22973](#22973)) ([773b74f](773b74f)) * ignore stale custom fields while checking back-links ([#22940](#22940)) ([#22943](#22943)) ([7ce96d9](7ce96d9)) * ignore workspace links on delete ([#22895](#22895)) ([#22897](#22897)) ([821d1e9](821d1e9)) * improve label and description for `fetch_if_empty` ([9e690be](9e690be)) * list view formatting logic (backport [#22646](#22646)) ([#22849](#22849)) ([16363ab](16363ab)) * **migrate:** raise exception even if db is not available ([#22922](#22922)) ([#23000](#23000)) ([a02ba82](a02ba82)) * **minor:** hide grid row on modal close ([#22930](#22930)) ([#22932](#22932)) ([c5a9fdf](c5a9fdf)) * **minor:** use inline-flex in page-actions btn ([#22846](#22846)) ([#22868](#22868)) ([59114ef](59114ef)) * resolve page not found error ([fc9b644](fc9b644)) * revert to setting `frappe.dynamic_link` instead of using `cur_frm` ([37243c6](37243c6)) * revert unintentional quick entry default for Address ([#22974](#22974)) ([f7aaaf3](f7aaaf3)) * skip invalid numbers on SMS `receiver_list` (backport [#22879](#22879)) ([#23003](#23003)) ([5b905e3](5b905e3)) * use frm.set_value for updating fields ([#22860](#22860)) ([#22869](#22869)) ([1df1a27](1df1a27)) * web styles espresso (backport [#22924](#22924)) ([#22933](#22933)) ([b2c6f07](b2c6f07)) ### Performance Improvements * query fields only once ([#22982](#22982)) ([#22988](#22988)) ([7e2adb4](7e2adb4))
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
frm.save fails with mandatory error because form builder is modifying
df.name
of newly created docfields. DFs are located bylocals.doctype.docname
and if you change the name it's orphaned.This was working so far only because we follow this naming:
new-doctype-#
so it would pick up any arbitrary document and move on.Alternate solution: Since form builder was directly updating
doc.fields
changes were not reflected in underlying model. doingfrm.set_value
prevent this out-of-sync model problems.closes #22851
closes #22723