[docs] major update
diff --git a/buying/doctype/purchase_common/purchase_common.js b/buying/doctype/purchase_common/purchase_common.js
index 67ba33c..5785b1a 100644
--- a/buying/doctype/purchase_common/purchase_common.js
+++ b/buying/doctype/purchase_common/purchase_common.js
@@ -333,10 +333,10 @@
// other charges added/deducted
if(tax_count) {
this.frm.doc.other_charges_added = wn.utils.sum($.map(this.frm.tax_doclist,
- function(tax) { return tax.add_deduct_tax == "Add" ? tax.tax_amount : 0.0; }));
+ function(tax) { return (tax.add_deduct_tax == "Add" && in_list(["Valuation and Total", "Total"], tax.category)) ? tax.tax_amount : 0.0; }));
this.frm.doc.other_charges_deducted = wn.utils.sum($.map(this.frm.tax_doclist,
- function(tax) { return tax.add_deduct_tax == "Deduct" ? tax.tax_amount : 0.0; }));
+ function(tax) { return (tax.add_deduct_tax == "Deduct" && in_list(["Valuation and Total", "Total"], tax.category)) ? tax.tax_amount : 0.0; }));
wn.model.round_floats_in(this.frm.doc, ["other_charges_added", "other_charges_deducted"]);
diff --git a/buying/doctype/supplier/supplier.py b/buying/doctype/supplier/supplier.py
index c646fdb..75b2e03 100644
--- a/buying/doctype/supplier/supplier.py
+++ b/buying/doctype/supplier/supplier.py
@@ -18,9 +18,6 @@
self.doc = doc
self.doclist = doclist
- def onload(self):
- self.add_communication_list()
-
def autoname(self):
supp_master_name = webnotes.defaults.get_global_default('supp_master_name')
diff --git a/buying/doctype/supplier/supplier.txt b/buying/doctype/supplier/supplier.txt
index 8fa7067..50202dc 100644
--- a/buying/doctype/supplier/supplier.txt
+++ b/buying/doctype/supplier/supplier.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:11",
"docstatus": 0,
- "modified": "2013-08-08 14:22:08",
+ "modified": "2013-09-02 16:25:44",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -205,6 +205,14 @@
"oldfieldtype": "Data"
},
{
+ "doctype": "DocField",
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication"
+ },
+ {
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
diff --git a/controllers/selling_controller.py b/controllers/selling_controller.py
index a13d747..5605ccf 100644
--- a/controllers/selling_controller.py
+++ b/controllers/selling_controller.py
@@ -99,6 +99,8 @@
for item in self.doclist.get({"parentfield": self.fname}):
if item.item_code in self.stock_items or \
(item_sales_bom and item_sales_bom.get(item.item_code)):
+
+ buying_amount = 0
if item.item_code in self.stock_items:
buying_amount = get_buying_amount(self.doc.doctype, self.doc.name,
item.name, stock_ledger_entries.get((item.item_code,
@@ -108,9 +110,10 @@
self.doc.doctype, self.doc.name, item.name, stock_ledger_entries,
item_sales_bom)
- item.buying_amount = buying_amount >= 0.01 and buying_amount or 0
- webnotes.conn.set_value(item.doctype, item.name, "buying_amount",
- item.buying_amount)
+ # buying_amount >= 0.01 so that gl entry doesn't get created for such small amounts
+ item.buying_amount = buying_amount >= 0.01 and buying_amount or 0
+ webnotes.conn.set_value(item.doctype, item.name, "buying_amount",
+ item.buying_amount)
def check_expense_account(self, item):
if item.buying_amount and not item.expense_account:
diff --git a/docs/docs.dev.api.md b/docs/dev/docs.dev.api.md
similarity index 100%
rename from docs/docs.dev.api.md
rename to docs/dev/docs.dev.api.md
diff --git a/docs/dev/docs.dev.client_script.md b/docs/dev/docs.dev.client_script.md
new file mode 100644
index 0000000..fc82f9d
--- /dev/null
+++ b/docs/dev/docs.dev.client_script.md
@@ -0,0 +1,10 @@
+---
+{
+ "_label": "Client Scripts: Custoimzing ERPNext"
+
+}
+---
+
+
+
+
diff --git a/docs/docs.dev.docs.md b/docs/dev/docs.dev.docs.md
similarity index 100%
rename from docs/docs.dev.docs.md
rename to docs/dev/docs.dev.docs.md
diff --git a/docs/docs.dev.install.md b/docs/dev/docs.dev.install.md
similarity index 100%
rename from docs/docs.dev.install.md
rename to docs/dev/docs.dev.install.md
diff --git a/docs/docs.dev.install.restore_from_backup.md b/docs/dev/docs.dev.install.restore_from_backup.md
similarity index 100%
rename from docs/docs.dev.install.restore_from_backup.md
rename to docs/dev/docs.dev.install.restore_from_backup.md
diff --git a/docs/docs.dev.md b/docs/dev/docs.dev.md
similarity index 96%
rename from docs/docs.dev.md
rename to docs/dev/docs.dev.md
index 3f645d8..285f176 100644
--- a/docs/docs.dev.md
+++ b/docs/dev/docs.dev.md
@@ -5,8 +5,9 @@
"docs.dev.install",
"docs.dev.quickstart",
"docs.dev.framework",
- "docs.dev.api",
"docs.dev.modules",
+ "docs.dev.client_script",
+ "docs.dev.api",
"docs.dev.translate",
"docs.dev.docs"
]
diff --git a/docs/docs.dev.modules.md b/docs/dev/docs.dev.modules.md
similarity index 100%
rename from docs/docs.dev.modules.md
rename to docs/dev/docs.dev.modules.md
diff --git a/docs/docs.dev.translate.md b/docs/dev/docs.dev.translate.md
similarity index 100%
rename from docs/docs.dev.translate.md
rename to docs/dev/docs.dev.translate.md
diff --git a/docs/templates/docs.html b/docs/templates/docs.html
new file mode 100644
index 0000000..ef3cf8e
--- /dev/null
+++ b/docs/templates/docs.html
@@ -0,0 +1,51 @@
+{% extends "lib/core/doctype/documentation_tool/docs.html" %}
+
+{% block navbar %}
+<div class="navbar navbar-default" style="border-bottom: 2px solid #c0392b">
+ <div class="container">
+ <button type="button" class="navbar-toggle"
+ data-toggle="collapse" data-target=".navbar-responsive-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="index.html">
+ <object data="img/splash.svg" class="erpnext-logo"
+ type="image/svg+xml"></object> erpnext.org</a>
+ <div class="collapse navbar-collapse navbar-responsive-collapse">
+ <ul class="nav navbar-nav">
+ <li><a href="docs.user.html">User</a></li>
+ <li><a href="docs.dev.html">Developer</a></li>
+ <li><a href="docs.user.help.html">Help</a></li>
+ <li><a href="docs.download.html">Download</a></li>
+ <li><a href="https://erpnext.com" target="_blank">Cloud</a></li>
+ </ul>
+ <ul class="nav navbar-nav pull-right">
+ <li><a href="docs.about.html">About</a></li>
+ </ul>
+ </div>
+ </div>
+</div>
+{% endblock %}
+
+{% block footer %}
+<hr />
+<div class="footer text-muted" style="font-size: 80%;">
+ <div class="content row">
+ <div class="col-md-12">
+ © <a href="https://erpnext.com">Web Notes</a> |
+ <a href="docs.user.help.html">Help</a> |
+ <a href="https://github.com/webnotes/erpnext" target="_blank">Code</a> |
+ <a href="docs.attributions.html">Attributions</a> |
+ <a href="https://erpnext.com">ERPNext Cloud</a> |
+ <a href="https://erpnext.com/partners">Find a Partner</a> |
+ <a href="https://erpnext.com/donate">Donate</a>
+ <br>
+ <p>
+ Code License: <a href="https://www.gnu.org/licenses/gpl.html">GNU/GPL 3</a>.
+ Documentation License: <a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA-3.0</a>.
+ </p>
+ </div>
+ </div>
+</div>
+{% endblock %}
\ No newline at end of file
diff --git a/docs/docs.user.accounts.closing.md b/docs/user/accounts/docs.user.accounts.closing.md
similarity index 100%
rename from docs/docs.user.accounts.closing.md
rename to docs/user/accounts/docs.user.accounts.closing.md
diff --git a/docs/docs.user.accounts.journal_voucher.md b/docs/user/accounts/docs.user.accounts.journal_voucher.md
similarity index 100%
rename from docs/docs.user.accounts.journal_voucher.md
rename to docs/user/accounts/docs.user.accounts.journal_voucher.md
diff --git a/docs/docs.user.accounts.md b/docs/user/accounts/docs.user.accounts.md
similarity index 100%
rename from docs/docs.user.accounts.md
rename to docs/user/accounts/docs.user.accounts.md
diff --git a/docs/docs.user.accounts.payments.md b/docs/user/accounts/docs.user.accounts.payments.md
similarity index 100%
rename from docs/docs.user.accounts.payments.md
rename to docs/user/accounts/docs.user.accounts.payments.md
diff --git a/docs/docs.user.accounts.pos.md b/docs/user/accounts/docs.user.accounts.pos.md
similarity index 100%
rename from docs/docs.user.accounts.pos.md
rename to docs/user/accounts/docs.user.accounts.pos.md
diff --git a/docs/docs.user.accounts.purchase_invoice.md b/docs/user/accounts/docs.user.accounts.purchase_invoice.md
similarity index 100%
rename from docs/docs.user.accounts.purchase_invoice.md
rename to docs/user/accounts/docs.user.accounts.purchase_invoice.md
diff --git a/docs/docs.user.accounts.reports.md b/docs/user/accounts/docs.user.accounts.reports.md
similarity index 100%
rename from docs/docs.user.accounts.reports.md
rename to docs/user/accounts/docs.user.accounts.reports.md
diff --git a/docs/docs.user.accounts.returns.md b/docs/user/accounts/docs.user.accounts.returns.md
similarity index 100%
rename from docs/docs.user.accounts.returns.md
rename to docs/user/accounts/docs.user.accounts.returns.md
diff --git a/docs/docs.user.accounts.sales_invoice.md b/docs/user/accounts/docs.user.accounts.sales_invoice.md
similarity index 100%
rename from docs/docs.user.accounts.sales_invoice.md
rename to docs/user/accounts/docs.user.accounts.sales_invoice.md
diff --git a/docs/docs.user.buying.material_request.md b/docs/user/buying/docs.user.buying.material_request.md
similarity index 100%
rename from docs/docs.user.buying.material_request.md
rename to docs/user/buying/docs.user.buying.material_request.md
diff --git a/docs/docs.user.buying.md b/docs/user/buying/docs.user.buying.md
similarity index 100%
rename from docs/docs.user.buying.md
rename to docs/user/buying/docs.user.buying.md
diff --git a/docs/docs.user.buying.purchase_order.md b/docs/user/buying/docs.user.buying.purchase_order.md
similarity index 100%
rename from docs/docs.user.buying.purchase_order.md
rename to docs/user/buying/docs.user.buying.purchase_order.md
diff --git a/docs/user/buying/docs.user.buying.purchase_taxes.md b/docs/user/buying/docs.user.buying.purchase_taxes.md
new file mode 100644
index 0000000..31e58bf
--- /dev/null
+++ b/docs/user/buying/docs.user.buying.purchase_taxes.md
@@ -0,0 +1,37 @@
+---
+{
+
+ "_label": "Purchase Taxes"
+}
+---
+For Tax Accounts that you want to use in the tax templates, you must mention them as type “Tax” in your Chart of Accounts.
+
+Similar to your Sales Taxes and Charges Master is the Purchase Taxes and Charges Master. This is the tax template that you can use in your Purchase Orders and Purchase Invoices.
+
+> Buying > Purchase Taxes and Charges Master > New Purchase Taxes and Charges Master
+
+
+![Purchase-Taxes](img/purchase-taxes.png)
+
+
+<br>
+
+
+You can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.
+
+If you select a particular tax as your Default tax, the system will apply this tax to all the purchase transactions by default.
+Calculation Type:
+
+This can be on Net Total (that is the sum of basic amount).
+On Previous Row Total / Amount (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.
+Actual (as mentioned).
+
+- **Account Head:** The Account ledger under which this tax will be booked.
+- **Cost Center:** If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.
+- **Description:** Description of the tax (that will be printed in invoices / quotes).
+- **Rate:** Tax rate.
+- **Amount:** Tax amount.
+- **Total:** Cumulative total to this point.
+- **Enter Row:** If based on "Previous Row Total" you can select the row number which will be taken as a base for this calculation (default is the previous row).
+- **Consider Tax or Charge for:** In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.
+- **Add or Deduct:** Whether you want to add or deduct the tax.
diff --git a/docs/docs.user.buying.supplier.md b/docs/user/buying/docs.user.buying.supplier.md
similarity index 100%
rename from docs/docs.user.buying.supplier.md
rename to docs/user/buying/docs.user.buying.supplier.md
diff --git a/docs/docs.user.buying.supplier_quotation.md b/docs/user/buying/docs.user.buying.supplier_quotation.md
similarity index 100%
rename from docs/docs.user.buying.supplier_quotation.md
rename to docs/user/buying/docs.user.buying.supplier_quotation.md
diff --git a/docs/user/buying/docs.user.buying.supplier_type.md b/docs/user/buying/docs.user.buying.supplier_type.md
new file mode 100644
index 0000000..deaf01f
--- /dev/null
+++ b/docs/user/buying/docs.user.buying.supplier_type.md
@@ -0,0 +1,19 @@
+---
+{
+ "_label": "Supplier Type"
+}
+---
+
+Based on what the suppliers supply, they are classified into different categories called Supplier Type.
+There can be different types of suppliers. You can create your own category of Supplier Type.
+
+> Buying > Supplier Type > New Supplier Type
+
+![Buying](img/supplier-type.png)
+
+You can classify your suppliers from a range of choice available in ERPNext. Choose from a set of given options like Distributor, Electrical,Hardware, Local, Pharmaceutical, Raw material, Services etc.
+
+Classifying your supplier into different types facilitates accounting and payments.
+
+
+Type your new supplier category and Save.
diff --git a/docs/docs.user.customize.custom_field.md b/docs/user/customize/docs.user.customize.custom_field.md
similarity index 100%
rename from docs/docs.user.customize.custom_field.md
rename to docs/user/customize/docs.user.customize.custom_field.md
diff --git a/docs/docs.user.customize.custom_form.md b/docs/user/customize/docs.user.customize.custom_form.md
similarity index 100%
rename from docs/docs.user.customize.custom_form.md
rename to docs/user/customize/docs.user.customize.custom_form.md
diff --git a/docs/docs.user.customize.md b/docs/user/customize/docs.user.customize.md
similarity index 100%
rename from docs/docs.user.customize.md
rename to docs/user/customize/docs.user.customize.md
diff --git a/docs/docs.user.customize.modules.md b/docs/user/customize/docs.user.customize.modules.md
similarity index 100%
rename from docs/docs.user.customize.modules.md
rename to docs/user/customize/docs.user.customize.modules.md
diff --git a/docs/docs.user.customize.print_format.md b/docs/user/customize/docs.user.customize.print_format.md
similarity index 100%
rename from docs/docs.user.customize.print_format.md
rename to docs/user/customize/docs.user.customize.print_format.md
diff --git a/docs/docs.user.help.md b/docs/user/docs.user.help.md
similarity index 100%
rename from docs/docs.user.help.md
rename to docs/user/docs.user.help.md
diff --git a/docs/docs.user.md b/docs/user/docs.user.md
similarity index 100%
rename from docs/docs.user.md
rename to docs/user/docs.user.md
diff --git a/docs/docs.user.projects.md b/docs/user/docs.user.projects.md
similarity index 100%
rename from docs/docs.user.projects.md
rename to docs/user/docs.user.projects.md
diff --git a/docs/docs.user.reports.builder.md b/docs/user/docs.user.reports.builder.md
similarity index 100%
rename from docs/docs.user.reports.builder.md
rename to docs/user/docs.user.reports.builder.md
diff --git a/docs/docs.user.reports.md b/docs/user/docs.user.reports.md
similarity index 100%
rename from docs/docs.user.reports.md
rename to docs/user/docs.user.reports.md
diff --git a/docs/docs.user.hr.appraisal.md b/docs/user/hr/docs.user.hr.appraisal.md
similarity index 100%
rename from docs/docs.user.hr.appraisal.md
rename to docs/user/hr/docs.user.hr.appraisal.md
diff --git a/docs/docs.user.hr.employee.md b/docs/user/hr/docs.user.hr.employee.md
similarity index 100%
rename from docs/docs.user.hr.employee.md
rename to docs/user/hr/docs.user.hr.employee.md
diff --git a/docs/docs.user.hr.expense_claim.md b/docs/user/hr/docs.user.hr.expense_claim.md
similarity index 100%
rename from docs/docs.user.hr.expense_claim.md
rename to docs/user/hr/docs.user.hr.expense_claim.md
diff --git a/docs/docs.user.hr.leave.md b/docs/user/hr/docs.user.hr.leave.md
similarity index 100%
rename from docs/docs.user.hr.leave.md
rename to docs/user/hr/docs.user.hr.leave.md
diff --git a/docs/docs.user.hr.md b/docs/user/hr/docs.user.hr.md
similarity index 100%
rename from docs/docs.user.hr.md
rename to docs/user/hr/docs.user.hr.md
diff --git a/docs/docs.user.hr.payroll.md b/docs/user/hr/docs.user.hr.payroll.md
similarity index 100%
rename from docs/docs.user.hr.payroll.md
rename to docs/user/hr/docs.user.hr.payroll.md
diff --git a/docs/docs.user.hr.setup.md b/docs/user/hr/docs.user.hr.setup.md
similarity index 100%
rename from docs/docs.user.hr.setup.md
rename to docs/user/hr/docs.user.hr.setup.md
diff --git a/docs/docs.user.implement.concepts.md b/docs/user/intro/docs.user.implement.concepts.md
similarity index 100%
rename from docs/docs.user.implement.concepts.md
rename to docs/user/intro/docs.user.implement.concepts.md
diff --git a/docs/docs.user.implement.md b/docs/user/intro/docs.user.implement.md
similarity index 100%
rename from docs/docs.user.implement.md
rename to docs/user/intro/docs.user.implement.md
diff --git a/docs/docs.user.implement.strategy.md b/docs/user/intro/docs.user.implement.strategy.md
similarity index 100%
rename from docs/docs.user.implement.strategy.md
rename to docs/user/intro/docs.user.implement.strategy.md
diff --git a/docs/docs.user.intro.md b/docs/user/intro/docs.user.intro.md
similarity index 100%
rename from docs/docs.user.intro.md
rename to docs/user/intro/docs.user.intro.md
diff --git a/docs/docs.user.intro.open_source.md b/docs/user/intro/docs.user.intro.open_source.md
similarity index 100%
rename from docs/docs.user.intro.open_source.md
rename to docs/user/intro/docs.user.intro.open_source.md
diff --git a/docs/docs.user.intro.try.md b/docs/user/intro/docs.user.intro.try.md
similarity index 100%
rename from docs/docs.user.intro.try.md
rename to docs/user/intro/docs.user.intro.try.md
diff --git a/docs/docs.user.mfg.bom.md b/docs/user/mfg/docs.user.mfg.bom.md
similarity index 100%
rename from docs/docs.user.mfg.bom.md
rename to docs/user/mfg/docs.user.mfg.bom.md
diff --git a/docs/docs.user.mfg.md b/docs/user/mfg/docs.user.mfg.md
similarity index 100%
rename from docs/docs.user.mfg.md
rename to docs/user/mfg/docs.user.mfg.md
diff --git a/docs/docs.user.mfg.planning.md b/docs/user/mfg/docs.user.mfg.planning.md
similarity index 100%
rename from docs/docs.user.mfg.planning.md
rename to docs/user/mfg/docs.user.mfg.planning.md
diff --git a/docs/docs.user.mfg.production_order.md b/docs/user/mfg/docs.user.mfg.production_order.md
similarity index 100%
rename from docs/docs.user.mfg.production_order.md
rename to docs/user/mfg/docs.user.mfg.production_order.md
diff --git a/docs/docs.user.selling.customer.md b/docs/user/selling/docs.user.selling.customer.md
similarity index 100%
rename from docs/docs.user.selling.customer.md
rename to docs/user/selling/docs.user.selling.customer.md
diff --git a/docs/docs.user.selling.lead.md b/docs/user/selling/docs.user.selling.lead.md
similarity index 100%
rename from docs/docs.user.selling.lead.md
rename to docs/user/selling/docs.user.selling.lead.md
diff --git a/docs/docs.user.selling.md b/docs/user/selling/docs.user.selling.md
similarity index 100%
rename from docs/docs.user.selling.md
rename to docs/user/selling/docs.user.selling.md
diff --git a/docs/docs.user.selling.opportunity.md b/docs/user/selling/docs.user.selling.opportunity.md
similarity index 100%
rename from docs/docs.user.selling.opportunity.md
rename to docs/user/selling/docs.user.selling.opportunity.md
diff --git a/docs/docs.user.selling.quotation.md b/docs/user/selling/docs.user.selling.quotation.md
similarity index 100%
rename from docs/docs.user.selling.quotation.md
rename to docs/user/selling/docs.user.selling.quotation.md
diff --git a/docs/docs.user.selling.sales_order.md b/docs/user/selling/docs.user.selling.sales_order.md
similarity index 100%
rename from docs/docs.user.selling.sales_order.md
rename to docs/user/selling/docs.user.selling.sales_order.md
diff --git a/docs/docs.user.setup.accounting.md b/docs/user/setup/docs.user.setup.accounting.md
similarity index 100%
rename from docs/docs.user.setup.accounting.md
rename to docs/user/setup/docs.user.setup.accounting.md
diff --git a/docs/docs.user.setup.codification.md b/docs/user/setup/docs.user.setup.codification.md
similarity index 100%
rename from docs/docs.user.setup.codification.md
rename to docs/user/setup/docs.user.setup.codification.md
diff --git a/docs/docs.user.setup.cost_centers.md b/docs/user/setup/docs.user.setup.cost_centers.md
similarity index 100%
rename from docs/docs.user.setup.cost_centers.md
rename to docs/user/setup/docs.user.setup.cost_centers.md
diff --git a/docs/docs.user.setup.data_import.md b/docs/user/setup/docs.user.setup.data_import.md
similarity index 100%
rename from docs/docs.user.setup.data_import.md
rename to docs/user/setup/docs.user.setup.data_import.md
diff --git a/docs/docs.user.setup.email.md b/docs/user/setup/docs.user.setup.email.md
similarity index 100%
rename from docs/docs.user.setup.email.md
rename to docs/user/setup/docs.user.setup.email.md
diff --git a/docs/docs.user.setup.first.md b/docs/user/setup/docs.user.setup.first.md
similarity index 100%
rename from docs/docs.user.setup.first.md
rename to docs/user/setup/docs.user.setup.first.md
diff --git a/docs/docs.user.setup.letter_head.md b/docs/user/setup/docs.user.setup.letter_head.md
similarity index 100%
rename from docs/docs.user.setup.letter_head.md
rename to docs/user/setup/docs.user.setup.letter_head.md
diff --git a/docs/docs.user.setup.masters.md b/docs/user/setup/docs.user.setup.masters.md
similarity index 100%
rename from docs/docs.user.setup.masters.md
rename to docs/user/setup/docs.user.setup.masters.md
diff --git a/docs/docs.user.setup.md b/docs/user/setup/docs.user.setup.md
similarity index 100%
rename from docs/docs.user.setup.md
rename to docs/user/setup/docs.user.setup.md
diff --git a/docs/docs.user.setup.opening.md b/docs/user/setup/docs.user.setup.opening.md
similarity index 100%
rename from docs/docs.user.setup.opening.md
rename to docs/user/setup/docs.user.setup.opening.md
diff --git a/docs/docs.user.setup.permissions.md b/docs/user/setup/docs.user.setup.permissions.md
similarity index 100%
rename from docs/docs.user.setup.permissions.md
rename to docs/user/setup/docs.user.setup.permissions.md
diff --git a/docs/user/setup/docs.user.setup.price_list.md b/docs/user/setup/docs.user.setup.price_list.md
new file mode 100644
index 0000000..0103cc3d
--- /dev/null
+++ b/docs/user/setup/docs.user.setup.price_list.md
@@ -0,0 +1,15 @@
+---
+{
+ "_label": "Price Lists"
+}
+---
+
+Price List is a table of sale price for an Item. An Item can have multiple prices based on customer, currency, region, shipping cost etc.
+
+A Price List is a place where different rate plans can be stored. It’s a name you can give to a set of Item prices. In case you have different zones (based on the shipping costs), for different currencies etc, you can maintain different Price Lists.You can maintain a Price List for your international customers with USD as transacting currency.
+
+
+![Price-List](img/price-lists.png)
+
+
+ A Price List is formed when you create different Item Prices. To import Item Price visit “Import Item Price”.
\ No newline at end of file
diff --git a/docs/docs.user.setup.series.md b/docs/user/setup/docs.user.setup.series.md
similarity index 100%
rename from docs/docs.user.setup.series.md
rename to docs/user/setup/docs.user.setup.series.md
diff --git a/docs/docs.user.setup.taxes.md b/docs/user/setup/docs.user.setup.taxes.md
similarity index 100%
rename from docs/docs.user.setup.taxes.md
rename to docs/user/setup/docs.user.setup.taxes.md
diff --git a/docs/docs.user.stock.delivery_note.md b/docs/user/stock/docs.user.stock.delivery_note.md
similarity index 100%
rename from docs/docs.user.stock.delivery_note.md
rename to docs/user/stock/docs.user.stock.delivery_note.md
diff --git a/docs/docs.user.stock.item.md b/docs/user/stock/docs.user.stock.item.md
similarity index 100%
rename from docs/docs.user.stock.item.md
rename to docs/user/stock/docs.user.stock.item.md
diff --git a/docs/user/stock/docs.user.stock.item_group.md b/docs/user/stock/docs.user.stock.item_group.md
new file mode 100644
index 0000000..aca2a78
--- /dev/null
+++ b/docs/user/stock/docs.user.stock.item_group.md
@@ -0,0 +1,9 @@
+---
+{
+ "_label": "Item Group"
+}
+---
+
+Item Group is the classification category. Depending on the type of product, you have to categorise it under its respective field. If the product is service oriented, you have to name it under the group head Service. If the product is used as a raw-material, you have to name it under the Raw-material category. In case, your product is used only in trading, you can categorise it under Trading.
+
+You can also create your own groups . Go to Setup- Master Data- Item Group- Item Group Tree- Add Child.
diff --git a/docs/user/stock/docs.user.stock.material_issue b/docs/user/stock/docs.user.stock.material_issue
new file mode 100644
index 0000000..e372e7f
--- /dev/null
+++ b/docs/user/stock/docs.user.stock.material_issue
@@ -0,0 +1,26 @@
+---
+{
+ "_label": "Material Issue"
+}
+---
+
+A Warehouse stocks materials required for manufacturing or trading. The Material Issue form has to be submitted to order materials out of a Warehouse by any department.
+
+> Stock > Stock Entry > New Stock Entry
+
+
+Go to Stock Entry.
+Click on New Stock Entry
+Select the option “Material Issue” under Purpose.
+Provide Source Warehouse details.
+Provide the BOM Number.
+Save
+
+
+![Material Issue](img/material-issue.png)
+
+
+
+
+
+Note: If you have done a stock entry and selected “Material Issue” under Purpose, that particular amount of stock will reflect as negative in stock details.
diff --git a/docs/user/stock/docs.user.stock.material_issue.md b/docs/user/stock/docs.user.stock.material_issue.md
new file mode 100644
index 0000000..45e3d98
--- /dev/null
+++ b/docs/user/stock/docs.user.stock.material_issue.md
@@ -0,0 +1,26 @@
+---
+{
+ "_label": "Material Issue"
+}
+---
+
+A Warehouse stocks materials required for manufacturing or trading. The Material Issue form has to be submitted to order materials out of a Warehouse by any department.
+
+> Stock > Stock Entry > New Stock Entry
+
+
+Go to Stock Entry.
+Click on New Stock Entry
+Select the option “Material Issue” under Purpose.
+Provide Source Warehouse details.
+Provide the BOM Number.
+Save
+
+
+![Material Issue](img/material-issue.png)
+
+
+
+
+
+Note: If you have done a stock entry and selected “Material Issue” under Purpose, that particular amount of stock will reflect as negative in stock details.
\ No newline at end of file
diff --git a/docs/docs.user.stock.md b/docs/user/stock/docs.user.stock.md
similarity index 100%
rename from docs/docs.user.stock.md
rename to docs/user/stock/docs.user.stock.md
diff --git a/docs/user/stock/docs.user.stock.projected_quantity.md b/docs/user/stock/docs.user.stock.projected_quantity.md
new file mode 100644
index 0000000..8fff133
--- /dev/null
+++ b/docs/user/stock/docs.user.stock.projected_quantity.md
@@ -0,0 +1,27 @@
+---
+{
+ "_label": "Projected Quantity"
+}
+---
+
+Projected Quantity is the level of stock that is predicted for a particular Item, based on the current stock levels and other requirements.It is the quantity of gross inventory that includes supply and demand in the past which is done as part of the planning process.
+
+The projected inventory is used by the planning system to monitor the reorder point and to determine the reorder quantity. The projected Quantity is used by the planning engine to monitor the safety stock levels. These levels are maintained to serve unexpected demands.
+
+Having a tight control of the projected inventory is crucial to determine shortages and to calculate the right order quantity.
+
+
+
+![Projected Quantity Stock Report](img/projected-quantity-stock-report.png)
+
+
+
+
+
+> Projected Qty = Actual Qty + Planned Qty + Requested Qty + Ordered Qty - Reserved Qty
+
+- Actual Qty: Quantity available in the warehouse.
+- Planned Qty: Quantity, for which, Production Order has been raised, but is pending to be manufactured.
+- Requested Qty: Quantity requested for purchase, but not ordered.
+- Ordered Qty: Quantity ordered for purchase, but not received.
+- Reserved Qty: Quantity ordered for sale, but not delivered.
\ No newline at end of file
diff --git a/docs/user/stock/docs.user.stock.purchase_receipt b/docs/user/stock/docs.user.stock.purchase_receipt
new file mode 100644
index 0000000..fd934d2
--- /dev/null
+++ b/docs/user/stock/docs.user.stock.purchase_receipt
@@ -0,0 +1,24 @@
+---
+{
+ "_label": "Purchase Return"
+}
+---
+ERPNext has an option to account for products that are returned to the supplier. This may be on account of a number of reasons like defects in goods, quality not matching, the buyer not needing the stock, etc. The transactions dealing with return of goods are also accounting transactions and have to be recorded in the books of accounts just like any other accounting transaction.
+
+
+> Stock > Stock Entry > New Stock Entry
+
+
+![Purchase Return](img/purchase-return.png)
+
+
+
+
+
+
+- To select Purchase Return go to Stock Entry.
+- Select Purchase Return under Purpose.
+- Enter Purchase Receipt number.
+- Enter Source Warehouse details.
+- Provide Supplier Information.
+- Save the document.
\ No newline at end of file
diff --git a/docs/docs.user.stock.purchase_receipt.md b/docs/user/stock/docs.user.stock.purchase_receipt.md
similarity index 100%
rename from docs/docs.user.stock.purchase_receipt.md
rename to docs/user/stock/docs.user.stock.purchase_receipt.md
diff --git a/docs/user/stock/docs.user.stock.purchase_return.md b/docs/user/stock/docs.user.stock.purchase_return.md
new file mode 100644
index 0000000..13a325a
--- /dev/null
+++ b/docs/user/stock/docs.user.stock.purchase_return.md
@@ -0,0 +1,23 @@
+---
+{
+ "_label": "Purchase Return"
+}
+---
+ERPNext has an option to account for products that are returned to the supplier.This may be on account of a number of reasons like defects in goods, quality not matching, the buyer not needing the stock, etc. The transactions dealing with return of goods are also accounting transactions and have to be recorded in the books of accounts just like any other accounting transaction.
+
+
+> Stock > Stock Entry > New Stock Entry
+
+
+![Purchase Return](img/purchase-return.png)
+
+
+
+
+- To select Purchase Return go to Stock Entry.
+- Select Purchase Return under Purpose.
+- Enter Purchase Receipt number.
+- Enter Source Warehouse details.
+- Provide Supplier Information.
+- Save the document.
+
diff --git a/docs/user/stock/docs.user.stock.sales_return.md b/docs/user/stock/docs.user.stock.sales_return.md
new file mode 100644
index 0000000..3198db0
--- /dev/null
+++ b/docs/user/stock/docs.user.stock.sales_return.md
@@ -0,0 +1,21 @@
+---
+{
+ "_label": "Sales Return"
+}
+---
+Goods sold being returned is quite a common practice in Business. They could be returned by the customer on quality issues, non-delivery on agreed date, or any other reason. ERPNext allows this transaction for ease of accounting.
+
+> Stock > Stock Entry > New Stock Entry
+
+
+
+![Sales Return](img/sales-return.png)
+
+
+
+
+- For Sales Return click on Stock Entry
+- Select Sales Return under Purpose
+- Mention the Delivery Note number and the Sales Invoice number.
+- Mention Contact Information of the Customer.
+- Save the file.
\ No newline at end of file
diff --git a/docs/docs.user.stock.serialized.md b/docs/user/stock/docs.user.stock.serialized.md
similarity index 100%
rename from docs/docs.user.stock.serialized.md
rename to docs/user/stock/docs.user.stock.serialized.md
diff --git a/docs/docs.user.stock.stock_entry.md b/docs/user/stock/docs.user.stock.stock_entry.md
similarity index 100%
rename from docs/docs.user.stock.stock_entry.md
rename to docs/user/stock/docs.user.stock.stock_entry.md
diff --git a/docs/docs.user.stock.sub_contracting.md b/docs/user/stock/docs.user.stock.sub_contracting.md
similarity index 100%
rename from docs/docs.user.stock.sub_contracting.md
rename to docs/user/stock/docs.user.stock.sub_contracting.md
diff --git a/docs/docs.user.stock.valuation.md b/docs/user/stock/docs.user.stock.valuation.md
similarity index 100%
rename from docs/docs.user.stock.valuation.md
rename to docs/user/stock/docs.user.stock.valuation.md
diff --git a/docs/user/stock/docs.user.stock.warehouse.md b/docs/user/stock/docs.user.stock.warehouse.md
new file mode 100644
index 0000000..dd8273a
--- /dev/null
+++ b/docs/user/stock/docs.user.stock.warehouse.md
@@ -0,0 +1,30 @@
+---
+{
+ "_label": "Warehouse"
+}
+---
+
+A warehouse is a commercial building for storage of goods. Warehouses are used by manufacturers, importers, exporters, wholesalers, transport businesses, customs, etc. They are usually large plain buildings in industrial areas of cities,towns, and villages. They usually have loading docks to load and unload goods from trucks.
+
+To go to Warehouse, click on Stock and go to Warehouse under Masters.
+
+
+> Stock > Warehouse > New Warehouse
+
+
+
+![Warehouse](img/warehouse.png)
+
+
+
+
+In ERPNext, every different company can have a separate Warehouse. Every Warehouse will belong to a specific company. User can get company wise accurate stock balance. The Warehouses are saved with their respective company’s abbreviations. This facilitates in identifying which Warehouse belongs to which company, at a glance.
+
+You can include user restrictions for these Warehouses. In case you do not wish a particular user to operate on a particular Warehouse, you can refrain the user from accessing that Warehouse.
+
+### Merge Warehouse
+
+In day to day transactions, if duplicate entries are done by mistake resulting in duplicate Warehouse, these mistakes can be rectified. Duplicate records can be merged into a single Warehouse. Enter the place where you want to keep all the warehouse records. Click on the Merge button. Once this transaction is done, delete the empty Warehouse.
+
+ERPNext system maintains stock balance for every distinct combination of Item and Warehouse. Thus you can get stock balance for any specific Item in a particular Warehouse on any particular date.
+
diff --git a/docs/docs.user.support.customer_issue.md b/docs/user/support/docs.user.support.customer_issue.md
similarity index 100%
rename from docs/docs.user.support.customer_issue.md
rename to docs/user/support/docs.user.support.customer_issue.md
diff --git a/docs/docs.user.support.maintenance_schedule.md b/docs/user/support/docs.user.support.maintenance_schedule.md
similarity index 100%
rename from docs/docs.user.support.maintenance_schedule.md
rename to docs/user/support/docs.user.support.maintenance_schedule.md
diff --git a/docs/docs.user.support.maintenance_visit.md b/docs/user/support/docs.user.support.maintenance_visit.md
similarity index 100%
rename from docs/docs.user.support.maintenance_visit.md
rename to docs/user/support/docs.user.support.maintenance_visit.md
diff --git a/docs/docs.user.support.md b/docs/user/support/docs.user.support.md
similarity index 100%
rename from docs/docs.user.support.md
rename to docs/user/support/docs.user.support.md
diff --git a/docs/docs.user.support.support_ticket.md b/docs/user/support/docs.user.support.support_ticket.md
similarity index 100%
rename from docs/docs.user.support.support_ticket.md
rename to docs/user/support/docs.user.support.support_ticket.md
diff --git a/docs/docs.user.tools.calendar.md b/docs/user/tools/docs.user.tools.calendar.md
similarity index 100%
rename from docs/docs.user.tools.calendar.md
rename to docs/user/tools/docs.user.tools.calendar.md
diff --git a/docs/docs.user.tools.form_tools.md b/docs/user/tools/docs.user.tools.form_tools.md
similarity index 100%
rename from docs/docs.user.tools.form_tools.md
rename to docs/user/tools/docs.user.tools.form_tools.md
diff --git a/docs/docs.user.tools.md b/docs/user/tools/docs.user.tools.md
similarity index 100%
rename from docs/docs.user.tools.md
rename to docs/user/tools/docs.user.tools.md
diff --git a/docs/docs.user.tools.messages.md b/docs/user/tools/docs.user.tools.messages.md
similarity index 100%
rename from docs/docs.user.tools.messages.md
rename to docs/user/tools/docs.user.tools.messages.md
diff --git a/docs/docs.user.tools.notes.md b/docs/user/tools/docs.user.tools.notes.md
similarity index 100%
rename from docs/docs.user.tools.notes.md
rename to docs/user/tools/docs.user.tools.notes.md
diff --git a/docs/docs.user.tools.todo.md b/docs/user/tools/docs.user.tools.todo.md
similarity index 100%
rename from docs/docs.user.tools.todo.md
rename to docs/user/tools/docs.user.tools.todo.md
diff --git a/docs/docs.user.website.blog.md b/docs/user/website/docs.user.website.blog.md
similarity index 100%
rename from docs/docs.user.website.blog.md
rename to docs/user/website/docs.user.website.blog.md
diff --git a/docs/docs.user.website.md b/docs/user/website/docs.user.website.md
similarity index 100%
rename from docs/docs.user.website.md
rename to docs/user/website/docs.user.website.md
diff --git a/docs/docs.user.website.setup.md b/docs/user/website/docs.user.website.setup.md
similarity index 100%
rename from docs/docs.user.website.setup.md
rename to docs/user/website/docs.user.website.setup.md
diff --git a/docs/docs.user.website.style.md b/docs/user/website/docs.user.website.style.md
similarity index 100%
rename from docs/docs.user.website.style.md
rename to docs/user/website/docs.user.website.style.md
diff --git a/docs/docs.user.website.web_page.md b/docs/user/website/docs.user.website.web_page.md
similarity index 100%
rename from docs/docs.user.website.web_page.md
rename to docs/user/website/docs.user.website.web_page.md
diff --git a/hr/doctype/job_applicant/get_job_applications.py b/hr/doctype/job_applicant/get_job_applications.py
index 9bec43e..2e01328 100644
--- a/hr/doctype/job_applicant/get_job_applications.py
+++ b/hr/doctype/job_applicant/get_job_applications.py
@@ -37,7 +37,7 @@
mail.save_attachments_in_doc(applicant.doc)
make(content=mail.content, sender=mail.from_email,
- doctype="Job Applicant", name=applicant.doc.name, set_lead=False)
+ doctype="Job Applicant", name=applicant.doc.name)
def get_job_applications():
if cint(webnotes.conn.get_value('Jobs Email Settings', None, 'extract_emails')):
diff --git a/hr/doctype/job_applicant/job_applicant.js b/hr/doctype/job_applicant/job_applicant.js
index 9aff605..f82da11 100644
--- a/hr/doctype/job_applicant/job_applicant.js
+++ b/hr/doctype/job_applicant/job_applicant.js
@@ -16,7 +16,7 @@
},
make_listing: function(doc) {
cur_frm.communication_view = new wn.views.CommunicationList({
- list: wn.model.get("Communication", {"job_applicant": doc.name}),
+ list: wn.model.get("Communication", {"parent": doc.name, "parenttype": "Job Applicant"}),
parent: cur_frm.fields_dict['thread_html'].wrapper,
doc: doc,
recipients: doc.email_id
diff --git a/hr/doctype/job_applicant/job_applicant.py b/hr/doctype/job_applicant/job_applicant.py
index e9b12b0..04b6da9 100644
--- a/hr/doctype/job_applicant/job_applicant.py
+++ b/hr/doctype/job_applicant/job_applicant.py
@@ -11,9 +11,6 @@
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
- def onload(self):
- self.add_communication_list()
-
def get_sender(self, comm):
return webnotes.conn.get_value('Jobs Email Settings',None,'email_id')
diff --git a/hr/doctype/job_applicant/job_applicant.txt b/hr/doctype/job_applicant/job_applicant.txt
index ebf95f6..62b1d80 100644
--- a/hr/doctype/job_applicant/job_applicant.txt
+++ b/hr/doctype/job_applicant/job_applicant.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-29 19:25:37",
"docstatus": 0,
- "modified": "2013-07-05 14:43:11",
+ "modified": "2013-09-02 16:26:23",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -90,6 +90,14 @@
"label": "Thread HTML"
},
{
+ "doctype": "DocField",
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication"
+ },
+ {
"doctype": "DocPerm"
}
]
\ No newline at end of file
diff --git a/patches/patch_list.py b/patches/patch_list.py
index 1d382a5..320614a 100644
--- a/patches/patch_list.py
+++ b/patches/patch_list.py
@@ -257,4 +257,6 @@
"execute:webnotes.reload_doc('accounts', 'Print Format', 'POS Invoice') # 2013-08-16",
"patches.august_2013.p06_fix_sle_against_stock_entry",
"execute:webnotes.bean('Style Settings').save() #2013-08-20",
+ "patches.september_2013.p01_fix_buying_amount_gl_entries",
+ "patches.september_2013.p01_update_communication",
]
\ No newline at end of file
diff --git a/patches/september_2013/__init__.py b/patches/september_2013/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/patches/september_2013/__init__.py
diff --git a/patches/september_2013/p01_fix_buying_amount_gl_entries.py b/patches/september_2013/p01_fix_buying_amount_gl_entries.py
new file mode 100644
index 0000000..369a291
--- /dev/null
+++ b/patches/september_2013/p01_fix_buying_amount_gl_entries.py
@@ -0,0 +1,66 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import webnotes
+import webnotes.defaults
+from webnotes.utils import cint
+
+def execute():
+ if not cint(webnotes.defaults.get_global_default("auto_inventory_accounting")):
+ return
+
+ # fix delivery note
+ for dn in webnotes.conn.sql_list("""select name from `tabDelivery Note` where docstatus=1
+ and posting_date >= "2013-08-06" order by posting_date"""):
+ recreate_gl_entries("Delivery Note", dn, "delivery_note_details")
+
+ # fix sales invoice
+ for si in webnotes.conn.sql_list("""select name from `tabSales Invoice` where docstatus=1
+ and update_stock=1 and posting_date >= "2013-08-06" order by posting_date"""):
+ recreate_gl_entries("Sales Invoice", si, "entries")
+
+def recreate_gl_entries(doctype, name, parentfield):
+ # calculate buying amount and make gl entries
+ bean = webnotes.bean(doctype, name)
+ bean.run_method("set_buying_amount")
+
+ company_values = webnotes.conn.get_value("Company", bean.doc.company, ["default_expense_account",
+ "stock_adjustment_account", "cost_center", "stock_adjustment_cost_center"])
+
+ # update missing expense account and cost center
+ for item in bean.doclist.get({"parentfield": parentfield}):
+ if item.buying_amount and not validate_item_values(item, bean.doc.company):
+ res = webnotes.conn.sql("""select expense_account, cost_center
+ from `tab%s` child where docstatus=1 and item_code=%s and
+ ifnull(expense_account, '')!='' and ifnull(cost_center, '')!='' and
+ (select company from `tabAccount` ac where ac.name=child.expense_account)=%s and
+ (select company from `tabCost Center` cc where cc.name=child.cost_center)=%s
+ order by creation desc limit 1""" % (item.doctype, "%s", "%s", "%s"),
+ (item.item_code, bean.doc.company, bean.doc.company))
+ if res:
+ item.expense_account = res[0][0]
+ item.cost_center = res[0][1]
+ elif company_values:
+ item.expense_account = company_values[0] or company_values[1]
+ item.cost_center = company_values[2] or company_values[3]
+
+ webnotes.conn.set_value(item.doctype, item.name, "expense_account", item.expense_account)
+ webnotes.conn.set_value(item.doctype, item.name, "cost_center", item.cost_center)
+
+ # remove gl entries
+ webnotes.conn.sql("""delete from `tabGL Entry` where voucher_type=%s
+ and voucher_no=%s""", (doctype, name))
+ bean.run_method("make_gl_entries")
+
+def validate_item_values(item, company):
+ if item.expense_account and \
+ webnotes.conn.get_value("Account", item.expense_account, "company")!=company:
+ return False
+ elif item.cost_center and \
+ webnotes.conn.get_value("Cost Center", item.cost_center, "company")!=company:
+ return False
+ elif not (item.expense_account and item.cost_center):
+ return False
+
+ return True
\ No newline at end of file
diff --git a/patches/september_2013/p01_update_communication.py b/patches/september_2013/p01_update_communication.py
new file mode 100644
index 0000000..d840c80
--- /dev/null
+++ b/patches/september_2013/p01_update_communication.py
@@ -0,0 +1,15 @@
+import webnotes
+
+def execute():
+ for doctype in ("Contact", "Lead", "Job Applicant", "Supplier", "Customer", "Quotation", "Sales Person", "Support Ticket"):
+ fieldname = doctype.replace(" ", '_').lower()
+ webnotes.conn.sql("""update tabCommunication
+ set parenttype=%s, parentfield='communications',
+ parent=`%s`
+ where ifnull(`%s`, '')!=''""" % ("%s", fieldname, fieldname), doctype)
+
+ webnotes.reload_doc("core", "doctype", "communication")
+
+ webnotes.conn.sql("""update tabCommunication set communication_date = creation where
+ ifnull(communication_date, '')='' """)
+
\ No newline at end of file
diff --git a/public/js/toolbar.js b/public/js/toolbar.js
index d2ca512..2566fcb 100644
--- a/public/js/toolbar.js
+++ b/public/js/toolbar.js
@@ -20,20 +20,6 @@
<i class="icon-fixed-width icon-comments"></i> '+wn._('Live Chat')+'</a></li>');
}
- erpnext.toolbar.set_new_comments();
-
$("#toolbar-tools").append('<li><a href="#latest-updates">\
<i class="icon-fixed-width icon-rss"></i> Latest Updates</li>');
-}
-
-erpnext.toolbar.set_new_comments = function(new_comments) {
- return;
- var navbar_nc = $('.navbar-new-comments');
- if(cint(new_comments)) {
- navbar_nc.addClass('navbar-new-comments-true')
- navbar_nc.text(new_comments);
- } else {
- navbar_nc.removeClass('navbar-new-comments-true');
- navbar_nc.text(0);
- }
}
\ No newline at end of file
diff --git a/selling/doctype/customer/customer.py b/selling/doctype/customer/customer.py
index 2eabf12..cb19d4f 100644
--- a/selling/doctype/customer/customer.py
+++ b/selling/doctype/customer/customer.py
@@ -17,10 +17,7 @@
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
-
- def onload(self):
- self.add_communication_list()
-
+
def autoname(self):
cust_master_name = webnotes.defaults.get_global_default('cust_master_name')
if cust_master_name == 'Customer Name':
diff --git a/selling/doctype/customer/customer.txt b/selling/doctype/customer/customer.txt
index 7da29d2..94bd8fc 100644
--- a/selling/doctype/customer/customer.txt
+++ b/selling/doctype/customer/customer.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-11 14:26:44",
"docstatus": 0,
- "modified": "2013-08-08 14:22:13",
+ "modified": "2013-09-02 16:25:13",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -349,6 +349,15 @@
"permlevel": 0
},
{
+ "doctype": "DocField",
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication",
+ "permlevel": 0
+ },
+ {
"amend": 0,
"cancel": 0,
"create": 1,
diff --git a/selling/doctype/lead/get_leads.py b/selling/doctype/lead/get_leads.py
index c63468e..3305a3b 100644
--- a/selling/doctype/lead/get_leads.py
+++ b/selling/doctype/lead/get_leads.py
@@ -25,12 +25,15 @@
lead.insert()
lead_name = lead.doc.name
+ parent_doctype = "Contact" if contact_name else "Lead"
+ parent_name = contact_name or lead_name
+
message = make(content=content, sender=sender, subject=subject,
- lead=lead_name, contact=contact_name, date=date)
+ doctype = parent_doctype, name = parent_name, date=date)
if mail:
# save attachments to parent if from mail
- bean = webnotes.bean("Contact" if contact_name else "Lead", contact_name or lead_name)
+ bean = webnotes.bean(parent_doctype, parent_name)
mail.save_attachments_in_doc(bean.doc)
class SalesMailbox(POP3Mailbox):
diff --git a/selling/doctype/lead/lead.js b/selling/doctype/lead/lead.js
index 4088739..9a86b22 100644
--- a/selling/doctype/lead/lead.js
+++ b/selling/doctype/lead/lead.js
@@ -51,7 +51,7 @@
}
cur_frm.communication_view = new wn.views.CommunicationList({
- list: wn.model.get("Communication", {"lead": this.frm.doc.name}),
+ list: wn.model.get("Communication", {"parenttype": "Lead", "parent":this.frm.doc.name}),
parent: this.frm.fields_dict.communication_html.wrapper,
doc: this.frm.doc,
recipients: this.frm.doc.email_id
diff --git a/selling/doctype/lead/lead.py b/selling/doctype/lead/lead.py
index 2bf1aa3..063c5f0 100644
--- a/selling/doctype/lead/lead.py
+++ b/selling/doctype/lead/lead.py
@@ -24,7 +24,6 @@
})
def onload(self):
- self.add_communication_list()
customer = webnotes.conn.get_value("Customer", {"lead_name": self.doc.name})
if customer:
self.doc.fields["__is_customer"] = customer
diff --git a/selling/doctype/lead/lead.txt b/selling/doctype/lead/lead.txt
index d66c6a0..9402259 100644
--- a/selling/doctype/lead/lead.txt
+++ b/selling/doctype/lead/lead.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-10 11:45:37",
"docstatus": 0,
- "modified": "2013-08-08 14:22:14",
+ "modified": "2013-09-02 17:25:59",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -411,6 +411,14 @@
"label": "Blog Subscriber"
},
{
+ "doctype": "DocField",
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication"
+ },
+ {
"cancel": 1,
"doctype": "DocPerm",
"role": "Sales Manager"
diff --git a/selling/doctype/opportunity/opportunity.py b/selling/doctype/opportunity/opportunity.py
index 906e547..a3ef197 100644
--- a/selling/doctype/opportunity/opportunity.py
+++ b/selling/doctype/opportunity/opportunity.py
@@ -25,9 +25,6 @@
"contact_by": webnotes.conn.get_value("Opportunity", self.doc.name, "contact_by") if \
(not cint(self.doc.fields.get("__islocal"))) else None,
})
-
- def onload(self):
- self.add_communication_list()
def get_item_details(self, item_code):
item = sql("""select item_name, stock_uom, description_html, description, item_group, brand
diff --git a/selling/doctype/opportunity/opportunity.txt b/selling/doctype/opportunity/opportunity.txt
index 5b1d93f..4ca1564 100644
--- a/selling/doctype/opportunity/opportunity.txt
+++ b/selling/doctype/opportunity/opportunity.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 18:50:30",
"docstatus": 0,
- "modified": "2013-08-08 14:22:15",
+ "modified": "2013-09-02 16:27:33",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -443,6 +443,14 @@
"width": "150px"
},
{
+ "doctype": "DocField",
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication"
+ },
+ {
"doctype": "DocPerm",
"role": "Sales User"
},
diff --git a/selling/doctype/quotation/quotation.py b/selling/doctype/quotation/quotation.py
index b6ff1d7..c1b529c 100644
--- a/selling/doctype/quotation/quotation.py
+++ b/selling/doctype/quotation/quotation.py
@@ -20,9 +20,6 @@
self.doclist = doclist
self.tname = 'Quotation Item'
self.fname = 'quotation_details'
-
- def onload(self):
- self.add_communication_list()
# Get contact person details based on customer selected
# ------------------------------------------------------
diff --git a/selling/doctype/quotation/quotation.txt b/selling/doctype/quotation/quotation.txt
index c3b2434..9d47259 100644
--- a/selling/doctype/quotation/quotation.txt
+++ b/selling/doctype/quotation/quotation.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:08",
"docstatus": 0,
- "modified": "2013-08-09 14:46:11",
+ "modified": "2013-09-02 16:25:01",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -836,6 +836,14 @@
"width": "40px"
},
{
+ "doctype": "DocField",
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication"
+ },
+ {
"amend": 1,
"cancel": 1,
"create": 1,
diff --git a/setup/doctype/sales_person/sales_person.txt b/setup/doctype/sales_person/sales_person.txt
index 77ba6af..d78b5c8 100644
--- a/setup/doctype/sales_person/sales_person.txt
+++ b/setup/doctype/sales_person/sales_person.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:24",
"docstatus": 0,
- "modified": "2013-08-05 18:11:22",
+ "modified": "2013-09-02 16:26:54",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -161,6 +161,14 @@
"search_index": 0
},
{
+ "doctype": "DocField",
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication"
+ },
+ {
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
diff --git a/support/doctype/support_ticket/get_support_mails.py b/support/doctype/support_ticket/get_support_mails.py
index 7e09846..fb26e57 100644
--- a/support/doctype/support_ticket/get_support_mails.py
+++ b/support/doctype/support_ticket/get_support_mails.py
@@ -46,7 +46,7 @@
make(content=mail.content, sender=mail.from_email, subject = ticket.doc.subject,
doctype="Support Ticket", name=ticket.doc.name,
- lead = ticket.doc.lead, contact=ticket.doc.contact, date=mail.date)
+ date=mail.date)
if new_ticket and cint(self.email_settings.send_autoreply) and \
"mailer-daemon" not in mail.from_email.lower():
diff --git a/support/doctype/support_ticket/support_ticket.js b/support/doctype/support_ticket/support_ticket.js
index 2c1f332..0e61273 100644
--- a/support/doctype/support_ticket/support_ticket.js
+++ b/support/doctype/support_ticket/support_ticket.js
@@ -46,16 +46,12 @@
make_listing: function(doc) {
var wrapper = cur_frm.fields_dict['thread_html'].wrapper;
- var comm_list = wn.model.get("Communication", {"support_ticket": doc.name})
-
- var sortfn = function (a, b) { return (b.creation > a.creation) ? 1 : -1; }
- comm_list = comm_list.sort(sortfn);
+ var comm_list = wn.model.get("Communication", {"parent": doc.name, "parenttype":"Support Ticket"})
- if(!comm_list.length || (comm_list[comm_list.length - 1].sender != doc.raised_by)) {
+ if(!comm_list.length) {
comm_list.push({
"sender": doc.raised_by,
"creation": doc.creation,
- "modified": doc.creation,
"content": doc.description});
}
diff --git a/support/doctype/support_ticket/support_ticket.py b/support/doctype/support_ticket/support_ticket.py
index 2b8fe85..8e723ee 100644
--- a/support/doctype/support_ticket/support_ticket.py
+++ b/support/doctype/support_ticket/support_ticket.py
@@ -11,9 +11,6 @@
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
-
- def onload(self):
- self.add_communication_list()
def get_sender(self, comm):
return webnotes.conn.get_value('Email Settings',None,'support_email')
@@ -53,7 +50,7 @@
if not self.doc.company:
self.doc.company = webnotes.conn.get_value("Lead", self.doc.lead, "company") or \
webnotes.conn.get_default("company")
-
+
def on_trash(self):
webnotes.conn.sql("""update `tabCommunication` set support_ticket=NULL
where support_ticket=%s""", (self.doc.name,))
diff --git a/support/doctype/support_ticket/support_ticket.txt b/support/doctype/support_ticket/support_ticket.txt
index dcb4520..01d0e35 100644
--- a/support/doctype/support_ticket/support_ticket.txt
+++ b/support/doctype/support_ticket/support_ticket.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-01 10:36:25",
"docstatus": 0,
- "modified": "2013-08-28 18:29:06",
+ "modified": "2013-09-02 16:24:24",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -262,6 +262,14 @@
"label": "Content Type"
},
{
+ "doctype": "DocField",
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication"
+ },
+ {
"cancel": 0,
"doctype": "DocPerm",
"role": "Guest"
diff --git a/utilities/demo/make_demo.py b/utilities/demo/make_demo.py
index 6f18f76..4383d32 100644
--- a/utilities/demo/make_demo.py
+++ b/utilities/demo/make_demo.py
@@ -30,7 +30,6 @@
}
def make(reset=False, simulate=True):
- webnotes.connect()
#webnotes.print_messages = True
webnotes.mute_emails = True
webnotes.rollback_on_exception = True
@@ -38,7 +37,7 @@
if reset:
setup()
if simulate:
- simulate()
+ _simulate()
def setup():
install()
@@ -50,7 +49,7 @@
# make_opening_stock()
# make_opening_accounts()
-def simulate():
+def _simulate():
global runs_for
current_date = webnotes.utils.getdate(start_date)
@@ -411,7 +410,4 @@
if submit:
webnotes.form_dict["params"] = json.dumps({"_submit": 1})
webnotes.uploaded_file = os.path.join(os.path.dirname(__file__), "demo_docs", doctype+".csv")
- upload()
-
-if __name__=="__main__":
- make()
\ No newline at end of file
+ upload()
\ No newline at end of file
diff --git a/utilities/demo/make_erpnext_demo.py b/utilities/demo/make_erpnext_demo.py
index db1d25b..9e56839 100644
--- a/utilities/demo/make_erpnext_demo.py
+++ b/utilities/demo/make_erpnext_demo.py
@@ -6,7 +6,14 @@
import utilities.demo.make_demo
def make_demo_app():
-
+ webnotes.mute_emails = 1
+ webnotes.connect()
+ utilities.demo.make_demo.make(reset=True, simulate=False)
+ # setup demo user etc so that the site it up faster, while the data loads
+ make_demo_user()
+ make_demo_login_page()
+ make_demo_on_login_script()
+ utilities.demo.make_demo.make(reset=False, simulate=True)
def make_demo_user():
roles = ["Accounts Manager", "Analytics", "Expense Approver", "Accounts User",
@@ -111,11 +118,4 @@
webnotes.conn.commit()
if __name__=="__main__":
- # webnotes.connect()
- webnotes.mute_emails = 1
- utilities.demo.make_demo.make(reset=True, simulate=False)
- # setup demo user etc so that the site it up faster, while the data loads
- make_demo_user()
- make_demo_login_page()
- make_demo_on_login_script()
- utilities.demo.make_demo.make(reset=False, simulate=True)
\ No newline at end of file
+ make_demo_app()
\ No newline at end of file
diff --git a/utilities/doctype/contact/contact.py b/utilities/doctype/contact/contact.py
index 961bb52..9997cab 100644
--- a/utilities/doctype/contact/contact.py
+++ b/utilities/doctype/contact/contact.py
@@ -12,9 +12,6 @@
self.doc = doc
self.doclist = doclist
- def onload(self):
- self.add_communication_list()
-
def on_communication_sent(self, comm):
webnotes.conn.set(self.doc, 'status', 'Replied')
diff --git a/utilities/doctype/contact/contact.txt b/utilities/doctype/contact/contact.txt
index 63d0252..d3c7d88 100644
--- a/utilities/doctype/contact/contact.txt
+++ b/utilities/doctype/contact/contact.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-01-10 16:34:32",
"docstatus": 0,
- "modified": "2013-07-05 14:32:19",
+ "modified": "2013-09-02 16:26:13",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -226,6 +226,14 @@
"read_only": 1
},
{
+ "doctype": "DocField",
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication"
+ },
+ {
"cancel": 1,
"doctype": "DocPerm",
"role": "System Manager"
diff --git a/utilities/transaction_base.py b/utilities/transaction_base.py
index aace0cb..ea807c2 100644
--- a/utilities/transaction_base.py
+++ b/utilities/transaction_base.py
@@ -87,7 +87,7 @@
if self.meta.get_field(fieldname):
self.doc.fields[fieldname] = val
- if self.meta.get_field("sales_team"):
+ if self.meta.get_field("sales_team") and self.doc.customer:
self.set_sales_team_for_customer()
def set_sales_team_for_customer(self):
@@ -229,20 +229,7 @@
if int(webnotes.conn.get_value("Notification Control", None, dt) or 0):
self.doc.fields["__notification_message"] = \
webnotes.conn.get_value("Notification Control", None, dt + "_message")
-
- def add_communication_list(self):
- # remove communications if present
- self.doclist = webnotes.doclist(self.doclist).get({
- "doctype": ["!=", "Communcation"]})
-
- comm_list = webnotes.conn.sql("""select * from tabCommunication
- where %s=%s order by modified desc limit 20""" \
- % (self.doc.doctype.replace(" ", "_").lower(), "%s"),
- self.doc.name, as_dict=1, update={"doctype":"Communication"})
-
- self.doclist.extend(webnotes.doclist([webnotes.doc(fielddata=d) \
- for d in comm_list]))
-
+
def validate_posting_time(self):
if not self.doc.posting_time:
self.doc.posting_time = now_datetime().strftime('%H:%M:%S')