Merge branch 'master' of github.com:webnotes/erpnext
diff --git a/docs/docs.user.md b/docs/docs.user.md
index 2294d31..00128f0 100644
--- a/docs/docs.user.md
+++ b/docs/docs.user.md
@@ -33,6 +33,7 @@
 	1. [Concepts](docs.user.implement.concepts.html)
 1. [Setup](docs.user.setup.html)
 	1. [First Login](docs.user.setup.first.html)
+	1. [Setting Up Masters (Item, Customer, Supplier)](docs.user.setup.masters.html)
 	1. [Chart of Accounts](docs.user.setup.accounting.html)
 	1. [Chart of Cost Centers](docs.user.setup.cost_centers.html)
 	1. [Company Setup](docs.user.setup.company.html)
diff --git a/docs/docs.user.setup.codification.md b/docs/docs.user.setup.codification.md
index 650e173..513f7a9 100644
--- a/docs/docs.user.setup.codification.md
+++ b/docs/docs.user.setup.codification.md
@@ -3,9 +3,6 @@
 	"_label": "Item Codification"
 }
 ---
-
-> To Codify or Not To Codify, is the question.
-
 If you already have a running business with a number of physical items, you would have probably coded your items. If you have not, you have a choice. We recommend you should codify, but its your call.
 
 Item codification is always a sensitive topic and wars have been fought on this (not joking). In our experience, when you have items that cross a certain size, life without codification is a nightmare. 
diff --git a/docs/docs.user.setup.md b/docs/docs.user.setup.md
index afdd1d3..847a215 100644
--- a/docs/docs.user.setup.md
+++ b/docs/docs.user.setup.md
@@ -3,6 +3,7 @@
 	"_label": "Setting Up",
 	"_toc": [
 		"docs.user.setup.first",
+		"docs.user.setup.masters",
 		"docs.user.setup.accounting",
 		"docs.user.setup.cost_centers",
 		"docs.user.setup.company",
diff --git a/docs/docs.user.stock.item.md b/docs/docs.user.stock.item.md
index 0f4b106..958c454 100644
--- a/docs/docs.user.stock.item.md
+++ b/docs/docs.user.stock.item.md
@@ -1,21 +1,14 @@
 ---
 {
 	"_label": "Item Master",
-	"_title_image": "img/items.png"
+	"_toc": [
+		"docs.user.stock.valuation",
+		"docs.user.setup.codification"
+	]
 }
 ---
-Items, Customers and Suppliers form the foundation of any ERP system.
-
-It is very likely that you will have your masters ready in another system or a spread sheet  saved somewhere else. You may just need to import them. Before importing, it might be a good idea to understand how ERPNext manages these records.
-
----
-
-## Items
-
 An Item is simply a product or service which you sell or buy from your Customers or Suppliers. ERPNext is optimized for itemized management of your sales and purchase. However, you can skip creating Items. If you are in services, you can create an Item for each services that your offer.
 
-> Items are mandatory if you want to track inventory.
-
 There are two main categories of Items in ERPNext
 
 - Stock Items
@@ -24,10 +17,6 @@
 As you may have guessed, inventory balances are tracked for stock items and not for
 non-stock items. Non-stock items could be services or consumables that are not tracked.
 
-### Naming Items
-
-This is a complex topic [coming up next]. In ERPNext you can use item codes or names. If you do not want to codify, you can keep the item name and item code as the same.
-
 ### Item Groups
 
 ERPNext allows you to classify items into groups. This will help you in getting reports about various classes of items and also help in cataloging your items for the website.
@@ -60,31 +49,6 @@

 Why would you want Price Lists? You have different prices for different zones (based on the shipping costs), for different currencies, regions etc.
 
-### Item Valuation
-
-How are Items Valued?
-
-One of the major features of any inventory system is that you can find out the value of any item based on its historic or average price. You can also find the value of all your items for your balance sheet. Why is valuation important?
-
-- The buying price fluctuates.
-- The value changes because of some process (value add).
-- The value changes because of decay, loss etc.
-
-You may encounter these terms, so lets clarify:
-
-- Rate: Rate at which the transaction takes place.
-- Valuation Rate: Rate at which the items value is set for your valuation.
-
-There are two major ways in which ERPNext values your items.
-
-- **FIFO (First In First Out):** In this system, ERPNext assumes that you will consume / sell those Items first that you bought first. For example, if you buy an Item at price X and then after a few days at price Y. Thus when you sell your Item, ERPNext will reduce the quantity of the Item priced at X first and then Y.
-
-
-
-- **Moving Average:** In this method, ERPNext assumes that the value of the item at any point is the average price of the units of that Item in stock. For example, if the value of an Item is X in a Warehouse with quantity Y and another quantity Y1 is added to the Warehouse at cost X1, the new value X2 would be:
-
-> New Value X2 = (X * Y + X1 * Y1) / (Y + Y1)
-
 #### Negative Stock
 
 FIFO is the more accurate system of the two but has a disadvantage. You cannot have negative stock in FIFO. This means that you cannot make forward transactions that would make your stock negative. Why is this? Because sequences are so important to FIFO, you cannot track the value of the stock if it does not exist!
diff --git a/manufacturing/doctype/production_order/production_order.py b/manufacturing/doctype/production_order/production_order.py
index 625e567..65670a0 100644
--- a/manufacturing/doctype/production_order/production_order.py
+++ b/manufacturing/doctype/production_order/production_order.py
@@ -19,7 +19,7 @@
 
 from webnotes.utils import cstr, flt, nowdate
 from webnotes.model.code import get_obj
-from webnotes import msgprint
+from webnotes import msgprint, _
 
 sql = webnotes.conn.sql
 
@@ -63,8 +63,8 @@
 	def validate_production_order_against_so(self):
 		# already ordered qty
 		ordered_qty_against_so = webnotes.conn.sql("""select sum(qty) from `tabProduction Order`
-			where production_item = %s and sales_order = %s and docstatus < 2""", 
-			(self.doc.production_item, self.doc.sales_order))[0][0]
+			where production_item = %s and sales_order = %s and docstatus < 2 and name != %s""", 
+			(self.doc.production_item, self.doc.sales_order, self.doc.name))[0][0]
 
 		total_qty = flt(ordered_qty_against_so) + flt(self.doc.qty)
 		
@@ -80,11 +80,11 @@
 		so_qty = flt(so_item_qty) + flt(dnpi_qty)
 				
 		if total_qty > so_qty:
-			webnotes.msgprint("""Total production order qty for item: %s against sales order: %s \
-			 	will be %s, which is greater than sales order qty (%s). 
-				Please reduce qty or remove the item.""" %
-				(self.doc.production_item, self.doc.sales_order, 
-					total_qty, so_qty), raise_exception=1)
+			webnotes.msgprint(_("Total production order qty for item") + ": " + 
+				cstr(self.doc.production_item) + _(" against sales order") + ": " + 
+				cstr(self.doc.sales_order) + _(" will be ") + cstr(total_qty) + ", " + 
+				_("which is greater than sales order qty ") + "(" + cstr(so_qty) + ")" + 
+				_("Please reduce qty."), raise_exception=1)
 
 
 	def stop_unstop(self, status):
diff --git a/utilities/demo_docs/Lead.csv b/utilities/demo_docs/Lead.csv
index b12afdf..9471b21 100644
--- a/utilities/demo_docs/Lead.csv
+++ b/utilities/demo_docs/Lead.csv
@@ -17,52 +17,52 @@
 Type:,Data (text),Data,Select,Select,Data,Data,Select,Link,Link,Small Text,Data,Data,Data,Data,Link,Select,Link,Select,Link,Select,Link,Link,Date,Date,Link,Check,Check

 Info:,,,"One of: Open, Replied, Attempted to Contact, Contact in Future, Contacted, Interested, Not interested, Lead Lost, Converted","One of: LEAD, LEAD/10-11/, LEAD/MUMBAI/",,,"One of: Advertisement, Blog Post, Campaign, Call, Customer, Exhibition, Supplier, Website, Email",Valid Customer,Valid Campaign,,,,,,Valid Territory,"One of: Client, Channel Partner, Consultant",Valid Profile,"One of: Lower Income, Middle Income, Upper Income",Valid Industry Type,"One of: Product Enquiry, Request for Information, Suggestions, Other",Valid Quotation Lost Reason,Valid Profile,,,Valid Company,0 or 1,0 or 1

 Start entering data below this line,,,,,,,,,,,,,,,,,,,,,,,,,,,

-,,Mart Lakeman,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Saga Lundqvist,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Adna Sjöberg,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Ida Svendsen,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Emppu Hämeenniemi,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Eugenio Pisano,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Semhar Hagos,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Branimira Ivanković,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Shelly Fields,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Leo Mikulić,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Denisa Jarošová,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Janek Rutkowski,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,美月 宇藤,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Даниил Афанасьев,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Zorislav Petković,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Nanao Niwa,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Hreiðar Jörundsson,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Lai Chu,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Victor Aksakov,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Saidalim Bisliev,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Totte Jakobsson,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Naná Armas,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Walerian Duda,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Moarimikashi ,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Dobromił Dąbrowski ,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Teigan Sinclair,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Fahad Guirguis,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Morten Olsen,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Christian Baecker,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Sebastianus Dohmen,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Eero Koskinen,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,富奎 盧,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Milica Jelić,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Barbora Holubová,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Marta Kos,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Simret Zula,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Kamil Chlubna,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Aceline Bolduc,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Lucie Stupková,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Roland Solvik,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Mekirinzukushitakufu ,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Mukharbek Sultanovich,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Osman Amanuel,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,幸子 阪部,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Masakazu Kamitani,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Omran Sabbagh,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Rikako Matsumura,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Anayolisa Chukwukadibia,Passive,,,,,,,,,,,,,,,,,,,,,,,,

-,,Gudmunda Hinna,Passive,,,,,,,,,,,,,,,,,,,,,,,,
\ No newline at end of file
+,,Mart Lakeman,Passive,,Zany Brainy,MartLakeman@einrot.com,,,,,,,,,,,,,,,,,,,,,

+,,Saga Lundqvist,Passive,,Patterson-Fletcher,SagaLundqvist@dayrep.com,,,,,,,,,,,,,,,,,,,,,

+,,Adna Sjöberg,Passive,,Griff's Hamburgers,AdnaSjoberg@gustr.com,,,,,,,,,,,,,,,,,,,,,

+,,Ida Svendsen,Passive,,Rhodes Furniture,IdaDSvendsen@superrito.com,,,,,,,,,,,,,,,,,,,,,

+,,Emppu Hämeenniemi,Passive,,Burger Chef,EmppuHameenniemi@teleworm.us,,,,,,,,,,,,,,,,,,,,,

+,,Eugenio Pisano,Passive,,Stratabiz,EugenioPisano@cuvox.de,,,,,,,,,,,,,,,,,,,,,

+,,Semhar Hagos,Passive,,Home Quarters Warehouse,SemharHagos@einrot.com,,,,,,,,,,,,,,,,,,,,,

+,,Branimira Ivanković,Passive,,Enviro Architectural Designs,BranimiraIvankovic@einrot.com,,,,,,,,,,,,,,,,,,,,,

+,,Shelly Fields,Passive,,Ideal Garden Management,ShellyLFields@superrito.com,,,,,,,,,,,,,,,,,,,,,

+,,Leo Mikulić,Passive,,Listen Up,LeoMikulic@gustr.com,,,,,,,,,,,,,,,,,,,,,

+,,Denisa Jarošová,Passive,,I. Magnin,DenisaJarosova@teleworm.us,,,,,,,,,,,,,,,,,,,,,

+,,Janek Rutkowski,Passive,,First Rate Choice,JanekRutkowski@dayrep.com,,,,,,,,,,,,,,,,,,,,,

+,,美月 宇藤,Passive,,Multi Tech Development,@gustr.com,,,,,,,,,,,,,,,,,,,,,

+,,Даниил Афанасьев,Passive,,National Auto Parts,@einrot.com,,,,,,,,,,,,,,,,,,,,,

+,,Zorislav Petković,Passive,,Integra Investment Plan,ZorislavPetkovic@cuvox.de,,,,,,,,,,,,,,,,,,,,,

+,,Nanao Niwa,Passive,,The Lawn Guru,NanaoNiwa@superrito.com,,,,,,,,,,,,,,,,,,,,,

+,,Hreiðar Jörundsson,Passive,,Buena Vista Realty Service,HreiarJorundsson@armyspy.com,,,,,,,,,,,,,,,,,,,,,

+,,Lai Chu,Passive,,Bountiful Harvest Health Food Store,ChuThiBichLai@einrot.com,,,,,,,,,,,,,,,,,,,,,

+,,Victor Aksakov,Passive,,P. Samuels Men's Clothiers,VictorAksakov@dayrep.com,,,,,,,,,,,,,,,,,,,,,

+,,Saidalim Bisliev,Passive,,Vinyl Fever,SaidalimBisliev@cuvox.de,,,,,,,,,,,,,,,,,,,,,

+,,Totte Jakobsson,Passive,,Garden Master,TotteJakobsson@armyspy.com,,,,,,,,,,,,,,,,,,,,,

+,,Naná Armas,Passive,,Big Apple,NanaArmasRobles@cuvox.de,,,,,,,,,,,,,,,,,,,,,

+,,Walerian Duda,Passive,,Monk House Sales,WalerianDuda@dayrep.com,,,,,,,,,,,,,,,,,,,,,

+,,Moarimikashi ,Passive,,ManCharm,Moarimikashi@teleworm.us,,,,,,,,,,,,,,,,,,,,,

+,,Dobromił Dąbrowski ,Passive,,Custom Lawn Care,DobromilDabrowski@dayrep.com,,,,,,,,,,,,,,,,,,,,,

+,,Teigan Sinclair,Passive,,The Serendipity Dip,TeiganSinclair@gustr.com,,,,,,,,,,,,,,,,,,,,,

+,,Fahad Guirguis,Passive,,Cavages,FahadSaidGuirguis@gustr.com,,,,,,,,,,,,,,,,,,,,,

+,,Morten Olsen,Passive,,Gallenkamp,MortenJOlsen@armyspy.com,,,,,,,,,,,,,,,,,,,,,

+,,Christian Baecker,Passive,,Webcom Business Services,ChristianBaecker@armyspy.com,,,,,,,,,,,,,,,,,,,,,

+,,Sebastianus Dohmen,Passive,,Accord Investments,SebastianusDohmen@cuvox.de,,,,,,,,,,,,,,,,,,,,,

+,,Eero Koskinen,Passive,,American Appliance,EeroKoskinen@superrito.com,,,,,,,,,,,,,,,,,,,,,

+,,富奎 盧,Passive,,Bettendorf's,LuFuKui@teleworm.us,,,,,,,,,,,,,,,,,,,,,

+,,Milica Jelić,Passive,,House Of Denmark,MilicaJelic@dayrep.com,,,,,,,,,,,,,,,,,,,,,

+,,Barbora Holubová,Passive,,10000 Auto Parts,BarboraHolubova@cuvox.de,,,,,,,,,,,,,,,,,,,,,

+,,Marta Kos,Passive,,Mages,MartaKos@einrot.com,,,,,,,,,,,,,,,,,,,,,

+,,Simret Zula,Passive,,CSK Auto,SimretZula@cuvox.de,,,,,,,,,,,,,,,,,,,,,

+,,Kamil Chlubna,Passive,,Eagle Hardware & Garden,KamilChlubna@einrot.com,,,,,,,,,,,,,,,,,,,,,

+,,Aceline Bolduc,Passive,,Rustler Steak House,AcelineBolduc@armyspy.com,,,,,,,,,,,,,,,,,,,,,

+,,Lucie Stupková,Passive,,ABCO Foods,LucieStupkova@gustr.com,,,,,,,,,,,,,,,,,,,,,

+,,Roland Solvik,Passive,,Trak Auto,RolandSolvik@cuvox.de,,,,,,,,,,,,,,,,,,,,,

+,,Mekirinzukushitakufu ,Passive,,Choices,Mekirinzukushitakufu@teleworm.us,,,,,,,,,,,,,,,,,,,,,

+,,Mukharbek Sultanovich,Passive,,Megatronic,MukharbekSultanovich@cuvox.de,,,,,,,,,,,,,,,,,,,,,

+,,Osman Amanuel,Passive,,Handy Dan,OsmanAmanuel@dayrep.com,,,,,,,,,,,,,,,,,,,,,

+,,幸子 阪部,Passive,,Channel Home Centers,@armyspy.com,,,,,,,,,,,,,,,,,,,,,

+,,Masakazu Kamitani,Passive,,Honest Air Group,MasakazuKamitani@superrito.com,,,,,,,,,,,,,,,,,,,,,

+,,Omran Sabbagh,Passive,,Pleasures and Pasttimes,OmranNuhaidSabbagh@einrot.com,,,,,,,,,,,,,,,,,,,,,

+,,Rikako Matsumura,Passive,,Lazysize,RikakoMatsumura@einrot.com,,,,,,,,,,,,,,,,,,,,,

+,,Anayolisa Chukwukadibia,Passive,,Prestiga-Biz,AnayolisaChukwukadibia@einrot.com,,,,,,,,,,,,,,,,,,,,,

+,,Gudmunda Hinna,Passive,,Childs Restaurants,GudmundaHinna@armyspy.com,,,,,,,,,,,,,,,,,,,,,
\ No newline at end of file