refactor: move allowed doctypes to accounts settings

- dropped 'allowed' field

(cherry picked from commit d5c58277cb)
This commit is contained in:
ruthra kumar
2026-04-14 10:18:39 +05:30
parent f785f36ad6
commit 151864079b
5 changed files with 40 additions and 17 deletions

View File

@@ -0,0 +1,10 @@
import frappe
def execute():
if allowed := frappe.get_hooks("repost_allowed_doctypes"):
accounts_settings = frappe.get_doc("Accounts Settings")
for x in allowed:
if x not in [t.document_type for t in accounts_settings.repost_allowed_types]:
accounts_settings.append("repost_allowed_types", {"document_type": x})
accounts_settings.save()