Merge pull request #6734 from KanchanChauhan/default-warehouse-in-item
Default warehouse in Item master
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index e5cdb1a..e7c9e7c 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -341,4 +341,5 @@
erpnext.patches.v7_0.repost_bin_qty_and_item_projected_qty
erpnext.patches.v7_1.set_prefered_contact_email
execute:frappe.db.sql("update `tabSingles` set value = 1 where field = 'unlink_payment_on_cancellation_of_invoice' and doctype = 'Accounts Settings'")
-execute:frappe.db.sql("update `tabStock Entry` set total_amount = null where purpose in('Repack', 'Manufacture')")
\ No newline at end of file
+execute:frappe.db.sql("update `tabStock Entry` set total_amount = null where purpose in('Repack', 'Manufacture')")
+erpnext.patches.v7_1.save_stock_settings
\ No newline at end of file
diff --git a/erpnext/patches/v7_1/save_stock_settings.py b/erpnext/patches/v7_1/save_stock_settings.py
new file mode 100644
index 0000000..83c27dc
--- /dev/null
+++ b/erpnext/patches/v7_1/save_stock_settings.py
@@ -0,0 +1,7 @@
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ stock_settings = frappe.get_doc('Stock Settings')
+ stock_settings.flags.ignore_mandatory = True
+ stock_settings.save()
diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.py b/erpnext/stock/doctype/stock_settings/stock_settings.py
index 7c67a65..68d64a2 100644
--- a/erpnext/stock/doctype/stock_settings/stock_settings.py
+++ b/erpnext/stock/doctype/stock_settings/stock_settings.py
@@ -10,7 +10,7 @@
class StockSettings(Document):
def validate(self):
- for key in ["item_naming_by", "item_group", "stock_uom", "allow_negative_stock"]:
+ for key in ["item_naming_by", "item_group", "stock_uom", "allow_negative_stock", "default_warehouse"]:
frappe.db.set_default(key, self.get(key, ""))
from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series