brotherton-erpnext/erpnext/patches/v7_2/set_null_value_to_fields.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
437 B
Python
Raw Normal View History

2017-01-19 08:52:29 +00:00
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
fields = {"Cost Center": "project", "Project": "cost_center"}
for budget_against, field in fields.items():
frappe.db.sql(""" update `tabBudget` set {field} = null
2017-01-20 07:05:22 +00:00
where budget_against = %s """.format(field = field), budget_against)