brotherton-erpnext/erpnext/patches/v8_0/move_perpetual_inventory_setting.py
2017-06-20 10:21:33 +05:30

10 lines
420 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype('Company')
enabled = frappe.db.get_single_value("Accounts Settings", "auto_accounting_for_stock") or 0
frappe.db.sql("""update tabCompany set enable_perpetual_inventory = {0}""".format(enabled))