Merge pull request #4535 from nabinhait/defaults

[fix] Get defaults based on doctype or fieldname
diff --git a/erpnext/docs/assets/img/articles/$SGrab_418.png b/erpnext/docs/assets/img/articles/$SGrab_418.png
deleted file mode 100644
index f778921..0000000
--- a/erpnext/docs/assets/img/articles/$SGrab_418.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/$SGrab_419.png b/erpnext/docs/assets/img/articles/$SGrab_419.png
deleted file mode 100644
index c396ba7..0000000
--- a/erpnext/docs/assets/img/articles/$SGrab_419.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/$SGrab_420.png b/erpnext/docs/assets/img/articles/$SGrab_420.png
deleted file mode 100644
index 9b3522e..0000000
--- a/erpnext/docs/assets/img/articles/$SGrab_420.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/Selection_0124080f1.png b/erpnext/docs/assets/img/articles/Selection_0124080f1.png
deleted file mode 100644
index cca65ac..0000000
--- a/erpnext/docs/assets/img/articles/Selection_0124080f1.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/Selection_014.png b/erpnext/docs/assets/img/articles/Selection_014.png
deleted file mode 100644
index f830942..0000000
--- a/erpnext/docs/assets/img/articles/Selection_014.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/Selection_019811b13.png b/erpnext/docs/assets/img/articles/Selection_019811b13.png
deleted file mode 100644
index dc669b8..0000000
--- a/erpnext/docs/assets/img/articles/Selection_019811b13.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/Selection_021ac61a5.png b/erpnext/docs/assets/img/articles/Selection_021ac61a5.png
deleted file mode 100644
index 49ad7e3..0000000
--- a/erpnext/docs/assets/img/articles/Selection_021ac61a5.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/Sselection_013.png b/erpnext/docs/assets/img/articles/Sselection_013.png
deleted file mode 100644
index 046de3c..0000000
--- a/erpnext/docs/assets/img/articles/Sselection_013.png
+++ /dev/null
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/current-no-1.png b/erpnext/docs/assets/img/articles/current-no-1.png
new file mode 100644
index 0000000..de748e8
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/current-no-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/current-no-2.png b/erpnext/docs/assets/img/articles/current-no-2.png
new file mode 100644
index 0000000..7793098
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/current-no-2.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/current-no-3.png b/erpnext/docs/assets/img/articles/current-no-3.png
new file mode 100644
index 0000000..c0dbb7c
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/current-no-3.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/overwrite-1.gif b/erpnext/docs/assets/img/articles/overwrite-1.gif
new file mode 100644
index 0000000..1ed4294
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/overwrite-1.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/overwrite-2.png b/erpnext/docs/assets/img/articles/overwrite-2.png
new file mode 100644
index 0000000..6ea628a
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/overwrite-2.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/overwrite-3.gif b/erpnext/docs/assets/img/articles/overwrite-3.gif
new file mode 100644
index 0000000..99e40c4
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/overwrite-3.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/overwrite-4.png b/erpnext/docs/assets/img/articles/overwrite-4.png
new file mode 100644
index 0000000..eb2ce16
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/overwrite-4.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/rename-user-1.png b/erpnext/docs/assets/img/articles/rename-user-1.png
new file mode 100644
index 0000000..b141869
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/rename-user-1.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/rename-user-2.png b/erpnext/docs/assets/img/articles/rename-user-2.png
new file mode 100644
index 0000000..53ef944
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/rename-user-2.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/territory-1.gif b/erpnext/docs/assets/img/articles/territory-1.gif
new file mode 100644
index 0000000..5a578d1
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/territory-1.gif
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/territory-2.png b/erpnext/docs/assets/img/articles/territory-2.png
new file mode 100644
index 0000000..4ce6c62
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/territory-2.png
Binary files differ
diff --git a/erpnext/docs/assets/img/articles/territory-3.png b/erpnext/docs/assets/img/articles/territory-3.png
new file mode 100644
index 0000000..24f6111
--- /dev/null
+++ b/erpnext/docs/assets/img/articles/territory-3.png
Binary files differ
diff --git a/erpnext/docs/user/manual/en/setting-up/articles/integrating-erpnext-with-other-application.md b/erpnext/docs/user/manual/en/setting-up/articles/integrating-erpnext-with-other-application.md
index 2bda7ca..2d2c179 100644
--- a/erpnext/docs/user/manual/en/setting-up/articles/integrating-erpnext-with-other-application.md
+++ b/erpnext/docs/user/manual/en/setting-up/articles/integrating-erpnext-with-other-application.md
@@ -1,14 +1,7 @@
 #Integrating ERPNext with other Applications
 
-For now, ERPNext doesn't have out-of-the-box integration available for the third party applications. However, Frappe has REST API using which you can get ERPNext integrated with any other solution.
+For now, ERPNext has out-of-the-box integration available for some applications like Shopify, your SMS gateway and payment gateway. To integrate ERPNext with other application, you can use REST API of Frappe. Check following links to learn more about REST API of Frappe.
 
-Learn more about Frappe API here.
-
-[https://frappe.io/help/rest_api](https://frappe.io/help/rest_api)
-
-For experts services on integration, you can connect with our service providers from community portal.
-
-[https://community.eprnext.com/service-providers](https://community.erpnext.com/service-providers)
-
+[Frappe Rest API](https://frappe.github.io/frappe/user/guides/integration/rest_api.html)
 
 <!-- markdown -->
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/setting-up/articles/manage-header-and-footer.md b/erpnext/docs/user/manual/en/setting-up/articles/manage-header-and-footer.md
index 73c4834..24a9a55 100644
--- a/erpnext/docs/user/manual/en/setting-up/articles/manage-header-and-footer.md
+++ b/erpnext/docs/user/manual/en/setting-up/articles/manage-header-and-footer.md
@@ -2,8 +2,8 @@
 
 Check following to learn how to setup Letter Head in ERPNext.
 
-[Managing Letter Head](https://frappe.github.io/erpnext/user/manual/en/setting-up/setup-wizard/step-5-letterhead-and-logo.html)
+[Managing Letter head]({{docs_base_url}}/user/manual/en/setting-up/setup-wizard/step-5-letterhead-and-logo.html)
 
 ERPNext doesn't have option to define standard Footer. As a work around, you can use Terms and Condition master for footer. Content of Terms and Condition is already the last to appear in the standard print formats on transactions. Check following link to learn how to manage Terms and Conditions in ERPNext.
 
-[Terms and Condition](https://frappe.github.io/erpnext/user/manual/en/setting-up/print/terms-and-conditions.html)
+[Terms and Condition]({{docs_base_url}}/user/manual/en/setting-up/print/terms-and-conditions.html)
diff --git a/erpnext/docs/user/manual/en/setting-up/articles/managing-multiple-companies.md b/erpnext/docs/user/manual/en/setting-up/articles/managing-multiple-companies.md
index fed7612..40c12f4 100644
--- a/erpnext/docs/user/manual/en/setting-up/articles/managing-multiple-companies.md
+++ b/erpnext/docs/user/manual/en/setting-up/articles/managing-multiple-companies.md
@@ -4,7 +4,7 @@
 
 In one account has multiple companies, you will find option to select Company in each transactions. While most of the records (mostly transactions) will be separated based on Company, there are few masters like Item, Item Group, Customer Group, Territory etc. which are common among all the companies.
 
-If you have separate teams working on each company, you can restrict access of the User to the data of specific Company. Click [here](http://frappe.github.io/erpnext/user/manual/en/setting-up/users-and-permissions/) to know how to set permission rules for giving restricted access to the User.
+If you have separate teams working on each company, you can restrict access of the User to the data of specific Company. Click [here]({{docs_base_url}}/user/manual/en/setting-up/users-and-permissions/) to know how to set permission rules for giving restricted access to the User.
 
 Following are the steps to add new Company.
 
diff --git a/erpnext/docs/user/manual/en/setting-up/articles/managing-perm-level.md b/erpnext/docs/user/manual/en/setting-up/articles/managing-perm-level.md
index d7fa47f..308a0a7 100644
--- a/erpnext/docs/user/manual/en/setting-up/articles/managing-perm-level.md
+++ b/erpnext/docs/user/manual/en/setting-up/articles/managing-perm-level.md
@@ -2,7 +2,7 @@
 
 In each document, you can group fields by "levels". Each group of field is denoted by a unique number (0, 1, 2, 3 etc.). A separate set of permission rules can be applied to each field group. By default all fields are of level 0.
 
-Perm Level for a field can be defined in the [Customize Form](https://frappe.github.io/erpnext/user/manual/en/customize-erpnext/customize-form.html).
+Perm Level for a field can be defined in the [Customize Form](docs_base_url}}/user/manual/en/customize-erpnext/customize-form.html).
 
 <img alt="Perm Level Field" class="screenshot" src="{{docs_base_url}}/assets/img/articles/perm-level-1.gif">
 
diff --git a/erpnext/docs/user/manual/en/setting-up/articles/managing-tree-structure-masters.md b/erpnext/docs/user/manual/en/setting-up/articles/managing-tree-structure-masters.md
index 499a654..98e67c6 100644
--- a/erpnext/docs/user/manual/en/setting-up/articles/managing-tree-structure-masters.md
+++ b/erpnext/docs/user/manual/en/setting-up/articles/managing-tree-structure-masters.md
@@ -1,6 +1,6 @@
 #Managing Tree Structure Masters
 
-Some of the masters in ERPNext are maintained in tree structure. Tree structured masters allow you to set parent master, and child masters under those parents. Setting up this structure allows you creating intelligent report, and track growth at each level in the hierarchy. 
+Some of the masters in ERPNext are maintained in tree structure. Tree structured masters allow you to set Parent master, and Child masters under those Parents. Setting up this structure allows you creating intelligent report, and track growth at each level in the hierarchy. 
 
 Following is the partial list of masters which are maintained in the tree structure.
 
@@ -22,17 +22,13 @@
 
 `Selling > Setup > Territory`
 
-Also you can type master name in Awesome Bar to go to the related master.
+####Step 2 : Parent Territory
 
-Tree master allows you to set parent Territories, and Child Territories Groups under those parents.
+<img alt="Default Territories" class="screenshot" src="{{docs_base_url}}/assets/img/articles/territory-2.png">
 
-####Step 2 : New Parent Territory
+When click on Parent territory, you will see option to add child territory under it. All default Territory groups will be listed under Parent group called "All Territories". You can add further Parent or child Territory Groups under it.
 
-![Territory Group]({{docs_base_url}}/assets/img/articles/Sselection_013.png)
-
-When click on Parent Territory, you will see option to add child territory under it. All default Territory groups will be listed under parent group called "All Territories". You can add further parent or child Territory Groups under it.
-
-####Step 3: Name The Territory Group
+####Step 3: Add new Territory
 
 When click on Add Child, a dialog box will provide two fields.
 
@@ -45,12 +41,13 @@
 If Group Node selected as Yes, then this Territory will be created as Parent, which means you can further create sub-territories under it. If select No, then it will become child Territory which you will be able to select in another masters.
 
 <div class="well">Only child Territory Groups are selectable in another masters and transactions.</div>
-![Child Territory]({{docs_base_url}}/assets/img/articles/Selection_0124080f1.png)
+
+<img alt="Default Territories" class="screenshot" src="{{docs_base_url}}/assets/img/articles/territory-1.gif">
 
 Following is how Child Territories will be listed under a Parent Territory.
 
-![Territory Tree]({{docs_base_url}}/assets/img/articles/Selection_014.png)
+<img alt="Adding new Territories" class="screenshot" src="{{docs_base_url}}/assets/img/articles/territory-3.png">
 
-Following this steps, you can manage other tree masters in ERPNext.
+Following this steps, you can manage other tree masters as well in ERPNext.
 
 <!-- markdown -->
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/setting-up/articles/naming-series-current-value.md b/erpnext/docs/user/manual/en/setting-up/articles/naming-series-current-value.md
index 47cf1a4..2e7145d 100644
--- a/erpnext/docs/user/manual/en/setting-up/articles/naming-series-current-value.md
+++ b/erpnext/docs/user/manual/en/setting-up/articles/naming-series-current-value.md
@@ -1,8 +1,6 @@
-<h1>Setting the Current Value for Naming Series</h1>
+#Setting the Current Value for Naming Series
 
-<h1>Setting the Current Value for Naming Series</h1>
-
-Naming Series feature allows you to define prefix for number series of documents. For example, if a Sales Order has prefix "SO", then the series will be generated as SO00001, SO00002... and so on. Click [here](https://erpnext.com/user-guide/setting-up/document-naming-series) to learn how you can customize Number Series for a transaction/master in ERPNext.
+Naming Series feature allows you to define prefix for naming of a documents. For example, if a Sales Order has prefix "SO", then the series will be generated as SO-00001, SO-00002... and so on. Click [here]({{docs_base_url}}/user/manual/en/setting-up/settings/naming-series.html) to learn how you can customize Number Series for a transaction/master in ERPNext.
 
 ### 1. Setting the Current Value
 
@@ -16,19 +14,19 @@
 
 #### Update Series Section
 
-![Update Series Section]({{docs_base_url}}/assets/img/articles/$SGrab_420.png)
+<img alt="Update Series Section" class="screenshot" src="{{docs_base_url}}/assets/img/articles/current-no-1.png">
 
 #### Select Prefix
 
 Considering our scenario, prefix for Sales Order will be "SO".
 
-![Series Prefix]({{docs_base_url}}/assets/img/articles/$SGrab_418.png)
+<img alt="Series Prefix" class="screenshot" src="{{docs_base_url}}/assets/img/articles/current-no-2.png">
 
 #### Current Value
 
 If you have currently 12 Sales Orders created in your account, then current value updated will be 12. You can edit Current Value to 322, and then click on Update Series Number.
 
-![Series Current Value]({{docs_base_url}}/assets/img/articles/$SGrab_419.png)
+<img alt="Series Current Value" class="screenshot" src="{{docs_base_url}}/assets/img/articles/current-no-3.png">
 
 With this setting, you will have numbering for the New Sales Orders starting with #323.
 
diff --git a/erpnext/docs/user/manual/en/setting-up/articles/overwriting-data-from-data-import-tool.html b/erpnext/docs/user/manual/en/setting-up/articles/overwriting-data-from-data-import-tool.html
deleted file mode 100644
index 1ae6cb5..0000000
--- a/erpnext/docs/user/manual/en/setting-up/articles/overwriting-data-from-data-import-tool.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<h1>Overwriting Data from Data Import Tool</h1>
-
-<h1>Overwriting Data from Data Import Tool</h1>
-
-Data Import Tool allows importing documents (like customers, Suppliers, Orders, Invoices etc.) from spreadsheet file into ERPNext. The very same tool can also be used for overwrite values in the existing documents.
-<br>
-<br><div class="well">Over-writing data from Data Import Tool works only for Saved transactions, and not for Submitted ones.</div>
-Let's assume there are no. of items for which we need to overwrite Item Group.
-Following are the steps to go about overwriting Item Groups for existing Items.<br><br><h4>Step 1: Download Template</h4><br>Template Used for overwriting data will be same as one used for importing new items. Hence, you should first download template from.<br><br>Setup &gt;&gt; Data &gt;&gt; Import/Export Data<br><br>Since items to be over-written will be already available in the system, while downloading template, "Download with data" field should be checked. With this, we will have all the existing items being downloaded with the template.<br><br><img src="{{docs_base_path}}/assets/img/articles/$SGrab_285.png"><br><br><h4>Step 2: Prepare Data</h4><br>In the download template, We will only keep rows of the items to be worked on and delete the rest. Then we will enter new value in the Item Group column for an item. Since Item Group is a master in itself, we should ensure that Item Group entered in the excel file is already available in the Item Group master as well.<br><br><img src="{{docs_base_path}}/assets/img/articles/$SGrab_287.png"><br><br>Since we are overwriting only Item Group, only following columns will be mandatory.<br><br><ol><li>Column A (since it has main values of template)<br></li><li>Name (Column B)<br></li><li>Item Group<br></li></ol>Columns of other field which won't have any impact of overwriting can be
- removed, even if they are mandatory. This is applicable only for 
-overwriting, and not when importing new records.<br><br><h4>Step 3: Import Data</h4><br>Once excel file is ready for importing, come back to Data Import Tool in ERPNext. We should first browser and select the File/template which has data to be overwritten. "Overwrite" field should be checked since we are overwriting Item Group in the existing items.<br><br><img src="{{docs_base_path}}/assets/img/articles/$SGrab_288.png"><br><br><h4>Step 4: Upload</h4><br>On clicking Upload and Import, if values as provided in the spreadsheet file is validated, it will be successfully updated in the item master.<br><br><img src="{{docs_base_path}}/assets/img/articles/$SGrab_289.png"><br><br>If validation of values fails, then it will indicate row no. of spreadsheet for which validation failed and needs correction. In that case, you should corrected value in that row, and then try importing/uploading file again. If validation fails for even one row, none of the records are imported/updated.<br>
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/setting-up/articles/overwriting-data-from-data-import-tool.md b/erpnext/docs/user/manual/en/setting-up/articles/overwriting-data-from-data-import-tool.md
new file mode 100644
index 0000000..5f28e32
--- /dev/null
+++ b/erpnext/docs/user/manual/en/setting-up/articles/overwriting-data-from-data-import-tool.md
@@ -0,0 +1,49 @@
+#Overwriting Data from Data Import Tool
+
+Data Import Tool allows importing documents (like customers, Suppliers, Orders, Invoices etc.) from spreadsheet file into ERPNext. The very same tool can also be used for overwrite values in the existing documents.
+
+<div class="well">Over-writing data from Data Import Tool works only for the saved transactions, and not for Submitted ones.</div>
+
+Let's assume there are no. of items for which we need to overwrite Item Group. Following are the steps to go about overwriting Item Groups for existing Items.
+
+####Step 1: Download Template
+
+Template Used for overwriting data will be same as one used for importing new items. Hence, you should first download template from.
+
+`Setup > Data > Import/Export Data'
+
+Since items to be over-written will be already available in the system, while downloading template, click on "Download with data" to get all the existing items in the template.
+
+<img alt="Download Template" class="screenshot" src="{{docs_base_url}}/assets/img/articles/overwrite-1.gif">
+	
+####Step 2: Prepare Data
+
+In the template, we can only keep rows of the items to be overwritten and delete the rest. 
+
+Enter new value in the Item Group column for an item. Since Item Group is a master in itself, ensure Item Group entered in the spreadsheet file is already added in the Item Group master.
+
+<img alt="Update Values" class="screenshot" src="{{docs_base_url}}/assets/img/articles/overwrite-2.png">
+
+Since we are overwriting only Item Group, only following columns will be mandatory.
+
+1. Column A (since it has main values of template)
+1. Name (Column B)
+1. Item Group
+
+Columns of other field which won't have any impact can be removed, even if they are mandatory. This is applicable only for overwriting, and not when importing new records.
+
+####Step 3: Browse Template
+
+After updating Item Groups in spreadheet, come back to Data Import Tool in ERPNext. Browser and select the File/template which has data to be overwritten.
+
+<img alt="Browse template" class="screenshot" src="{{docs_base_url}}/assets/img/articles/overwrite-3.gif">
+
+####Step 4: Upload
+
+On clicking Import, Item Group will be over-written.
+
+<img alt="Upload" class="screenshot" src="{{docs_base_url}}/assets/img/articles/overwrite-4.png">
+
+If validation of values fails, then it will indicate row no. of spreadsheet for which validation failed and needs correction. In that case, you should corrected value in that row of spreadsheet, and then import same file again. If validation fails even for one row, none of the records are imported/overwritten.
+
+<!-- markdown -->
\ No newline at end of file
diff --git a/erpnext/docs/user/manual/en/setting-up/articles/rename-user.md b/erpnext/docs/user/manual/en/setting-up/articles/rename-user.md
index 51fb637..79cefe1 100644
--- a/erpnext/docs/user/manual/en/setting-up/articles/rename-user.md
+++ b/erpnext/docs/user/manual/en/setting-up/articles/rename-user.md
@@ -1,31 +1,27 @@
-<h1>Rename User</h1>
-
-<h1>Rename User</h1>
+#Rename User
 
 Renaming functionality allows you to edit id of specific record. User is saved with person's email id. Only User with System Manager's role will be able to rename User IDs.
 
 Following are the steps to rename user id.
 
-#### Step 1: Go to User List
+#### Step 1: Users
 
-Setup &gt; Users &gt; User
+`Setup > Users > User`
 
-Click to open user id you want to rename.
+Open User to be renamed.
 
-#### Step 2: Go to Menu and click on Rename option. 
+#### Step 2: Rename
 
-When will you click on Rename option, pop up will open on same form. 
+From Menu, select Rename.
 
-<img src="{{docs_base_url}}/assets/img/articles/Selection_019811b13.png">
+<img alt="Rename" class="screenshot" src="{{docs_base_url}}/assets/img/articles/rename-user-1.png">
 
+#### Step 3: Update
 
-#### Step 3: Enter new user ID and Press Rename Button.
+Enter valid email id and click on Rename.
 
+<img alt="Update" class="screenshot" src="{{docs_base_url}}/assets/img/articles/rename-user-2.png"> 
 
-<img src="{{docs_base_url}}/assets/img/articles/Selection_021ac61a5.png"> 
-
-After successful renaming user can login to their ERPNext account with new ID.
-
-
+After successful renaming, User will be able login using updated user id.
 
 <!-- markdown -->
\ No newline at end of file