Repository navigation
fix: register both after_migrate hooks so bf_contract custom field is created - #11
Merged
Merged
Conversation
… created hooks.py assigned after_migrate twice. The second assignment replaced the first, so consms.custom_fields.create_custom_fields never ran. Sales Invoice had no bf_contract field, and the BF Contract dashboard failed with "Unknown column 'tabSales Invoice.bf_contract'". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
On production, opening a BF Contract fails:
hooks.pyassignedafter_migratetwo times. The second assignment replaced the first. Because of this,consms.custom_fields.create_custom_fieldsdid not run on migrate, and thebf_contractcustom field was not created on Sales Invoice. The BF Contract dashboard counts linked Sales Invoices bybf_contract, so the query fails.Fix
Merge the two hooks into one list, so that both functions run:
Both functions use Frappe's
create_custom_fields. It is safe to run them again on sites that already have the fields.After merge
Run
bench --site <site> migrateon each site that has consms installed.🤖 Generated with Claude Code