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

fix: DocType Number Card #23171

Merged
merged 3 commits into from
Nov 18, 2023
Merged

fix: DocType Number Card #23171

merged 3 commits into from
Nov 18, 2023

Conversation

barredterra
Copy link
Collaborator

@barredterra barredterra commented Nov 9, 2023

Problem

  • We have a whitelisted method that returns values for a Number Card and a standard number card of type "Custom" that makes use of it
  • On the production system, a System Manager wants to create other number cards that use the same whitelisted method, but with different filters

This was not possible, because standard Number Cards, especially ones of type "Custom", could not be duplicated and saved.

Solution

  • Don't copy value of "Is Standard" checkbox

    The field becomes read only in production, so after "Menu" > "Duplicate", it wasn't possible to disable "Is Standard " for the copy.

  • Disable/enable only the save button, not the entire form

    Disable form is a one way street and cannot adapt to changed conditions, e.g. changing value of "Is Standard" during duplication.

  • Move field descriptions to the doctype definition

    Unrelated refactor

The field becomes read only in production, so after
"Menu" > "Duplicate", it wasn't possible to disable
"Is Standard " for the copy.
Disable form is a one way street and cannot adapt to changed conditions
@barredterra barredterra requested review from a team and shariquerik and removed request for a team November 9, 2023 12:49
@barredterra barredterra changed the title number cards fix: DocType Number Card Nov 9, 2023
@barredterra barredterra added backport version-14-hotfix backport to version 14 backport version-15-hotfix Backport the PR to v15 labels Nov 9, 2023
@barredterra
Copy link
Collaborator Author

Failing cypress tests are unrelated

@shariquerik shariquerik self-assigned this Nov 18, 2023
@shariquerik shariquerik merged commit 0d0ff68 into frappe:develop Nov 18, 2023
23 of 26 checks passed
shariquerik added a commit that referenced this pull request Nov 18, 2023
@barredterra barredterra deleted the number-cards branch November 18, 2023 16:48
shariquerik added a commit that referenced this pull request Nov 18, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14 backport version-15-hotfix Backport the PR to v15
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants