feat: allow syncing new fields in Doctype Layout
Changes:
- Populate doctype fields when the document type is selected (closes #16387)
- Set "Document Type" field as "Set Only Once" to improve UX and avoid ordering issues on change
- Add a new "Sync Fields" action button to sync added/removed fields from the Doctype (including both Docfield and Custom Field)
- Dynamically insert new fields based on their order in the doctype to maintain layout
- If a Custom Field is deleted from a doctype, also delete it from all Doctype Layouts for that doctype
Screenshots / Videos:
https://user-images.githubusercontent.com/13396535/188114262-298730b4-2050-4724-9284-b3e937ccd0ef.mp4
https://user-images.githubusercontent.com/13396535/188119643-07827814-52cc-4e97-9f29-a48fef065bfa.mp4
Codecov Report
Merging #18020 (b61e91d) into develop (6ed3ce5) will decrease coverage by
0.44%. The diff coverage is16.27%.
Additional details and impacted files
@@ Coverage Diff @@
## develop #18020 +/- ##
===========================================
- Coverage 62.72% 62.28% -0.45%
===========================================
Files 746 745 -1
Lines 67307 68079 +772
Branches 5966 5960 -6
===========================================
+ Hits 42218 42400 +182
- Misses 21587 22178 +591
+ Partials 3502 3501 -1
| Flag | Coverage Δ | |
|---|---|---|
| server-mariadb | 66.60% <5.08%> (-0.23%) |
:arrow_down: |
| server-postgres | 66.64% <5.08%> (-0.22%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
oops this (or something else) breaks comments somehow 👀
@ankush, that's weird. I can look into a bug report if you have one.
TypeError: frappe.template.compile(...) is not a function
at frappe.render (microtemplate.js:100:42)
at frappe.render_template (microtemplate.js:114:16)
at FormTimeline.get_comment_timeline_content (form_timeline.js:289:36)
at FormTimeline.get_comment_timeline_item (form_timeline.js:283:18)
at form_timeline.js:270:40
at Array.forEach (<anonymous>)
at FormTimeline.get_comment_timeline_contents (form_timeline.js:269:34)
at FormTimeline.prepare_timeline_contents (form_timeline.js:159:36)
at FormTimeline.render_timeline_items (base_timeline.js:51:23)
at FormTimeline.render_timeline_items (form_timeline.js:112:9)
It's probably not related to this PR.
To reproduce add a comment on any form and refresh the page.
Looking into it.

test failing since yesterday, no good.
@mergifyio backport version-14-hotfix
backport version-14-hotfix
❌ No backport have been created
- Backport to branch
version-14-hotfixfailed Pull request with merge commit are not supported