From d51b09282a60a3b15a77e894bc5b4685689fdd42 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 1 May 2015 20:31:11 +0530 Subject: [PATCH] link warehouse with account --- erpnext/patches.txt | 3 ++- erpnext/patches/v4_2/party_model.py | 5 ----- erpnext/patches/v5_0/link_warehouse_with_account.py | 9 +++++++++ 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 erpnext/patches/v5_0/link_warehouse_with_account.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index df2c694636..e147ee3d48 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -146,4 +146,5 @@ erpnext.patches.v4_2.fix_recurring_orders erpnext.patches.v4_2.delete_gl_entries_for_cancelled_invoices erpnext.patches.v5_0.project_costing erpnext.patches.v5_0.update_temporary_account -erpnext.patches.v5_0.update_advance_paid \ No newline at end of file +erpnext.patches.v5_0.update_advance_paid +erpnext.patches.v5_0.link_warehouse_with_account \ No newline at end of file diff --git a/erpnext/patches/v4_2/party_model.py b/erpnext/patches/v4_2/party_model.py index 897598fd29..ac9a141e25 100644 --- a/erpnext/patches/v4_2/party_model.py +++ b/erpnext/patches/v4_2/party_model.py @@ -15,11 +15,6 @@ def execute(): delete_individual_party_account() remove_customer_supplier_account_report() - -def link_warehouse_account(): - frappe.db.sql("""update tabAccount set warehouse=master_name - where ifnull(account_type, '') = 'Warehouse' and ifnull(master_name, '') != ''""") - def create_receivable_payable_account(): receivable_payable_accounts = frappe._dict() diff --git a/erpnext/patches/v5_0/link_warehouse_with_account.py b/erpnext/patches/v5_0/link_warehouse_with_account.py new file mode 100644 index 0000000000..87e9b49112 --- /dev/null +++ b/erpnext/patches/v5_0/link_warehouse_with_account.py @@ -0,0 +1,9 @@ +# 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(): + frappe.db.sql("""update tabAccount set warehouse=master_name + where ifnull(account_type, '') = 'Warehouse' and ifnull(master_name, '') != ''""") \ No newline at end of file