mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 04:39:11 +00:00
fix: Accounting Dimension custom fields should be admin owned (#19525)
* fix: Accounting Dimension custom fileds should be admin owned * fix: Update query * fix: Travis
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import get_doctypes_with_dimensions
|
||||
|
||||
def execute():
|
||||
accounting_dimensions = frappe.db.sql("""select fieldname from
|
||||
`tabAccounting Dimension`""", as_dict=1)
|
||||
|
||||
doclist = get_doctypes_with_dimensions()
|
||||
|
||||
for dimension in accounting_dimensions:
|
||||
frappe.db.sql("""
|
||||
UPDATE `tabCustom Field`
|
||||
SET owner = 'Administrator'
|
||||
WHERE fieldname = %s
|
||||
AND dt IN (%s)""" % #nosec
|
||||
('%s', ', '.join(['%s']* len(doclist))), tuple([dimension.fieldname] + doclist))
|
||||
Reference in New Issue
Block a user