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: Avoid changing Ref. Doctype in Accounting Dimension after creation #24579

Conversation

marination
Copy link
Collaborator

@marination marination commented Feb 8, 2021

Port of #24578

Issue:

  • On creating an Accounting Dimension, fieldname is set and custom fields are created
  • For e.g. Acc. Dimension Branch is created, fieldname is set as branch. Custom fields branch are created in doctypes that affect accounting ledgers
  • Now a user changes the Reference Document Type to Territory from Branch and Saves this record
  • Custom field creation does not run again as it runs only once on record creation. Hence, the doctype field change has no affect on the Accounting Dimension whatsoever
  • Now if you go to General Ledger Report, the filter field will show Territory and will try to search for results in custom field territory, which does not exist. branch exists.
         Unknown column 'territory' in where clause
    
  • Deleting Dimension Territory does not delete custom fields branch

Fix:

  • Made Reference Document Type a read only field after first save
  • Don't let users change this field as they are not aware custom fields are created based on it.
  • If a dimension was wrongly created, they must delete it , so that custom fields are deleted. And then create the appropriate one.
  • Validation for the same on server side for API manipulations.

@deepeshgarg007 deepeshgarg007 merged commit 179d826 into frappe:version-12-hotfix Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants