Merge remote-tracking branch 'frappe/develop' into model-cleanup
Conflicts:
erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py
erpnext/accounts/doctype/sales_invoice/sales_invoice.py
erpnext/controllers/stock_controller.py
diff --git a/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt b/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt
index 19456a9..60088c9 100755
--- a/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt
+++ b/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt
@@ -1,21 +1,14 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2012-04-11 13:16:56",
- "modified_by": "Administrator",
- "modified": "2012-04-13 12:24:20"
- },
- {
- "doc_type": "Journal Voucher",
- "name": "__common__",
- "module": "Accounts",
- "doctype": "Print Format",
- "html": "<!-- p.big {line-height: 200%} .noborder td { border: 0px solid #fff; } -->\n<div style=\"position: relative;\">\n<h3><script>doc.company</script><br /> <br /> \n<hr />\nPAYMENT ADVICE</h3>\n<table class=\"noborder\" style=\"width: 100%;\">\n<tbody>\n<tr>\n<td style=\"vertical-align: top;\" width=\"50%\">To :<br />\n<script type=\"text/javascript\">// <![CDATA[\ndoc.pay_to_recd_from\n// ]]></script>\n</td>\n<td width=\"50%\">\n<table class=\"noborder\" width=\"100%\">\n<tbody>\n<tr>\n<td width=\"30%\">Voucher No :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.name\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td width=\"30%\">Voucher Date :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.voucher_date)\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td width=\"30%\">Cheque No :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.cheque_no)\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td width=\"30%\">Cheque Date :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.cheque_date)\n// ]]></script>\n</td>\n</tr>\n</tbody>\n</table>\n</td>\n</tr>\n</tbody>\n</table>\n<br /> <strong>We are pleased to enclose our cheque in full/part Settlement of your under noted bills</strong> <br /> \n<hr />\n<table class=\"noborder\" width=\"100%\">\n<tbody>\n<tr>\n<td width=\"70%\"> </td>\n<td width=\"15%\">Total :</td>\n<td class=\"pos_left\" width=\"15%\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.total_amount\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td colspan=\"3\">Narration :\n<script type=\"text/javascript\">// <![CDATA[\nreplace_newlines(doc.remark)\n// ]]></script>\n<br /><br /><br /></td>\n</tr>\n</tbody>\n</table>\n<div style=\"position: absolute; top: 14cm; left: 0cm;\">Prepared By</div>\n<div style=\"position: absolute; top: 14cm; left: 5.5cm;\">Authorised Signatory</div>\n<div style=\"position: absolute; top: 14cm; left: 11cm;\">Received Payment as Above</div>\n<div style=\"position: absolute; top: 16.4cm; left: 5.9cm;\"><strong>_____________</strong></div>\n<div style=\"position: absolute; top: 16.7cm; left: 6cm;\"><strong>A/c Payee</strong></div>\n<div style=\"position: absolute; top: 16.7cm; left: 5.9cm;\"><strong>_____________</strong></div>\n<div style=\"position: absolute; top: 16.9cm; left: 12cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.cheque_date)\n// ]]></script>\n</div>\n<div style=\"position: absolute; top: 17.9cm; left: 1cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.pay_to_recd_from\n// ]]></script>\n</div>\n<div style=\"position: absolute; top: 18.6cm; left: 1cm; width: 7cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.total_amount_in_words\n// ]]></script>\n</div>\n<div style=\"position: absolute; top: 19.7cm; left: 12cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.total_amount\n// ]]></script>\n</div>\n</div>",
- "standard": "Yes"
- },
- {
- "name": "Cheque Printing Format",
- "doctype": "Print Format"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-04-11 13:16:56.000000",
+ "doc_type": "Journal Voucher",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!-- p.big {line-height: 200%} .noborder td { border: 0px solid #fff; } -->\n<div style=\"position: relative;\">\n<h3><script>doc.company</script><br /> <br /> \n<hr />\nPAYMENT ADVICE</h3>\n<table class=\"noborder\" style=\"width: 100%;\">\n<tbody>\n<tr>\n<td style=\"vertical-align: top;\" width=\"50%\">To :<br />\n<script type=\"text/javascript\">// <![CDATA[\ndoc.pay_to_recd_from\n// ]]></script>\n</td>\n<td width=\"50%\">\n<table class=\"noborder\" width=\"100%\">\n<tbody>\n<tr>\n<td width=\"30%\">Voucher No :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.name\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td width=\"30%\">Voucher Date :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.voucher_date)\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td width=\"30%\">Cheque No :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.cheque_no)\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td width=\"30%\">Cheque Date :</td>\n<td width=\"70%\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.cheque_date)\n// ]]></script>\n</td>\n</tr>\n</tbody>\n</table>\n</td>\n</tr>\n</tbody>\n</table>\n<br /> <strong>We are pleased to enclose our cheque in full/part Settlement of your under noted bills</strong> <br /> \n<hr />\n<table class=\"noborder\" width=\"100%\">\n<tbody>\n<tr>\n<td width=\"70%\"> </td>\n<td width=\"15%\">Total :</td>\n<td class=\"pos_left\" width=\"15%\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.total_amount\n// ]]></script>\n</td>\n</tr>\n<tr>\n<td colspan=\"3\">Narration :\n<script type=\"text/javascript\">// <![CDATA[\nreplace_newlines(doc.remark)\n// ]]></script>\n<br /><br /><br /></td>\n</tr>\n</tbody>\n</table>\n<div style=\"position: absolute; top: 14cm; left: 0cm;\">Prepared By</div>\n<div style=\"position: absolute; top: 14cm; left: 5.5cm;\">Authorised Signatory</div>\n<div style=\"position: absolute; top: 14cm; left: 11cm;\">Received Payment as Above</div>\n<div style=\"position: absolute; top: 16.4cm; left: 5.9cm;\"><strong>_____________</strong></div>\n<div style=\"position: absolute; top: 16.7cm; left: 6cm;\"><strong>A/c Payee</strong></div>\n<div style=\"position: absolute; top: 16.7cm; left: 5.9cm;\"><strong>_____________</strong></div>\n<div style=\"position: absolute; top: 16.9cm; left: 12cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndate.str_to_user(doc.cheque_date)\n// ]]></script>\n</div>\n<div style=\"position: absolute; top: 17.9cm; left: 1cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.pay_to_recd_from\n// ]]></script>\n</div>\n<div style=\"position: absolute; top: 18.6cm; left: 1cm; width: 7cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.total_amount_in_words\n// ]]></script>\n</div>\n<div style=\"position: absolute; top: 19.7cm; left: 12cm;\">\n<script type=\"text/javascript\">// <![CDATA[\ndoc.total_amount\n// ]]></script>\n</div>\n</div>",
+ "idx": 1,
+ "modified": "2012-04-13 12:24:20.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Cheque Printing Format",
+ "owner": "Administrator",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt b/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt
index 4f20ac2..c251c90 100644
--- a/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt
+++ b/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2011-12-21 11:08:55",
- "docstatus": 0,
- "modified": "2014-01-27 17:26:10",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Sales Invoice",
- "doctype": "Print Format",
- "html": "<html>\n\t<head>\n\n\t\t<!-- Style Settings -->\n\t\t<style>\n\t\t\ttable, tr, td, div, p {\n\t\t\t\tfont-family: Monospace;\n\t\t\t\tline-height: 200%;\n\t\t\t\tvertical-align: middle;\n\t\t\t}\n\t\t\t@media screen {\n\t\t\t\tbody {\n\t\t\t\t\twidth: 4in;\n\t\t\t\t}\n\t\t\t}\n\t\t</style>\n\n\t\t<!-- Javascript -->\n\t\t<script>\n\t\t\tfunction print_header() {\n\t\t\t\tvar header = '<table width=\"100%\" cellpadding=\"4\">';\n\n\t\t\t\theader += '<tr>\\\n\t\t\t\t\t<td colspan=\"2\" align=\"center\"><h3>' + (doc.select_print_heading || \"Invoice\") + '</h3></td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\theader += '<tr>\\\n\t\t\t\t\t<td align=\"left\"><b>RECEIPT NO:</b> ' + doc.name + '</td>\\\n\t\t\t\t\t<td align=\"right\"><b>DATE:</b> ' + date.str_to_user(doc.posting_date) + '</td>\\\n\t\t\t\t</tr>\\\n\t\t\t\t<tr>\\\n\t\t\t\t\t<td colspan=\"2\"><b>M/s.</b> ' + doc.customer + '</td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\treturn header + '</table>';\n\t\t\t}\n\n\t\t\tfunction print_items() {\n\t\t\t\tvar rows = '<table width=\"100%\" cellpadding=\"0\" class=\"cart\">';\n\n\t\t\t\trows += '<tr>\\\n\t\t\t\t\t<td colspan=\"3\"><hr></td>\\\n\t\t\t\t</tr>\\\n\t\t\t\t<tr>\\\n\t\t\t\t\t<td width=\"60%\" align=\"left\"><b>ITEM CODE / DESC.</b></td>\\\n\t\t\t\t\t<td width=\"10%\" align=\"right\"><b>QTY</b></td>\\\n\t\t\t\t\t<td width=\"30%\" align=\"right\"><b>RATE</b></td>\\\n\t\t\t\t</tr>\\\n\t\t\t\t<tr>\\\n\t\t\t\t\t<td colspan=\"3\"><hr></td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\t// print items\n\t\t\t\tvar items = getchildren('Sales Invoice Item', doc.name, 'entries');\n\t\t\t\tfor (var x=0; x<items.length; x++) {\n\t\t\t\t\trows += '<tr>\\\n\t\t\t\t\t\t<td align=\"left\">' + items[x].item_code + '<br>' + items[x].item_name + '</td>\\\n\t\t\t\t\t\t<td align=\"right\" style=\"vertical-align:top;\">' + items[x].qty + '</td>\\\n\t\t\t\t\t\t<td align=\"right\" style=\"vertical-align:top;\">' + format_currency(items[x].amount) + '</td>\\\n\t\t\t\t\t</tr>';\n\t\t\t\t}\n\n\t\t\t\trows += '<tr>\\\n\t\t\t\t\t<td colspan=\"3\"><hr></td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\treturn rows + '</table>';\n\t\t\t}\n\n\t\t\tfunction print_other_charges_and_totals() {\n\t\t\t\tvar totals = '<table width=\"100%\">';\n\t\t\t\t// print net total\n\t\t\t\ttotals +='<tr>\\\n\t\t\t\t\t<td align=\"right\" width=\"70%\">Net Total</td>\\\n\t\t\t\t\t<td align=\"right\">' + format_currency(doc.net_total_export) + '</td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\t// print exclusive taxes\n\t\t\t\tvar taxes = frappe.model.get_children(\"Sales Taxes and Charges\", doc.name, \"other_charges\", \"Sales Invoice\");\n\t\t\t\tif (taxes) {\n\t\t\t\t\t$.each(taxes, function(i, d) {\n\t\t\t\t\t\tif (!d.included_in_print_rate && d.tax_amount) {\n\t\t\t\t\t\t\ttotals += '<tr>\\\n\t\t\t\t\t\t\t\t<td align=\"right\">' + d.description + '</td>\\\n\t\t\t\t\t\t\t\t<td align=\"right\">' + format_currency(d.tax_amount) + '</td>\\\n\t\t\t\t\t\t\t<tr>';\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// show discount amount\n\t\t\t\tif (doc.discount_amount) {\n\t\t\t\t\ttotals += '<tr>\\\n\t\t\t\t\t\t<td align=\"right\">Discount Amount</td>\\\n\t\t\t\t\t\t<td align=\"right\">' + format_currency(doc.discount_amount) + '</td>\\\n\t\t\t\t\t<tr>';\n\t\t\t\t}\n\n\t\t\t\t// print grand total\n\t\t\t\ttotals += '<tr>\\\n\t\t\t\t\t<td align=\"right\">Grand Total</td>\\\n\t\t\t\t\t<td align=\"right\"><hr width=\"90%\" align=\"right\">' + format_currency(doc.grand_total_export) + '<br>\\\n\t\t\t\t\t<hr width=\"90%\" align=\"right\"></td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\treturn totals + '</table>';\n\t\t\t}\n\n\t\t\tfunction print_inclusive_taxes() {\n\t\t\t\tvar count = 0;\n\t\t\t\tvar inc_tax = '';\n\t\t\t\tvar taxes = frappe.model.get_children(\"Sales Taxes and Charges\", doc.name, \"other_charges\", \"Sales Invoice\");\n\t\t\t\tif (taxes) {\n\t\t\t\t\t$.each(taxes, function(i, d) {\n\t\t\t\t\t\tif (d.included_in_print_rate && d.tax_amount) {\n\t\t\t\t\t\t\tif (count == 0) {\n\t\t\t\t\t\t\t\tinc_tax = '<table width=\"100%\">\\\n\t\t\t\t\t\t\t\t\t<tr>\\\n\t\t\t\t\t\t\t\t\t\t<td colspan=\"2\"><b>Inclusive Taxes</b></td>\\\n\t\t\t\t\t\t\t\t\t</tr>';\n\t\t\t\t\t\t\t\tcount += 1;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tinc_tax += '<tr>\\\n\t\t\t\t\t\t\t\t<td width=\"60%\">' + d.description + '</td>\\\n\t\t\t\t\t\t\t\t<td>' + format_currency(d.tax_amount) + '</td>\\\n\t\t\t\t\t\t\t<tr>';\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (inc_tax) {\n\t\t\t\t\tinc_tax += '<tr>\\\n\t\t\t\t\t\t<td colspan=\"2\"><hr></td>\\\n\t\t\t\t\t</tr></table>';\n\t\t\t\t}\n\n\t\t\t\treturn inc_tax;\n\t\t\t}\n\n\t\t\tfunction print_footer() {\n\t\t\t\tvar footer = '<table width=\"100%\">';\n\n\t\t\t\t// print terms\n\t\t\t\tif (doc.terms) {\n\t\t\t\t\tfooter += '<tr>\\\n\t\t\t\t\t\t<td align=\"center\">' + doc.terms + '</td>\\\n\t\t\t\t\t</tr>';\n\t\t\t\t}\n\n\t\t\t\tfooter +='<tr>\\\n\t\t\t\t\t<td align=\"center\">Thank You. Please visit again.</td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\treturn footer + '</table>';\n\t\t\t}\n\t\t</script>\n\t</head>\n\n\t<body>\n\t\t<!--Headers, Item Table, Totals & Footer-->\n\t\t<div><script>print_header();</script></div>\n\t\t<div><script>print_items();</script></div>\n\t\t<div><script>print_inclusive_taxes();</script></div>\n\t\t<div><script>print_other_charges_and_totals();</script></div>\n\t\t<div><script>print_footer();</script></div>\n\t</body>\n</html>",
- "module": "Accounts",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "POS Invoice"
- }
-]
\ No newline at end of file
+{
+ "creation": "2011-12-21 11:08:55.000000",
+ "doc_type": "Sales Invoice",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<html>\n\t<head>\n\n\t\t<!-- Style Settings -->\n\t\t<style>\n\t\t\ttable, tr, td, div, p {\n\t\t\t\tfont-family: Monospace;\n\t\t\t\tline-height: 200%;\n\t\t\t\tvertical-align: middle;\n\t\t\t}\n\t\t\t@media screen {\n\t\t\t\tbody {\n\t\t\t\t\twidth: 4in;\n\t\t\t\t}\n\t\t\t}\n\t\t</style>\n\n\t\t<!-- Javascript -->\n\t\t<script>\n\t\t\tfunction print_header() {\n\t\t\t\tvar header = '<table width=\"100%\" cellpadding=\"4\">';\n\n\t\t\t\theader += '<tr>\\\n\t\t\t\t\t<td colspan=\"2\" align=\"center\"><h3>' + (doc.select_print_heading || \"Invoice\") + '</h3></td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\theader += '<tr>\\\n\t\t\t\t\t<td align=\"left\"><b>RECEIPT NO:</b> ' + doc.name + '</td>\\\n\t\t\t\t\t<td align=\"right\"><b>DATE:</b> ' + date.str_to_user(doc.posting_date) + '</td>\\\n\t\t\t\t</tr>\\\n\t\t\t\t<tr>\\\n\t\t\t\t\t<td colspan=\"2\"><b>M/s.</b> ' + doc.customer + '</td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\treturn header + '</table>';\n\t\t\t}\n\n\t\t\tfunction print_items() {\n\t\t\t\tvar rows = '<table width=\"100%\" cellpadding=\"0\" class=\"cart\">';\n\n\t\t\t\trows += '<tr>\\\n\t\t\t\t\t<td colspan=\"3\"><hr></td>\\\n\t\t\t\t</tr>\\\n\t\t\t\t<tr>\\\n\t\t\t\t\t<td width=\"60%\" align=\"left\"><b>ITEM CODE / DESC.</b></td>\\\n\t\t\t\t\t<td width=\"10%\" align=\"right\"><b>QTY</b></td>\\\n\t\t\t\t\t<td width=\"30%\" align=\"right\"><b>RATE</b></td>\\\n\t\t\t\t</tr>\\\n\t\t\t\t<tr>\\\n\t\t\t\t\t<td colspan=\"3\"><hr></td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\t// print items\n\t\t\t\tvar items = getchildren('Sales Invoice Item', doc.name, 'entries');\n\t\t\t\tfor (var x=0; x<items.length; x++) {\n\t\t\t\t\trows += '<tr>\\\n\t\t\t\t\t\t<td align=\"left\">' + items[x].item_code + '<br>' + items[x].item_name + '</td>\\\n\t\t\t\t\t\t<td align=\"right\" style=\"vertical-align:top;\">' + items[x].qty + '</td>\\\n\t\t\t\t\t\t<td align=\"right\" style=\"vertical-align:top;\">' + format_currency(items[x].amount) + '</td>\\\n\t\t\t\t\t</tr>';\n\t\t\t\t}\n\n\t\t\t\trows += '<tr>\\\n\t\t\t\t\t<td colspan=\"3\"><hr></td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\treturn rows + '</table>';\n\t\t\t}\n\n\t\t\tfunction print_other_charges_and_totals() {\n\t\t\t\tvar totals = '<table width=\"100%\">';\n\t\t\t\t// print net total\n\t\t\t\ttotals +='<tr>\\\n\t\t\t\t\t<td align=\"right\" width=\"70%\">Net Total</td>\\\n\t\t\t\t\t<td align=\"right\">' + format_currency(doc.net_total_export) + '</td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\t// print exclusive taxes\n\t\t\t\tvar taxes = frappe.model.get_children(\"Sales Taxes and Charges\", doc.name, \"other_charges\", \"Sales Invoice\");\n\t\t\t\tif (taxes) {\n\t\t\t\t\t$.each(taxes, function(i, d) {\n\t\t\t\t\t\tif (!d.included_in_print_rate && d.tax_amount) {\n\t\t\t\t\t\t\ttotals += '<tr>\\\n\t\t\t\t\t\t\t\t<td align=\"right\">' + d.description + '</td>\\\n\t\t\t\t\t\t\t\t<td align=\"right\">' + format_currency(d.tax_amount) + '</td>\\\n\t\t\t\t\t\t\t<tr>';\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// show discount amount\n\t\t\t\tif (doc.discount_amount) {\n\t\t\t\t\ttotals += '<tr>\\\n\t\t\t\t\t\t<td align=\"right\">Discount Amount</td>\\\n\t\t\t\t\t\t<td align=\"right\">' + format_currency(doc.discount_amount) + '</td>\\\n\t\t\t\t\t<tr>';\n\t\t\t\t}\n\n\t\t\t\t// print grand total\n\t\t\t\ttotals += '<tr>\\\n\t\t\t\t\t<td align=\"right\">Grand Total</td>\\\n\t\t\t\t\t<td align=\"right\"><hr width=\"90%\" align=\"right\">' + format_currency(doc.grand_total_export) + '<br>\\\n\t\t\t\t\t<hr width=\"90%\" align=\"right\"></td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\treturn totals + '</table>';\n\t\t\t}\n\n\t\t\tfunction print_inclusive_taxes() {\n\t\t\t\tvar count = 0;\n\t\t\t\tvar inc_tax = '';\n\t\t\t\tvar taxes = frappe.model.get_children(\"Sales Taxes and Charges\", doc.name, \"other_charges\", \"Sales Invoice\");\n\t\t\t\tif (taxes) {\n\t\t\t\t\t$.each(taxes, function(i, d) {\n\t\t\t\t\t\tif (d.included_in_print_rate && d.tax_amount) {\n\t\t\t\t\t\t\tif (count == 0) {\n\t\t\t\t\t\t\t\tinc_tax = '<table width=\"100%\">\\\n\t\t\t\t\t\t\t\t\t<tr>\\\n\t\t\t\t\t\t\t\t\t\t<td colspan=\"2\"><b>Inclusive Taxes</b></td>\\\n\t\t\t\t\t\t\t\t\t</tr>';\n\t\t\t\t\t\t\t\tcount += 1;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tinc_tax += '<tr>\\\n\t\t\t\t\t\t\t\t<td width=\"60%\">' + d.description + '</td>\\\n\t\t\t\t\t\t\t\t<td>' + format_currency(d.tax_amount) + '</td>\\\n\t\t\t\t\t\t\t<tr>';\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (inc_tax) {\n\t\t\t\t\tinc_tax += '<tr>\\\n\t\t\t\t\t\t<td colspan=\"2\"><hr></td>\\\n\t\t\t\t\t</tr></table>';\n\t\t\t\t}\n\n\t\t\t\treturn inc_tax;\n\t\t\t}\n\n\t\t\tfunction print_footer() {\n\t\t\t\tvar footer = '<table width=\"100%\">';\n\n\t\t\t\t// print terms\n\t\t\t\tif (doc.terms) {\n\t\t\t\t\tfooter += '<tr>\\\n\t\t\t\t\t\t<td align=\"center\">' + doc.terms + '</td>\\\n\t\t\t\t\t</tr>';\n\t\t\t\t}\n\n\t\t\t\tfooter +='<tr>\\\n\t\t\t\t\t<td align=\"center\">Thank You. Please visit again.</td>\\\n\t\t\t\t</tr>';\n\n\t\t\t\treturn footer + '</table>';\n\t\t\t}\n\t\t</script>\n\t</head>\n\n\t<body>\n\t\t<!--Headers, Item Table, Totals & Footer-->\n\t\t<div><script>print_header();</script></div>\n\t\t<div><script>print_items();</script></div>\n\t\t<div><script>print_inclusive_taxes();</script></div>\n\t\t<div><script>print_other_charges_and_totals();</script></div>\n\t\t<div><script>print_footer();</script></div>\n\t</body>\n</html>",
+ "idx": 1,
+ "modified": "2014-01-27 17:26:10.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "POS Invoice",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt b/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt
index 73bc63b..aacb311 100755
--- a/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt
+++ b/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt
@@ -1,21 +1,14 @@
-[
- {
- "creation": "2012-05-01 12:46:31",
- "docstatus": 0,
- "modified": "2013-01-21 18:40:20",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Journal Voucher",
- "doctype": "Print Format",
- "html": "<h3 align=\"center\"><script>doc.select_print_heading || \"Payment Receipt Note\"</script></h3>\n\n<table class='simpletable'>\n<tr>\n<td><b> Receipt No.: </b></td>\n<td><script>doc.name</script></td>\n</tr>\n<tr>\n<td><b> Date : </b></td>\n<td><script>date.str_to_user(doc.voucher_date)</script></td>\n</tr> \n<tr>\n<td><b> Remark: </b></td>\n<td><script> doc.remark </script></td>\n</tr>\n<tr>\n<td><b> Received From: </b></td>\n<td><b><script> doc.pay_to_recd_from </script></b></td>\n</tr>\n</table>\n<br>\n\n<div><b><script>doc.total_amount</script></b> </td></div><br>\n<div style=\"text-align:left\"><b><script>doc.total_amount_in_words</script></b></div><br>\n<br>\n<table class=\"noborder\">\n<tr>\n<td style = \"text-align = right;\"><h3>For <script>doc.company</script>,</h3><br><div>(Authorised Signatory)</div></td>\n</tr>\n</table>",
- "module": "Accounts",
- "name": "__common__",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Payment Receipt Voucher"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-05-01 12:46:31.000000",
+ "doc_type": "Journal Voucher",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<h3 align=\"center\"><script>doc.select_print_heading || \"Payment Receipt Note\"</script></h3>\n\n<table class='simpletable'>\n<tr>\n<td><b> Receipt No.: </b></td>\n<td><script>doc.name</script></td>\n</tr>\n<tr>\n<td><b> Date : </b></td>\n<td><script>date.str_to_user(doc.voucher_date)</script></td>\n</tr> \n<tr>\n<td><b> Remark: </b></td>\n<td><script> doc.remark </script></td>\n</tr>\n<tr>\n<td><b> Received From: </b></td>\n<td><b><script> doc.pay_to_recd_from </script></b></td>\n</tr>\n</table>\n<br>\n\n<div><b><script>doc.total_amount</script></b> </td></div><br>\n<div style=\"text-align:left\"><b><script>doc.total_amount_in_words</script></b></div><br>\n<br>\n<table class=\"noborder\">\n<tr>\n<td style = \"text-align = right;\"><h3>For <script>doc.company</script>,</h3><br><div>(Authorised Signatory)</div></td>\n</tr>\n</table>",
+ "idx": 1,
+ "modified": "2013-01-21 18:40:20.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Payment Receipt Voucher",
+ "owner": "Administrator",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt
index 5bf9bf3..795df9a 100644
--- a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt
+++ b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-04-19 13:30:27",
- "docstatus": 0,
- "modified": "2014-02-11 17:33:08",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Sales Invoice",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Georgia\", serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Georgia\", serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table thead {\n\t\tborder-bottom: 1px solid black;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px 0px;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Sales Invoice',\n\t\t\t\tdoc.name,\n\t\t\t\t'entries',\n\t\t\t\t'Sales Invoice Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '20%', '37%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td><script>'<h1>' + (doc.select_print_heading || 'Invoice') + '</h1>'</script></td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=40%><b>Invoice Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.posting_date)</script></td>\n\t\t\t\t\t<tr>\n <tr>\n \t\t\t\t\t<td width=40%><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?\"<b>Invoice Period</b>\"\n :\"\";\n \t\t\t\t\t</script></td>\n\t\t\t\t\t\t<td><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?(date.str_to_user(doc.invoice_period_from_date) +\n ' to ' + date.str_to_user(doc.invoice_period_to_date))\n :\"\";\n </script></td>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Due Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.due_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
- "module": "Accounts",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Sales Invoice Classic"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-19 13:30:27.000000",
+ "doc_type": "Sales Invoice",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Georgia\", serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Georgia\", serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table thead {\n\t\tborder-bottom: 1px solid black;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px 0px;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Sales Invoice',\n\t\t\t\tdoc.name,\n\t\t\t\t'entries',\n\t\t\t\t'Sales Invoice Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '20%', '37%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td><script>'<h1>' + (doc.select_print_heading || 'Invoice') + '</h1>'</script></td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=40%><b>Invoice Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.posting_date)</script></td>\n\t\t\t\t\t<tr>\n <tr>\n \t\t\t\t\t<td width=40%><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?\"<b>Invoice Period</b>\"\n :\"\";\n \t\t\t\t\t</script></td>\n\t\t\t\t\t\t<td><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?(date.str_to_user(doc.invoice_period_from_date) +\n ' to ' + date.str_to_user(doc.invoice_period_to_date))\n :\"\";\n </script></td>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Due Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.due_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
+ "idx": 1,
+ "modified": "2014-02-11 17:33:08.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Invoice Classic",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt
index f36f4a5..567da70 100644
--- a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt
+++ b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-04-19 13:30:27",
- "docstatus": 0,
- "modified": "2014-02-11 17:33:05",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Sales Invoice",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n line-height: 150%;\n\t}\n\n\t.common {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t\tborder-style: none !important;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t\tborder-style: none !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h1 {\n\t\ttext-transform: uppercase;\n\t\tcolor: white;\n\t\tfont-size: 55px;\n\t\tfont-style: italic;\n\t}\n\n\ttable.header-table thead tr:nth-child(1) div {\n\t\theight: 24px;\n\t\tbackground-color: #696969;\n\t\tvertical-align: middle;\n\t\tpadding: 12px 0px 0px 0px;\n\t\twidth: 100%;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body table tr td {\n\t\tbackground-color: #DCDCDC !important;\n\t}\n\n\tdiv.page-body table tr:nth-child(1) td {\n\t\tbackground-color: #696969 !important;\n\t\tcolor: white !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table tfoot td {\n\t\tbackground-color: #696969;\n\t\theight: 10px;\n\t}\n\n\t.imp-details {\n\t\tbackground-color: #DCDCDC;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Sales Invoice',\n\t\t\t\tdoc.name,\n\t\t\t\t'entries',\n\t\t\t\t'Sales Invoice Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '20%', '37%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Invoice') + '</h1>'</script></div></td></tr>\n\t\t\t<tr><td colspan=2><div style=\"height:15px\"></div></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr class='imp-details'>\n\t\t\t\t\t\t<td><b>Invoice No.</b></td>\n\t\t\t\t\t\t<td><script>cur_frm.docname</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=40%><b>Invoice Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.posting_date)</script></td>\n\t\t\t\t\t<tr>\n <tr>\n \t\t\t\t<td width=40%><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?\"<b>Invoice Period</b>\"\n :\"\";\n \t\t\t\t\t</script></td>\n\t\t\t\t\t\t<td><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?(date.str_to_user(doc.invoice_period_from_date) +\n ' to ' + date.str_to_user(doc.invoice_period_to_date))\n :\"\";\n </script></td>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Due Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.due_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold' class='imp-details'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr><td colspan=2><div></div></td><tr>\n\t\t</tfoot>\n\t</table>\n</div>",
- "module": "Accounts",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Sales Invoice Modern"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-19 13:30:27.000000",
+ "doc_type": "Sales Invoice",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n line-height: 150%;\n\t}\n\n\t.common {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t\tborder-style: none !important;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t\tborder-style: none !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h1 {\n\t\ttext-transform: uppercase;\n\t\tcolor: white;\n\t\tfont-size: 55px;\n\t\tfont-style: italic;\n\t}\n\n\ttable.header-table thead tr:nth-child(1) div {\n\t\theight: 24px;\n\t\tbackground-color: #696969;\n\t\tvertical-align: middle;\n\t\tpadding: 12px 0px 0px 0px;\n\t\twidth: 100%;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body table tr td {\n\t\tbackground-color: #DCDCDC !important;\n\t}\n\n\tdiv.page-body table tr:nth-child(1) td {\n\t\tbackground-color: #696969 !important;\n\t\tcolor: white !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table tfoot td {\n\t\tbackground-color: #696969;\n\t\theight: 10px;\n\t}\n\n\t.imp-details {\n\t\tbackground-color: #DCDCDC;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Sales Invoice',\n\t\t\t\tdoc.name,\n\t\t\t\t'entries',\n\t\t\t\t'Sales Invoice Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '20%', '37%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Invoice') + '</h1>'</script></div></td></tr>\n\t\t\t<tr><td colspan=2><div style=\"height:15px\"></div></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr class='imp-details'>\n\t\t\t\t\t\t<td><b>Invoice No.</b></td>\n\t\t\t\t\t\t<td><script>cur_frm.docname</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=40%><b>Invoice Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.posting_date)</script></td>\n\t\t\t\t\t<tr>\n <tr>\n \t\t\t\t<td width=40%><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?\"<b>Invoice Period</b>\"\n :\"\";\n \t\t\t\t\t</script></td>\n\t\t\t\t\t\t<td><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?(date.str_to_user(doc.invoice_period_from_date) +\n ' to ' + date.str_to_user(doc.invoice_period_to_date))\n :\"\";\n </script></td>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Due Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.due_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold' class='imp-details'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr><td colspan=2><div></div></td><tr>\n\t\t</tfoot>\n\t</table>\n</div>",
+ "idx": 1,
+ "modified": "2014-02-11 17:33:05.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Invoice Modern",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt
index e60f8a0..7c3de89 100644
--- a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt
+++ b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-04-19 13:30:27",
- "docstatus": 0,
- "modified": "2014-02-11 17:34:00",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Sales Invoice",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 0px;\n\t}\n\n\ttable {\n\t\twidth: 100% !important;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\n\ttable, td {\n\t\tborder-collapse: collapse !important;\n\t\tpadding: 0px;\n\t\tmargin: 0px !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px;\n\t}\n\n\ttable.header-table > thead,\n\ttable.header-table > tbody > tr > td,\n\ttable.footer-table > tbody > tr > td {\n\t\tborder: 1px solid black;\n\t\tpadding: 5px;\n\t}\n\n\ttable.footer-table > tbody,\n\ttable.header-table > thead {\n\t\tborder-bottom: 3px solid black;\n\t}\n\n\ttable.header-table > thead {\n\t\tborder-top: 3px solid black;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body td {\n\t\tbackground-color: white !important;\n\t\tborder: 1px solid black !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Sales Invoice',\n\t\t\t\tdoc.name,\n\t\t\t\t'entries',\n\t\t\t\t'Sales Invoice Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '20%', '37%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td></td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Invoice') + '</h1>'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=40%><b>Invoice Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.posting_date)</script></td>\n\t\t\t\t\t<tr>\n <tr>\n \t\t\t\t<td width=40%><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?\"<b>Invoice Period</b>\"\n :\"\";\n \t\t\t\t\t</script></td>\n\t\t\t\t\t\t<td><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?(date.str_to_user(doc.invoice_period_from_date) +\n ' to ' + date.str_to_user(doc.invoice_period_to_date))\n :\"\";\n </script></td>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Due Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.due_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
- "module": "Accounts",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Sales Invoice Spartan"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-19 13:30:27.000000",
+ "doc_type": "Sales Invoice",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 0px;\n\t}\n\n\ttable {\n\t\twidth: 100% !important;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\n\ttable, td {\n\t\tborder-collapse: collapse !important;\n\t\tpadding: 0px;\n\t\tmargin: 0px !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px;\n\t}\n\n\ttable.header-table > thead,\n\ttable.header-table > tbody > tr > td,\n\ttable.footer-table > tbody > tr > td {\n\t\tborder: 1px solid black;\n\t\tpadding: 5px;\n\t}\n\n\ttable.footer-table > tbody,\n\ttable.header-table > thead {\n\t\tborder-bottom: 3px solid black;\n\t}\n\n\ttable.header-table > thead {\n\t\tborder-top: 3px solid black;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body td {\n\t\tbackground-color: white !important;\n\t\tborder: 1px solid black !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Sales Invoice',\n\t\t\t\tdoc.name,\n\t\t\t\t'entries',\n\t\t\t\t'Sales Invoice Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '20%', '37%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td></td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Invoice') + '</h1>'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=40%><b>Invoice Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.posting_date)</script></td>\n\t\t\t\t\t<tr>\n <tr>\n \t\t\t\t<td width=40%><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?\"<b>Invoice Period</b>\"\n :\"\";\n \t\t\t\t\t</script></td>\n\t\t\t\t\t\t<td><script>\n (doc.convert_into_recurring_invoice && doc.recurring_id)\n ?(date.str_to_user(doc.invoice_period_from_date) +\n ' to ' + date.str_to_user(doc.invoice_period_to_date))\n :\"\";\n </script></td>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Due Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.due_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
+ "idx": 1,
+ "modified": "2014-02-11 17:34:00.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Invoice Spartan",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt b/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt
index d2b1cdb..6c66cb8 100644
--- a/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt
+++ b/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt
@@ -1,20 +1,13 @@
-[
- {
- "creation": "2013-03-21 15:24:28",
- "docstatus": 0,
- "modified": "2013-03-21 15:26:21",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Sales Invoice",
- "doctype": "Print Format",
- "module": "Accounts",
- "name": "__common__",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "SalesInvoice"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-03-21 15:24:28.000000",
+ "doc_type": "Sales Invoice",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "idx": 1,
+ "modified": "2013-03-21 15:26:21.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "SalesInvoice",
+ "owner": "Administrator",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js
index 2577ccf..76a1e56 100644
--- a/erpnext/accounts/doctype/account/account.js
+++ b/erpnext/accounts/doctype/account/account.js
@@ -18,7 +18,7 @@
if(doc.group_or_ledger=='Ledger') {
frappe.model.with_doc("Accounts Settings", "Accounts Settings", function (name) {
- var accounts_settings = frappe.model.get_doc("Accounts Settings", name);
+ var accounts_settings = frappe.get_doc("Accounts Settings", name);
var display = accounts_settings["frozen_accounts_modifier"]
&& in_list(user_roles, accounts_settings["frozen_accounts_modifier"]);
@@ -87,7 +87,7 @@
}
cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) {
- return $c_obj(cur_frm.get_doclist(),'convert_group_to_ledger','',function(r,rt) {
+ return $c_obj(cur_frm.doc,'convert_group_to_ledger','',function(r,rt) {
if(r.message == 1) {
cur_frm.refresh();
}
@@ -95,7 +95,7 @@
}
cur_frm.cscript.convert_to_group = function(doc, cdt, cdn) {
- return $c_obj(cur_frm.get_doclist(),'convert_ledger_to_group','',function(r,rt) {
+ return $c_obj(cur_frm.doc,'convert_ledger_to_group','',function(r,rt) {
if(r.message == 1) {
cur_frm.refresh();
}
diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py
index 4c3e4d1..0c88aeb 100644
--- a/erpnext/accounts/doctype/account/account.py
+++ b/erpnext/accounts/doctype/account/account.py
@@ -9,10 +9,10 @@
get_value = frappe.db.get_value
-class DocType:
- def __init__(self,d,dl):
- self.doc, self.doclist = d,dl
- self.nsm_parent_field = 'parent_account'
+from frappe.model.document import Document
+
+class Account(Document):
+ nsm_parent_field = 'parent_account'
def autoname(self):
self.doc.name = self.doc.account_name.strip() + ' - ' + \
diff --git a/erpnext/accounts/doctype/account/account.txt b/erpnext/accounts/doctype/account/account.txt
index 17d77f9..85ab439 100644
--- a/erpnext/accounts/doctype/account/account.txt
+++ b/erpnext/accounts/doctype/account/account.txt
@@ -1,317 +1,326 @@
-[
- {
- "creation": "2013-01-30 12:49:46",
- "docstatus": 0,
- "modified": "2014-03-19 12:07:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_copy": 1,
- "allow_rename": 1,
- "description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-money",
- "in_create": 1,
- "module": "Accounts",
- "name": "__common__",
- "search_fields": "group_or_ledger"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Account",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Account",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Account"
- },
- {
- "doctype": "DocField",
- "fieldname": "properties",
- "fieldtype": "Section Break",
- "label": "Account Details",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "account_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Account Name",
- "no_copy": 1,
- "oldfieldname": "account_name",
- "oldfieldtype": "Data",
- "read_only": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "level",
- "fieldtype": "Int",
- "hidden": 1,
- "label": "Level",
- "oldfieldname": "level",
- "oldfieldtype": "Int",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "default": "Ledger",
- "doctype": "DocField",
- "fieldname": "group_or_ledger",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Group or Ledger",
- "oldfieldname": "group_or_ledger",
- "oldfieldtype": "Select",
- "options": "\nLedger\nGroup",
- "read_only": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "read_only": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "parent_account",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Parent Account",
- "oldfieldname": "parent_account",
- "oldfieldtype": "Link",
- "options": "Account",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "report_type",
- "fieldtype": "Select",
- "label": "Report Type",
- "options": "\nBalance Sheet\nProfit and Loss"
- },
- {
- "description": "Setting Account Type helps in selecting this Account in transactions.",
- "doctype": "DocField",
- "fieldname": "account_type",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Account Type",
- "oldfieldname": "account_type",
- "oldfieldtype": "Select",
- "options": "Bank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment",
- "search_index": 0
- },
- {
- "description": "Rate at which this tax is applied",
- "doctype": "DocField",
- "fieldname": "tax_rate",
- "fieldtype": "Float",
- "hidden": 0,
- "label": "Rate",
- "oldfieldname": "tax_rate",
- "oldfieldtype": "Currency",
- "reqd": 0
- },
- {
- "description": "If the account is frozen, entries are allowed to restricted users.",
- "doctype": "DocField",
- "fieldname": "freeze_account",
- "fieldtype": "Select",
- "label": "Frozen",
- "oldfieldname": "freeze_account",
- "oldfieldtype": "Select",
- "options": "No\nYes"
- },
- {
- "doctype": "DocField",
- "fieldname": "credit_days",
- "fieldtype": "Int",
- "hidden": 1,
- "label": "Credit Days",
- "oldfieldname": "credit_days",
- "oldfieldtype": "Int",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "credit_limit",
- "fieldtype": "Currency",
- "hidden": 1,
- "label": "Credit Limit",
- "oldfieldname": "credit_limit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1
- },
- {
- "description": "If this Account represents a Customer, Supplier or Employee, set it here.",
- "doctype": "DocField",
- "fieldname": "master_type",
- "fieldtype": "Select",
- "label": "Master Type",
- "oldfieldname": "master_type",
- "oldfieldtype": "Select",
- "options": "\nSupplier\nCustomer\nEmployee"
- },
- {
- "doctype": "DocField",
- "fieldname": "master_name",
- "fieldtype": "Link",
- "label": "Master Name",
- "oldfieldname": "master_name",
- "oldfieldtype": "Link",
- "options": "[Select]"
- },
- {
- "doctype": "DocField",
- "fieldname": "balance_must_be",
- "fieldtype": "Select",
- "label": "Balance must be",
- "options": "\nDebit\nCredit"
- },
- {
- "doctype": "DocField",
- "fieldname": "lft",
- "fieldtype": "Int",
- "hidden": 1,
- "label": "Lft",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rgt",
- "fieldtype": "Int",
- "hidden": 1,
- "label": "Rgt",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "old_parent",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Old Parent",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "role": "Accounts User",
- "write": 1
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "role": "Auditor",
- "write": 0
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "role": "Sales User",
- "write": 0
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "role": "Purchase User",
- "write": 0
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "permlevel": 2,
- "role": "Auditor",
- "write": 0
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "export": 0,
- "import": 0,
- "permlevel": 0,
- "print": 1,
- "restrict": 1,
- "role": "Accounts Manager",
- "write": 1
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "permlevel": 2,
- "role": "Accounts Manager",
- "write": 1
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "permlevel": 2,
- "role": "Accounts User",
- "write": 0
- }
-]
\ No newline at end of file
+{
+ "allow_copy": 1,
+ "allow_rename": 1,
+ "creation": "2013-01-30 12:49:46.000000",
+ "description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "properties",
+ "fieldtype": "Section Break",
+ "label": "Account Details",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "account_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Account Name",
+ "no_copy": 1,
+ "oldfieldname": "account_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "level",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "label": "Level",
+ "oldfieldname": "level",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "default": "Ledger",
+ "fieldname": "group_or_ledger",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Group or Ledger",
+ "oldfieldname": "group_or_ledger",
+ "oldfieldtype": "Select",
+ "options": "\nLedger\nGroup",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "parent_account",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Parent Account",
+ "oldfieldname": "parent_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "report_type",
+ "fieldtype": "Select",
+ "label": "Report Type",
+ "options": "\nBalance Sheet\nProfit and Loss",
+ "permlevel": 0
+ },
+ {
+ "description": "Setting Account Type helps in selecting this Account in transactions.",
+ "fieldname": "account_type",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Account Type",
+ "oldfieldname": "account_type",
+ "oldfieldtype": "Select",
+ "options": "Bank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "description": "Rate at which this tax is applied",
+ "fieldname": "tax_rate",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "label": "Rate",
+ "oldfieldname": "tax_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "description": "If the account is frozen, entries are allowed to restricted users.",
+ "fieldname": "freeze_account",
+ "fieldtype": "Select",
+ "label": "Frozen",
+ "oldfieldname": "freeze_account",
+ "oldfieldtype": "Select",
+ "options": "No\nYes",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "credit_days",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "label": "Credit Days",
+ "oldfieldname": "credit_days",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "credit_limit",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "label": "Credit Limit",
+ "oldfieldname": "credit_limit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "description": "If this Account represents a Customer, Supplier or Employee, set it here.",
+ "fieldname": "master_type",
+ "fieldtype": "Select",
+ "label": "Master Type",
+ "oldfieldname": "master_type",
+ "oldfieldtype": "Select",
+ "options": "\nSupplier\nCustomer\nEmployee",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "master_name",
+ "fieldtype": "Link",
+ "label": "Master Name",
+ "oldfieldname": "master_name",
+ "oldfieldtype": "Link",
+ "options": "[Select]",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "balance_must_be",
+ "fieldtype": "Select",
+ "label": "Balance must be",
+ "options": "\nDebit\nCredit",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "lft",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "label": "Lft",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "rgt",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "label": "Rgt",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "old_parent",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Old Parent",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-money",
+ "idx": 1,
+ "in_create": 1,
+ "modified": "2014-03-19 12:07:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Account",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Auditor",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "permlevel": 2,
+ "read": 1,
+ "report": 1,
+ "role": "Auditor",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "restrict": 1,
+ "role": "Accounts Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "permlevel": 2,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "permlevel": 2,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 0,
+ "write": 0
+ }
+ ],
+ "search_fields": "group_or_ledger"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py
index 3e01eea..ab7e8ab 100644
--- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py
+++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py
@@ -8,9 +8,9 @@
from frappe import _
from frappe.utils import cint
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class AccountsSettings(Document):
def on_update(self):
frappe.db.set_default("auto_accounting_for_stock", self.doc.auto_accounting_for_stock)
diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt b/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt
index f36e218..942de75 100644
--- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt
+++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt
@@ -1,85 +1,66 @@
-[
- {
- "creation": "2013-06-24 15:49:57",
- "docstatus": 0,
- "modified": "2013-12-20 19:22:52",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "description": "Settings for Accounts",
- "doctype": "DocType",
- "icon": "icon-cog",
- "issingle": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Accounts Settings",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Accounts Settings",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "role": "Accounts Manager",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Accounts Settings"
- },
- {
- "default": "1",
- "description": "If enabled, the system will post accounting entries for inventory automatically.",
- "doctype": "DocField",
- "fieldname": "auto_accounting_for_stock",
- "fieldtype": "Check",
- "label": "Make Accounting Entry For Every Stock Movement"
- },
- {
- "description": "Accounting entry frozen up to this date, nobody can do / modify entry except role specified below.",
- "doctype": "DocField",
- "fieldname": "acc_frozen_upto",
- "fieldtype": "Date",
- "label": "Accounts Frozen Upto"
- },
- {
- "description": "Users with this role are allowed to create / modify accounting entry before frozen date",
- "doctype": "DocField",
- "fieldname": "bde_auth_role",
- "fieldtype": "Link",
- "label": "Allowed Role to Edit Entries Before Frozen Date",
- "options": "Role"
- },
- {
- "description": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts",
- "doctype": "DocField",
- "fieldname": "frozen_accounts_modifier",
- "fieldtype": "Link",
- "label": "Frozen Accounts Modifier",
- "options": "Role"
- },
- {
- "description": "Role that is allowed to submit transactions that exceed credit limits set.",
- "doctype": "DocField",
- "fieldname": "credit_controller",
- "fieldtype": "Link",
- "label": "Credit Controller",
- "options": "Role"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-24 15:49:57.000000",
+ "description": "Settings for Accounts",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "default": "1",
+ "description": "If enabled, the system will post accounting entries for inventory automatically.",
+ "fieldname": "auto_accounting_for_stock",
+ "fieldtype": "Check",
+ "label": "Make Accounting Entry For Every Stock Movement",
+ "permlevel": 0
+ },
+ {
+ "description": "Accounting entry frozen up to this date, nobody can do / modify entry except role specified below.",
+ "fieldname": "acc_frozen_upto",
+ "fieldtype": "Date",
+ "label": "Accounts Frozen Upto",
+ "permlevel": 0
+ },
+ {
+ "description": "Users with this role are allowed to create / modify accounting entry before frozen date",
+ "fieldname": "bde_auth_role",
+ "fieldtype": "Link",
+ "label": "Allowed Role to Edit Entries Before Frozen Date",
+ "options": "Role",
+ "permlevel": 0
+ },
+ {
+ "description": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts",
+ "fieldname": "frozen_accounts_modifier",
+ "fieldtype": "Link",
+ "label": "Frozen Accounts Modifier",
+ "options": "Role",
+ "permlevel": 0
+ },
+ {
+ "description": "Role that is allowed to submit transactions that exceed credit limits set.",
+ "fieldname": "credit_controller",
+ "fieldtype": "Link",
+ "label": "Credit Controller",
+ "options": "Role",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-cog",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-12-20 19:22:52.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Accounts Settings",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "Accounts Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
index 859c9d0..5ad447c 100644
--- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
+++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py
@@ -5,17 +5,11 @@
import frappe
from frappe.utils import cstr, flt, getdate, now, nowdate
-from frappe.model import db_exists
-from frappe.model.doc import addchild
-from frappe.model.bean import getlist, copy_doclist
from frappe import msgprint
-
+from frappe.model.document import Document
-
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+class BankReconciliation(Document):
def get_details(self):
if not (self.doc.bank_account and self.doc.from_date and self.doc.to_date):
@@ -24,11 +18,11 @@
dl = frappe.db.sql("select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, t2.credit, t1.posting_date, t2.against_account from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 where t2.parent = t1.name and t2.account = %s and (clearance_date is null or clearance_date = '0000-00-00' or clearance_date = '') and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1", (self.doc.bank_account, self.doc.from_date, self.doc.to_date))
- self.doclist = self.doc.clear_table(self.doclist, 'entries')
+ self.set('entries', [])
self.doc.total_amount = 0.0
for d in dl:
- nl = addchild(self.doc, 'entries', 'Bank Reconciliation Detail', self.doclist)
+ nl = self.doc.append('entries', {})
nl.posting_date = cstr(d[5])
nl.voucher_id = cstr(d[0])
nl.cheque_number = cstr(d[1])
@@ -40,7 +34,7 @@
def update_details(self):
vouchers = []
- for d in getlist(self.doclist, 'entries'):
+ for d in self.get('entries'):
if d.clearance_date:
if d.cheque_date and getdate(d.clearance_date) < getdate(d.cheque_date):
msgprint("Clearance Date can not be before Cheque Date (Row #%s)" %
diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt
index 3cd385b..eff6e6d 100644
--- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt
+++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt
@@ -1,115 +1,96 @@
-[
- {
- "creation": "2013-01-10 16:34:05",
- "docstatus": 0,
- "modified": "2013-07-05 14:26:22",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_copy": 1,
- "allow_email": 1,
- "allow_print": 1,
- "doctype": "DocType",
- "hide_heading": 1,
- "hide_toolbar": 1,
- "icon": "icon-check",
- "issingle": 1,
- "module": "Accounts",
- "name": "__common__",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Bank Reconciliation",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Bank Reconciliation",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "report": 0,
- "role": "Accounts User",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Bank Reconciliation"
- },
- {
- "description": "Select account head of the bank where cheque was deposited.",
- "doctype": "DocField",
- "fieldname": "bank_account",
- "fieldtype": "Link",
- "label": "Bank Account",
- "options": "Account",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 1,
- "label": "Company",
- "options": "Company",
- "print_hide": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "from_date",
- "fieldtype": "Date",
- "label": "From Date",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "to_date",
- "fieldtype": "Date",
- "label": "To Date",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "get_non_reconciled_entries",
- "fieldtype": "Button",
- "label": "Get Non Reconciled Entries",
- "options": "get_details"
- },
- {
- "doctype": "DocField",
- "fieldname": "entries",
- "fieldtype": "Table",
- "label": "Entries",
- "options": "Bank Reconciliation Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "update_clearance_date",
- "fieldtype": "Button",
- "label": "Update Clearance Date",
- "options": "update_details"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_amount",
- "fieldtype": "Currency",
- "label": "Total Amount",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_copy": 1,
+ "allow_email": 1,
+ "allow_print": 1,
+ "creation": "2013-01-10 16:34:05.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "Select account head of the bank where cheque was deposited.",
+ "fieldname": "bank_account",
+ "fieldtype": "Link",
+ "label": "Bank Account",
+ "options": "Account",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "from_date",
+ "fieldtype": "Date",
+ "label": "From Date",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "to_date",
+ "fieldtype": "Date",
+ "label": "To Date",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "get_non_reconciled_entries",
+ "fieldtype": "Button",
+ "label": "Get Non Reconciled Entries",
+ "options": "get_details",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "entries",
+ "fieldtype": "Table",
+ "label": "Entries",
+ "options": "Bank Reconciliation Detail",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "update_clearance_date",
+ "fieldtype": "Button",
+ "label": "Update Clearance Date",
+ "options": "update_details",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "total_amount",
+ "fieldtype": "Currency",
+ "label": "Total Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "hide_heading": 1,
+ "hide_toolbar": 1,
+ "icon": "icon-check",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-07-05 14:26:22.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Bank Reconciliation",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "permlevel": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Accounts User",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 1
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py
index 26c87f1..93dca1d 100644
--- a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py
+++ b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class BankReconciliationDetail(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt
index 47ff4f1..250dc45 100644
--- a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt
+++ b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt
@@ -1,108 +1,109 @@
-[
- {
- "creation": "2013-02-22 01:27:37",
- "docstatus": 0,
- "modified": "2013-12-20 19:22:55",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "no_copy": 0,
- "parent": "Bank Reconciliation Detail",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "search_index": 0
- },
- {
- "doctype": "DocType",
- "name": "Bank Reconciliation Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "voucher_id",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Voucher ID",
- "oldfieldname": "voucher_id",
- "oldfieldtype": "Link",
- "options": "Journal Voucher"
- },
- {
- "doctype": "DocField",
- "fieldname": "against_account",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Against Account",
- "oldfieldname": "against_account",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "label": "Posting Date",
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "clearance_date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "label": "Clearance Date",
- "oldfieldname": "clearance_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "cheque_number",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Cheque Number",
- "oldfieldname": "cheque_number",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cheque_date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "label": "Cheque Date",
- "oldfieldname": "cheque_date",
- "oldfieldtype": "Date",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "debit",
- "fieldtype": "Currency",
- "label": "Debit",
- "oldfieldname": "debit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "credit",
- "fieldtype": "Currency",
- "label": "Credit",
- "oldfieldname": "credit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:37.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "voucher_id",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Voucher ID",
+ "no_copy": 0,
+ "oldfieldname": "voucher_id",
+ "oldfieldtype": "Link",
+ "options": "Journal Voucher",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "against_account",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Against Account",
+ "no_copy": 0,
+ "oldfieldname": "against_account",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Posting Date",
+ "no_copy": 0,
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "clearance_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Clearance Date",
+ "no_copy": 0,
+ "oldfieldname": "clearance_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "cheque_number",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Cheque Number",
+ "no_copy": 0,
+ "oldfieldname": "cheque_number",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "cheque_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Cheque Date",
+ "no_copy": 0,
+ "oldfieldname": "cheque_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "debit",
+ "fieldtype": "Currency",
+ "label": "Debit",
+ "no_copy": 0,
+ "oldfieldname": "debit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "credit",
+ "fieldtype": "Currency",
+ "label": "Credit",
+ "no_copy": 0,
+ "oldfieldname": "credit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:22:55.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Bank Reconciliation Detail",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/budget_detail/budget_detail.py b/erpnext/accounts/doctype/budget_detail/budget_detail.py
index 26c87f1..58106a0 100644
--- a/erpnext/accounts/doctype/budget_detail/budget_detail.py
+++ b/erpnext/accounts/doctype/budget_detail/budget_detail.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class BudgetDetail(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/budget_detail/budget_detail.txt b/erpnext/accounts/doctype/budget_detail/budget_detail.txt
index 31312c9..f8a969c 100644
--- a/erpnext/accounts/doctype/budget_detail/budget_detail.txt
+++ b/erpnext/accounts/doctype/budget_detail/budget_detail.txt
@@ -1,61 +1,52 @@
-[
- {
- "creation": "2013-03-07 11:55:04",
- "docstatus": 0,
- "modified": "2013-12-20 19:22:59",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "CBD/.######",
- "doctype": "DocType",
- "istable": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Budget Detail",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "reqd": 1
- },
- {
- "doctype": "DocType",
- "name": "Budget Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "account",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Account",
- "oldfieldname": "account",
- "oldfieldtype": "Link",
- "options": "Account",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "budget_allocated",
- "fieldtype": "Currency",
- "label": "Budget Allocated",
- "oldfieldname": "budget_allocated",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "search_index": 1
- }
-]
\ No newline at end of file
+{
+ "autoname": "CBD/.######",
+ "creation": "2013-03-07 11:55:04.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "account",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Account",
+ "oldfieldname": "account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "budget_allocated",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Budget Allocated",
+ "oldfieldname": "budget_allocated",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:22:59.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Budget Detail",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/budget_distribution/budget_distribution.js b/erpnext/accounts/doctype/budget_distribution/budget_distribution.js
index c256374..3c11d87 100644
--- a/erpnext/accounts/doctype/budget_distribution/budget_distribution.js
+++ b/erpnext/accounts/doctype/budget_distribution/budget_distribution.js
@@ -7,8 +7,7 @@
refresh_field('budget_distribution_details');
}
- return $c('runserverobj',args={'method' : 'get_months', 'docs' :
- frappe.model.compress(make_doclist(doc.doctype, doc.name))},callback1);
+ return $c('runserverobj',args={'method':'get_months', 'docs':doc}, callback1);
}
}
diff --git a/erpnext/accounts/doctype/budget_distribution/budget_distribution.py b/erpnext/accounts/doctype/budget_distribution/budget_distribution.py
index 5173097..069c4d3 100644
--- a/erpnext/accounts/doctype/budget_distribution/budget_distribution.py
+++ b/erpnext/accounts/doctype/budget_distribution/budget_distribution.py
@@ -5,21 +5,18 @@
import frappe
from frappe.utils import flt
-from frappe.model.doc import addchild
from frappe.model.bean import getlist
from frappe import msgprint, _
-class DocType:
- def __init__(self,doc,doclist=[]):
- self.doc,self.doclist = doc,doclist
-
+from frappe.model.document import Document
+
+class BudgetDistribution(Document):
def get_months(self):
month_list = ['January','February','March','April','May','June','July','August','September',
'October','November','December']
idx =1
for m in month_list:
- mnth = addchild(self.doc, 'budget_distribution_details',
- 'Budget Distribution Detail', self.doclist)
+ mnth = self.append('budget_distribution_details')
mnth.month = m or ''
mnth.idx = idx
idx += 1
diff --git a/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt b/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt
index 48d6e7b..2bad589 100644
--- a/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt
+++ b/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt
@@ -1,96 +1,81 @@
-[
- {
- "creation": "2013-01-10 16:34:05",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "field:distribution_id",
- "description": "**Budget Distribution** helps you distribute your budget across months if you have seasonality in your business.\n\nTo distribute a budget using this distribution, set this **Budget Distribution** in the **Cost Center**",
- "doctype": "DocType",
- "icon": "icon-bar-chart",
- "module": "Accounts",
- "name": "__common__",
- "name_case": "Title Case"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Budget Distribution",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Budget Distribution",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "read": 1,
- "report": 1,
- "role": "Accounts Manager",
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Budget Distribution"
- },
- {
- "description": "Name of the Budget Distribution",
- "doctype": "DocField",
- "fieldname": "distribution_id",
- "fieldtype": "Data",
- "label": "Distribution Name",
- "oldfieldname": "distribution_id",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "budget_distribution_details",
- "fieldtype": "Table",
- "label": "Budget Distribution Details",
- "oldfieldname": "budget_distribution_details",
- "oldfieldtype": "Table",
- "options": "Budget Distribution Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "amend": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "write": 1
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "permlevel": 2
- }
-]
\ No newline at end of file
+{
+ "autoname": "field:distribution_id",
+ "creation": "2013-01-10 16:34:05.000000",
+ "description": "**Budget Distribution** helps you distribute your budget across months if you have seasonality in your business.\n\nTo distribute a budget using this distribution, set this **Budget Distribution** in the **Cost Center**",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "Name of the Budget Distribution",
+ "fieldname": "distribution_id",
+ "fieldtype": "Data",
+ "label": "Distribution Name",
+ "oldfieldname": "distribution_id",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "budget_distribution_details",
+ "fieldtype": "Table",
+ "label": "Budget Distribution Details",
+ "oldfieldname": "budget_distribution_details",
+ "oldfieldtype": "Table",
+ "options": "Budget Distribution Detail",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-bar-chart",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Budget Distribution",
+ "name_case": "Title Case",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "delete": 0,
+ "permlevel": 2,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 0
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py
index 26c87f1..84d8060 100644
--- a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py
+++ b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class BudgetDistributionDetail(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt
index a171bf6..aa4f2ae 100644
--- a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt
+++ b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt
@@ -1,47 +1,35 @@
-[
- {
- "creation": "2013-02-22 01:27:38",
- "docstatus": 0,
- "modified": "2013-12-20 19:22:59",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "BDD/.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Budget Distribution Detail",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Budget Distribution Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "month",
- "fieldtype": "Data",
- "label": "Month",
- "oldfieldname": "month",
- "oldfieldtype": "Data",
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "percentage_allocation",
- "fieldtype": "Float",
- "label": "Percentage Allocation",
- "oldfieldname": "percentage_allocation",
- "oldfieldtype": "Currency"
- }
-]
\ No newline at end of file
+{
+ "autoname": "BDD/.#####",
+ "creation": "2013-02-22 01:27:38.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "month",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Month",
+ "oldfieldname": "month",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "percentage_allocation",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Percentage Allocation",
+ "oldfieldname": "percentage_allocation",
+ "oldfieldtype": "Currency",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:22:59.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Budget Distribution Detail",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py
index fdf8b30..b832554 100644
--- a/erpnext/accounts/doctype/c_form/c_form.py
+++ b/erpnext/accounts/doctype/c_form/c_form.py
@@ -6,15 +6,16 @@
from frappe.utils import flt, getdate
from frappe.model.bean import getlist
-class DocType:
- def __init__(self,d,dl):
- self.doc, self.doclist = d,dl
+from frappe.model.document import Document
+
+class CForm(Document):
+
def validate(self):
"""Validate invoice that c-form is applicable
and no other c-form is received for that"""
- for d in getlist(self.doclist, 'invoice_details'):
+ for d in self.get('invoice_details'):
if d.invoice_no:
inv = frappe.db.sql("""select c_form_applicable, c_form_no from
`tabSales Invoice` where name = %s and docstatus = 1""", d.invoice_no)
@@ -46,7 +47,7 @@
where c_form_no=%s""", self.doc.name)
def set_cform_in_sales_invoices(self):
- inv = [d.invoice_no for d in getlist(self.doclist, 'invoice_details')]
+ inv = [d.invoice_no for d in self.get('invoice_details')]
if inv:
frappe.db.sql("""update `tabSales Invoice` set c_form_no=%s, modified=%s
where name in (%s)""" % ('%s', '%s', ', '.join(['%s'] * len(inv))),
@@ -60,7 +61,7 @@
frappe.msgprint("Please enter atleast 1 invoice in the table", raise_exception=1)
def set_total_invoiced_amount(self):
- total = sum([flt(d.grand_total) for d in getlist(self.doclist, 'invoice_details')])
+ total = sum([flt(d.grand_total) for d in self.get('invoice_details')])
frappe.db.set(self.doc, 'total_invoiced_amount', total)
def get_invoice_details(self, invoice_no):
diff --git a/erpnext/accounts/doctype/c_form/c_form.txt b/erpnext/accounts/doctype/c_form/c_form.txt
index d5ff32b..06c56d2 100644
--- a/erpnext/accounts/doctype/c_form/c_form.txt
+++ b/erpnext/accounts/doctype/c_form/c_form.txt
@@ -1,193 +1,178 @@
-[
- {
- "creation": "2013-03-07 11:55:06",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:58",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "icon": "icon-file-text",
- "is_submittable": 1,
- "max_attachments": 3,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "C-Form",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "C-Form",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "C-Form"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "print_width": "50%",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "options": "\nC-FORM/",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "c_form_no",
- "fieldtype": "Data",
- "label": "C-Form No",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "received_date",
- "fieldtype": "Date",
- "label": "Received Date",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "label": "Customer",
- "options": "Customer",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "print_width": "50%",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "label": "Company",
- "options": "link:Company",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "label": "Fiscal Year",
- "options": "link:Fiscal Year",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "quarter",
- "fieldtype": "Select",
- "label": "Quarter",
- "options": "\nI\nII\nIII\nIV",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "total_amount",
- "fieldtype": "Currency",
- "label": "Total Amount",
- "options": "Company:company:default_currency",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "state",
- "fieldtype": "Data",
- "label": "State",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "invoice_details",
- "fieldtype": "Table",
- "label": "Invoice Details",
- "options": "C-Form Invoice Detail",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "total_invoiced_amount",
- "fieldtype": "Currency",
- "label": "Total Invoiced Amount",
- "options": "Company:company:default_currency",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "options": "C-Form",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "role": "Accounts User",
- "write": 1
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "role": "Accounts Manager",
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "doctype": "DocPerm",
- "permlevel": 1,
- "role": "All"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-03-07 11:55:06.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "options": "\nC-FORM/",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "c_form_no",
+ "fieldtype": "Data",
+ "label": "C-Form No",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "received_date",
+ "fieldtype": "Date",
+ "label": "Received Date",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "label": "Customer",
+ "options": "Customer",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "label": "Company",
+ "options": "link:Company",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "label": "Fiscal Year",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "quarter",
+ "fieldtype": "Select",
+ "label": "Quarter",
+ "options": "\nI\nII\nIII\nIV",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "total_amount",
+ "fieldtype": "Currency",
+ "label": "Total Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "state",
+ "fieldtype": "Data",
+ "label": "State",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "invoice_details",
+ "fieldtype": "Table",
+ "label": "Invoice Details",
+ "options": "C-Form Invoice Detail",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "total_invoiced_amount",
+ "fieldtype": "Currency",
+ "label": "Total Invoiced Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "options": "C-Form",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "is_submittable": 1,
+ "max_attachments": 3,
+ "modified": "2013-12-20 19:23:58.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "C-Form",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "permlevel": 1,
+ "read": 1,
+ "report": 1,
+ "role": "All",
+ "submit": 0
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py
index 26c87f1..8e3bc29 100644
--- a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py
+++ b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class CFormInvoiceDetail(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt
index 77dfa72..37b63b7 100644
--- a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt
+++ b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt
@@ -1,77 +1,68 @@
-[
- {
- "creation": "2013-02-22 01:27:38",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:00",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "C-Form Invoice Detail",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "C-Form Invoice Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "invoice_no",
- "fieldtype": "Link",
- "label": "Invoice No",
- "options": "Sales Invoice",
- "print_width": "160px",
- "width": "160px"
- },
- {
- "doctype": "DocField",
- "fieldname": "invoice_date",
- "fieldtype": "Date",
- "label": "Invoice Date",
- "print_width": "120px",
- "read_only": 1,
- "width": "120px"
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "label": "Territory",
- "options": "Territory",
- "print_width": "120px",
- "read_only": 1,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "label": "Net Total",
- "options": "Company:company:default_currency",
- "print_width": "120px",
- "read_only": 1,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total",
- "fieldtype": "Currency",
- "label": "Grand Total",
- "options": "Company:company:default_currency",
- "print_width": "120px",
- "read_only": 1,
- "width": "120px"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:38.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "invoice_no",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Invoice No",
+ "options": "Sales Invoice",
+ "permlevel": 0,
+ "print_width": "160px",
+ "width": "160px"
+ },
+ {
+ "fieldname": "invoice_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Invoice Date",
+ "permlevel": 0,
+ "print_width": "120px",
+ "read_only": 1,
+ "width": "120px"
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_width": "120px",
+ "read_only": 1,
+ "width": "120px"
+ },
+ {
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Net Total",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_width": "120px",
+ "read_only": 1,
+ "width": "120px"
+ },
+ {
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Grand Total",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_width": "120px",
+ "read_only": 1,
+ "width": "120px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:00.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "C-Form Invoice Detail",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py
index 16c6acf..3b377fc 100644
--- a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py
+++ b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py
@@ -7,9 +7,9 @@
from unidecode import unidecode
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class ChartOfAccounts(Document):
self.no_report_type = False
def create_accounts(self, company):
diff --git a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt
index fc2a742..4f5ce66 100644
--- a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt
+++ b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt
@@ -1,78 +1,59 @@
-[
- {
- "creation": "2014-03-05 14:11:31",
- "docstatus": 0,
- "modified": "2014-03-05 14:51:05",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "field:chart_name",
- "description": "Financial Chart of Accounts. Imported from file.",
- "doctype": "DocType",
- "document_type": "Master",
- "in_create": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Chart of Accounts",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "export": 0,
- "name": "__common__",
- "parent": "Chart of Accounts",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Accounts Manager"
- },
- {
- "doctype": "DocType",
- "name": "Chart of Accounts"
- },
- {
- "doctype": "DocField",
- "fieldname": "chart_name",
- "fieldtype": "Data",
- "in_list_view": 0,
- "label": "Chart Name",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "country",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Country",
- "options": "Country",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "preview",
- "fieldtype": "HTML",
- "label": "Preview"
- },
- {
- "doctype": "DocField",
- "fieldname": "source_file",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Source File",
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "autoname": "field:chart_name",
+ "creation": "2014-03-05 14:11:31.000000",
+ "description": "Financial Chart of Accounts. Imported from file.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "chart_name",
+ "fieldtype": "Data",
+ "in_list_view": 0,
+ "label": "Chart Name",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "country",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Country",
+ "options": "Country",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "preview",
+ "fieldtype": "HTML",
+ "label": "Preview",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "source_file",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Source File",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0
+ }
+ ],
+ "idx": 1,
+ "in_create": 1,
+ "modified": "2014-03-05 14:51:05.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Chart of Accounts",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "export": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/cost_center/cost_center.js b/erpnext/accounts/doctype/cost_center/cost_center.js
index 5c8be10..0cd3a70 100644
--- a/erpnext/accounts/doctype/cost_center/cost_center.js
+++ b/erpnext/accounts/doctype/cost_center/cost_center.js
@@ -70,7 +70,7 @@
}
cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) {
- return $c_obj(cur_frm.get_doclist(),'convert_group_to_ledger','',function(r,rt) {
+ return $c_obj(cur_frm.doc,'convert_group_to_ledger','',function(r,rt) {
if(r.message == 1) {
cur_frm.refresh();
}
@@ -78,7 +78,7 @@
}
cur_frm.cscript.convert_to_group = function(doc, cdt, cdn) {
- return $c_obj(cur_frm.get_doclist(),'convert_ledger_to_group','',function(r,rt) {
+ return $c_obj(cur_frm.doc,'convert_ledger_to_group','',function(r,rt) {
if(r.message == 1) {
cur_frm.refresh();
}
diff --git a/erpnext/accounts/doctype/cost_center/cost_center.py b/erpnext/accounts/doctype/cost_center/cost_center.py
index e02496f..720b0ba 100644
--- a/erpnext/accounts/doctype/cost_center/cost_center.py
+++ b/erpnext/accounts/doctype/cost_center/cost_center.py
@@ -8,9 +8,8 @@
from frappe.utils.nestedset import DocTypeNestedSet
-class DocType(DocTypeNestedSet):
- def __init__(self,d,dl):
- self.doc, self.doclist = d,dl
+class CostCenter(DocTypeNestedSet):
+
self.nsm_parent_field = 'parent_cost_center'
def autoname(self):
@@ -54,7 +53,7 @@
def validate_budget_details(self):
check_acc_list = []
- for d in getlist(self.doclist, 'budget_details'):
+ for d in self.get('budget_details'):
if self.doc.group_or_ledger=="Group":
msgprint("Budget cannot be set for Group Cost Centers", raise_exception=1)
diff --git a/erpnext/accounts/doctype/cost_center/cost_center.txt b/erpnext/accounts/doctype/cost_center/cost_center.txt
index 66864bc..9dd868a 100644
--- a/erpnext/accounts/doctype/cost_center/cost_center.txt
+++ b/erpnext/accounts/doctype/cost_center/cost_center.txt
@@ -1,202 +1,190 @@
-[
- {
- "creation": "2013-01-23 19:57:17",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:30",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_copy": 1,
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:cost_center_name",
- "description": "Track separate Income and Expense for product verticals or divisions.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-money",
- "in_create": 1,
- "module": "Accounts",
- "name": "__common__",
- "search_fields": "name,parent_cost_center"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Cost Center",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Cost Center",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Cost Center"
- },
- {
- "doctype": "DocField",
- "fieldname": "sb0",
- "fieldtype": "Section Break",
- "label": "Cost Center Details"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cost_center_name",
- "fieldtype": "Data",
- "in_filter": 0,
- "label": "Cost Center Name",
- "no_copy": 1,
- "oldfieldname": "cost_center_name",
- "oldfieldtype": "Data",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "parent_cost_center",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Parent Cost Center",
- "oldfieldname": "parent_cost_center",
- "oldfieldtype": "Link",
- "options": "Cost Center",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "oldfieldname": "company_name",
- "oldfieldtype": "Link",
- "options": "Company",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cb0",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "group_or_ledger",
- "fieldtype": "Select",
- "hidden": 0,
- "label": "Group or Ledger",
- "no_copy": 1,
- "oldfieldname": "group_or_ledger",
- "oldfieldtype": "Select",
- "options": "\nGroup\nLedger",
- "print_hide": 1,
- "report_hide": 1,
- "reqd": 1
- },
- {
- "description": "Define Budget for this Cost Center. To set budget action, see <a href=\"#!List/Company\">Company Master</a>",
- "doctype": "DocField",
- "fieldname": "sb1",
- "fieldtype": "Section Break",
- "label": "Budget"
- },
- {
- "description": "Select Budget Distribution, if you want to track based on seasonality.",
- "doctype": "DocField",
- "fieldname": "distribution_id",
- "fieldtype": "Link",
- "label": "Distribution Id",
- "oldfieldname": "distribution_id",
- "oldfieldtype": "Link",
- "options": "Budget Distribution"
- },
- {
- "description": "Add rows to set annual budgets on Accounts.",
- "doctype": "DocField",
- "fieldname": "budget_details",
- "fieldtype": "Table",
- "label": "Budget Details",
- "oldfieldname": "budget_details",
- "oldfieldtype": "Table",
- "options": "Budget Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "lft",
- "fieldtype": "Int",
- "hidden": 1,
- "in_filter": 1,
- "label": "lft",
- "no_copy": 1,
- "oldfieldname": "lft",
- "oldfieldtype": "Int",
- "print_hide": 1,
- "report_hide": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rgt",
- "fieldtype": "Int",
- "hidden": 1,
- "in_filter": 1,
- "label": "rgt",
- "no_copy": 1,
- "oldfieldname": "rgt",
- "oldfieldtype": "Int",
- "print_hide": 1,
- "report_hide": 1,
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "old_parent",
- "fieldtype": "Link",
- "hidden": 1,
- "ignore_restrictions": 1,
- "label": "old_parent",
- "no_copy": 1,
- "oldfieldname": "old_parent",
- "oldfieldtype": "Data",
- "options": "Cost Center",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Accounts Manager",
- "write": 1
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Accounts User",
- "write": 0
- }
-]
\ No newline at end of file
+{
+ "allow_copy": 1,
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:cost_center_name",
+ "creation": "2013-01-23 19:57:17.000000",
+ "description": "Track separate Income and Expense for product verticals or divisions.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "sb0",
+ "fieldtype": "Section Break",
+ "label": "Cost Center Details",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "cost_center_name",
+ "fieldtype": "Data",
+ "in_filter": 0,
+ "label": "Cost Center Name",
+ "no_copy": 1,
+ "oldfieldname": "cost_center_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "parent_cost_center",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Parent Cost Center",
+ "oldfieldname": "parent_cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "oldfieldname": "company_name",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "cb0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "group_or_ledger",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "label": "Group or Ledger",
+ "no_copy": 1,
+ "oldfieldname": "group_or_ledger",
+ "oldfieldtype": "Select",
+ "options": "\nGroup\nLedger",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1,
+ "reqd": 1
+ },
+ {
+ "description": "Define Budget for this Cost Center. To set budget action, see <a href=\"#!List/Company\">Company Master</a>",
+ "fieldname": "sb1",
+ "fieldtype": "Section Break",
+ "label": "Budget",
+ "permlevel": 0
+ },
+ {
+ "description": "Select Budget Distribution, if you want to track based on seasonality.",
+ "fieldname": "distribution_id",
+ "fieldtype": "Link",
+ "label": "Distribution Id",
+ "oldfieldname": "distribution_id",
+ "oldfieldtype": "Link",
+ "options": "Budget Distribution",
+ "permlevel": 0
+ },
+ {
+ "description": "Add rows to set annual budgets on Accounts.",
+ "fieldname": "budget_details",
+ "fieldtype": "Table",
+ "label": "Budget Details",
+ "oldfieldname": "budget_details",
+ "oldfieldtype": "Table",
+ "options": "Budget Detail",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "lft",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "lft",
+ "no_copy": 1,
+ "oldfieldname": "lft",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "rgt",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "rgt",
+ "no_copy": 1,
+ "oldfieldname": "rgt",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "old_parent",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_restrictions": 1,
+ "label": "old_parent",
+ "no_copy": 1,
+ "oldfieldname": "old_parent",
+ "oldfieldtype": "Data",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ }
+ ],
+ "icon": "icon-money",
+ "idx": 1,
+ "in_create": 1,
+ "modified": "2014-01-20 17:48:30.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Cost Center",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 0,
+ "write": 0
+ }
+ ],
+ "search_fields": "name,parent_cost_center"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
index 3918751..34110d3 100644
--- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py
@@ -6,9 +6,9 @@
from frappe import msgprint, _
from frappe.utils import getdate
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class FiscalYear(Document):
def set_as_default(self):
frappe.db.set_value("Global Defaults", None, "current_fiscal_year", self.doc.name)
diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt b/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt
index 27fac8d..314dfab 100644
--- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt
+++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt
@@ -1,98 +1,82 @@
-[
- {
- "creation": "2013-01-22 16:50:25",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:46",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:year",
- "description": "**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-calendar",
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Fiscal Year",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Fiscal Year",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1
- },
- {
- "doctype": "DocType",
- "name": "Fiscal Year"
- },
- {
- "description": "For e.g. 2012, 2012-13",
- "doctype": "DocField",
- "fieldname": "year",
- "fieldtype": "Data",
- "label": "Year Name",
- "oldfieldname": "year",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "year_start_date",
- "fieldtype": "Date",
- "label": "Year Start Date",
- "no_copy": 1,
- "oldfieldname": "year_start_date",
- "oldfieldtype": "Date",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "year_end_date",
- "fieldtype": "Date",
- "label": "Year End Date",
- "no_copy": 1,
- "reqd": 1
- },
- {
- "default": "No",
- "description": "Entries are not allowed against this Fiscal Year if the year is closed.",
- "doctype": "DocField",
- "fieldname": "is_fiscal_year_closed",
- "fieldtype": "Select",
- "label": "Year Closed",
- "no_copy": 1,
- "oldfieldname": "is_fiscal_year_closed",
- "oldfieldtype": "Select",
- "options": "\nNo\nYes",
- "reqd": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "report": 1,
- "role": "System Manager",
- "submit": 0,
- "write": 1
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "All"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:year",
+ "creation": "2013-01-22 16:50:25.000000",
+ "description": "**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "description": "For e.g. 2012, 2012-13",
+ "fieldname": "year",
+ "fieldtype": "Data",
+ "label": "Year Name",
+ "oldfieldname": "year",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "year_start_date",
+ "fieldtype": "Date",
+ "label": "Year Start Date",
+ "no_copy": 1,
+ "oldfieldname": "year_start_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "year_end_date",
+ "fieldtype": "Date",
+ "label": "Year End Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "default": "No",
+ "description": "Entries are not allowed against this Fiscal Year if the year is closed.",
+ "fieldname": "is_fiscal_year_closed",
+ "fieldtype": "Select",
+ "label": "Year Closed",
+ "no_copy": 1,
+ "oldfieldname": "is_fiscal_year_closed",
+ "oldfieldtype": "Select",
+ "options": "\nNo\nYes",
+ "permlevel": 0,
+ "reqd": 0
+ }
+ ],
+ "icon": "icon-calendar",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:46.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Fiscal Year",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "All"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py
index 9e1dbb7..b6a5295 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.py
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py
@@ -7,9 +7,9 @@
from frappe.utils import flt, fmt_money, getdate
from frappe import _
-class DocType:
- def __init__(self,d,dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class GlEntry(Document):
def validate(self):
self.check_mandatory()
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.txt b/erpnext/accounts/doctype/gl_entry/gl_entry.txt
index 3ec5ec6..79bf90b 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.txt
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.txt
@@ -1,234 +1,229 @@
-[
- {
- "creation": "2013-01-10 16:34:06",
- "docstatus": 0,
- "modified": "2013-12-20 19:24:08",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "GL.#######",
- "doctype": "DocType",
- "icon": "icon-list",
- "in_create": 1,
- "module": "Accounts",
- "name": "__common__",
- "search_fields": "voucher_no,account,posting_date,against_voucher"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "GL Entry",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "GL Entry",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0,
- "write": 0
- },
- {
- "doctype": "DocType",
- "name": "GL Entry"
- },
- {
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Posting Date",
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "transaction_date",
- "fieldtype": "Date",
- "label": "Transaction Date",
- "oldfieldname": "transaction_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "aging_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Aging Date",
- "oldfieldname": "aging_date",
- "oldfieldtype": "Date",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "account",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Account",
- "oldfieldname": "account",
- "oldfieldtype": "Link",
- "options": "Account",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Cost Center",
- "oldfieldname": "cost_center",
- "oldfieldtype": "Link",
- "options": "Cost Center",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "debit",
- "fieldtype": "Currency",
- "label": "Debit Amt",
- "oldfieldname": "debit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "credit",
- "fieldtype": "Currency",
- "label": "Credit Amt",
- "oldfieldname": "credit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "against",
- "fieldtype": "Text",
- "in_filter": 1,
- "label": "Against",
- "oldfieldname": "against",
- "oldfieldtype": "Text"
- },
- {
- "doctype": "DocField",
- "fieldname": "against_voucher",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Against Voucher",
- "oldfieldname": "against_voucher",
- "oldfieldtype": "Data",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "against_voucher_type",
- "fieldtype": "Data",
- "in_filter": 0,
- "label": "Against Voucher Type",
- "oldfieldname": "against_voucher_type",
- "oldfieldtype": "Data",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "voucher_type",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Voucher Type",
- "oldfieldname": "voucher_type",
- "oldfieldtype": "Select",
- "options": "Journal Voucher\nSales Invoice\nPurchase Invoice",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "voucher_no",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Voucher No",
- "oldfieldname": "voucher_no",
- "oldfieldtype": "Data",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "remarks",
- "fieldtype": "Text",
- "in_filter": 1,
- "label": "Remarks",
- "no_copy": 1,
- "oldfieldname": "remarks",
- "oldfieldtype": "Text",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "is_opening",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Is Opening",
- "oldfieldname": "is_opening",
- "oldfieldtype": "Select",
- "options": "No\nYes",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "is_advance",
- "fieldtype": "Select",
- "in_filter": 0,
- "label": "Is Advance",
- "oldfieldname": "is_advance",
- "oldfieldtype": "Select",
- "options": "No\nYes",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "search_index": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "role": "Accounts User"
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "role": "Accounts Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "System Manager"
- }
-]
\ No newline at end of file
+{
+ "autoname": "GL.#######",
+ "creation": "2013-01-10 16:34:06.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Posting Date",
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "label": "Transaction Date",
+ "oldfieldname": "transaction_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "aging_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Aging Date",
+ "oldfieldname": "aging_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "account",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Account",
+ "oldfieldname": "account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Cost Center",
+ "oldfieldname": "cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "debit",
+ "fieldtype": "Currency",
+ "label": "Debit Amt",
+ "oldfieldname": "debit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "credit",
+ "fieldtype": "Currency",
+ "label": "Credit Amt",
+ "oldfieldname": "credit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "against",
+ "fieldtype": "Text",
+ "in_filter": 1,
+ "label": "Against",
+ "oldfieldname": "against",
+ "oldfieldtype": "Text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "against_voucher",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Against Voucher",
+ "oldfieldname": "against_voucher",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "against_voucher_type",
+ "fieldtype": "Data",
+ "in_filter": 0,
+ "label": "Against Voucher Type",
+ "oldfieldname": "against_voucher_type",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "voucher_type",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Voucher Type",
+ "oldfieldname": "voucher_type",
+ "oldfieldtype": "Select",
+ "options": "Journal Voucher\nSales Invoice\nPurchase Invoice",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "voucher_no",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Voucher No",
+ "oldfieldname": "voucher_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "remarks",
+ "fieldtype": "Text",
+ "in_filter": 1,
+ "label": "Remarks",
+ "no_copy": 1,
+ "oldfieldname": "remarks",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "is_opening",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Is Opening",
+ "oldfieldname": "is_opening",
+ "oldfieldtype": "Select",
+ "options": "No\nYes",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "is_advance",
+ "fieldtype": "Select",
+ "in_filter": 0,
+ "label": "Is Advance",
+ "oldfieldname": "is_advance",
+ "oldfieldtype": "Select",
+ "options": "No\nYes",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "search_index": 0
+ }
+ ],
+ "icon": "icon-list",
+ "idx": 1,
+ "in_create": 1,
+ "modified": "2013-12-20 19:24:08.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "GL Entry",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "create": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 0
+ }
+ ],
+ "search_fields": "voucher_no,account,posting_date,against_voucher"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
index 1107ba4..e8e513d 100644
--- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
+++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
@@ -12,8 +12,7 @@
load_defaults: function() {
if(this.frm.doc.__islocal && this.frm.doc.company) {
frappe.model.set_default_values(this.frm.doc);
- $.each(frappe.model.get_doclist(this.frm.doc.doctype,
- this.frm.doc.name, {parentfield: "entries"}), function(i, jvd) {
+ $.each(this.frm.doc.entries, function(i, jvd) {
frappe.model.set_default_values(jvd);
}
);
@@ -40,7 +39,7 @@
$.each([["against_voucher", "Purchase Invoice", "credit_to"],
["against_invoice", "Sales Invoice", "debit_to"]], function(i, opts) {
me.frm.set_query(opts[0], "entries", function(doc, cdt, cdn) {
- var jvd = frappe.model.get_doc(cdt, cdn);
+ var jvd = frappe.get_doc(cdt, cdn);
frappe.model.validate_missing(jvd, "account");
return {
filters: [
@@ -53,7 +52,7 @@
});
this.frm.set_query("against_jv", "entries", function(doc, cdt, cdn) {
- var jvd = frappe.model.get_doc(cdt, cdn);
+ var jvd = frappe.get_doc(cdt, cdn);
frappe.model.validate_missing(jvd, "account");
return {
@@ -64,7 +63,7 @@
},
against_voucher: function(doc, cdt, cdn) {
- var d = frappe.model.get_doc(cdt, cdn);
+ var d = frappe.get_doc(cdt, cdn);
if (d.against_voucher && !flt(d.debit)) {
this.get_outstanding({
'doctype': 'Purchase Invoice',
@@ -74,7 +73,7 @@
},
against_invoice: function(doc, cdt, cdn) {
- var d = frappe.model.get_doc(cdt, cdn);
+ var d = frappe.get_doc(cdt, cdn);
if (d.against_invoice && !flt(d.credit)) {
this.get_outstanding({
'doctype': 'Sales Invoice',
@@ -84,7 +83,7 @@
},
against_jv: function(doc, cdt, cdn) {
- var d = frappe.model.get_doc(cdt, cdn);
+ var d = frappe.get_doc(cdt, cdn);
if (d.against_jv && !flt(d.credit) && !flt(d.debit)) {
this.get_outstanding({
'doctype': 'Journal Voucher',
@@ -139,7 +138,7 @@
cur_frm.cscript.update_totals = function(doc) {
var td=0.0; var tc =0.0;
- var el = getchildren('Journal Voucher Detail', doc.name, 'entries');
+ var el = doc.entries || [];
for(var i in el) {
td += flt(el[i].debit, 2);
tc += flt(el[i].credit, 2);
@@ -156,7 +155,7 @@
cur_frm.cscript.get_balance = function(doc,dt,dn) {
cur_frm.cscript.update_totals(doc);
- return $c_obj(make_doclist(dt,dn), 'get_balance', '', function(r, rt){
+ return $c_obj(cur_frm.doc, 'get_balance', '', function(r, rt){
cur_frm.refresh();
});
}
@@ -194,8 +193,7 @@
cur_frm.set_df_property("cheque_no", "reqd", doc.voucher_type=="Bank Voucher");
cur_frm.set_df_property("cheque_date", "reqd", doc.voucher_type=="Bank Voucher");
- if(frappe.model.get("Journal Voucher Detail", {"parent":doc.name}).length!==0 // too late
- || !doc.company) // too early
+ if((doc.entries || []).length!==0 || !doc.company) // too early
return;
var update_jv_details = function(doc, r) {
diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py
index 57c14b0..5727ed4 100644
--- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py
+++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py
@@ -5,16 +5,13 @@
import frappe
from frappe.utils import cint, cstr, flt, fmt_money, formatdate, getdate
-from frappe.model.doc import addchild
-from frappe.model.bean import getlist
from frappe import msgprint, _
from erpnext.setup.utils import get_company_currency
from erpnext.controllers.accounts_controller import AccountsController
-class DocType(AccountsController):
- def __init__(self,d,dl):
- self.doc, self.doclist = d,dl
+class JournalVoucher(AccountsController):
+
self.master_type = {}
self.credit_days_for = {}
self.credit_days_global = -1
@@ -57,7 +54,7 @@
# frappe.delete_doc("Journal Voucher", self.doc.amended_from)
def validate_debit_credit(self):
- for d in getlist(self.doclist, 'entries'):
+ for d in self.get('entries'):
if d.debit and d.credit:
msgprint("You cannot credit and debit same account at the same time.",
raise_exception=1)
@@ -72,7 +69,7 @@
msgprint("Reference No is mandatory if you entered Reference Date", raise_exception=1)
def validate_entries_for_advance(self):
- for d in getlist(self.doclist,'entries'):
+ for d in self.get('entries'):
if not d.is_advance and not d.against_voucher and \
not d.against_invoice and not d.against_jv:
master_type = frappe.db.get_value("Account", d.account, "master_type")
@@ -82,7 +79,7 @@
Account %s if this is an advance entry." % d.account)
def validate_against_jv(self):
- for d in getlist(self.doclist, 'entries'):
+ for d in self.get('entries'):
if d.against_jv:
if d.against_jv == self.doc.name:
msgprint("You can not enter current voucher in 'Against JV' column",
@@ -96,7 +93,7 @@
# Debit = Credit
debit, credit = 0.0, 0.0
debit_list, credit_list = [], []
- for d in getlist(self.doclist, 'entries'):
+ for d in self.get('entries'):
debit += flt(d.debit, 2)
credit += flt(d.credit, 2)
if flt(d.debit)>0 and (d.account not in debit_list): debit_list.append(d.account)
@@ -110,7 +107,7 @@
(self.doc.total_debit-self.doc.total_credit), raise_exception=1)
# update against account
- for d in getlist(self.doclist, 'entries'):
+ for d in self.get('entries'):
if flt(d.debit) > 0: d.against_account = ', '.join(credit_list)
if flt(d.credit) > 0: d.against_account = ', '.join(debit_list)
@@ -123,7 +120,7 @@
else :
msgprint("Please enter Reference date", raise_exception=1)
- for d in getlist(self.doclist, 'entries'):
+ for d in self.get('entries'):
if d.against_invoice and d.credit:
currency = frappe.db.get_value("Sales Invoice", d.against_invoice, "currency")
r.append('%s %s against Invoice: %s' %
@@ -152,7 +149,7 @@
else:
# check account type whether supplier or customer
exists = False
- for d in getlist(self.doclist, 'entries'):
+ for d in self.get('entries'):
account_type = frappe.db.get_value("Account", d.account, "account_type")
if account_type in ["Supplier", "Customer"]:
exists = True
@@ -165,7 +162,7 @@
self.doc.aging_date = self.doc.posting_date
def set_print_format_fields(self):
- for d in getlist(self.doclist, 'entries'):
+ for d in self.get('entries'):
account_type, master_type = frappe.db.get_value("Account", d.account,
["account_type", "master_type"])
@@ -191,7 +188,7 @@
# Get List of Customer Account
acc_list = filter(lambda d: frappe.db.get_value("Account", d.account,
- "master_type")=='Customer', getlist(self.doclist,'entries'))
+ "master_type")=='Customer', self.get('entries'))
for d in acc_list:
credit_days = self.get_credit_days_for(d.account)
@@ -228,7 +225,7 @@
return self.is_approving_authority
def check_account_against_entries(self):
- for d in self.doclist.get({"parentfield": "entries"}):
+ for d in self.get("entries"):
if d.against_invoice and frappe.db.get_value("Sales Invoice",
d.against_invoice, "debit_to") != d.account:
frappe.throw(_("Row #") + cstr(d.idx) + ": " +
@@ -246,7 +243,7 @@
self.check_account_against_entries()
gl_map = []
- for d in self.doclist.get({"parentfield": "entries"}):
+ for d in self.get("entries"):
if d.debit or d.credit:
gl_map.append(
self.get_gl_dict({
@@ -266,21 +263,21 @@
make_gl_entries(gl_map, cancel=cancel, adv_adj=adv_adj)
def check_credit_limit(self):
- for d in self.doclist.get({"parentfield": "entries"}):
+ for d in self.get("entries"):
master_type, master_name = frappe.db.get_value("Account", d.account,
["master_type", "master_name"])
if master_type == "Customer" and master_name:
super(DocType, self).check_credit_limit(d.account)
def get_balance(self):
- if not getlist(self.doclist,'entries'):
+ if not self.get('entries'):
msgprint("Please enter atleast 1 entry in 'GL Entries' table")
else:
flag, self.doc.total_debit, self.doc.total_credit = 0, 0, 0
diff = flt(self.doc.difference, 2)
# If any row without amount, set the diff on that row
- for d in getlist(self.doclist,'entries'):
+ for d in self.get('entries'):
if not d.credit and not d.debit and diff != 0:
if diff>0:
d.credit = diff
@@ -290,25 +287,25 @@
# Set the diff in a new row
if flag == 0 and diff != 0:
- jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', self.doclist)
+ jd = self.doc.append('entries', {})
if diff>0:
jd.credit = abs(diff)
elif diff<0:
jd.debit = abs(diff)
# Set the total debit, total credit and difference
- for d in getlist(self.doclist,'entries'):
+ for d in self.get('entries'):
self.doc.total_debit += flt(d.debit, 2)
self.doc.total_credit += flt(d.credit, 2)
self.doc.difference = flt(self.doc.total_debit, 2) - flt(self.doc.total_credit, 2)
def get_outstanding_invoices(self):
- self.doclist = self.doc.clear_table(self.doclist, 'entries')
+ self.set('entries', [])
total = 0
for d in self.get_values():
total += flt(d[2])
- jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', self.doclist)
+ jd = self.doc.append('entries', {})
jd.account = cstr(d[1])
if self.doc.write_off_based_on == 'Accounts Receivable':
jd.credit = flt(d[2])
@@ -317,7 +314,7 @@
jd.debit = flt(d[2])
jd.against_voucher = cstr(d[0])
jd.save(1)
- jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', self.doclist)
+ jd = self.doc.append('entries', {})
if self.doc.write_off_based_on == 'Accounts Receivable':
jd.debit = total
elif self.doc.write_off_based_on == 'Accounts Payable':
@@ -392,19 +389,12 @@
jv.doc.company = doc.company
jv.doc.fiscal_year = doc.fiscal_year
- jv.doclist.append({
- "doctype": "Journal Voucher Detail",
- "parentfield": "entries"
- })
+ d1 = jv.append("entries")
+ d2 = jv.append("entries")
- jv.doclist.append({
- "doctype": "Journal Voucher Detail",
- "parentfield": "entries"
- })
-
if bank_account:
- jv.doclist[2].account = bank_account["account"]
- jv.doclist[2].balance = bank_account["balance"]
+ d2.account = bank_account["account"]
+ d2.balance = bank_account["balance"]
return jv
diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt b/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt
index 73710f9..872fffa 100644
--- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt
+++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt
@@ -1,503 +1,492 @@
-[
- {
- "creation": "2013-03-25 10:53:52",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:51",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "icon": "icon-file-text",
- "is_submittable": 1,
- "module": "Accounts",
- "name": "__common__",
- "read_only_onload": 1,
- "search_fields": "voucher_type,posting_date, due_date, cheque_no"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Journal Voucher",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Journal Voucher",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Journal Voucher"
- },
- {
- "doctype": "DocField",
- "fieldname": "voucher_type_and_date",
- "fieldtype": "Section Break",
- "label": "Voucher Type and Date",
- "options": "icon-flag"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "JV",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "voucher_type",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Voucher Type",
- "oldfieldname": "voucher_type",
- "oldfieldtype": "Select",
- "options": "\nJournal Entry\nBank Voucher\nCash Voucher\nCredit Card Voucher\nDebit Note\nCredit Note\nContra Voucher\nExcise Voucher\nWrite Off Voucher\nOpening Entry",
- "print_hide": 0,
- "read_only": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Posting Date",
- "no_copy": 1,
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "2_add_edit_gl_entries",
- "fieldtype": "Section Break",
- "label": "Journal Entries",
- "oldfieldtype": "Section Break",
- "options": "icon-table",
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "entries",
- "fieldtype": "Table",
- "label": "Entries",
- "oldfieldname": "entries",
- "oldfieldtype": "Table",
- "options": "Journal Voucher Detail",
- "print_hide": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break99",
- "fieldtype": "Section Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "total_debit",
- "fieldtype": "Currency",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Total Debit",
- "no_copy": 1,
- "oldfieldname": "total_debit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_credit",
- "fieldtype": "Currency",
- "in_filter": 1,
- "label": "Total Credit",
- "no_copy": 1,
- "oldfieldname": "total_credit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break99",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "difference",
- "fieldtype": "Currency",
- "label": "Difference",
- "no_copy": 1,
- "oldfieldname": "difference",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "get_balance",
- "fieldtype": "Button",
- "label": "Make Difference Entry",
- "oldfieldtype": "Button",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "reference",
- "fieldtype": "Section Break",
- "label": "Reference",
- "options": "icon-pushpin",
- "read_only": 0
- },
- {
- "description": "eg. Cheque Number",
- "doctype": "DocField",
- "fieldname": "cheque_no",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Reference Number",
- "no_copy": 1,
- "oldfieldname": "cheque_no",
- "oldfieldtype": "Data",
- "read_only": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cheque_date",
- "fieldtype": "Date",
- "label": "Reference Date",
- "no_copy": 1,
- "oldfieldname": "cheque_date",
- "oldfieldtype": "Date",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "clearance_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Clearance Date",
- "no_copy": 1,
- "oldfieldname": "clearance_date",
- "oldfieldtype": "Date",
- "print_hide": 0,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break98",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "user_remark",
- "fieldtype": "Small Text",
- "in_filter": 1,
- "label": "User Remark",
- "no_copy": 1,
- "oldfieldname": "user_remark",
- "oldfieldtype": "Small Text",
- "read_only": 0
- },
- {
- "description": "User Remark will be added to Auto Remark",
- "doctype": "DocField",
- "fieldname": "remark",
- "fieldtype": "Small Text",
- "in_list_view": 0,
- "label": "Remark",
- "no_copy": 1,
- "oldfieldname": "remark",
- "oldfieldtype": "Small Text",
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "bill_no",
- "fieldtype": "Data",
- "in_list_view": 0,
- "label": "Bill No",
- "oldfieldname": "bill_no",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "bill_date",
- "fieldtype": "Date",
- "label": "Bill Date",
- "oldfieldname": "bill_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "due_date",
- "fieldtype": "Date",
- "label": "Due Date",
- "oldfieldname": "due_date",
- "oldfieldtype": "Date",
- "print_hide": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "addtional_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "default": "No",
- "description": "Considered as Opening Balance",
- "doctype": "DocField",
- "fieldname": "is_opening",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Is Opening",
- "oldfieldname": "is_opening",
- "oldfieldtype": "Select",
- "options": "No\nYes",
- "print_hide": 1,
- "read_only": 0,
- "search_index": 1
- },
- {
- "description": "Actual Posting Date",
- "doctype": "DocField",
- "fieldname": "aging_date",
- "fieldtype": "Date",
- "label": "Aging Date",
- "no_copy": 0,
- "oldfieldname": "aging_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "default": "Accounts Receivable",
- "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'",
- "doctype": "DocField",
- "fieldname": "write_off_based_on",
- "fieldtype": "Select",
- "label": "Write Off Based On",
- "options": "Accounts Receivable\nAccounts Payable",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'",
- "doctype": "DocField",
- "fieldname": "write_off_amount",
- "fieldtype": "Currency",
- "label": "Write Off Amount <=",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'",
- "doctype": "DocField",
- "fieldname": "get_outstanding_invoices",
- "fieldtype": "Button",
- "label": "Get Outstanding Invoices",
- "options": "get_outstanding_invoices",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "letter_head",
- "fieldtype": "Link",
- "label": "Letter Head",
- "options": "Letter Head"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "pay_to_recd_from",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Pay To / Recd From",
- "no_copy": 1,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_amount",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Total Amount",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_amount_in_words",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Total Amount in Words",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "label": "Print Heading",
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Link",
- "options": "Journal Voucher",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Accounts User",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Accounts Manager",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Auditor",
- "submit": 0,
- "write": 0
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-03-25 10:53:52.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "voucher_type_and_date",
+ "fieldtype": "Section Break",
+ "label": "Voucher Type and Date",
+ "options": "icon-flag",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "JV",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "voucher_type",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Voucher Type",
+ "oldfieldname": "voucher_type",
+ "oldfieldtype": "Select",
+ "options": "\nJournal Entry\nBank Voucher\nCash Voucher\nCredit Card Voucher\nDebit Note\nCredit Note\nContra Voucher\nExcise Voucher\nWrite Off Voucher\nOpening Entry",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Posting Date",
+ "no_copy": 1,
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "2_add_edit_gl_entries",
+ "fieldtype": "Section Break",
+ "label": "Journal Entries",
+ "oldfieldtype": "Section Break",
+ "options": "icon-table",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "entries",
+ "fieldtype": "Table",
+ "label": "Entries",
+ "oldfieldname": "entries",
+ "oldfieldtype": "Table",
+ "options": "Journal Voucher Detail",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break99",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "total_debit",
+ "fieldtype": "Currency",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Total Debit",
+ "no_copy": 1,
+ "oldfieldname": "total_debit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "total_credit",
+ "fieldtype": "Currency",
+ "in_filter": 1,
+ "label": "Total Credit",
+ "no_copy": 1,
+ "oldfieldname": "total_credit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break99",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "difference",
+ "fieldtype": "Currency",
+ "label": "Difference",
+ "no_copy": 1,
+ "oldfieldname": "difference",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "get_balance",
+ "fieldtype": "Button",
+ "label": "Make Difference Entry",
+ "oldfieldtype": "Button",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "reference",
+ "fieldtype": "Section Break",
+ "label": "Reference",
+ "options": "icon-pushpin",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "eg. Cheque Number",
+ "fieldname": "cheque_no",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Reference Number",
+ "no_copy": 1,
+ "oldfieldname": "cheque_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "cheque_date",
+ "fieldtype": "Date",
+ "label": "Reference Date",
+ "no_copy": 1,
+ "oldfieldname": "cheque_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "clearance_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Clearance Date",
+ "no_copy": 1,
+ "oldfieldname": "clearance_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "column_break98",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "user_remark",
+ "fieldtype": "Small Text",
+ "in_filter": 1,
+ "label": "User Remark",
+ "no_copy": 1,
+ "oldfieldname": "user_remark",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "User Remark will be added to Auto Remark",
+ "fieldname": "remark",
+ "fieldtype": "Small Text",
+ "in_list_view": 0,
+ "label": "Remark",
+ "no_copy": 1,
+ "oldfieldname": "remark",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "bill_no",
+ "fieldtype": "Data",
+ "in_list_view": 0,
+ "label": "Bill No",
+ "oldfieldname": "bill_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "bill_date",
+ "fieldtype": "Date",
+ "label": "Bill Date",
+ "oldfieldname": "bill_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "due_date",
+ "fieldtype": "Date",
+ "label": "Due Date",
+ "oldfieldname": "due_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "addtional_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "default": "No",
+ "description": "Considered as Opening Balance",
+ "fieldname": "is_opening",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Is Opening",
+ "oldfieldname": "is_opening",
+ "oldfieldtype": "Select",
+ "options": "No\nYes",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "search_index": 1
+ },
+ {
+ "description": "Actual Posting Date",
+ "fieldname": "aging_date",
+ "fieldtype": "Date",
+ "label": "Aging Date",
+ "no_copy": 0,
+ "oldfieldname": "aging_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "default": "Accounts Receivable",
+ "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'",
+ "fieldname": "write_off_based_on",
+ "fieldtype": "Select",
+ "label": "Write Off Based On",
+ "options": "Accounts Receivable\nAccounts Payable",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'",
+ "fieldname": "write_off_amount",
+ "fieldtype": "Currency",
+ "label": "Write Off Amount <=",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'",
+ "fieldname": "get_outstanding_invoices",
+ "fieldtype": "Button",
+ "label": "Get Outstanding Invoices",
+ "options": "get_outstanding_invoices",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "letter_head",
+ "fieldtype": "Link",
+ "label": "Letter Head",
+ "options": "Letter Head",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "pay_to_recd_from",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Pay To / Recd From",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "total_amount",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Total Amount",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "total_amount_in_words",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Total Amount in Words",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "label": "Print Heading",
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Link",
+ "options": "Journal Voucher",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-20 17:48:51.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Journal Voucher",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Auditor",
+ "submit": 0,
+ "write": 0
+ }
+ ],
+ "read_only_onload": 1,
+ "search_fields": "voucher_type,posting_date, due_date, cheque_no"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py
index 26c87f1..36700d2 100644
--- a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py
+++ b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class JournalVoucherDetail(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
index c03e025..defd88e 100644
--- a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
+++ b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt
@@ -1,179 +1,166 @@
-[
- {
- "creation": "2013-02-22 01:27:39",
- "docstatus": 0,
- "modified": "2014-02-03 12:44:31",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "JVD.######",
- "doctype": "DocType",
- "istable": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Journal Voucher Detail",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Journal Voucher Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "account",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Account",
- "oldfieldname": "account",
- "oldfieldtype": "Link",
- "options": "Account",
- "print_width": "250px",
- "reqd": 1,
- "search_index": 1,
- "width": "250px"
- },
- {
- "default": ":Company",
- "description": "If Income or Expense",
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Cost Center",
- "oldfieldname": "cost_center",
- "oldfieldtype": "Link",
- "options": "Cost Center",
- "print_width": "180px",
- "search_index": 0,
- "width": "180px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "balance",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Account Balance",
- "no_copy": 1,
- "oldfieldname": "balance",
- "oldfieldtype": "Data",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sec_break1",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "debit",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Debit",
- "oldfieldname": "debit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "credit",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Credit",
- "oldfieldname": "credit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "reference",
- "fieldtype": "Section Break",
- "label": "Reference"
- },
- {
- "doctype": "DocField",
- "fieldname": "against_invoice",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Against Sales Invoice",
- "no_copy": 1,
- "oldfieldname": "against_invoice",
- "oldfieldtype": "Link",
- "options": "Sales Invoice",
- "print_hide": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "against_voucher",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Against Purchase Invoice",
- "no_copy": 1,
- "oldfieldname": "against_voucher",
- "oldfieldtype": "Link",
- "options": "Purchase Invoice",
- "print_hide": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "against_jv",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Against Journal Voucher",
- "no_copy": 1,
- "oldfieldname": "against_jv",
- "oldfieldtype": "Link",
- "options": "Journal Voucher",
- "print_hide": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "is_advance",
- "fieldtype": "Select",
- "label": "Is Advance",
- "no_copy": 1,
- "oldfieldname": "is_advance",
- "oldfieldtype": "Select",
- "options": "No\nYes",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "against_account",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Against Account",
- "no_copy": 1,
- "oldfieldname": "against_account",
- "oldfieldtype": "Text",
- "print_hide": 1
- }
-]
\ No newline at end of file
+{
+ "autoname": "JVD.######",
+ "creation": "2013-02-22 01:27:39.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "account",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Account",
+ "oldfieldname": "account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_width": "250px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "250px"
+ },
+ {
+ "default": ":Company",
+ "description": "If Income or Expense",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Cost Center",
+ "oldfieldname": "cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_width": "180px",
+ "search_index": 0,
+ "width": "180px"
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "balance",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Account Balance",
+ "no_copy": 1,
+ "oldfieldname": "balance",
+ "oldfieldtype": "Data",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "sec_break1",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "debit",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Debit",
+ "oldfieldname": "debit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "credit",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Credit",
+ "oldfieldname": "credit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reference",
+ "fieldtype": "Section Break",
+ "label": "Reference",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "against_invoice",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Against Sales Invoice",
+ "no_copy": 1,
+ "oldfieldname": "against_invoice",
+ "oldfieldtype": "Link",
+ "options": "Sales Invoice",
+ "permlevel": 0,
+ "print_hide": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "against_voucher",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Against Purchase Invoice",
+ "no_copy": 1,
+ "oldfieldname": "against_voucher",
+ "oldfieldtype": "Link",
+ "options": "Purchase Invoice",
+ "permlevel": 0,
+ "print_hide": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "against_jv",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Against Journal Voucher",
+ "no_copy": 1,
+ "oldfieldname": "against_jv",
+ "oldfieldtype": "Link",
+ "options": "Journal Voucher",
+ "permlevel": 0,
+ "print_hide": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "is_advance",
+ "fieldtype": "Select",
+ "label": "Is Advance",
+ "no_copy": 1,
+ "oldfieldname": "is_advance",
+ "oldfieldtype": "Select",
+ "options": "No\nYes",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "against_account",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Against Account",
+ "no_copy": 1,
+ "oldfieldname": "against_account",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-03 12:44:31.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Journal Voucher Detail",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py
index 26c87f1..ddabf89 100644
--- a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py
+++ b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ModeOfPayment(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt
index 5830030..870c185 100644
--- a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt
+++ b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt
@@ -1,75 +1,58 @@
-[
- {
- "creation": "2012-12-04 17:49:20",
- "docstatus": 0,
- "modified": "2013-12-20 19:24:14",
- "modified_by": "Administrator",
- "owner": "harshada@webnotestech.com"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:mode_of_payment",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-credit-card",
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Mode of Payment",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Mode of Payment",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Accounts Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Mode of Payment"
- },
- {
- "doctype": "DocField",
- "fieldname": "mode_of_payment",
- "fieldtype": "Data",
- "label": "Mode of Payment",
- "oldfieldname": "mode_of_payment",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "options": "Company"
- },
- {
- "description": "Default Bank / Cash account will be automatically updated in POS Invoice when this mode is selected.",
- "doctype": "DocField",
- "fieldname": "default_account",
- "fieldtype": "Link",
- "label": "Default Account",
- "options": "Account"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:mode_of_payment",
+ "creation": "2012-12-04 17:49:20.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "mode_of_payment",
+ "fieldtype": "Data",
+ "label": "Mode of Payment",
+ "oldfieldname": "mode_of_payment",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "Default Bank / Cash account will be automatically updated in POS Invoice when this mode is selected.",
+ "fieldname": "default_account",
+ "fieldtype": "Link",
+ "label": "Default Account",
+ "options": "Account",
+ "permlevel": 0,
+ "read_only": 0
+ }
+ ],
+ "icon": "icon-credit-card",
+ "idx": 1,
+ "modified": "2013-12-20 19:24:14.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Mode of Payment",
+ "owner": "harshada@webnotestech.com",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py
index 5b23608..51c2c7d 100644
--- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py
+++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py
@@ -5,15 +5,12 @@
import frappe
from frappe.utils import flt
-from frappe.model.doc import addchild
from frappe.model.bean import getlist
from frappe import msgprint, _
-class DocType:
- def __init__(self, doc, doclist):
- self.doc = doc
- self.doclist = doclist
-
+from frappe.model.document import Document
+
+class PaymentToInvoiceMatchingTool(Document):
def get_voucher_details(self):
total_amount = frappe.db.sql("""select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
from `tabGL Entry`
@@ -40,7 +37,7 @@
Payment entry will be decided based on account type (Dr/Cr)
"""
- self.doclist = self.doc.clear_table(self.doclist, 'ir_payment_details')
+ self.set('ir_payment_details', [])
gle = self.get_gl_entries()
self.create_payment_table(gle)
@@ -71,8 +68,7 @@
def create_payment_table(self, gle):
for d in gle:
- ch = addchild(self.doc, 'ir_payment_details',
- 'Payment to Invoice Matching Tool Detail', self.doclist)
+ ch = self.doc.append('ir_payment_details', {})
ch.voucher_no = d.get('voucher_no')
ch.posting_date = d.get('posting_date')
ch.amt_due = flt(d.get('amt_due'))
@@ -97,7 +93,7 @@
frappe.throw(_("Please select valid Voucher No to proceed"))
lst = []
- for d in getlist(self.doclist, 'ir_payment_details'):
+ for d in self.get('ir_payment_details'):
if flt(d.amt_to_be_reconciled) > 0:
args = {
'voucher_no' : d.voucher_no,
diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt
index bc4e0f7..ce1a06b 100644
--- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt
+++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt
@@ -1,198 +1,186 @@
-[
- {
- "creation": "2013-01-30 12:49:46",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:24",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "document_type": "Other",
- "hide_toolbar": 1,
- "icon": "icon-magic",
- "issingle": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Payment to Invoice Matching Tool",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Payment to Invoice Matching Tool",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 0,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Payment to Invoice Matching Tool"
- },
- {
- "doctype": "DocField",
- "fieldname": "account",
- "fieldtype": "Link",
- "label": "Account",
- "options": "Account",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "account_type",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Account Type",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 1,
- "label": "Company",
- "options": "Company",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "voucher_type",
- "fieldtype": "Select",
- "label": "Voucher Type",
- "options": "Sales Invoice\nPurchase Invoice\nJournal Voucher",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "voucher_no",
- "fieldtype": "Link",
- "label": "Voucher No",
- "options": "[Select]",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pull_payment_entries",
- "fieldtype": "Button",
- "label": "Pull Payment Entries",
- "options": "get_payment_entries"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_amount",
- "fieldtype": "Currency",
- "label": "Total Amount",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pending_amt_to_reconcile",
- "fieldtype": "Currency",
- "label": "Outstanding Amount",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "payment_entries",
- "fieldtype": "Section Break",
- "label": "Payment Entries"
- },
- {
- "description": "Update allocated amount in the above table and then click \"Allocate\" button",
- "doctype": "DocField",
- "fieldname": "ir_payment_details",
- "fieldtype": "Table",
- "label": "Payment Entries",
- "options": "Payment to Invoice Matching Tool Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "reconcile",
- "fieldtype": "Button",
- "label": "Allocate",
- "options": "reconcile"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "options": "Simple"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "label": "Filter By Date",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "from_date",
- "fieldtype": "Date",
- "label": "From Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "to_date",
- "fieldtype": "Date",
- "label": "To Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "help_html",
- "fieldtype": "HTML",
- "label": "Help HTML",
- "options": "Click \"Pull Payment Entries\" to refresh the table with filters."
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "label": "Filter By Amount",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "amt_greater_than",
- "fieldtype": "Data",
- "label": "Amount >="
- },
- {
- "doctype": "DocField",
- "fieldname": "amt_less_than",
- "fieldtype": "Data",
- "label": "Amount <="
- },
- {
- "doctype": "DocPerm",
- "role": "Accounts Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Accounts User"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-30 12:49:46.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "fields": [
+ {
+ "fieldname": "account",
+ "fieldtype": "Link",
+ "label": "Account",
+ "options": "Account",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "account_type",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Account Type",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "voucher_type",
+ "fieldtype": "Select",
+ "label": "Voucher Type",
+ "options": "Sales Invoice\nPurchase Invoice\nJournal Voucher",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "voucher_no",
+ "fieldtype": "Link",
+ "label": "Voucher No",
+ "options": "[Select]",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "pull_payment_entries",
+ "fieldtype": "Button",
+ "label": "Pull Payment Entries",
+ "options": "get_payment_entries",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "total_amount",
+ "fieldtype": "Currency",
+ "label": "Total Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "pending_amt_to_reconcile",
+ "fieldtype": "Currency",
+ "label": "Outstanding Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "payment_entries",
+ "fieldtype": "Section Break",
+ "label": "Payment Entries",
+ "permlevel": 0
+ },
+ {
+ "description": "Update allocated amount in the above table and then click \"Allocate\" button",
+ "fieldname": "ir_payment_details",
+ "fieldtype": "Table",
+ "label": "Payment Entries",
+ "options": "Payment to Invoice Matching Tool Detail",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reconcile",
+ "fieldtype": "Button",
+ "label": "Allocate",
+ "options": "reconcile",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "options": "Simple",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "label": "Filter By Date",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "from_date",
+ "fieldtype": "Date",
+ "label": "From Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "to_date",
+ "fieldtype": "Date",
+ "label": "To Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "help_html",
+ "fieldtype": "HTML",
+ "label": "Help HTML",
+ "options": "Click \"Pull Payment Entries\" to refresh the table with filters.",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "label": "Filter By Amount",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "amt_greater_than",
+ "fieldtype": "Data",
+ "label": "Amount >=",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "amt_less_than",
+ "fieldtype": "Data",
+ "label": "Amount <=",
+ "permlevel": 0
+ }
+ ],
+ "hide_toolbar": 1,
+ "icon": "icon-magic",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-12-20 19:23:24.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Payment to Invoice Matching Tool",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Accounts Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Accounts User",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.py
index 26c87f1..a7bf686 100644
--- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.py
+++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class PaymentToInvoiceMatchingToolDetail(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt
index 1017a98..eecbb11 100644
--- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt
+++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt
@@ -1,101 +1,88 @@
-[
- {
- "creation": "2013-02-22 01:27:39",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:24",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Payment to Invoice Matching Tool Detail",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Payment to Invoice Matching Tool Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "voucher_no",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Voucher No",
- "options": "Journal Voucher",
- "print_width": "140px",
- "read_only": 1,
- "reqd": 0,
- "width": "140px"
- },
- {
- "doctype": "DocField",
- "fieldname": "amt_due",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Unmatched Amount",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amt_to_be_reconciled",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Allocated Amount",
- "options": "Company:company:default_currency",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "label": "Posting Date",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_amt",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Total Amount",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "against_account",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Against Account",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "remarks",
- "fieldtype": "Small Text",
- "label": "Remarks",
- "print_width": "200px",
- "read_only": 1,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "voucher_detail_no",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Voucher Detail No",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 0
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:39.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "voucher_no",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Voucher No",
+ "options": "Journal Voucher",
+ "permlevel": 0,
+ "print_width": "140px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "140px"
+ },
+ {
+ "fieldname": "amt_due",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Unmatched Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "amt_to_be_reconciled",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Allocated Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Posting Date",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "total_amt",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Total Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "against_account",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Against Account",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "remarks",
+ "fieldtype": "Small Text",
+ "label": "Remarks",
+ "permlevel": 0,
+ "print_width": "200px",
+ "read_only": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "voucher_detail_no",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Voucher Detail No",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:24.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Payment to Invoice Matching Tool Detail",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py
index 100bd95..cdc20e8 100644
--- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py
+++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py
@@ -7,9 +7,7 @@
from frappe import _
from erpnext.controllers.accounts_controller import AccountsController
-class DocType(AccountsController):
- def __init__(self,d,dl):
- self.doc, self.doclist = d, dl
+class PeriodClosingVoucher(AccountsController):
self.year_start_date = ''
def validate(self):
diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt
index 170f49f..d964ac7 100644
--- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt
+++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt
@@ -1,145 +1,136 @@
-[
- {
- "creation": "2013-01-10 16:34:07",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:59",
- "modified_by": "Administrator",
- "owner": "jai@webnotestech.com"
- },
- {
- "autoname": "PCE/.###",
- "doctype": "DocType",
- "icon": "icon-file-text",
- "is_submittable": 1,
- "module": "Accounts",
- "name": "__common__",
- "search_fields": "posting_date, fiscal_year"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Period Closing Voucher",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Period Closing Voucher",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Period Closing Voucher"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "transaction_date",
- "fieldtype": "Date",
- "label": "Transaction Date",
- "oldfieldname": "transaction_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "label": "Posting Date",
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "label": "Closing Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Select",
- "options": "link:Company",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break"
- },
- {
- "description": "The account head under Liability, in which Profit/Loss will be booked",
- "doctype": "DocField",
- "fieldname": "closing_account_head",
- "fieldtype": "Link",
- "label": "Closing Account Head",
- "oldfieldname": "closing_account_head",
- "oldfieldtype": "Link",
- "options": "Account",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "coa_help",
- "fieldtype": "HTML",
- "label": "CoA Help",
- "oldfieldtype": "HTML",
- "options": "<a href=\"#!Accounts Browser/Account\">To manage Account Head, click here</a>"
- },
- {
- "doctype": "DocField",
- "fieldname": "remarks",
- "fieldtype": "Small Text",
- "label": "Remarks",
- "oldfieldname": "remarks",
- "oldfieldtype": "Small Text",
- "reqd": 1
- },
- {
- "doctype": "DocPerm",
- "role": "System Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Accounts Manager"
- }
-]
\ No newline at end of file
+{
+ "autoname": "PCE/.###",
+ "creation": "2013-01-10 16:34:07.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "label": "Transaction Date",
+ "oldfieldname": "transaction_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "label": "Posting Date",
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "label": "Closing Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Select",
+ "options": "link:Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "The account head under Liability, in which Profit/Loss will be booked",
+ "fieldname": "closing_account_head",
+ "fieldtype": "Link",
+ "label": "Closing Account Head",
+ "oldfieldname": "closing_account_head",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "coa_help",
+ "fieldtype": "HTML",
+ "label": "CoA Help",
+ "oldfieldtype": "HTML",
+ "options": "<a href=\"#!Accounts Browser/Account\">To manage Account Head, click here</a>",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "remarks",
+ "fieldtype": "Small Text",
+ "label": "Remarks",
+ "oldfieldname": "remarks",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-20 17:48:59.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Period Closing Voucher",
+ "owner": "jai@webnotestech.com",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "search_fields": "posting_date, fiscal_year"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.js b/erpnext/accounts/doctype/pos_setting/pos_setting.js
index debfcd9..61c64c2 100755
--- a/erpnext/accounts/doctype/pos_setting/pos_setting.js
+++ b/erpnext/accounts/doctype/pos_setting/pos_setting.js
@@ -2,7 +2,7 @@
// License: GNU General Public License v3. See license.txt
cur_frm.cscript.onload = function(doc,cdt,cdn){
- return $c_obj(make_doclist(cdt,cdn),'get_series','',function(r,rt){
+ return $c_obj(cur_frm.doc, 'get_series','',function(r,rt){
if(r.message) set_field_options('naming_series', r.message);
});
diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.py b/erpnext/accounts/doctype/pos_setting/pos_setting.py
index 29ae298..61d405b 100755
--- a/erpnext/accounts/doctype/pos_setting/pos_setting.py
+++ b/erpnext/accounts/doctype/pos_setting/pos_setting.py
@@ -6,10 +6,9 @@
from frappe import msgprint, _
from frappe.utils import cint
-class DocType:
- def __init__(self,doc,doclist):
- self.doc, self.doclist = doc,doclist
+from frappe.model.document import Document
+class PosSetting(Document):
def get_series(self):
import frappe.model.doctype
docfield = frappe.model.doctype.get('Sales Invoice')
diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.txt b/erpnext/accounts/doctype/pos_setting/pos_setting.txt
index bad0d7e..0e68bc3 100755
--- a/erpnext/accounts/doctype/pos_setting/pos_setting.txt
+++ b/erpnext/accounts/doctype/pos_setting/pos_setting.txt
@@ -1,246 +1,234 @@
-[
- {
- "creation": "2013-05-24 12:15:51",
- "docstatus": 0,
- "modified": "2014-01-29 13:08:25",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "POS/.####",
- "doctype": "DocType",
- "icon": "icon-cog",
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "POS Setting",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "POS Setting",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "POS Setting"
- },
- {
- "doctype": "DocField",
- "fieldname": "user",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "User",
- "oldfieldname": "user",
- "oldfieldtype": "Link",
- "options": "User",
- "read_only": 0
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "label": "Territory",
- "oldfieldname": "territory",
- "oldfieldtype": "Link",
- "options": "Territory",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "currency",
- "fieldtype": "Link",
- "label": "Currency",
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "selling_price_list",
- "fieldtype": "Link",
- "label": "Price List",
- "oldfieldname": "price_list_name",
- "oldfieldtype": "Select",
- "options": "Price List",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0
- },
- {
- "default": "1",
- "description": "Create Stock Ledger Entries when you submit a Sales Invoice",
- "doctype": "DocField",
- "fieldname": "update_stock",
- "fieldtype": "Check",
- "label": "Update Stock",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "label": "Customer",
- "oldfieldname": "customer_account",
- "oldfieldtype": "Link",
- "options": "Customer",
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "cash_bank_account",
- "fieldtype": "Link",
- "label": "Cash/Bank Account",
- "oldfieldname": "cash_bank_account",
- "oldfieldtype": "Link",
- "options": "Account",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "income_account",
- "fieldtype": "Link",
- "label": "Income Account",
- "oldfieldname": "income_account",
- "oldfieldtype": "Link",
- "options": "Account",
- "read_only": 0,
- "reqd": 1
- },
- {
- "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
- "doctype": "DocField",
- "fieldname": "expense_account",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Expense Account",
- "options": "Account",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "label": "Warehouse",
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "label": "Cost Center",
- "oldfieldname": "cost_center",
- "oldfieldtype": "Link",
- "options": "Cost Center",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "taxes_and_charges",
- "fieldtype": "Link",
- "label": "Taxes and Charges",
- "oldfieldname": "charge",
- "oldfieldtype": "Link",
- "options": "Sales Taxes and Charges Master",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "letter_head",
- "fieldtype": "Select",
- "label": "Letter Head",
- "oldfieldname": "letter_head",
- "oldfieldtype": "Select",
- "options": "link:Letter Head",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "tc_name",
- "fieldtype": "Link",
- "label": "Terms and Conditions",
- "oldfieldname": "tc_name",
- "oldfieldtype": "Link",
- "options": "Terms and Conditions",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "select_print_heading",
- "fieldtype": "Select",
- "in_filter": 0,
- "label": "Print Heading",
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Select",
- "options": "link:Print Heading",
- "read_only": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "role": "Accounts Manager",
- "write": 1
- },
- {
- "doctype": "DocPerm",
- "role": "Accounts User"
- }
-]
\ No newline at end of file
+{
+ "autoname": "POS/.####",
+ "creation": "2013-05-24 12:15:51.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "user",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "User",
+ "oldfieldname": "user",
+ "oldfieldtype": "Link",
+ "options": "User",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "label": "Territory",
+ "oldfieldname": "territory",
+ "oldfieldtype": "Link",
+ "options": "Territory",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "label": "Currency",
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "selling_price_list",
+ "fieldtype": "Link",
+ "label": "Price List",
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Select",
+ "options": "Price List",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "default": "1",
+ "description": "Create Stock Ledger Entries when you submit a Sales Invoice",
+ "fieldname": "update_stock",
+ "fieldtype": "Check",
+ "label": "Update Stock",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "label": "Customer",
+ "oldfieldname": "customer_account",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "cash_bank_account",
+ "fieldtype": "Link",
+ "label": "Cash/Bank Account",
+ "oldfieldname": "cash_bank_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "income_account",
+ "fieldtype": "Link",
+ "label": "Income Account",
+ "oldfieldname": "income_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
+ "fieldname": "expense_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Expense Account",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "label": "Warehouse",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "label": "Cost Center",
+ "oldfieldname": "cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "label": "Taxes and Charges",
+ "oldfieldname": "charge",
+ "oldfieldtype": "Link",
+ "options": "Sales Taxes and Charges Master",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "letter_head",
+ "fieldtype": "Select",
+ "label": "Letter Head",
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "link:Letter Head",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "label": "Terms and Conditions",
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "select_print_heading",
+ "fieldtype": "Select",
+ "in_filter": 0,
+ "label": "Print Heading",
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Select",
+ "options": "link:Print Heading",
+ "permlevel": 0,
+ "read_only": 0
+ }
+ ],
+ "icon": "icon-cog",
+ "idx": 1,
+ "modified": "2014-01-29 13:08:25.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "POS Setting",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 0
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
index 5073718..831efac 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py
@@ -8,9 +8,7 @@
from frappe import throw, _
from frappe.model.controller import DocListController
-class DocType(DocListController):
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+class PricingRule(DocListController):
def validate(self):
self.validate_mandatory()
diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt b/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt
index 413405c..32df323 100644
--- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt
+++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt
@@ -1,261 +1,258 @@
-[
- {
- "creation": "2014-02-21 15:02:51",
- "docstatus": 0,
- "modified": "2014-03-05 18:23:34",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "PRULE.#####",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-gift",
- "istable": 0,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Pricing Rule",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Pricing Rule",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Pricing Rule"
- },
- {
- "doctype": "DocField",
- "fieldname": "basic_section",
- "fieldtype": "Section Break",
- "label": "Basic Section"
- },
- {
- "default": "Today",
- "doctype": "DocField",
- "fieldname": "valid_from",
- "fieldtype": "Date",
- "label": "Valid From"
- },
- {
- "doctype": "DocField",
- "fieldname": "valid_upto",
- "fieldtype": "Date",
- "label": "Valid Upto"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "priority",
- "fieldtype": "Select",
- "label": "Priority",
- "options": "\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20"
- },
- {
- "doctype": "DocField",
- "fieldname": "disable",
- "fieldtype": "Check",
- "label": "Disable"
- },
- {
- "doctype": "DocField",
- "fieldname": "price_discount_section",
- "fieldtype": "Section Break",
- "label": "Price / Discount"
- },
- {
- "default": "Discount Percentage",
- "doctype": "DocField",
- "fieldname": "price_or_discount",
- "fieldtype": "Select",
- "label": "Price or Discount",
- "options": "\nPrice\nDiscount Percentage",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "depends_on": "eval:doc.price_or_discount==\"Price\"",
- "doctype": "DocField",
- "fieldname": "price",
- "fieldtype": "Float",
- "label": "Price"
- },
- {
- "depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
- "doctype": "DocField",
- "fieldname": "discount_percentage",
- "fieldtype": "Float",
- "label": "Discount Percentage"
- },
- {
- "depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
- "doctype": "DocField",
- "fieldname": "for_price_list",
- "fieldtype": "Link",
- "label": "For Price List",
- "options": "Price List"
- },
- {
- "doctype": "DocField",
- "fieldname": "applicability_section",
- "fieldtype": "Section Break",
- "label": "Applicability"
- },
- {
- "default": "Item Code",
- "doctype": "DocField",
- "fieldname": "apply_on",
- "fieldtype": "Select",
- "label": "Apply On",
- "options": "\nItem Code\nItem Group\nBrand",
- "reqd": 1
- },
- {
- "depends_on": "eval:doc.apply_on==\"Item Code\"",
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "label": "Item Code",
- "options": "Item",
- "reqd": 0
- },
- {
- "depends_on": "eval:doc.apply_on==\"Item Group\"",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "label": "Item Group",
- "options": "Item Group"
- },
- {
- "depends_on": "eval:doc.apply_on==\"Brand\"",
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Link",
- "label": "Brand",
- "options": "Brand"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "applicable_for",
- "fieldtype": "Select",
- "label": "Applicable For",
- "options": "\nCustomer\nCustomer Group\nTerritory\nSales Partner\nCampaign\nSupplier\nSupplier Type"
- },
- {
- "depends_on": "eval:doc.applicable_for==\"Customer\"",
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "label": "Customer",
- "options": "Customer"
- },
- {
- "depends_on": "eval:doc.applicable_for==\"Customer Group\"",
- "doctype": "DocField",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "label": "Customer Group",
- "options": "Customer Group"
- },
- {
- "depends_on": "eval:doc.applicable_for==\"Territory\"",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "label": "Territory",
- "options": "Territory"
- },
- {
- "depends_on": "eval:doc.applicable_for==\"Sales Partner\"",
- "doctype": "DocField",
- "fieldname": "sales_partner",
- "fieldtype": "Link",
- "label": "Sales Partner",
- "options": "Sales Partner"
- },
- {
- "depends_on": "eval:doc.applicable_for==\"Campaign\"",
- "doctype": "DocField",
- "fieldname": "campaign",
- "fieldtype": "Link",
- "label": "Campaign",
- "options": "Campaign"
- },
- {
- "depends_on": "eval:doc.applicable_for==\"Supplier\"",
- "doctype": "DocField",
- "fieldname": "supplier",
- "fieldtype": "Link",
- "label": "Supplier",
- "options": "Supplier"
- },
- {
- "depends_on": "eval:doc.applicable_for==\"Supplier Type\"",
- "doctype": "DocField",
- "fieldname": "supplier_type",
- "fieldtype": "Link",
- "label": "Supplier Type",
- "options": "Supplier Type"
- },
- {
- "doctype": "DocField",
- "fieldname": "min_qty",
- "fieldtype": "Float",
- "label": "Min Qty"
- },
- {
- "doctype": "DocField",
- "fieldname": "max_qty",
- "fieldtype": "Float",
- "label": "Max Qty"
- },
- {
- "doctype": "DocPerm",
- "role": "Accounts Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Sales Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Purchase Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Website Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "System Manager"
- }
-]
\ No newline at end of file
+{
+ "autoname": "PRULE.#####",
+ "creation": "2014-02-21 15:02:51.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "basic_section",
+ "fieldtype": "Section Break",
+ "label": "Basic Section",
+ "permlevel": 0
+ },
+ {
+ "default": "Today",
+ "fieldname": "valid_from",
+ "fieldtype": "Date",
+ "label": "Valid From",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "valid_upto",
+ "fieldtype": "Date",
+ "label": "Valid Upto",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "priority",
+ "fieldtype": "Select",
+ "label": "Priority",
+ "options": "\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "disable",
+ "fieldtype": "Check",
+ "label": "Disable",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "price_discount_section",
+ "fieldtype": "Section Break",
+ "label": "Price / Discount",
+ "permlevel": 0
+ },
+ {
+ "default": "Discount Percentage",
+ "fieldname": "price_or_discount",
+ "fieldtype": "Select",
+ "label": "Price or Discount",
+ "options": "\nPrice\nDiscount Percentage",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.price_or_discount==\"Price\"",
+ "fieldname": "price",
+ "fieldtype": "Float",
+ "label": "Price",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
+ "fieldname": "discount_percentage",
+ "fieldtype": "Float",
+ "label": "Discount Percentage",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"",
+ "fieldname": "for_price_list",
+ "fieldtype": "Link",
+ "label": "For Price List",
+ "options": "Price List",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "applicability_section",
+ "fieldtype": "Section Break",
+ "label": "Applicability",
+ "permlevel": 0
+ },
+ {
+ "default": "Item Code",
+ "fieldname": "apply_on",
+ "fieldtype": "Select",
+ "label": "Apply On",
+ "options": "\nItem Code\nItem Group\nBrand",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:doc.apply_on==\"Item Code\"",
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "label": "Item Code",
+ "options": "Item",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "depends_on": "eval:doc.apply_on==\"Item Group\"",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "label": "Item Group",
+ "options": "Item Group",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.apply_on==\"Brand\"",
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "label": "Brand",
+ "options": "Brand",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "applicable_for",
+ "fieldtype": "Select",
+ "label": "Applicable For",
+ "options": "\nCustomer\nCustomer Group\nTerritory\nSales Partner\nCampaign\nSupplier\nSupplier Type",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Customer\"",
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "label": "Customer",
+ "options": "Customer",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Customer Group\"",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "label": "Customer Group",
+ "options": "Customer Group",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Territory\"",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Sales Partner\"",
+ "fieldname": "sales_partner",
+ "fieldtype": "Link",
+ "label": "Sales Partner",
+ "options": "Sales Partner",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Campaign\"",
+ "fieldname": "campaign",
+ "fieldtype": "Link",
+ "label": "Campaign",
+ "options": "Campaign",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Supplier\"",
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "label": "Supplier",
+ "options": "Supplier",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.applicable_for==\"Supplier Type\"",
+ "fieldname": "supplier_type",
+ "fieldtype": "Link",
+ "label": "Supplier Type",
+ "options": "Supplier Type",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "min_qty",
+ "fieldtype": "Float",
+ "label": "Min Qty",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "max_qty",
+ "fieldtype": "Float",
+ "label": "Max Qty",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-gift",
+ "idx": 1,
+ "istable": 0,
+ "modified": "2014-03-05 18:23:34.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Pricing Rule",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "delete": 1,
+ "permlevel": 0,
+ "read": 1,
+ "role": "Accounts Manager",
+ "write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "permlevel": 0,
+ "read": 1,
+ "role": "Sales Manager",
+ "write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "permlevel": 0,
+ "read": 1,
+ "role": "Purchase Manager",
+ "write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "permlevel": 0,
+ "read": 1,
+ "role": "Website Manager",
+ "write": 1
+ },
+ {
+ "create": 1,
+ "delete": 1,
+ "permlevel": 0,
+ "read": 1,
+ "role": "System Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
index be1f3b2..a45af20 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js
@@ -108,7 +108,7 @@
},
entries_add: function(doc, cdt, cdn) {
- var row = frappe.model.get_doc(cdt, cdn);
+ var row = frappe.get_doc(cdt, cdn);
this.frm.script_manager.copy_from_first_row("entries", row, ["expense_account", "cost_center"]);
}
});
@@ -184,7 +184,7 @@
cur_frm.cscript.expense_account = function(doc, cdt, cdn){
var d = locals[cdt][cdn];
if(d.idx == 1 && d.expense_account){
- var cl = getchildren('Purchase Invoice Item', doc.name, 'entries', doc.doctype);
+ var cl = doc.entries || [];
for(var i = 0; i < cl.length; i++){
if(!cl[i].expense_account) cl[i].expense_account = d.expense_account;
}
@@ -205,7 +205,7 @@
cur_frm.cscript.cost_center = function(doc, cdt, cdn){
var d = locals[cdt][cdn];
if(d.idx == 1 && d.cost_center){
- var cl = getchildren('Purchase Invoice Item', doc.name, 'entries', doc.doctype);
+ var cl = doc.entries || [];
for(var i = 0; i < cl.length; i++){
if(!cl[i].cost_center) cl[i].cost_center = d.cost_center;
}
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
index c059d2d..c07b2c8 100644
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
@@ -15,22 +15,20 @@
from erpnext.controllers.buying_controller import BuyingController
from erpnext.accounts.party import get_party_account, get_due_date
-class DocType(BuyingController):
- def __init__(self,d,dl):
- self.doc, self.doclist = d, dl
- self.tname = 'Purchase Invoice Item'
- self.fname = 'entries'
- self.status_updater = [{
- 'source_dt': 'Purchase Invoice Item',
- 'target_dt': 'Purchase Order Item',
- 'join_field': 'po_detail',
- 'target_field': 'billed_amt',
- 'target_parent_dt': 'Purchase Order',
- 'target_parent_field': 'per_billed',
- 'target_ref_field': 'amount',
- 'source_field': 'amount',
- 'percent_join_field': 'purchase_order',
- }]
+class PurchaseInvoice(BuyingController):
+ tname = 'Purchase Invoice Item'
+ fname = 'entries'
+ status_updater = [{
+ 'source_dt': 'Purchase Invoice Item',
+ 'target_dt': 'Purchase Order Item',
+ 'join_field': 'po_detail',
+ 'target_field': 'billed_amt',
+ 'target_parent_dt': 'Purchase Order',
+ 'target_parent_field': 'per_billed',
+ 'target_ref_field': 'amount',
+ 'source_field': 'amount',
+ 'percent_join_field': 'purchase_order',
+ }]
def validate(self):
if not self.doc.is_opening:
@@ -71,7 +69,7 @@
"Purchase Invoice Advance", "advance_allocation_details", "debit")
def check_active_purchase_items(self):
- for d in getlist(self.doclist, 'entries'):
+ for d in self.get('entries'):
if d.item_code: # extra condn coz item_code is not mandatory in PV
valid_item = frappe.db.sql("select docstatus,is_purchase_item from tabItem where name = %s",d.item_code)
if valid_item[0][0] == 2:
@@ -125,7 +123,7 @@
# ---------------------
def check_for_stopped_status(self):
check_list = []
- for d in getlist(self.doclist,'entries'):
+ for d in self.get('entries'):
if d.purchase_order and not d.purchase_order in check_list and not d.purchase_receipt:
check_list.append(d.purhcase_order)
stopped = frappe.db.sql("select name from `tabPurchase Order` where status = 'Stopped' and name = %s", d.purchase_order)
@@ -187,7 +185,7 @@
against_accounts = []
stock_items = self.get_stock_items()
- for item in self.doclist.get({"parentfield": "entries"}):
+ for item in self.get("entries"):
if auto_accounting_for_stock and item.item_code in stock_items \
and self.doc.is_opening == 'No':
# in case of auto inventory accounting, against expense account is always
@@ -210,14 +208,14 @@
def po_required(self):
if frappe.db.get_value("Buying Settings", None, "po_required") == 'Yes':
- for d in getlist(self.doclist,'entries'):
+ for d in self.get('entries'):
if not d.purchase_order:
msgprint("Purchse Order No. required against item %s"%d.item_code)
raise Exception
def pr_required(self):
if frappe.db.get_value("Buying Settings", None, "pr_required") == 'Yes':
- for d in getlist(self.doclist,'entries'):
+ for d in self.get('entries'):
if not d.purchase_receipt:
msgprint("Purchase Receipt No. required against item %s"%d.item_code)
raise Exception
@@ -227,7 +225,7 @@
msgprint("Please enter Write Off Account", raise_exception=1)
def check_prev_docstatus(self):
- for d in getlist(self.doclist,'entries'):
+ for d in self.get('entries'):
if d.purchase_order:
submitted = frappe.db.sql("select name from `tabPurchase Order` where docstatus = 1 and name = %s", d.purchase_order)
if not submitted:
@@ -247,7 +245,7 @@
"""
lst = []
- for d in getlist(self.doclist, 'advance_allocation_details'):
+ for d in self.get('advance_allocation_details'):
if flt(d.allocated_amount) > 0:
args = {
'voucher_no' : d.journal_voucher,
@@ -299,7 +297,7 @@
# tax table gl entries
valuation_tax = {}
- for tax in self.doclist.get({"parentfield": "other_charges"}):
+ for tax in self.get("other_charges"):
if tax.category in ("Total", "Valuation and Total") and flt(tax.tax_amount):
gl_entries.append(
self.get_gl_dict({
@@ -325,7 +323,7 @@
# item gl entries
stock_item_and_auto_accounting_for_stock = False
stock_items = self.get_stock_items()
- for item in self.doclist.get({"parentfield": "entries"}):
+ for item in self.get("entries"):
if auto_accounting_for_stock and item.item_code in stock_items:
if flt(item.valuation_rate):
# if auto inventory accounting enabled and stock item,
@@ -404,7 +402,7 @@
def update_raw_material_cost(self):
if self.sub_contracted_items:
- for d in self.doclist.get({"parentfield": "entries"}):
+ for d in self.get("entries"):
rm_cost = frappe.db.sql("""select raw_material_cost / quantity
from `tabBOM` where item = %s and is_default = 1 and docstatus = 1
and is_active = 1 """, (d.item_code,))
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt
index 1ad767e..7917caf 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt
@@ -1,829 +1,826 @@
-[
- {
- "creation": "2013-05-21 16:16:39",
- "docstatus": 0,
- "modified": "2014-02-17 12:01:59",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "icon": "icon-file-text",
- "is_submittable": 1,
- "module": "Accounts",
- "name": "__common__",
- "read_only_onload": 1,
- "search_fields": "posting_date, credit_to, fiscal_year, bill_no, grand_total, outstanding_amount"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Purchase Invoice",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Purchase Invoice",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Purchase Invoice"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_section",
- "fieldtype": "Section Break",
- "label": "Supplier",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "BILL\nBILLJ",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Supplier",
- "oldfieldname": "supplier",
- "oldfieldtype": "Link",
- "options": "Supplier",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "supplier",
- "doctype": "DocField",
- "fieldname": "supplier_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Name",
- "oldfieldname": "supplier_name",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Address",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_mobile",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Mobile No",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_email",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Contact Email",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "reqd": 0,
- "width": "50%"
- },
- {
- "default": "Today",
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Posting Date",
- "no_copy": 0,
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "description": "If not applicable please enter: NA",
- "doctype": "DocField",
- "fieldname": "bill_no",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Supplier Invoice No",
- "oldfieldname": "bill_no",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "bill_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Supplier Invoice Date",
- "oldfieldname": "bill_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Link",
- "options": "Purchase Invoice",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "print_hide": 1,
- "read_only": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "currency_price_list",
- "fieldtype": "Section Break",
- "label": "Currency and Price List",
- "options": "icon-tag",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "currency",
- "fieldtype": "Link",
- "label": "Currency",
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "description": "The rate at which Bill Currency is converted into company's base currency",
- "doctype": "DocField",
- "fieldname": "conversion_rate",
- "fieldtype": "Float",
- "label": "Exchange Rate",
- "oldfieldname": "conversion_rate",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "buying_price_list",
- "fieldtype": "Link",
- "label": "Price List",
- "options": "Price List",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_currency",
- "fieldtype": "Link",
- "label": "Price List Currency",
- "options": "Currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "plc_conversion_rate",
- "fieldtype": "Float",
- "label": "Price List Exchange Rate",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "items",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart",
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "entries",
- "fieldtype": "Table",
- "label": "Entries",
- "oldfieldname": "entries",
- "oldfieldtype": "Table",
- "options": "Purchase Invoice Item",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_26",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total_import",
- "fieldtype": "Currency",
- "label": "Net Total",
- "oldfieldname": "net_total_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_28",
- "fieldtype": "Column Break"
- },
- {
- "description": "Will be calculated automatically when you enter the details",
- "doctype": "DocField",
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "label": "Net Total (Company Currency)",
- "oldfieldname": "net_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "taxes",
- "fieldtype": "Section Break",
- "label": "Taxes and Charges",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "taxes_and_charges",
- "fieldtype": "Link",
- "label": "Taxes and Charges",
- "oldfieldname": "purchase_other_charges",
- "oldfieldtype": "Link",
- "options": "Purchase Taxes and Charges Master",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges",
- "fieldtype": "Table",
- "label": "Purchase Taxes and Charges",
- "oldfieldname": "purchase_tax_details",
- "oldfieldtype": "Table",
- "options": "Purchase Taxes and Charges",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_calculation",
- "fieldtype": "HTML",
- "label": "Taxes and Charges Calculation",
- "oldfieldtype": "HTML",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "label": "Totals",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_added_import",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Added",
- "oldfieldname": "other_charges_added_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_deducted_import",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Deducted",
- "oldfieldname": "other_charges_deducted_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total_import",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Grand Total",
- "oldfieldname": "grand_total_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "in_words_import",
- "fieldtype": "Data",
- "label": "In Words",
- "oldfieldname": "in_words_import",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_amount_to_pay",
- "fieldtype": "Currency",
- "hidden": 0,
- "label": "Total Amount To Pay",
- "no_copy": 1,
- "oldfieldname": "total_amount_to_pay",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_advance",
- "fieldtype": "Currency",
- "label": "Total Advance",
- "no_copy": 1,
- "oldfieldname": "total_advance",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "outstanding_amount",
- "fieldtype": "Currency",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Outstanding Amount",
- "no_copy": 1,
- "oldfieldname": "outstanding_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break8",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 1,
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_tax",
- "fieldtype": "Currency",
- "label": "Total Tax (Company Currency)",
- "oldfieldname": "total_tax",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_added",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Added (Company Currency)",
- "oldfieldname": "other_charges_added",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_deducted",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Deducted (Company Currency)",
- "oldfieldname": "other_charges_deducted",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total",
- "fieldtype": "Currency",
- "label": "Grand Total (Company Currency)",
- "oldfieldname": "grand_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "description": "In Words will be visible once you save the Purchase Invoice.",
- "doctype": "DocField",
- "fieldname": "in_words",
- "fieldtype": "Data",
- "label": "In Words (Company Currency)",
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "write_off_amount",
- "fieldtype": "Currency",
- "label": "Write Off Amount",
- "no_copy": 1,
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "eval:flt(doc.write_off_amount)!=0",
- "doctype": "DocField",
- "fieldname": "write_off_account",
- "fieldtype": "Link",
- "label": "Write Off Account",
- "no_copy": 1,
- "options": "Account",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "eval:flt(doc.write_off_amount)!=0",
- "doctype": "DocField",
- "fieldname": "write_off_cost_center",
- "fieldtype": "Link",
- "label": "Write Off Cost Center",
- "no_copy": 1,
- "options": "Cost Center",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "against_expense_account",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Against Expense Account",
- "no_copy": 1,
- "oldfieldname": "against_expense_account",
- "oldfieldtype": "Small Text",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "advances",
- "fieldtype": "Section Break",
- "label": "Advances",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "get_advances_paid",
- "fieldtype": "Button",
- "label": "Get Advances Paid",
- "oldfieldtype": "Button",
- "options": "get_advances",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "advance_allocation_details",
- "fieldtype": "Table",
- "label": "Purchase Invoice Advances",
- "no_copy": 1,
- "oldfieldname": "advance_allocation_details",
- "oldfieldtype": "Table",
- "options": "Purchase Invoice Advance",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "options": "icon-legal"
- },
- {
- "doctype": "DocField",
- "fieldname": "tc_name",
- "fieldtype": "Link",
- "label": "Terms",
- "options": "Terms and Conditions",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "terms",
- "fieldtype": "Text Editor",
- "label": "Terms and Conditions1"
- },
- {
- "depends_on": "supplier",
- "doctype": "DocField",
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "label": "Contact Info",
- "options": "icon-bullhorn",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_address",
- "fieldtype": "Link",
- "label": "Supplier Address",
- "options": "Address",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break23",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "label": "Contact Person",
- "options": "Contact",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "description": "Supplier (Payable) Account",
- "doctype": "DocField",
- "fieldname": "credit_to",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Credit To",
- "oldfieldname": "credit_to",
- "oldfieldtype": "Link",
- "options": "Account",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "default": "No",
- "description": "Considered as Opening Balance",
- "doctype": "DocField",
- "fieldname": "is_opening",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Is Opening",
- "oldfieldname": "is_opening",
- "oldfieldtype": "Select",
- "options": "No\nYes",
- "print_hide": 1,
- "read_only": 0,
- "search_index": 1
- },
- {
- "description": "Actual Invoice Date",
- "doctype": "DocField",
- "fieldname": "aging_date",
- "fieldtype": "Date",
- "label": "Aging Date",
- "oldfieldname": "aging_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 0,
- "search_index": 0
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "label": "Print Heading",
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "due_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Due Date",
- "no_copy": 0,
- "oldfieldname": "due_date",
- "oldfieldtype": "Date",
- "print_hide": 0,
- "read_only": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "mode_of_payment",
- "fieldtype": "Select",
- "label": "Mode of Payment",
- "oldfieldname": "mode_of_payment",
- "oldfieldtype": "Select",
- "options": "link:Mode of Payment",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_63",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "letter_head",
- "fieldtype": "Select",
- "label": "Letter Head",
- "options": "link:Letter Head",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "read_only": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "remarks",
- "fieldtype": "Small Text",
- "label": "Remarks",
- "no_copy": 1,
- "oldfieldname": "remarks",
- "oldfieldtype": "Text",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Accounts User",
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Purchase User",
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Supplier",
- "submit": 0,
- "write": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Accounts Manager",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Auditor",
- "submit": 0,
- "write": 0
- }
-]
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-05-21 16:16:39.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "supplier_section",
+ "fieldtype": "Section Break",
+ "label": "Supplier",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "BILL\nBILLJ",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Supplier",
+ "oldfieldname": "supplier",
+ "oldfieldtype": "Link",
+ "options": "Supplier",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "supplier",
+ "fieldname": "supplier_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Name",
+ "oldfieldname": "supplier_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Address",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_mobile",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Mobile No",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_email",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Contact Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 0,
+ "width": "50%"
+ },
+ {
+ "default": "Today",
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Posting Date",
+ "no_copy": 0,
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "description": "If not applicable please enter: NA",
+ "fieldname": "bill_no",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Supplier Invoice No",
+ "oldfieldname": "bill_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "bill_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Supplier Invoice Date",
+ "oldfieldname": "bill_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Link",
+ "options": "Purchase Invoice",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "currency_price_list",
+ "fieldtype": "Section Break",
+ "label": "Currency and Price List",
+ "options": "icon-tag",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "label": "Currency",
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "description": "The rate at which Bill Currency is converted into company's base currency",
+ "fieldname": "conversion_rate",
+ "fieldtype": "Float",
+ "label": "Exchange Rate",
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "buying_price_list",
+ "fieldtype": "Link",
+ "label": "Price List",
+ "options": "Price List",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "price_list_currency",
+ "fieldtype": "Link",
+ "label": "Price List Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "plc_conversion_rate",
+ "fieldtype": "Float",
+ "label": "Price List Exchange Rate",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "items",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "entries",
+ "fieldtype": "Table",
+ "label": "Entries",
+ "oldfieldname": "entries",
+ "oldfieldtype": "Table",
+ "options": "Purchase Invoice Item",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_26",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total_import",
+ "fieldtype": "Currency",
+ "label": "Net Total",
+ "oldfieldname": "net_total_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_28",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "Will be calculated automatically when you enter the details",
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "label": "Net Total (Company Currency)",
+ "oldfieldname": "net_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "taxes",
+ "fieldtype": "Section Break",
+ "label": "Taxes and Charges",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "label": "Taxes and Charges",
+ "oldfieldname": "purchase_other_charges",
+ "oldfieldtype": "Link",
+ "options": "Purchase Taxes and Charges Master",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "other_charges",
+ "fieldtype": "Table",
+ "label": "Purchase Taxes and Charges",
+ "oldfieldname": "purchase_tax_details",
+ "oldfieldtype": "Table",
+ "options": "Purchase Taxes and Charges",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "other_charges_calculation",
+ "fieldtype": "HTML",
+ "label": "Taxes and Charges Calculation",
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "label": "Totals",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "other_charges_added_import",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Added",
+ "oldfieldname": "other_charges_added_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "other_charges_deducted_import",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Deducted",
+ "oldfieldname": "other_charges_deducted_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "grand_total_import",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Grand Total",
+ "oldfieldname": "grand_total_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "in_words_import",
+ "fieldtype": "Data",
+ "label": "In Words",
+ "oldfieldname": "in_words_import",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "total_amount_to_pay",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "label": "Total Amount To Pay",
+ "no_copy": 1,
+ "oldfieldname": "total_amount_to_pay",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "total_advance",
+ "fieldtype": "Currency",
+ "label": "Total Advance",
+ "no_copy": 1,
+ "oldfieldname": "total_advance",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "outstanding_amount",
+ "fieldtype": "Currency",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Outstanding Amount",
+ "no_copy": 1,
+ "oldfieldname": "outstanding_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "column_break8",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "total_tax",
+ "fieldtype": "Currency",
+ "label": "Total Tax (Company Currency)",
+ "oldfieldname": "total_tax",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "other_charges_added",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Added (Company Currency)",
+ "oldfieldname": "other_charges_added",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "other_charges_deducted",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Deducted (Company Currency)",
+ "oldfieldname": "other_charges_deducted",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "label": "Grand Total (Company Currency)",
+ "oldfieldname": "grand_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "description": "In Words will be visible once you save the Purchase Invoice.",
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "label": "In Words (Company Currency)",
+ "oldfieldname": "in_words",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "write_off_amount",
+ "fieldtype": "Currency",
+ "label": "Write Off Amount",
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:flt(doc.write_off_amount)!=0",
+ "fieldname": "write_off_account",
+ "fieldtype": "Link",
+ "label": "Write Off Account",
+ "no_copy": 1,
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:flt(doc.write_off_amount)!=0",
+ "fieldname": "write_off_cost_center",
+ "fieldtype": "Link",
+ "label": "Write Off Cost Center",
+ "no_copy": 1,
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "against_expense_account",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Against Expense Account",
+ "no_copy": 1,
+ "oldfieldname": "against_expense_account",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "advances",
+ "fieldtype": "Section Break",
+ "label": "Advances",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "get_advances_paid",
+ "fieldtype": "Button",
+ "label": "Get Advances Paid",
+ "oldfieldtype": "Button",
+ "options": "get_advances",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "advance_allocation_details",
+ "fieldtype": "Table",
+ "label": "Purchase Invoice Advances",
+ "no_copy": 1,
+ "oldfieldname": "advance_allocation_details",
+ "oldfieldtype": "Table",
+ "options": "Purchase Invoice Advance",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "label": "Terms and Conditions",
+ "options": "icon-legal",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "label": "Terms",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "label": "Terms and Conditions1",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "supplier",
+ "fieldname": "contact_section",
+ "fieldtype": "Section Break",
+ "label": "Contact Info",
+ "options": "icon-bullhorn",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "supplier_address",
+ "fieldtype": "Link",
+ "label": "Supplier Address",
+ "options": "Address",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "col_break23",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "label": "Contact Person",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "description": "Supplier (Payable) Account",
+ "fieldname": "credit_to",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Credit To",
+ "oldfieldname": "credit_to",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "default": "No",
+ "description": "Considered as Opening Balance",
+ "fieldname": "is_opening",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Is Opening",
+ "oldfieldname": "is_opening",
+ "oldfieldtype": "Select",
+ "options": "No\nYes",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "search_index": 1
+ },
+ {
+ "description": "Actual Invoice Date",
+ "fieldname": "aging_date",
+ "fieldtype": "Date",
+ "label": "Aging Date",
+ "oldfieldname": "aging_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "search_index": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "label": "Print Heading",
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "due_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Due Date",
+ "no_copy": 0,
+ "oldfieldname": "due_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "mode_of_payment",
+ "fieldtype": "Select",
+ "label": "Mode of Payment",
+ "oldfieldname": "mode_of_payment",
+ "oldfieldtype": "Select",
+ "options": "link:Mode of Payment",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break_63",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "letter_head",
+ "fieldtype": "Select",
+ "label": "Letter Head",
+ "options": "link:Letter Head",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "remarks",
+ "fieldtype": "Small Text",
+ "label": "Remarks",
+ "no_copy": 1,
+ "oldfieldname": "remarks",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0
+ }
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-02-17 12:01:59.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Purchase Invoice",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Supplier",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Auditor",
+ "submit": 0,
+ "write": 0
+ }
+ ],
+ "read_only_onload": 1,
+ "search_fields": "posting_date, credit_to, fiscal_year, bill_no, grand_total, outstanding_amount"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
index b5942e3..c648c37 100644
--- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
+++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py
@@ -107,7 +107,7 @@
["_Test Item Home Desktop 100", 90, 59],
["_Test Item Home Desktop 200", 135, 177]
]
- for i, item in enumerate(wrapper.doclist.get({"parentfield": "entries"})):
+ for i, item in enumerate(wrapper.get("entries")):
self.assertEqual(item.item_code, expected_values[i][0])
self.assertEqual(item.item_tax_amount, expected_values[i][1])
self.assertEqual(item.valuation_rate, expected_values[i][2])
@@ -126,7 +126,7 @@
["_Test Account Discount - _TC", 168.03, 1512.30],
]
- for i, tax in enumerate(wrapper.doclist.get({"parentfield": "other_charges"})):
+ for i, tax in enumerate(wrapper.get("other_charges")):
self.assertEqual(tax.account_head, expected_values[i][0])
self.assertEqual(tax.tax_amount, expected_values[i][1])
self.assertEqual(tax.total, expected_values[i][2])
@@ -141,7 +141,7 @@
["_Test FG Item", 90, 7059],
["_Test Item Home Desktop 200", 135, 177]
]
- for i, item in enumerate(wrapper.doclist.get({"parentfield": "entries"})):
+ for i, item in enumerate(wrapper.get("entries")):
self.assertEqual(item.item_code, expected_values[i][0])
self.assertEqual(item.item_tax_amount, expected_values[i][1])
self.assertEqual(item.valuation_rate, expected_values[i][2])
@@ -160,7 +160,7 @@
["_Test Account Discount - _TC", 168.03, 1512.30],
]
- for i, tax in enumerate(wrapper.doclist.get({"parentfield": "other_charges"})):
+ for i, tax in enumerate(wrapper.get("other_charges")):
self.assertEqual(tax.account_head, expected_values[i][0])
self.assertEqual(tax.tax_amount, expected_values[i][1])
self.assertEqual(tax.total, expected_values[i][2])
@@ -174,9 +174,7 @@
jv.submit()
pi = frappe.bean(copy=test_records[0])
- pi.doclist.append({
- "doctype": "Purchase Invoice Advance",
- "parentfield": "advance_allocation_details",
+ pi.append("advance_allocation_details", {
"journal_voucher": jv.doc.name,
"jv_detail_no": jv.doclist[1].name,
"advance_amount": 400,
diff --git a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py
index 26c87f1..9dc3b16 100644
--- a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py
+++ b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class PurchaseInvoiceAdvance(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt
index 98c8587..47e2d89 100644
--- a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt
+++ b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt
@@ -1,101 +1,88 @@
-[
- {
- "creation": "2013-03-08 15:36:46",
- "docstatus": 0,
- "modified": "2014-02-03 12:38:24",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Purchase Invoice Advance",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Purchase Invoice Advance"
- },
- {
- "doctype": "DocField",
- "fieldname": "journal_voucher",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Journal Voucher",
- "no_copy": 1,
- "oldfieldname": "journal_voucher",
- "oldfieldtype": "Link",
- "options": "Journal Voucher",
- "print_width": "180px",
- "read_only": 1,
- "width": "180px"
- },
- {
- "doctype": "DocField",
- "fieldname": "jv_detail_no",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Journal Voucher Detail No",
- "no_copy": 1,
- "oldfieldname": "jv_detail_no",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "print_width": "80px",
- "read_only": 1,
- "width": "80px"
- },
- {
- "doctype": "DocField",
- "fieldname": "remarks",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Remarks",
- "no_copy": 1,
- "oldfieldname": "remarks",
- "oldfieldtype": "Small Text",
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "advance_amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Advance Amount",
- "no_copy": 1,
- "oldfieldname": "advance_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_width": "100px",
- "read_only": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "allocated_amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Allocated Amount",
- "no_copy": 1,
- "oldfieldname": "allocated_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_width": "100px",
- "width": "100px"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-03-08 15:36:46.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "journal_voucher",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Journal Voucher",
+ "no_copy": 1,
+ "oldfieldname": "journal_voucher",
+ "oldfieldtype": "Link",
+ "options": "Journal Voucher",
+ "permlevel": 0,
+ "print_width": "180px",
+ "read_only": 1,
+ "width": "180px"
+ },
+ {
+ "fieldname": "jv_detail_no",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Journal Voucher Detail No",
+ "no_copy": 1,
+ "oldfieldname": "jv_detail_no",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "80px",
+ "read_only": 1,
+ "width": "80px"
+ },
+ {
+ "fieldname": "remarks",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Remarks",
+ "no_copy": 1,
+ "oldfieldname": "remarks",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "advance_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Advance Amount",
+ "no_copy": 1,
+ "oldfieldname": "advance_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "allocated_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Allocated Amount",
+ "no_copy": 1,
+ "oldfieldname": "allocated_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_width": "100px",
+ "width": "100px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-03 12:38:24.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Purchase Invoice Advance",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py
index 26c87f1..580d989 100644
--- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py
+++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class PurchaseInvoiceItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
index b3562b3..26f3be7 100755
--- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
+++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt
@@ -1,450 +1,437 @@
-[
- {
- "creation": "2013-05-22 12:43:10",
- "docstatus": 0,
- "modified": "2014-02-28 11:27:53",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "EVD.######",
- "doctype": "DocType",
- "istable": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Purchase Invoice Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Purchase Invoice Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Item",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "read_only": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "print_width": "300px",
- "read_only": 0,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "quantity_and_rate",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Quantity and Rate"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Qty",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "print_hide": 0,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "UOM",
- "options": "UOM",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Conversion Factor",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sec_break1",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate",
- "options": "currency",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "discount_percentage",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Discount %",
- "print_hide": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate (Company Currency)",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sec_break2",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Rate ",
- "oldfieldname": "import_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "import_amount",
- "oldfieldtype": "Currency",
- "options": "currency",
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break4",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Rate (Company Currency)",
- "oldfieldname": "rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "base_amount",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Amount (Company Currency)",
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_price",
- "fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "accounting",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Accounting"
- },
- {
- "doctype": "DocField",
- "fieldname": "expense_account",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Expense Head",
- "oldfieldname": "expense_head",
- "oldfieldtype": "Link",
- "options": "Account",
- "print_hide": 1,
- "print_width": "120px",
- "read_only": 0,
- "reqd": 0,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break5",
- "fieldtype": "Column Break"
- },
- {
- "default": ":Company",
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Cost Center",
- "oldfieldname": "cost_center",
- "oldfieldtype": "Link",
- "options": "Cost Center",
- "print_hide": 1,
- "print_width": "120px",
- "read_only": 0,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "reference",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Reference"
- },
- {
- "doctype": "DocField",
- "fieldname": "project_name",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Project Name",
- "options": "Project",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Brand",
- "oldfieldname": "brand",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 1,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Item Group",
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges",
- "doctype": "DocField",
- "fieldname": "item_tax_rate",
- "fieldtype": "Small Text",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Item Tax Rate",
- "oldfieldname": "item_tax_rate",
- "oldfieldtype": "Small Text",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_tax_amount",
- "fieldtype": "Currency",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Item Tax Amount",
- "no_copy": 1,
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "search_index": 0,
- "width": "150px"
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "page_break",
- "fieldtype": "Check",
- "in_list_view": 0,
- "label": "Page Break",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break6",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_order",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Purchase Order",
- "no_copy": 1,
- "oldfieldname": "purchase_order",
- "oldfieldtype": "Link",
- "options": "Purchase Order",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "po_detail",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Purchase Order Item",
- "no_copy": 1,
- "oldfieldname": "po_detail",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_receipt",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Purchase Receipt",
- "no_copy": 1,
- "oldfieldname": "purchase_receipt",
- "oldfieldtype": "Link",
- "options": "Purchase Receipt",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pr_detail",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "PR Detail",
- "no_copy": 1,
- "oldfieldname": "pr_detail",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "valuation_rate",
- "fieldtype": "Currency",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Valuation Rate",
- "no_copy": 1,
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rm_supp_cost",
- "fieldtype": "Currency",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Raw Materials Supplied Cost",
- "no_copy": 1,
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- }
-]
\ No newline at end of file
+{
+ "autoname": "EVD.######",
+ "creation": "2013-05-22 12:43:10.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Item",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "read_only": 0,
+ "width": "300px"
+ },
+ {
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Quantity and Rate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Qty",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Conversion Factor",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "sec_break1",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "discount_percentage",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Discount %",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "base_price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate (Company Currency)",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "sec_break2",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Rate ",
+ "oldfieldname": "import_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "import_amount",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "base_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Rate (Company Currency)",
+ "oldfieldname": "rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "base_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Amount (Company Currency)",
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "accounting",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Accounting",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "expense_account",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Expense Head",
+ "oldfieldname": "expense_head",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "120px",
+ "read_only": 0,
+ "reqd": 0,
+ "width": "120px"
+ },
+ {
+ "fieldname": "col_break5",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "default": ":Company",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Cost Center",
+ "oldfieldname": "cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "120px",
+ "read_only": 0,
+ "width": "120px"
+ },
+ {
+ "fieldname": "reference",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Reference",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Project Name",
+ "options": "Project",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "brand",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Brand",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Item Group",
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges",
+ "fieldname": "item_tax_rate",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Item Tax Rate",
+ "oldfieldname": "item_tax_rate",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "item_tax_amount",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Item Tax Amount",
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 0,
+ "width": "150px"
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "in_list_view": 0,
+ "label": "Page Break",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "col_break6",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "purchase_order",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Purchase Order",
+ "no_copy": 1,
+ "oldfieldname": "purchase_order",
+ "oldfieldtype": "Link",
+ "options": "Purchase Order",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "po_detail",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Purchase Order Item",
+ "no_copy": 1,
+ "oldfieldname": "po_detail",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "purchase_receipt",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Purchase Receipt",
+ "no_copy": 1,
+ "oldfieldname": "purchase_receipt",
+ "oldfieldtype": "Link",
+ "options": "Purchase Receipt",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "pr_detail",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "PR Detail",
+ "no_copy": 1,
+ "oldfieldname": "pr_detail",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "valuation_rate",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Valuation Rate",
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "rm_supp_cost",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Raw Materials Supplied Cost",
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-28 11:27:53.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Purchase Invoice Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py
index 26c87f1..910e380 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class PurchaseTaxesAndCharges(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
index c5768c6..4ec65db 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt
@@ -1,175 +1,162 @@
-[
- {
- "creation": "2013-05-21 16:16:04",
- "docstatus": 0,
- "modified": "2014-02-03 12:36:04",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "PVTD.######",
- "doctype": "DocType",
- "hide_heading": 1,
- "istable": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Purchase Taxes and Charges",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Purchase Taxes and Charges"
- },
- {
- "default": "Valuation and Total",
- "doctype": "DocField",
- "fieldname": "category",
- "fieldtype": "Select",
- "in_list_view": 0,
- "label": "Consider Tax or Charge for",
- "oldfieldname": "category",
- "oldfieldtype": "Select",
- "options": "Valuation and Total\nValuation\nTotal",
- "read_only": 0,
- "reqd": 1
- },
- {
- "default": "Add",
- "doctype": "DocField",
- "fieldname": "add_deduct_tax",
- "fieldtype": "Select",
- "label": "Add or Deduct",
- "oldfieldname": "add_deduct_tax",
- "oldfieldtype": "Select",
- "options": "Add\nDeduct",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "charge_type",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Type",
- "oldfieldname": "charge_type",
- "oldfieldtype": "Select",
- "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "row_id",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Enter Row",
- "oldfieldname": "row_id",
- "oldfieldtype": "Data",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "print_width": "300px",
- "read_only": 0,
- "reqd": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "account_head",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Account Head",
- "oldfieldname": "account_head",
- "oldfieldtype": "Link",
- "options": "Account",
- "read_only": 0,
- "reqd": 1
- },
- {
- "default": ":Company",
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Cost Center",
- "oldfieldname": "cost_center",
- "oldfieldtype": "Link",
- "options": "Cost Center",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Rate",
- "oldfieldname": "rate",
- "oldfieldtype": "Currency",
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "tax_amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "tax_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "total",
- "fieldtype": "Currency",
- "label": "Total",
- "oldfieldname": "total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_wise_tax_detail",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Item Wise Tax Detail ",
- "oldfieldname": "item_wise_tax_detail",
- "oldfieldtype": "Small Text",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "parenttype",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "label": "Parenttype",
- "oldfieldname": "parenttype",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 0,
- "search_index": 0
- }
-]
\ No newline at end of file
+{
+ "autoname": "PVTD.######",
+ "creation": "2013-05-21 16:16:04.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "default": "Valuation and Total",
+ "fieldname": "category",
+ "fieldtype": "Select",
+ "in_list_view": 0,
+ "label": "Consider Tax or Charge for",
+ "oldfieldname": "category",
+ "oldfieldtype": "Select",
+ "options": "Valuation and Total\nValuation\nTotal",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "default": "Add",
+ "fieldname": "add_deduct_tax",
+ "fieldtype": "Select",
+ "label": "Add or Deduct",
+ "oldfieldname": "add_deduct_tax",
+ "oldfieldtype": "Select",
+ "options": "Add\nDeduct",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "charge_type",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Type",
+ "oldfieldname": "charge_type",
+ "oldfieldtype": "Select",
+ "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "row_id",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Enter Row",
+ "oldfieldname": "row_id",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "account_head",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Account Head",
+ "oldfieldname": "account_head",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "default": ":Company",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Cost Center",
+ "oldfieldname": "cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Rate",
+ "oldfieldname": "rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "tax_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "tax_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "total",
+ "fieldtype": "Currency",
+ "label": "Total",
+ "oldfieldname": "total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "item_wise_tax_detail",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Item Wise Tax Detail ",
+ "oldfieldname": "item_wise_tax_detail",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "parenttype",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Parenttype",
+ "oldfieldname": "parenttype",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "search_index": 0
+ }
+ ],
+ "hide_heading": 1,
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-03 12:36:04.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Purchase Taxes and Charges",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js
index 2027a7b..bc0a912 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js
@@ -41,7 +41,7 @@
return doc_field.print_hide;
}
- var cl = getchildren('Purchase Taxes and Charges', doc.name, 'other_charges');
+ var cl = doc.other_charges || [];
// outer table
var out='<div><table class="noborder" style="width:100%">\
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py
index eee6e9a..fb9a0ab 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py
@@ -3,15 +3,7 @@
from __future__ import unicode_literals
import frappe
+from frappe.model.document import Document
-from frappe.model import db_exists
-from frappe.model.bean import copy_doclist
-from frappe.model.code import get_obj
-
-
-
-
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
\ No newline at end of file
+class PurchaseTaxesAndChargesMaster(Document):
+ pass
diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt
index 346dd0e..dd7c8e4 100644
--- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt
+++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt
@@ -1,96 +1,83 @@
-[
- {
- "creation": "2013-01-10 16:34:08",
- "docstatus": 0,
- "modified": "2014-01-29 12:26:38",
- "modified_by": "Administrator",
- "owner": "wasim@webnotestech.com"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:title",
- "description": "Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **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.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. 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).\n9. 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.\n10. Add or Deduct: Whether you want to add or deduct the tax.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-money",
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Purchase Taxes and Charges Master",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Purchase Taxes and Charges Master",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Purchase Taxes and Charges Master"
- },
- {
- "doctype": "DocField",
- "fieldname": "title",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Title",
- "oldfieldname": "title",
- "oldfieldtype": "Data",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "is_default",
- "fieldtype": "Check",
- "label": "Default"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "options": "Company",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges",
- "fieldtype": "Table",
- "label": "Purchase Taxes and Charges",
- "oldfieldname": "purchase_tax_details",
- "oldfieldtype": "Table",
- "options": "Purchase Taxes and Charges"
- },
- {
- "amend": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Purchase Manager",
- "write": 0
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Purchase Master Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:title",
+ "creation": "2013-01-10 16:34:08.000000",
+ "description": "Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **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.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. 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).\n9. 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.\n10. Add or Deduct: Whether you want to add or deduct the tax.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "title",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Title",
+ "oldfieldname": "title",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "is_default",
+ "fieldtype": "Check",
+ "label": "Default",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "other_charges",
+ "fieldtype": "Table",
+ "label": "Purchase Taxes and Charges",
+ "oldfieldname": "purchase_tax_details",
+ "oldfieldtype": "Table",
+ "options": "Purchase Taxes and Charges",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-money",
+ "idx": 1,
+ "modified": "2014-01-29 12:26:38.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Purchase Taxes and Charges Master",
+ "owner": "wasim@webnotestech.com",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Manager",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Master Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/pos.js b/erpnext/accounts/doctype/sales_invoice/pos.js
index fc6190a..ff996cc 100644
--- a/erpnext/accounts/doctype/sales_invoice/pos.js
+++ b/erpnext/accounts/doctype/sales_invoice/pos.js
@@ -293,8 +293,7 @@
// check whether the item is already added
if (no_of_items != 0) {
- $.each(frappe.model.get_children(this.frm.doctype + " Item", this.frm.doc.name,
- this.frm.cscript.fname, this.frm.doctype), function(i, d) {
+ $.each(this.frm.doc[this.frm.cscript.fname] || [], function(i, d) {
if (d.item_code == item_code) {
caught = true;
if (serial_no)
@@ -335,8 +334,7 @@
},
update_qty: function(item_code, qty) {
var me = this;
- $.each(frappe.model.get_children(this.frm.doctype + " Item", this.frm.doc.name,
- this.frm.cscript.fname, this.frm.doctype), function(i, d) {
+ $.each(this.frm.doc[this.frm.cscript.fname] || [], function(i, d) {
if (d.item_code == item_code) {
if (qty == 0) {
frappe.model.clear_doc(d.doctype, d.name);
@@ -387,8 +385,7 @@
var me = this;
var $items = this.wrapper.find("#cart tbody").empty();
- $.each(frappe.model.get_children(this.frm.doctype + " Item", this.frm.doc.name,
- this.frm.cscript.fname, this.frm.doctype), function(i, d) {
+ $.each(this.frm.doc[this.frm.cscript.fname] || [], function(i, d) {
$(repl('<tr id="%(item_code)s" data-selected="false">\
<td>%(item_code)s%(item_name)s</td>\
@@ -422,8 +419,7 @@
},
show_taxes: function() {
var me = this;
- var taxes = frappe.model.get_children(this.sales_or_purchase + " Taxes and Charges",
- this.frm.doc.name, this.frm.cscript.other_fname, this.frm.doctype);
+ var taxes = this.frm.doc[this.frm.cscript.other_fname] || [];
$(this.wrapper).find(".tax-table")
.toggle((taxes && taxes.length) ? true : false)
.find("tbody").empty();
@@ -544,8 +540,7 @@
}
}
- var child = frappe.model.get_children(this.frm.doctype + " Item", this.frm.doc.name,
- this.frm.cscript.fname, this.frm.doctype);
+ var child = this.frm.doc[this.frm.cscript.fname] || [];
$.each(child, function(i, d) {
for (var i in selected_items) {
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 42cf823..077c913 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -68,7 +68,7 @@
if(cint(doc.update_stock)!=1) {
// show Make Delivery Note button only if Sales Invoice is not created from Delivery Note
var from_delivery_note = false;
- from_delivery_note = cur_frm.get_doclist({parentfield: "entries"})
+ from_delivery_note = cur_frm.doc.entries
.some(function(item) {
return item.delivery_note ? true : false;
});
@@ -199,7 +199,7 @@
},
entries_add: function(doc, cdt, cdn) {
- var row = frappe.model.get_doc(cdt, cdn);
+ var row = frappe.get_doc(cdt, cdn);
this.frm.script_manager.copy_from_first_row("entries", row, ["income_account", "cost_center"]);
},
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index e021485..f62efa4 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -9,7 +9,7 @@
get_first_day, get_last_day
from frappe.utils import comma_and
-from frappe.model.doc import make_autoname
+from frappe.model.naming import make_autoname
from frappe.model.bean import getlist
from frappe.model.code import get_obj
from frappe import _, msgprint
@@ -20,27 +20,23 @@
from erpnext.controllers.selling_controller import SellingController
-class DocType(SellingController):
- def __init__(self,d,dl):
- self.doc, self.doclist = d, dl
- self.log = []
- self.tname = 'Sales Invoice Item'
- self.fname = 'entries'
- self.status_updater = [{
- 'source_dt': 'Sales Invoice Item',
- 'target_field': 'billed_amt',
- 'target_ref_field': 'amount',
- 'target_dt': 'Sales Order Item',
- 'join_field': 'so_detail',
- 'target_parent_dt': 'Sales Order',
- 'target_parent_field': 'per_billed',
- 'source_field': 'amount',
- 'join_field': 'so_detail',
- 'percent_join_field': 'sales_order',
- 'status_field': 'billing_status',
- 'keyword': 'Billed'
- }]
-
+class SalesInvoice(SellingController):
+ tname = 'Sales Invoice Item'
+ fname = 'entries'
+ status_updater = [{
+ 'source_dt': 'Sales Invoice Item',
+ 'target_field': 'billed_amt',
+ 'target_ref_field': 'amount',
+ 'target_dt': 'Sales Order Item',
+ 'join_field': 'so_detail',
+ 'target_parent_dt': 'Sales Order',
+ 'target_parent_field': 'per_billed',
+ 'source_field': 'amount',
+ 'join_field': 'so_detail',
+ 'percent_join_field': 'sales_order',
+ 'status_field': 'billing_status',
+ 'keyword': 'Billed'
+ }]
def validate(self):
super(DocType, self).validate()
@@ -194,7 +190,7 @@
self.doc.update_stock = cint(pos.get("update_stock"))
# set pos values in items
- for item in self.doclist.get({"parentfield": "entries"}):
+ for item in self.get("entries"):
if item.fields.get('item_code'):
for fname, val in get_pos_settings_item_details(pos,
frappe._dict(item.fields), pos).items():
@@ -207,7 +203,7 @@
self.doc.terms = frappe.db.get_value("Terms and Conditions", self.doc.tc_name, "terms")
# fetch charges
- if self.doc.charge and not len(self.doclist.get({"parentfield": "other_charges"})):
+ if self.doc.charge and not len(self.get("other_charges")):
self.set_taxes("other_charges", "taxes_and_charges")
def get_advances(self):
@@ -226,7 +222,7 @@
"""
lst = []
- for d in getlist(self.doclist, 'advance_adjustment_details'):
+ for d in self.get('advance_adjustment_details'):
if flt(d.allocated_amount) > 0:
args = {
'voucher_no' : d.journal_voucher,
@@ -262,7 +258,7 @@
def validate_fixed_asset_account(self):
"""Validate Fixed Asset and whether Income Account Entered Exists"""
- for d in getlist(self.doclist,'entries'):
+ for d in self.get('entries'):
item = frappe.db.sql("""select name,is_asset_item,is_sales_item from `tabItem`
where name = %s and (ifnull(end_of_life,'')='' or end_of_life = '0000-00-00'
or end_of_life > now())""", d.item_code)
@@ -314,7 +310,7 @@
def set_against_income_account(self):
"""Set against account for debit to account"""
against_acc = []
- for d in getlist(self.doclist, 'entries'):
+ for d in self.get('entries'):
if d.income_account not in against_acc:
against_acc.append(d.income_account)
self.doc.against_income_account = ','.join(against_acc)
@@ -329,7 +325,7 @@
dic = {'Sales Order':'so_required','Delivery Note':'dn_required'}
for i in dic:
if frappe.db.get_value('Selling Settings', None, dic[i]) == 'Yes':
- for d in getlist(self.doclist,'entries'):
+ for d in self.get('entries'):
if frappe.db.get_value('Item', d.item_code, 'is_stock_item') == 'Yes' \
and not d.fields[i.lower().replace(' ','_')]:
msgprint("%s is mandatory for stock item which is not mentioed against item: %s"%(i,d.item_code), raise_exception=1)
@@ -356,13 +352,13 @@
def validate_item_code(self):
- for d in getlist(self.doclist, 'entries'):
+ for d in self.get('entries'):
if not d.item_code:
msgprint("Please enter Item Code at line no : %s to update stock or remove check from Update Stock in Basic Info Tab." % (d.idx),
raise_exception=True)
def validate_delivery_note(self):
- for d in self.doclist.get({"parentfield": "entries"}):
+ for d in self.get("entries"):
if d.delivery_note:
msgprint("""Stock update can not be made against Delivery Note""", raise_exception=1)
@@ -381,12 +377,12 @@
frappe.db.set(self.doc, 'c_form_no', '')
def update_current_stock(self):
- for d in getlist(self.doclist, 'entries'):
+ for d in self.get('entries'):
if d.item_code and d.warehouse:
bin = frappe.db.sql("select actual_qty from `tabBin` where item_code = %s and warehouse = %s", (d.item_code, d.warehouse), as_dict = 1)
d.actual_qty = bin and flt(bin[0]['actual_qty']) or 0
- for d in getlist(self.doclist, 'packing_details'):
+ for d in self.get('packing_details'):
bin = frappe.db.sql("select actual_qty, projected_qty from `tabBin` where item_code = %s and warehouse = %s", (d.item_code, d.warehouse), as_dict = 1)
d.actual_qty = bin and flt(bin[0]['actual_qty']) or 0
d.projected_qty = bin and flt(bin[0]['projected_qty']) or 0
@@ -414,14 +410,14 @@
if cint(self.doc.is_pos) == 1:
w = self.get_warehouse()
if w:
- for d in getlist(self.doclist, 'entries'):
+ for d in self.get('entries'):
if not d.warehouse:
d.warehouse = cstr(w)
from erpnext.stock.doctype.packed_item.packed_item import make_packing_list
make_packing_list(self, 'entries')
else:
- self.doclist = self.doc.clear_table(self.doclist, 'packing_details')
+ self.set('packing_details', [])
if cint(self.doc.is_pos) == 1:
if flt(self.doc.paid_amount) == 0:
@@ -436,7 +432,7 @@
frappe.db.set(self.doc,'paid_amount',0)
def check_prev_docstatus(self):
- for d in getlist(self.doclist,'entries'):
+ for d in self.get('entries'):
if d.sales_order:
submitted = frappe.db.sql("""select name from `tabSales Order`
where docstatus = 1 and name = %s""", d.sales_order)
@@ -513,7 +509,7 @@
)
def make_tax_gl_entries(self, gl_entries):
- for tax in self.doclist.get({"parentfield": "other_charges"}):
+ for tax in self.get("other_charges"):
if flt(tax.tax_amount_after_discount_amount):
gl_entries.append(
self.get_gl_dict({
@@ -527,7 +523,7 @@
def make_item_gl_entries(self, gl_entries):
# income account gl entries
- for item in self.doclist.get({"parentfield": "entries"}):
+ for item in self.get("entries"):
if flt(item.base_amount):
gl_entries.append(
self.get_gl_dict({
@@ -594,12 +590,6 @@
invoice_date = %s, territory = %s, net_total = %s,
grand_total = %s where invoice_no = %s and parent = %s""",
(self.doc.name, self.doc.amended_from, self.doc.c_form_no))
-
- @property
- def meta(self):
- if not hasattr(self, "_meta"):
- self._meta = frappe.get_doctype(self.doc.doctype)
- return self._meta
def validate_recurring_invoice(self):
if self.doc.convert_into_recurring_invoice:
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt
index 49cc213..09c4fb1 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt
@@ -1,1239 +1,1228 @@
-[
- {
- "creation": "2013-05-24 19:29:05",
- "docstatus": 0,
- "modified": "2014-01-28 18:43:10",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "autoname": "naming_series:",
- "default_print_format": "Standard",
- "doctype": "DocType",
- "document_type": "Transaction",
- "icon": "icon-file-text",
- "is_submittable": 1,
- "module": "Accounts",
- "name": "__common__",
- "read_only_onload": 1,
- "search_fields": "posting_date, due_date, debit_to, fiscal_year, grand_total, outstanding_amount"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Sales Invoice",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Sales Invoice",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Sales Invoice"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_section",
- "fieldtype": "Section Break",
- "label": "Customer",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "INV\nINV/10-11/",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Customer",
- "no_copy": 0,
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Name",
- "oldfieldname": "customer_name",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Address",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_mobile",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Mobile No",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_email",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Contact Email",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "is_pos",
- "fieldtype": "Check",
- "label": "Is POS",
- "oldfieldname": "is_pos",
- "oldfieldtype": "Check",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Link",
- "options": "Sales Invoice",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "default": "Today",
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Posting Date",
- "no_copy": 1,
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "print_hide": 0,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "due_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Payment Due Date",
- "no_copy": 1,
- "oldfieldname": "due_date",
- "oldfieldtype": "Date",
- "read_only": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "mode_of_payment",
- "fieldtype": "Select",
- "label": "Mode of Payment",
- "no_copy": 0,
- "oldfieldname": "mode_of_payment",
- "oldfieldtype": "Select",
- "options": "link:Mode of Payment",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "currency_section",
- "fieldtype": "Section Break",
- "label": "Currency and Price List",
- "options": "icon-tag",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "currency",
- "fieldtype": "Link",
- "label": "Currency",
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "description": "Rate at which Customer Currency is converted to customer's base currency",
- "doctype": "DocField",
- "fieldname": "conversion_rate",
- "fieldtype": "Float",
- "label": "Exchange Rate",
- "oldfieldname": "conversion_rate",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "selling_price_list",
- "fieldtype": "Link",
- "label": "Price List",
- "oldfieldname": "price_list_name",
- "oldfieldtype": "Select",
- "options": "Price List",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_currency",
- "fieldtype": "Link",
- "label": "Price List Currency",
- "options": "Currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "description": "Rate at which Price list currency is converted to customer's base currency",
- "doctype": "DocField",
- "fieldname": "plc_conversion_rate",
- "fieldtype": "Float",
- "label": "Price List Exchange Rate",
- "no_copy": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "items",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "update_stock",
- "fieldtype": "Check",
- "label": "Update Stock",
- "oldfieldname": "update_stock",
- "oldfieldtype": "Check",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "entries",
- "fieldtype": "Table",
- "label": "Sales Invoice Items",
- "oldfieldname": "entries",
- "oldfieldtype": "Table",
- "options": "Sales Invoice Item",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "packing_list",
- "fieldtype": "Section Break",
- "label": "Packing List",
- "options": "icon-suitcase",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "packing_details",
- "fieldtype": "Table",
- "label": "Packing Details",
- "options": "Packed Item",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_bom_help",
- "fieldtype": "HTML",
- "label": "Sales BOM Help",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_30",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total_export",
- "fieldtype": "Currency",
- "label": "Net Total",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_32",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "label": "Net Total (Company Currency)",
- "oldfieldname": "net_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "taxes",
- "fieldtype": "Section Break",
- "label": "Taxes and Charges",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "taxes_and_charges",
- "fieldtype": "Link",
- "label": "Taxes and Charges",
- "oldfieldname": "charge",
- "oldfieldtype": "Link",
- "options": "Sales Taxes and Charges Master",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_38",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "shipping_rule",
- "fieldtype": "Link",
- "label": "Shipping Rule",
- "oldfieldtype": "Button",
- "options": "Shipping Rule",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_40",
- "fieldtype": "Section Break"
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "other_charges",
- "fieldtype": "Table",
- "label": "Sales Taxes and Charges",
- "oldfieldname": "other_charges",
- "oldfieldtype": "Table",
- "options": "Sales Taxes and Charges",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_calculation",
- "fieldtype": "HTML",
- "label": "Taxes and Charges Calculation",
- "oldfieldtype": "HTML",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_43",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_total_export",
- "fieldtype": "Currency",
- "label": "Total Taxes and Charges",
- "options": "currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_45",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_total",
- "fieldtype": "Currency",
- "label": "Total Taxes and Charges (Company Currency)",
- "oldfieldname": "other_charges_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "discount_amount",
- "fieldtype": "Currency",
- "label": "Discount Amount",
- "options": "Company:company:default_currency",
- "print_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "label": "Totals",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total_export",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Grand Total",
- "oldfieldname": "grand_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rounded_total_export",
- "fieldtype": "Currency",
- "label": "Rounded Total",
- "oldfieldname": "rounded_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "in_words_export",
- "fieldtype": "Data",
- "label": "In Words",
- "oldfieldname": "in_words_export",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "gross_profit",
- "fieldtype": "Currency",
- "label": "Gross Profit",
- "oldfieldname": "gross_profit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "gross_profit_percent",
- "fieldtype": "Float",
- "label": "Gross Profit (%)",
- "oldfieldname": "gross_profit_percent",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break5",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 1,
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total",
- "fieldtype": "Currency",
- "in_filter": 1,
- "label": "Grand Total (Company Currency)",
- "oldfieldname": "grand_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "rounded_total",
- "fieldtype": "Currency",
- "label": "Rounded Total (Company Currency)",
- "oldfieldname": "rounded_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "description": "In Words will be visible once you save the Sales Invoice.",
- "doctype": "DocField",
- "fieldname": "in_words",
- "fieldtype": "Data",
- "label": "In Words (Company Currency)",
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_advance",
- "fieldtype": "Currency",
- "label": "Total Advance",
- "oldfieldname": "total_advance",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "outstanding_amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Outstanding Amount",
- "no_copy": 1,
- "oldfieldname": "outstanding_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "advances",
- "fieldtype": "Section Break",
- "label": "Advances",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "get_advances_received",
- "fieldtype": "Button",
- "label": "Get Advances Received",
- "oldfieldtype": "Button",
- "options": "get_advances",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "advance_adjustment_details",
- "fieldtype": "Table",
- "label": "Sales Invoice Advance",
- "oldfieldname": "advance_adjustment_details",
- "oldfieldtype": "Table",
- "options": "Sales Invoice Advance",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "is_pos",
- "doctype": "DocField",
- "fieldname": "payments_section",
- "fieldtype": "Section Break",
- "label": "Payments",
- "options": "icon-money",
- "read_only": 0
- },
- {
- "depends_on": "is_pos",
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "depends_on": "is_pos",
- "doctype": "DocField",
- "fieldname": "paid_amount",
- "fieldtype": "Currency",
- "label": "Paid Amount",
- "oldfieldname": "paid_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "is_pos",
- "doctype": "DocField",
- "fieldname": "cash_bank_account",
- "fieldtype": "Link",
- "label": "Cash/Bank Account",
- "oldfieldname": "cash_bank_account",
- "oldfieldtype": "Link",
- "options": "Account",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "is_pos",
- "doctype": "DocField",
- "fieldname": "column_break4",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "depends_on": "is_pos",
- "doctype": "DocField",
- "fieldname": "write_off_outstanding_amount_automatically",
- "fieldtype": "Check",
- "label": "Write Off Outstanding Amount",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "is_pos",
- "doctype": "DocField",
- "fieldname": "write_off_amount",
- "fieldtype": "Currency",
- "label": "Write Off Amount",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "is_pos",
- "doctype": "DocField",
- "fieldname": "write_off_account",
- "fieldtype": "Link",
- "label": "Write Off Account",
- "options": "Account",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "is_pos",
- "doctype": "DocField",
- "fieldname": "write_off_cost_center",
- "fieldtype": "Link",
- "label": "Write Off Cost Center",
- "options": "Cost Center",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "icon-legal",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "tc_name",
- "fieldtype": "Link",
- "label": "Terms",
- "oldfieldname": "tc_name",
- "oldfieldtype": "Link",
- "options": "Terms and Conditions",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "terms",
- "fieldtype": "Text Editor",
- "label": "Terms and Conditions Details",
- "oldfieldname": "terms",
- "oldfieldtype": "Text Editor",
- "read_only": 0
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "hidden": 0,
- "label": "Contact Info",
- "options": "icon-bullhorn",
- "read_only": 0
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Territory",
- "options": "Territory",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Customer Group",
- "options": "Customer Group",
- "print_hide": 1,
- "read_only": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break23",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "label": "Customer Address",
- "options": "Address",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "label": "Contact Person",
- "options": "Contact",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "description": "Customer (Receivable) Account",
- "doctype": "DocField",
- "fieldname": "debit_to",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Debit To",
- "oldfieldname": "debit_to",
- "oldfieldtype": "Link",
- "options": "Account",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "project_name",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Project Name",
- "oldfieldname": "project_name",
- "oldfieldtype": "Link",
- "options": "Project",
- "read_only": 0,
- "search_index": 1
- },
- {
- "depends_on": "eval:doc.source == 'Campaign'",
- "doctype": "DocField",
- "fieldname": "campaign",
- "fieldtype": "Link",
- "label": "Campaign",
- "oldfieldname": "campaign",
- "oldfieldtype": "Link",
- "options": "Campaign",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "source",
- "fieldtype": "Select",
- "label": "Source",
- "oldfieldname": "source",
- "oldfieldtype": "Select",
- "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "default": "No",
- "description": "Considered as an Opening Balance",
- "doctype": "DocField",
- "fieldname": "is_opening",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Is Opening Entry",
- "oldfieldname": "is_opening",
- "oldfieldtype": "Select",
- "options": "No\nYes",
- "print_hide": 1,
- "read_only": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "c_form_applicable",
- "fieldtype": "Select",
- "label": "C-Form Applicable",
- "no_copy": 1,
- "options": "No\nYes",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "c_form_no",
- "fieldtype": "Link",
- "label": "C-Form No",
- "no_copy": 1,
- "options": "C-Form",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break8",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "letter_head",
- "fieldtype": "Select",
- "label": "Letter Head",
- "oldfieldname": "letter_head",
- "oldfieldtype": "Select",
- "options": "link:Letter Head",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "label": "Print Heading",
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "posting_time",
- "fieldtype": "Time",
- "label": "Posting Time",
- "no_copy": 1,
- "oldfieldname": "posting_time",
- "oldfieldtype": "Time",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "description": "Actual Invoice Date",
- "doctype": "DocField",
- "fieldname": "aging_date",
- "fieldtype": "Date",
- "label": "Aging Date",
- "oldfieldname": "aging_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "no_copy": 0,
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "remarks",
- "fieldtype": "Small Text",
- "label": "Remarks",
- "no_copy": 1,
- "oldfieldname": "remarks",
- "oldfieldtype": "Text",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_team_section_break",
- "fieldtype": "Section Break",
- "label": "Sales Team",
- "oldfieldtype": "Section Break",
- "options": "icon-group",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break9",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 1,
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_partner",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Sales Partner",
- "oldfieldname": "sales_partner",
- "oldfieldtype": "Link",
- "options": "Sales Partner",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break10",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 1,
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "commission_rate",
- "fieldtype": "Float",
- "label": "Commission Rate (%)",
- "oldfieldname": "commission_rate",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "total_commission",
- "fieldtype": "Currency",
- "label": "Total Commission",
- "oldfieldname": "total_commission",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break2",
- "fieldtype": "Section Break",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_team",
- "fieldtype": "Table",
- "label": "Sales Team1",
- "oldfieldname": "sales_team",
- "oldfieldtype": "Table",
- "options": "Sales Team",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.docstatus<2",
- "doctype": "DocField",
- "fieldname": "recurring_invoice",
- "fieldtype": "Section Break",
- "label": "Recurring Invoice",
- "options": "icon-time",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break11",
- "fieldtype": "Column Break",
- "print_hide": 1,
- "read_only": 0,
- "width": "50%"
- },
- {
- "allow_on_submit": 1,
- "depends_on": "eval:doc.docstatus<2",
- "description": "Check if recurring invoice, uncheck to stop recurring or put proper End Date",
- "doctype": "DocField",
- "fieldname": "convert_into_recurring_invoice",
- "fieldtype": "Check",
- "label": "Convert into Recurring Invoice",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "depends_on": "eval:doc.convert_into_recurring_invoice==1",
- "description": "Select the period when the invoice will be generated automatically",
- "doctype": "DocField",
- "fieldname": "recurring_type",
- "fieldtype": "Select",
- "label": "Recurring Type",
- "no_copy": 1,
- "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "depends_on": "eval:doc.convert_into_recurring_invoice==1",
- "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc ",
- "doctype": "DocField",
- "fieldname": "repeat_on_day_of_month",
- "fieldtype": "Int",
- "label": "Repeat on Day of Month",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "depends_on": "eval:doc.convert_into_recurring_invoice==1",
- "description": "Start date of current invoice's period",
- "doctype": "DocField",
- "fieldname": "invoice_period_from_date",
- "fieldtype": "Date",
- "label": "Invoice Period From Date",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "depends_on": "eval:doc.convert_into_recurring_invoice==1",
- "description": "End date of current invoice's period",
- "doctype": "DocField",
- "fieldname": "invoice_period_to_date",
- "fieldtype": "Date",
- "label": "Invoice Period To Date",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break12",
- "fieldtype": "Column Break",
- "no_copy": 0,
- "print_hide": 1,
- "read_only": 0,
- "width": "50%"
- },
- {
- "allow_on_submit": 1,
- "depends_on": "eval:doc.convert_into_recurring_invoice==1",
- "description": "Enter email id separated by commas, invoice will be mailed automatically on particular date",
- "doctype": "DocField",
- "fieldname": "notification_email_address",
- "fieldtype": "Small Text",
- "label": "Notification Email Address",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.convert_into_recurring_invoice==1",
- "description": "The unique id for tracking all recurring invoices.\u00a0It is generated on submit.",
- "doctype": "DocField",
- "fieldname": "recurring_id",
- "fieldtype": "Data",
- "label": "Recurring Id",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 1
- },
- {
- "depends_on": "eval:doc.convert_into_recurring_invoice==1",
- "description": "The date on which next invoice will be generated. It is generated on submit.\n",
- "doctype": "DocField",
- "fieldname": "next_date",
- "fieldtype": "Date",
- "label": "Next Date",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 1
- },
- {
- "allow_on_submit": 1,
- "depends_on": "eval:doc.convert_into_recurring_invoice==1",
- "description": "The date on which recurring invoice will be stop",
- "doctype": "DocField",
- "fieldname": "end_date",
- "fieldtype": "Date",
- "label": "End Date",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "against_income_account",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Against Income Account",
- "no_copy": 1,
- "oldfieldname": "against_income_account",
- "oldfieldtype": "Small Text",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Accounts Manager",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Accounts User",
- "submit": 1,
- "write": 1
- },
- {
- "cancel": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Customer"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-05-24 19:29:05.000000",
+ "default_print_format": "Standard",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "fieldname": "customer_section",
+ "fieldtype": "Section Break",
+ "label": "Customer",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "INV\nINV/10-11/",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Customer",
+ "no_copy": 0,
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Name",
+ "oldfieldname": "customer_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Address",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_mobile",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Mobile No",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_email",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Contact Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "is_pos",
+ "fieldtype": "Check",
+ "label": "Is POS",
+ "oldfieldname": "is_pos",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Link",
+ "options": "Sales Invoice",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "default": "Today",
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Posting Date",
+ "no_copy": 1,
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "due_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Payment Due Date",
+ "no_copy": 1,
+ "oldfieldname": "due_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "mode_of_payment",
+ "fieldtype": "Select",
+ "label": "Mode of Payment",
+ "no_copy": 0,
+ "oldfieldname": "mode_of_payment",
+ "oldfieldtype": "Select",
+ "options": "link:Mode of Payment",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "currency_section",
+ "fieldtype": "Section Break",
+ "label": "Currency and Price List",
+ "options": "icon-tag",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "label": "Currency",
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Rate at which Customer Currency is converted to customer's base currency",
+ "fieldname": "conversion_rate",
+ "fieldtype": "Float",
+ "label": "Exchange Rate",
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "selling_price_list",
+ "fieldtype": "Link",
+ "label": "Price List",
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Select",
+ "options": "Price List",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "price_list_currency",
+ "fieldtype": "Link",
+ "label": "Price List Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "description": "Rate at which Price list currency is converted to customer's base currency",
+ "fieldname": "plc_conversion_rate",
+ "fieldtype": "Float",
+ "label": "Price List Exchange Rate",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "items",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "update_stock",
+ "fieldtype": "Check",
+ "label": "Update Stock",
+ "oldfieldname": "update_stock",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "entries",
+ "fieldtype": "Table",
+ "label": "Sales Invoice Items",
+ "oldfieldname": "entries",
+ "oldfieldtype": "Table",
+ "options": "Sales Invoice Item",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "packing_list",
+ "fieldtype": "Section Break",
+ "label": "Packing List",
+ "options": "icon-suitcase",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "packing_details",
+ "fieldtype": "Table",
+ "label": "Packing Details",
+ "options": "Packed Item",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "sales_bom_help",
+ "fieldtype": "HTML",
+ "label": "Sales BOM Help",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_30",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total_export",
+ "fieldtype": "Currency",
+ "label": "Net Total",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_32",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "label": "Net Total (Company Currency)",
+ "oldfieldname": "net_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "taxes",
+ "fieldtype": "Section Break",
+ "label": "Taxes and Charges",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "label": "Taxes and Charges",
+ "oldfieldname": "charge",
+ "oldfieldtype": "Link",
+ "options": "Sales Taxes and Charges Master",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break_38",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "shipping_rule",
+ "fieldtype": "Link",
+ "label": "Shipping Rule",
+ "oldfieldtype": "Button",
+ "options": "Shipping Rule",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_40",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "other_charges",
+ "fieldtype": "Table",
+ "label": "Sales Taxes and Charges",
+ "oldfieldname": "other_charges",
+ "oldfieldtype": "Table",
+ "options": "Sales Taxes and Charges",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "other_charges_calculation",
+ "fieldtype": "HTML",
+ "label": "Taxes and Charges Calculation",
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_43",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_total_export",
+ "fieldtype": "Currency",
+ "label": "Total Taxes and Charges",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_45",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_total",
+ "fieldtype": "Currency",
+ "label": "Total Taxes and Charges (Company Currency)",
+ "oldfieldname": "other_charges_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "discount_amount",
+ "fieldtype": "Currency",
+ "label": "Discount Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 0
+ },
+ {
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "label": "Totals",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "grand_total_export",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Grand Total",
+ "oldfieldname": "grand_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "rounded_total_export",
+ "fieldtype": "Currency",
+ "label": "Rounded Total",
+ "oldfieldname": "rounded_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "in_words_export",
+ "fieldtype": "Data",
+ "label": "In Words",
+ "oldfieldname": "in_words_export",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "gross_profit",
+ "fieldtype": "Currency",
+ "label": "Gross Profit",
+ "oldfieldname": "gross_profit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "gross_profit_percent",
+ "fieldtype": "Float",
+ "label": "Gross Profit (%)",
+ "oldfieldname": "gross_profit_percent",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break5",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "in_filter": 1,
+ "label": "Grand Total (Company Currency)",
+ "oldfieldname": "grand_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "rounded_total",
+ "fieldtype": "Currency",
+ "label": "Rounded Total (Company Currency)",
+ "oldfieldname": "rounded_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "description": "In Words will be visible once you save the Sales Invoice.",
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "label": "In Words (Company Currency)",
+ "oldfieldname": "in_words",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "total_advance",
+ "fieldtype": "Currency",
+ "label": "Total Advance",
+ "oldfieldname": "total_advance",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "outstanding_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Outstanding Amount",
+ "no_copy": 1,
+ "oldfieldname": "outstanding_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "advances",
+ "fieldtype": "Section Break",
+ "label": "Advances",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "get_advances_received",
+ "fieldtype": "Button",
+ "label": "Get Advances Received",
+ "oldfieldtype": "Button",
+ "options": "get_advances",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "advance_adjustment_details",
+ "fieldtype": "Table",
+ "label": "Sales Invoice Advance",
+ "oldfieldname": "advance_adjustment_details",
+ "oldfieldtype": "Table",
+ "options": "Sales Invoice Advance",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "is_pos",
+ "fieldname": "payments_section",
+ "fieldtype": "Section Break",
+ "label": "Payments",
+ "options": "icon-money",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "is_pos",
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "depends_on": "is_pos",
+ "fieldname": "paid_amount",
+ "fieldtype": "Currency",
+ "label": "Paid Amount",
+ "oldfieldname": "paid_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "is_pos",
+ "fieldname": "cash_bank_account",
+ "fieldtype": "Link",
+ "label": "Cash/Bank Account",
+ "oldfieldname": "cash_bank_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "is_pos",
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "depends_on": "is_pos",
+ "fieldname": "write_off_outstanding_amount_automatically",
+ "fieldtype": "Check",
+ "label": "Write Off Outstanding Amount",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "is_pos",
+ "fieldname": "write_off_amount",
+ "fieldtype": "Currency",
+ "label": "Write Off Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "is_pos",
+ "fieldname": "write_off_account",
+ "fieldtype": "Link",
+ "label": "Write Off Account",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "is_pos",
+ "fieldname": "write_off_cost_center",
+ "fieldtype": "Link",
+ "label": "Write Off Cost Center",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "label": "Terms and Conditions",
+ "oldfieldtype": "Section Break",
+ "options": "icon-legal",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "label": "Terms",
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "label": "Terms and Conditions Details",
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_section",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "label": "Contact Info",
+ "options": "icon-bullhorn",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Customer Group",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "col_break23",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "label": "Customer Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "label": "Contact Person",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "description": "Customer (Receivable) Account",
+ "fieldname": "debit_to",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Debit To",
+ "oldfieldname": "debit_to",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Project Name",
+ "oldfieldname": "project_name",
+ "oldfieldtype": "Link",
+ "options": "Project",
+ "permlevel": 0,
+ "read_only": 0,
+ "search_index": 1
+ },
+ {
+ "depends_on": "eval:doc.source == 'Campaign'",
+ "fieldname": "campaign",
+ "fieldtype": "Link",
+ "label": "Campaign",
+ "oldfieldname": "campaign",
+ "oldfieldtype": "Link",
+ "options": "Campaign",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "source",
+ "fieldtype": "Select",
+ "label": "Source",
+ "oldfieldname": "source",
+ "oldfieldtype": "Select",
+ "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "default": "No",
+ "description": "Considered as an Opening Balance",
+ "fieldname": "is_opening",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Is Opening Entry",
+ "oldfieldname": "is_opening",
+ "oldfieldtype": "Select",
+ "options": "No\nYes",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "c_form_applicable",
+ "fieldtype": "Select",
+ "label": "C-Form Applicable",
+ "no_copy": 1,
+ "options": "No\nYes",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "c_form_no",
+ "fieldtype": "Link",
+ "label": "C-Form No",
+ "no_copy": 1,
+ "options": "C-Form",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break8",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "letter_head",
+ "fieldtype": "Select",
+ "label": "Letter Head",
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "link:Letter Head",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "label": "Print Heading",
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "posting_time",
+ "fieldtype": "Time",
+ "label": "Posting Time",
+ "no_copy": 1,
+ "oldfieldname": "posting_time",
+ "oldfieldtype": "Time",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "description": "Actual Invoice Date",
+ "fieldname": "aging_date",
+ "fieldtype": "Date",
+ "label": "Aging Date",
+ "oldfieldname": "aging_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "no_copy": 0,
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "remarks",
+ "fieldtype": "Small Text",
+ "label": "Remarks",
+ "no_copy": 1,
+ "oldfieldname": "remarks",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "sales_team_section_break",
+ "fieldtype": "Section Break",
+ "label": "Sales Team",
+ "oldfieldtype": "Section Break",
+ "options": "icon-group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break9",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "sales_partner",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Sales Partner",
+ "oldfieldname": "sales_partner",
+ "oldfieldtype": "Link",
+ "options": "Sales Partner",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break10",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "commission_rate",
+ "fieldtype": "Float",
+ "label": "Commission Rate (%)",
+ "oldfieldname": "commission_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "total_commission",
+ "fieldtype": "Currency",
+ "label": "Total Commission",
+ "oldfieldname": "total_commission",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break2",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "sales_team",
+ "fieldtype": "Table",
+ "label": "Sales Team1",
+ "oldfieldname": "sales_team",
+ "oldfieldtype": "Table",
+ "options": "Sales Team",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.docstatus<2",
+ "fieldname": "recurring_invoice",
+ "fieldtype": "Section Break",
+ "label": "Recurring Invoice",
+ "options": "icon-time",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break11",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.docstatus<2",
+ "description": "Check if recurring invoice, uncheck to stop recurring or put proper End Date",
+ "fieldname": "convert_into_recurring_invoice",
+ "fieldtype": "Check",
+ "label": "Convert into Recurring Invoice",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.convert_into_recurring_invoice==1",
+ "description": "Select the period when the invoice will be generated automatically",
+ "fieldname": "recurring_type",
+ "fieldtype": "Select",
+ "label": "Recurring Type",
+ "no_copy": 1,
+ "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.convert_into_recurring_invoice==1",
+ "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc ",
+ "fieldname": "repeat_on_day_of_month",
+ "fieldtype": "Int",
+ "label": "Repeat on Day of Month",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.convert_into_recurring_invoice==1",
+ "description": "Start date of current invoice's period",
+ "fieldname": "invoice_period_from_date",
+ "fieldtype": "Date",
+ "label": "Invoice Period From Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.convert_into_recurring_invoice==1",
+ "description": "End date of current invoice's period",
+ "fieldname": "invoice_period_to_date",
+ "fieldtype": "Date",
+ "label": "Invoice Period To Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break12",
+ "fieldtype": "Column Break",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.convert_into_recurring_invoice==1",
+ "description": "Enter email id separated by commas, invoice will be mailed automatically on particular date",
+ "fieldname": "notification_email_address",
+ "fieldtype": "Small Text",
+ "label": "Notification Email Address",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.convert_into_recurring_invoice==1",
+ "description": "The unique id for tracking all recurring invoices.\u00a0It is generated on submit.",
+ "fieldname": "recurring_id",
+ "fieldtype": "Data",
+ "label": "Recurring Id",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:doc.convert_into_recurring_invoice==1",
+ "description": "The date on which next invoice will be generated. It is generated on submit.\n",
+ "fieldname": "next_date",
+ "fieldtype": "Date",
+ "label": "Next Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.convert_into_recurring_invoice==1",
+ "description": "The date on which recurring invoice will be stop",
+ "fieldname": "end_date",
+ "fieldtype": "Date",
+ "label": "End Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "against_income_account",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Against Income Account",
+ "no_copy": 1,
+ "oldfieldname": "against_income_account",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ }
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-28 18:43:10.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Invoice",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Customer"
+ }
+ ],
+ "read_only_onload": 1,
+ "search_fields": "posting_date, due_date, debit_to, fiscal_year, grand_total, outstanding_amount"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
index 81d5572..1c67e71 100644
--- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py
@@ -54,11 +54,11 @@
}
# check if children are saved
- self.assertEquals(len(si.doclist.get({"parentfield": "entries"})),
+ self.assertEquals(len(si.get("entries")),
len(expected_values)-1)
# check if item values are calculated
- for d in si.doclist.get({"parentfield": "entries"}):
+ for d in si.get("entries"):
for i, k in enumerate(expected_values["keys"]):
self.assertEquals(d.fields.get(k), expected_values[d.item_code][i])
@@ -79,7 +79,7 @@
"_Test Account Discount - _TC": [-180.78, 1627.05]
}
- for d in si.doclist.get({"parentfield": "other_charges"}):
+ for d in si.get("other_charges"):
for i, k in enumerate(expected_values["keys"]):
self.assertEquals(d.fields.get(k), expected_values[d.account_head][i])
@@ -104,11 +104,11 @@
}
# check if children are saved
- self.assertEquals(len(si.doclist.get({"parentfield": "entries"})),
+ self.assertEquals(len(si.get("entries")),
len(expected_values)-1)
# check if item values are calculated
- for d in si.doclist.get({"parentfield": "entries"}):
+ for d in si.get("entries"):
for i, k in enumerate(expected_values["keys"]):
self.assertEquals(d.fields.get(k), expected_values[d.item_code][i])
@@ -129,7 +129,7 @@
"_Test Account Discount - _TC": [-180.78, 1627.05]
}
- for d in si.doclist.get({"parentfield": "other_charges"}):
+ for d in si.get("other_charges"):
for i, k in enumerate(expected_values["keys"]):
self.assertEquals(d.fields.get(k), expected_values[d.account_head][i])
@@ -139,16 +139,14 @@
def test_sales_invoice_discount_amount(self):
si = frappe.bean(copy=test_records[3])
si.doc.discount_amount = 104.95
- si.doclist.append({
+ si.append("other_charges", {
"doctype": "Sales Taxes and Charges",
- "parentfield": "other_charges",
"charge_type": "On Previous Row Amount",
"account_head": "_Test Account Service Tax - _TC",
"cost_center": "_Test Cost Center - _TC",
"description": "Service Tax",
"rate": 10,
"row_id": 8,
- "idx": 9
})
si.insert()
@@ -160,11 +158,11 @@
}
# check if children are saved
- self.assertEquals(len(si.doclist.get({"parentfield": "entries"})),
+ self.assertEquals(len(si.get("entries")),
len(expected_values)-1)
# check if item values are calculated
- for d in si.doclist.get({"parentfield": "entries"}):
+ for d in si.get("entries"):
for i, k in enumerate(expected_values["keys"]):
self.assertEquals(d.fields.get(k), expected_values[d.item_code][i])
@@ -186,7 +184,7 @@
"_Test Account Service Tax - _TC": [-18.03, -16.88, 1500]
}
- for d in si.doclist.get({"parentfield": "other_charges"}):
+ for d in si.get("other_charges"):
for i, k in enumerate(expected_values["keys"]):
self.assertEquals(d.fields.get(k), expected_values[d.account_head][i])
@@ -196,16 +194,14 @@
def test_discount_amount_gl_entry(self):
si = frappe.bean(copy=test_records[3])
si.doc.discount_amount = 104.95
- si.doclist.append({
+ si.append("other_charges", {
"doctype": "Sales Taxes and Charges",
- "parentfield": "other_charges",
"charge_type": "On Previous Row Amount",
"account_head": "_Test Account Service Tax - _TC",
"cost_center": "_Test Cost Center - _TC",
"description": "Service Tax",
"rate": 10,
- "row_id": 8,
- "idx": 9
+ "row_id": 8
})
si.insert()
si.submit()
@@ -245,7 +241,7 @@
def test_inclusive_rate_validations(self):
si = frappe.bean(copy=test_records[2])
- for i, tax in enumerate(si.doclist.get({"parentfield": "other_charges"})):
+ for i, tax in enumerate(si.get("other_charges")):
tax.idx = i+1
si.doclist[1].price_list_rate = 62.5
@@ -273,11 +269,11 @@
}
# check if children are saved
- self.assertEquals(len(si.doclist.get({"parentfield": "entries"})),
+ self.assertEquals(len(si.get("entries")),
len(expected_values)-1)
# check if item values are calculated
- for d in si.doclist.get({"parentfield": "entries"}):
+ for d in si.get("entries"):
for i, k in enumerate(expected_values["keys"]):
self.assertEquals(d.fields.get(k), expected_values[d.item_code][i])
@@ -298,7 +294,7 @@
"_Test Account Discount - _TC": [-180.33, 1622.98]
}
- for d in si.doclist.get({"parentfield": "other_charges"}):
+ for d in si.get("other_charges"):
for i, k in enumerate(expected_values["keys"]):
self.assertEquals(d.fields.get(k), expected_values[d.account_head][i])
@@ -326,11 +322,11 @@
}
# check if children are saved
- self.assertEquals(len(si.doclist.get({"parentfield": "entries"})),
+ self.assertEquals(len(si.get("entries")),
len(expected_values)-1)
# check if item values are calculated
- for d in si.doclist.get({"parentfield": "entries"}):
+ for d in si.get("entries"):
for i, k in enumerate(expected_values["keys"]):
self.assertEquals(d.fields.get(k), expected_values[d.item_code][i])
@@ -351,7 +347,7 @@
"_Test Account Discount - _TC": [-7245.01, 65205.16]
}
- for d in si.doclist.get({"parentfield": "other_charges"}):
+ for d in si.get("other_charges"):
for i, k in enumerate(expected_values["keys"]):
self.assertEquals(d.fields.get(k), expected_values[d.account_head][i])
@@ -369,7 +365,7 @@
from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \
import test_records as jv_test_records
- jv = frappe.bean(frappe.copy_doclist(jv_test_records[0]))
+ jv = frappe.bean(frappe.copy_doc(jv_test_records[0]))
jv.doclist[1].against_invoice = w.doc.name
jv.insert()
jv.submit()
@@ -385,7 +381,7 @@
tlb = frappe.bean("Time Log Batch", "_T-Time Log Batch-00001")
tlb.submit()
- si = frappe.bean(frappe.copy_doclist(test_records[0]))
+ si = frappe.bean(frappe.copy_doc(test_records[0]))
si.doclist[1].time_log_batch = "_T-Time Log Batch-00001"
si.insert()
si.submit()
@@ -444,7 +440,7 @@
self._insert_purchase_receipt()
self._insert_pos_settings()
- pos = frappe.copy_doclist(test_records[1])
+ pos = frappe.copy_doc(test_records[1])
pos[0]["is_pos"] = 1
pos[0]["update_stock"] = 1
pos[0]["posting_time"] = "12:05"
@@ -510,7 +506,7 @@
pr.insert()
pr.submit()
- si_doclist = frappe.copy_doclist(test_records[1])
+ si_doclist = frappe.copy_doc(test_records[1])
si_doclist[0]["update_stock"] = 1
si_doclist[0]["posting_time"] = "12:05"
si_doclist[1]["warehouse"] = "_Test Warehouse No Account - _TC"
@@ -555,7 +551,7 @@
self.clear_stock_account_balance()
set_perpetual_inventory()
- si_copy = frappe.copy_doclist(test_records[1])
+ si_copy = frappe.copy_doc(test_records[1])
si_copy[1]["item_code"] = None
si = frappe.bean(si_copy)
si.insert()
@@ -582,7 +578,7 @@
def test_sales_invoice_gl_entry_with_aii_non_stock_item(self):
self.clear_stock_account_balance()
set_perpetual_inventory()
- si_copy = frappe.copy_doclist(test_records[1])
+ si_copy = frappe.copy_doc(test_records[1])
si_copy[1]["item_code"] = "_Test Non Stock Item"
si = frappe.bean(si_copy)
si.insert()
@@ -640,9 +636,8 @@
jv.submit()
si = frappe.bean(copy=test_records[0])
- si.doclist.append({
+ si.append("advance_adjustment_details", {
"doctype": "Sales Invoice Advance",
- "parentfield": "advance_adjustment_details",
"journal_voucher": jv.doc.name,
"jv_detail_no": jv.doclist[1].name,
"advance_amount": 400,
diff --git a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py
index 26c87f1..683ca8a 100644
--- a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py
+++ b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SalesInvoiceAdvance(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
index f0f361d..15bac1d 100644
--- a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
+++ b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt
@@ -1,101 +1,88 @@
-[
- {
- "creation": "2013-02-22 01:27:41",
- "docstatus": 0,
- "modified": "2014-02-03 12:38:53",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Sales Invoice Advance",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Sales Invoice Advance"
- },
- {
- "doctype": "DocField",
- "fieldname": "journal_voucher",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Journal Voucher",
- "no_copy": 1,
- "oldfieldname": "journal_voucher",
- "oldfieldtype": "Link",
- "options": "Journal Voucher",
- "print_width": "250px",
- "read_only": 1,
- "width": "250px"
- },
- {
- "doctype": "DocField",
- "fieldname": "remarks",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Remarks",
- "no_copy": 1,
- "oldfieldname": "remarks",
- "oldfieldtype": "Small Text",
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "jv_detail_no",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Journal Voucher Detail No",
- "no_copy": 1,
- "oldfieldname": "jv_detail_no",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "120px",
- "read_only": 1,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "advance_amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Advance amount",
- "no_copy": 1,
- "oldfieldname": "advance_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_width": "120px",
- "read_only": 1,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "allocated_amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Allocated amount",
- "no_copy": 1,
- "oldfieldname": "allocated_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_width": "120px",
- "width": "120px"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:41.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "journal_voucher",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Journal Voucher",
+ "no_copy": 1,
+ "oldfieldname": "journal_voucher",
+ "oldfieldtype": "Link",
+ "options": "Journal Voucher",
+ "permlevel": 0,
+ "print_width": "250px",
+ "read_only": 1,
+ "width": "250px"
+ },
+ {
+ "fieldname": "remarks",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Remarks",
+ "no_copy": 1,
+ "oldfieldname": "remarks",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "jv_detail_no",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Journal Voucher Detail No",
+ "no_copy": 1,
+ "oldfieldname": "jv_detail_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "120px",
+ "read_only": 1,
+ "width": "120px"
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "advance_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Advance amount",
+ "no_copy": 1,
+ "oldfieldname": "advance_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_width": "120px",
+ "read_only": 1,
+ "width": "120px"
+ },
+ {
+ "fieldname": "allocated_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Allocated amount",
+ "no_copy": 1,
+ "oldfieldname": "allocated_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_width": "120px",
+ "width": "120px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-03 12:38:53.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Invoice Advance",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py
index 26c87f1..3fa0f2e 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SalesInvoiceItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
index 224f7b7..527213b 100644
--- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
+++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt
@@ -1,477 +1,464 @@
-[
- {
- "creation": "2013-06-04 11:02:19",
- "docstatus": 0,
- "modified": "2014-02-28 11:04:19",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "INVD.######",
- "doctype": "DocType",
- "istable": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Sales Invoice Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Sales Invoice Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "barcode",
- "fieldtype": "Data",
- "in_list_view": 0,
- "label": "Barcode",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "print_hide": 0,
- "read_only": 0,
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_item_code",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Customer's Item Code",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "print_width": "200px",
- "read_only": 0,
- "reqd": 1,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "quantity_and_rate",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Quantity and Rate"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Quantity",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate",
- "oldfieldname": "ref_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "discount_percentage",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Discount (%)",
- "oldfieldname": "adj_rate",
- "oldfieldtype": "Float",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "UOM",
- "options": "UOM",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "base_price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate (Company Currency)",
- "oldfieldname": "base_ref_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break1",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Rate",
- "oldfieldname": "export_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "export_amount",
- "oldfieldtype": "Currency",
- "options": "currency",
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_rate",
- "fieldtype": "Currency",
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Rate (Company Currency)",
- "oldfieldname": "basic_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "base_amount",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Amount (Company Currency)",
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_price",
- "fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "accounting",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Accounting"
- },
- {
- "doctype": "DocField",
- "fieldname": "income_account",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Income Account",
- "oldfieldname": "income_account",
- "oldfieldtype": "Link",
- "options": "Account",
- "print_hide": 1,
- "print_width": "120px",
- "read_only": 0,
- "reqd": 1,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "expense_account",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Expense Account",
- "options": "Account",
- "print_hide": 1,
- "read_only": 0,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break4",
- "fieldtype": "Column Break"
- },
- {
- "default": ":Company",
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Cost Center",
- "oldfieldname": "cost_center",
- "oldfieldtype": "Link",
- "options": "Cost Center",
- "print_hide": 1,
- "print_width": "120px",
- "read_only": 0,
- "reqd": 0,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse_and_reference",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Warehouse and Reference"
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "hidden": 0,
- "in_list_view": 0,
- "label": "Warehouse",
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no",
- "fieldtype": "Small Text",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Serial No",
- "oldfieldname": "serial_no",
- "oldfieldtype": "Small Text",
- "print_hide": 0,
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "batch_no",
- "fieldtype": "Link",
- "label": "Batch No",
- "options": "Batch",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 1,
- "in_filter": 1,
- "label": "Item Group",
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "label": "Brand Name",
- "oldfieldname": "brand",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "item_tax_rate",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Item Tax Rate",
- "oldfieldname": "item_tax_rate",
- "oldfieldtype": "Small Text",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break5",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "actual_qty",
- "fieldtype": "Float",
- "label": "Available Qty at Warehouse",
- "oldfieldname": "actual_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "time_log_batch",
- "fieldtype": "Link",
- "label": "Time Log Batch",
- "options": "Time Log Batch",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_order",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Sales Order",
- "no_copy": 1,
- "oldfieldname": "sales_order",
- "oldfieldtype": "Link",
- "options": "Sales Order",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "so_detail",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "label": "Sales Order Item",
- "no_copy": 1,
- "oldfieldname": "so_detail",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "delivery_note",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Delivery Note",
- "no_copy": 1,
- "oldfieldname": "delivery_note",
- "oldfieldtype": "Link",
- "options": "Delivery Note",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "dn_detail",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "label": "Delivery Note Item",
- "no_copy": 1,
- "oldfieldname": "dn_detail",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "delivered_qty",
- "fieldtype": "Float",
- "label": "Delivered Qty",
- "oldfieldname": "delivered_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "page_break",
- "fieldtype": "Check",
- "label": "Page Break",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- }
-]
\ No newline at end of file
+{
+ "autoname": "INVD.######",
+ "creation": "2013-06-04 11:02:19.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "barcode",
+ "fieldtype": "Data",
+ "in_list_view": 0,
+ "label": "Barcode",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "customer_item_code",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Customer's Item Code",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_width": "200px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Quantity and Rate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Quantity",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate",
+ "oldfieldname": "ref_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "discount_percentage",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Discount (%)",
+ "oldfieldname": "adj_rate",
+ "oldfieldtype": "Float",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "base_price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate (Company Currency)",
+ "oldfieldname": "base_ref_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "section_break1",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Rate",
+ "oldfieldname": "export_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "export_amount",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "base_rate",
+ "fieldtype": "Currency",
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Rate (Company Currency)",
+ "oldfieldname": "basic_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "base_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Amount (Company Currency)",
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "accounting",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Accounting",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "income_account",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Income Account",
+ "oldfieldname": "income_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "120px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "120px"
+ },
+ {
+ "fieldname": "expense_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Expense Account",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "width": "120px"
+ },
+ {
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "default": ":Company",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Cost Center",
+ "oldfieldname": "cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "120px",
+ "read_only": 0,
+ "reqd": 0,
+ "width": "120px"
+ },
+ {
+ "fieldname": "warehouse_and_reference",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Warehouse and Reference",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_list_view": 0,
+ "label": "Warehouse",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "serial_no",
+ "fieldtype": "Small Text",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Serial No",
+ "oldfieldname": "serial_no",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "batch_no",
+ "fieldtype": "Link",
+ "label": "Batch No",
+ "options": "Batch",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Item Group",
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "brand",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Brand Name",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "item_tax_rate",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Item Tax Rate",
+ "oldfieldname": "item_tax_rate",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "col_break5",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "actual_qty",
+ "fieldtype": "Float",
+ "label": "Available Qty at Warehouse",
+ "oldfieldname": "actual_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "time_log_batch",
+ "fieldtype": "Link",
+ "label": "Time Log Batch",
+ "options": "Time Log Batch",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "sales_order",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Sales Order",
+ "no_copy": 1,
+ "oldfieldname": "sales_order",
+ "oldfieldtype": "Link",
+ "options": "Sales Order",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "so_detail",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Sales Order Item",
+ "no_copy": 1,
+ "oldfieldname": "so_detail",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "delivery_note",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Delivery Note",
+ "no_copy": 1,
+ "oldfieldname": "delivery_note",
+ "oldfieldtype": "Link",
+ "options": "Delivery Note",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "dn_detail",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Delivery Note Item",
+ "no_copy": 1,
+ "oldfieldname": "dn_detail",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "delivered_qty",
+ "fieldtype": "Float",
+ "label": "Delivered Qty",
+ "oldfieldname": "delivered_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "label": "Page Break",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-28 11:04:19.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Invoice Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py
index 26c87f1..8f621de 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SalesTaxesAndCharges(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
index 8bb154c..cd02e81 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt
@@ -1,166 +1,153 @@
-[
- {
- "creation": "2013-04-24 11:39:32",
- "docstatus": 0,
- "modified": "2014-01-03 15:04:25",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "INVTD.######",
- "doctype": "DocType",
- "hide_heading": 1,
- "istable": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Sales Taxes and Charges",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Sales Taxes and Charges"
- },
- {
- "doctype": "DocField",
- "fieldname": "charge_type",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Type",
- "oldfieldname": "charge_type",
- "oldfieldtype": "Select",
- "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "row_id",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Enter Row",
- "oldfieldname": "row_id",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "print_width": "300px",
- "reqd": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break_1",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "account_head",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Account Head",
- "oldfieldname": "account_head",
- "oldfieldtype": "Link",
- "options": "Account",
- "reqd": 1,
- "search_index": 1
- },
- {
- "default": ":Company",
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Cost Center",
- "oldfieldname": "cost_center_other_charges",
- "oldfieldtype": "Link",
- "options": "Cost Center"
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Rate",
- "oldfieldname": "rate",
- "oldfieldtype": "Currency",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "tax_amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "tax_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "total",
- "fieldtype": "Currency",
- "label": "Total",
- "oldfieldname": "total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "allow_on_submit": 0,
- "description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount",
- "doctype": "DocField",
- "fieldname": "included_in_print_rate",
- "fieldtype": "Check",
- "label": "Is this Tax included in Basic Rate?",
- "no_copy": 0,
- "print_hide": 1,
- "print_width": "150px",
- "report_hide": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "tax_amount_after_discount_amount",
- "fieldtype": "Currency",
- "hidden": 1,
- "label": "Tax Amount After Discount Amount",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_wise_tax_detail",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Item Wise Tax Detail",
- "oldfieldname": "item_wise_tax_detail",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "parenttype",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "label": "Parenttype",
- "oldfieldname": "parenttype",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "search_index": 1
- }
-]
\ No newline at end of file
+{
+ "autoname": "INVTD.######",
+ "creation": "2013-04-24 11:39:32.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "charge_type",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Type",
+ "oldfieldname": "charge_type",
+ "oldfieldtype": "Select",
+ "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "row_id",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Enter Row",
+ "oldfieldname": "row_id",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "reqd": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "col_break_1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "account_head",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Account Head",
+ "oldfieldname": "account_head",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "default": ":Company",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Cost Center",
+ "oldfieldname": "cost_center_other_charges",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Rate",
+ "oldfieldname": "rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "tax_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "tax_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "total",
+ "fieldtype": "Currency",
+ "label": "Total",
+ "oldfieldname": "total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "allow_on_submit": 0,
+ "description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount",
+ "fieldname": "included_in_print_rate",
+ "fieldtype": "Check",
+ "label": "Is this Tax included in Basic Rate?",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "report_hide": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "tax_amount_after_discount_amount",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "label": "Tax Amount After Discount Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "item_wise_tax_detail",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Item Wise Tax Detail",
+ "oldfieldname": "item_wise_tax_detail",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "parenttype",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Parenttype",
+ "oldfieldname": "parenttype",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "search_index": 1
+ }
+ ],
+ "hide_heading": 1,
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-01-03 15:04:25.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Taxes and Charges",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
index 6f35f4a..f4b425b 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js
@@ -54,7 +54,7 @@
out ='';
if (!doc.print_without_amount) {
- var cl = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');
+ var cl = doc.other_charges || [];
// outer table
var out='<div><table class="noborder" style="width:100%"><tr><td style="width: 60%"></td><td>';
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py
index 047bbd4..0546ce7 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py
@@ -6,7 +6,7 @@
from frappe.utils import cint
from frappe.model.controller import DocListController
-class DocType(DocListController):
+class SalesTaxesAndChargesMaster(DocListController):
def validate(self):
if self.doc.is_default == 1:
frappe.db.sql("""update `tabSales Taxes and Charges Master` set is_default = 0
diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt
index db83cce..81cd189 100644
--- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt
+++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt
@@ -1,126 +1,121 @@
-[
- {
- "creation": "2013-01-10 16:34:09",
- "docstatus": 0,
- "modified": "2014-01-28 12:28:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:title",
- "description": "Standard tax template that can be applied to all Sales Transactions. This template can contain list of tax heads and also other expense / income heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **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.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. 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).\n9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-money",
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Sales Taxes and Charges Master",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Sales Taxes and Charges Master",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Sales Taxes and Charges Master"
- },
- {
- "doctype": "DocField",
- "fieldname": "title",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Title",
- "oldfieldname": "title",
- "oldfieldtype": "Data",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "is_default",
- "fieldtype": "Check",
- "label": "Default"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_5",
- "fieldtype": "Section Break"
- },
- {
- "description": "* Will be calculated in the transaction.",
- "doctype": "DocField",
- "fieldname": "other_charges",
- "fieldtype": "Table",
- "label": "Sales Taxes and Charges Master",
- "oldfieldname": "other_charges",
- "oldfieldtype": "Table",
- "options": "Sales Taxes and Charges"
- },
- {
- "description": "Specify a list of Territories, for which, this Taxes Master is valid",
- "doctype": "DocField",
- "fieldname": "valid_for_territories",
- "fieldtype": "Table",
- "label": "Valid for Territories",
- "options": "Applicable Territory",
- "reqd": 1
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales User",
- "write": 0
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Accounts Manager",
- "write": 1
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales Master Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:title",
+ "creation": "2013-01-10 16:34:09.000000",
+ "description": "Standard tax template that can be applied to all Sales Transactions. This template can contain list of tax heads and also other expense / income heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **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.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. 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).\n9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "title",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Title",
+ "oldfieldname": "title",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "is_default",
+ "fieldtype": "Check",
+ "label": "Default",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "section_break_5",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "description": "* Will be calculated in the transaction.",
+ "fieldname": "other_charges",
+ "fieldtype": "Table",
+ "label": "Sales Taxes and Charges Master",
+ "oldfieldname": "other_charges",
+ "oldfieldtype": "Table",
+ "options": "Sales Taxes and Charges",
+ "permlevel": 0
+ },
+ {
+ "description": "Specify a list of Territories, for which, this Taxes Master is valid",
+ "fieldname": "valid_for_territories",
+ "fieldtype": "Table",
+ "label": "Valid for Territories",
+ "options": "Applicable Territory",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "icon": "icon-money",
+ "idx": 1,
+ "modified": "2014-01-28 12:28:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Taxes and Charges Master",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
index fe5d7f9..e450e70 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py
@@ -14,13 +14,11 @@
class FromGreaterThanToError(frappe.ValidationError): pass
class ManyBlankToValuesError(frappe.ValidationError): pass
-class DocType(DocListController):
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+class ShippingRule(DocListController):
def validate(self):
self.validate_value("calculate_based_on", "in", ["Net Total", "Net Weight"])
- self.shipping_rule_conditions = self.doclist.get({"parentfield": "shipping_rule_conditions"})
+ self.shipping_rule_conditions = self.get("shipping_rule_conditions")
self.validate_from_to_values()
self.sort_shipping_rule_conditions()
self.validate_overlapping_shipping_rule_conditions()
diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt b/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt
index c1e2e90..d46bfdf 100644
--- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt
+++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt
@@ -1,161 +1,154 @@
-[
- {
- "creation": "2013-06-25 11:48:03",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "Prompt",
- "description": "Specify conditions to calculate shipping amount",
- "doctype": "DocType",
- "icon": "icon-truck",
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Shipping Rule",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Shipping Rule",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Shipping Rule"
- },
- {
- "description": "example: Next Day Shipping",
- "doctype": "DocField",
- "fieldname": "label",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Shipping Rule Label",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_2",
- "fieldtype": "Column Break"
- },
- {
- "default": "Net Total",
- "doctype": "DocField",
- "fieldname": "calculate_based_on",
- "fieldtype": "Select",
- "hidden": 1,
- "in_list_view": 1,
- "label": "Calculate Based On",
- "options": "Net Total\nNet Weight",
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "rule_conditions_section",
- "fieldtype": "Section Break",
- "label": "Shipping Rule Conditions"
- },
- {
- "doctype": "DocField",
- "fieldname": "shipping_rule_conditions",
- "fieldtype": "Table",
- "label": "Shipping Rule Conditions",
- "options": "Shipping Rule Condition",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_6",
- "fieldtype": "Section Break"
- },
- {
- "description": "Specify a list of Territories, for which, this Shipping Rule is valid",
- "doctype": "DocField",
- "fieldname": "valid_for_territories",
- "fieldtype": "Table",
- "label": "Valid For Territories",
- "options": "Applicable Territory",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_8",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Company",
- "options": "Company",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_10",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "account",
- "fieldtype": "Link",
- "label": "Shipping Account",
- "options": "Account",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_12",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "label": "Cost Center",
- "options": "Cost Center",
- "reqd": 1
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Accounts User"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales User"
- },
- {
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Accounts Manager",
- "write": 1
- },
- {
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales Master Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "autoname": "Prompt",
+ "creation": "2013-06-25 11:48:03.000000",
+ "description": "Specify conditions to calculate shipping amount",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "example: Next Day Shipping",
+ "fieldname": "label",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Shipping Rule Label",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break_2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "default": "Net Total",
+ "fieldname": "calculate_based_on",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "in_list_view": 1,
+ "label": "Calculate Based On",
+ "options": "Net Total\nNet Weight",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "rule_conditions_section",
+ "fieldtype": "Section Break",
+ "label": "Shipping Rule Conditions",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "shipping_rule_conditions",
+ "fieldtype": "Table",
+ "label": "Shipping Rule Conditions",
+ "options": "Shipping Rule Condition",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "section_break_6",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "description": "Specify a list of Territories, for which, this Shipping Rule is valid",
+ "fieldname": "valid_for_territories",
+ "fieldtype": "Table",
+ "label": "Valid For Territories",
+ "options": "Applicable Territory",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break_8",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "section_break_10",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "account",
+ "fieldtype": "Link",
+ "label": "Shipping Account",
+ "options": "Account",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break_12",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "label": "Cost Center",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "icon": "icon-truck",
+ "idx": 1,
+ "modified": "2014-01-20 17:49:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Shipping Rule",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User"
+ },
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User"
+ },
+ {
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "write": 1
+ },
+ {
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py
index 968a25b..76d0a57 100644
--- a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py
+++ b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ShippingRuleCondition(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt
index 22af554..2d4cf2d 100644
--- a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt
+++ b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt
@@ -1,51 +1,40 @@
-[
- {
- "creation": "2013-06-25 11:54:50",
- "docstatus": 0,
- "modified": "2013-12-20 19:21:46",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "description": "A condition for a Shipping Rule",
- "doctype": "DocType",
- "istable": 1,
- "module": "Accounts",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Shipping Rule Condition",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Shipping Rule Condition"
- },
- {
- "doctype": "DocField",
- "fieldname": "from_value",
- "fieldtype": "Float",
- "label": "From Value",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "to_value",
- "fieldtype": "Float",
- "label": "To Value",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "shipping_amount",
- "fieldtype": "Currency",
- "label": "Shipping Amount",
- "options": "Company:company:default_currency",
- "reqd": 1
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-25 11:54:50.000000",
+ "description": "A condition for a Shipping Rule",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "from_value",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "From Value",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "to_value",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "To Value",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "shipping_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Shipping Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:21:46.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Shipping Rule Condition",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.txt b/erpnext/accounts/page/accounts_browser/accounts_browser.txt
index e83759c..7fb1815 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.txt
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.txt
@@ -1,36 +1,22 @@
-[
- {
- "creation": "2012-06-14 15:07:28",
- "docstatus": 0,
- "modified": "2013-07-11 14:39:42",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-sitemap",
- "module": "Accounts",
- "name": "__common__",
- "page_name": "Accounts Browser",
- "standard": "Yes"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "Accounts Browser",
- "parentfield": "roles",
- "parenttype": "Page"
- },
- {
- "doctype": "Page",
- "name": "Accounts Browser"
- },
- {
- "doctype": "Page Role",
- "role": "Accounts User"
- },
- {
- "doctype": "Page Role",
- "role": "Accounts Manager"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-06-14 15:07:28.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-sitemap",
+ "idx": 1,
+ "modified": "2013-07-11 14:39:42.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Accounts Browser",
+ "owner": "Administrator",
+ "page_name": "Accounts Browser",
+ "roles": [
+ {
+ "role": "Accounts User"
+ },
+ {
+ "role": "Accounts Manager"
+ }
+ ],
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/page/financial_analytics/financial_analytics.txt b/erpnext/accounts/page/financial_analytics/financial_analytics.txt
index 94a9b8e..f551d82 100644
--- a/erpnext/accounts/page/financial_analytics/financial_analytics.txt
+++ b/erpnext/accounts/page/financial_analytics/financial_analytics.txt
@@ -1,37 +1,23 @@
-[
- {
- "creation": "2013-01-27 16:30:52",
- "docstatus": 0,
- "modified": "2013-07-11 14:42:16",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-bar-chart",
- "module": "Accounts",
- "name": "__common__",
- "page_name": "financial-analytics",
- "standard": "Yes",
- "title": "Financial Analytics"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "financial-analytics",
- "parentfield": "roles",
- "parenttype": "Page"
- },
- {
- "doctype": "Page",
- "name": "financial-analytics"
- },
- {
- "doctype": "Page Role",
- "role": "Analytics"
- },
- {
- "doctype": "Page Role",
- "role": "Accounts Manager"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-27 16:30:52.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-bar-chart",
+ "idx": 1,
+ "modified": "2013-07-11 14:42:16.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "financial-analytics",
+ "owner": "Administrator",
+ "page_name": "financial-analytics",
+ "roles": [
+ {
+ "role": "Analytics"
+ },
+ {
+ "role": "Accounts Manager"
+ }
+ ],
+ "standard": "Yes",
+ "title": "Financial Analytics"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/page/trial_balance/trial_balance.txt b/erpnext/accounts/page/trial_balance/trial_balance.txt
index f65146c..72fb981 100644
--- a/erpnext/accounts/page/trial_balance/trial_balance.txt
+++ b/erpnext/accounts/page/trial_balance/trial_balance.txt
@@ -1,37 +1,23 @@
-[
- {
- "creation": "2013-01-27 16:30:52",
- "docstatus": 0,
- "modified": "2013-07-11 14:44:49",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-table",
- "module": "Accounts",
- "name": "__common__",
- "page_name": "trial-balance",
- "standard": "Yes",
- "title": "Trial Balance"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "trial-balance",
- "parentfield": "roles",
- "parenttype": "Page"
- },
- {
- "doctype": "Page",
- "name": "trial-balance"
- },
- {
- "doctype": "Page Role",
- "role": "Analytics"
- },
- {
- "doctype": "Page Role",
- "role": "Accounts Manager"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-27 16:30:52.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-table",
+ "idx": 1,
+ "modified": "2013-07-11 14:44:49.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "trial-balance",
+ "owner": "Administrator",
+ "page_name": "trial-balance",
+ "roles": [
+ {
+ "role": "Analytics"
+ },
+ {
+ "role": "Accounts Manager"
+ }
+ ],
+ "standard": "Yes",
+ "title": "Trial Balance"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.txt b/erpnext/accounts/report/accounts_payable/accounts_payable.txt
index 9d20510..82c9337 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.txt
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-04-22 16:16:03",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Purchase Invoice",
- "report_name": "Accounts Payable",
- "report_type": "Report Builder"
- },
- {
- "doctype": "Report",
- "name": "Accounts Payable"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-04-22 16:16:03.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Accounts Payable",
+ "owner": "Administrator",
+ "ref_doctype": "Purchase Invoice",
+ "report_name": "Accounts Payable",
+ "report_type": "Report Builder"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt b/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt
index 6da3088..558a9fa 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-04-16 11:31:13",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Sales Invoice",
- "report_name": "Accounts Receivable",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Accounts Receivable"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-04-16 11:31:13.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Accounts Receivable",
+ "owner": "Administrator",
+ "ref_doctype": "Sales Invoice",
+ "report_name": "Accounts Receivable",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt
index 3b462a0..5768fb2 100644
--- a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt
+++ b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-05-01 12:13:25",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Journal Voucher",
- "report_name": "Bank Clearance Summary",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Bank Clearance Summary"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-05-01 12:13:25.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Bank Clearance Summary",
+ "owner": "Administrator",
+ "ref_doctype": "Journal Voucher",
+ "report_name": "Bank Clearance Summary",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt
index a2436a8..3da22e6 100644
--- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt
+++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-04-30 18:30:21",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 0,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Journal Voucher",
- "report_name": "Bank Reconciliation Statement",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Bank Reconciliation Statement"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 0,
+ "creation": "2013-04-30 18:30:21.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Bank Reconciliation Statement",
+ "owner": "Administrator",
+ "ref_doctype": "Journal Voucher",
+ "report_name": "Bank Reconciliation Statement",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt b/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt
index be9ce13..592ee69 100644
--- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt
+++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-18 12:56:36",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Cost Center",
- "report_name": "Budget Variance Report",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Budget Variance Report"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-18 12:56:36.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Budget Variance Report",
+ "owner": "Administrator",
+ "ref_doctype": "Cost Center",
+ "report_name": "Budget Variance Report",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/customer_account_head/customer_account_head.txt b/erpnext/accounts/report/customer_account_head/customer_account_head.txt
index c2a856b..c60f594 100644
--- a/erpnext/accounts/report/customer_account_head/customer_account_head.txt
+++ b/erpnext/accounts/report/customer_account_head/customer_account_head.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-03 16:17:34",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Account",
- "report_name": "Customer Account Head",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Customer Account Head"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-03 16:17:34.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Customer Account Head",
+ "owner": "Administrator",
+ "ref_doctype": "Account",
+ "report_name": "Customer Account Head",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt
index a525d2d..53af907 100644
--- a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt
+++ b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-07-30 17:28:49",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "query": "select\n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n\t`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n\t`tabDelivery Note`.`posting_date` as \"Date:Date\",\n\t`tabDelivery Note`.`project_name` as \"Project\",\n\t`tabDelivery Note Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabDelivery Note Item`.`qty` - ifnull((select sum(qty) from `tabSales Invoice Item` \n\t where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n\t `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\n\t\tas \"Qty:Float:110\",\n\t(`tabDelivery Note Item`.`base_amount` - ifnull((select sum(base_amount) from `tabSales Invoice Item` \n where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\n\t\tas \"Amount:Currency:110\",\n\t`tabDelivery Note Item`.`item_name` as \"Item Name::150\",\n\t`tabDelivery Note Item`.`description` as \"Description::200\"\nfrom `tabDelivery Note`, `tabDelivery Note Item`\nwhere\n `tabDelivery Note`.docstatus = 1 and\n\t`tabDelivery Note`.`status` != \"Stopped\" and\n `tabDelivery Note`.name = `tabDelivery Note Item`.parent and\n (`tabDelivery Note Item`.qty > ifnull((select sum(qty) from `tabSales Invoice Item` \n where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\norder by `tabDelivery Note`.`name` desc",
- "ref_doctype": "Sales Invoice",
- "report_name": "Delivered Items To Be Billed",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Delivered Items To Be Billed"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-07-30 17:28:49.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Delivered Items To Be Billed",
+ "owner": "Administrator",
+ "query": "select\n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n\t`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n\t`tabDelivery Note`.`posting_date` as \"Date:Date\",\n\t`tabDelivery Note`.`project_name` as \"Project\",\n\t`tabDelivery Note Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabDelivery Note Item`.`qty` - ifnull((select sum(qty) from `tabSales Invoice Item` \n\t where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n\t `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\n\t\tas \"Qty:Float:110\",\n\t(`tabDelivery Note Item`.`base_amount` - ifnull((select sum(base_amount) from `tabSales Invoice Item` \n where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\n\t\tas \"Amount:Currency:110\",\n\t`tabDelivery Note Item`.`item_name` as \"Item Name::150\",\n\t`tabDelivery Note Item`.`description` as \"Description::200\"\nfrom `tabDelivery Note`, `tabDelivery Note Item`\nwhere\n `tabDelivery Note`.docstatus = 1 and\n\t`tabDelivery Note`.`status` != \"Stopped\" and\n `tabDelivery Note`.name = `tabDelivery Note Item`.parent and\n (`tabDelivery Note Item`.qty > ifnull((select sum(qty) from `tabSales Invoice Item` \n where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\norder by `tabDelivery Note`.`name` desc",
+ "ref_doctype": "Sales Invoice",
+ "report_name": "Delivered Items To Be Billed",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.txt b/erpnext/accounts/report/general_ledger/general_ledger.txt
index cdfb033..59ac1a5 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.txt
+++ b/erpnext/accounts/report/general_ledger/general_ledger.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-12-06 13:22:23",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "GL Entry",
- "report_name": "General Ledger",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "General Ledger"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-12-06 13:22:23.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "General Ledger",
+ "owner": "Administrator",
+ "ref_doctype": "GL Entry",
+ "report_name": "General Ledger",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/gross_profit/gross_profit.txt b/erpnext/accounts/report/gross_profit/gross_profit.txt
index 5677660..12293bc 100644
--- a/erpnext/accounts/report/gross_profit/gross_profit.txt
+++ b/erpnext/accounts/report/gross_profit/gross_profit.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-02-25 17:03:34",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Sales Invoice",
- "report_name": "Gross Profit",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Gross Profit"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-25 17:03:34.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Gross Profit",
+ "owner": "Administrator",
+ "ref_doctype": "Sales Invoice",
+ "report_name": "Gross Profit",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.txt b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.txt
index 3dbd536..f37db79 100644
--- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.txt
+++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-06-05 15:37:30",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Purchase Invoice",
- "report_name": "Item-wise Purchase Register",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Item-wise Purchase Register"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-06-05 15:37:30.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Item-wise Purchase Register",
+ "owner": "Administrator",
+ "ref_doctype": "Purchase Invoice",
+ "report_name": "Item-wise Purchase Register",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.txt b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.txt
index 8d30644..4dffc71 100644
--- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.txt
+++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-05-13 17:50:55",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Sales Invoice",
- "report_name": "Item-wise Sales Register",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Item-wise Sales Register"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-05-13 17:50:55.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Item-wise Sales Register",
+ "owner": "Administrator",
+ "ref_doctype": "Sales Invoice",
+ "report_name": "Item-wise Sales Register",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt b/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt
index 09b6cff..b734f0e 100644
--- a/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt
+++ b/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-02-21 14:26:44",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project_name` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.base_amount as \"Amount:Currency:110\",\n (`tabSales Order Item`.billed_amt * ifnull(`tabSales Order`.conversion_rate, 1)) as \"Billed Amount:Currency:110\",\n (ifnull(`tabSales Order Item`.base_amount, 0) - (ifnull(`tabSales Order Item`.billed_amt, 0) * ifnull(`tabSales Order`.conversion_rate, 1))) as \"Pending Amount:Currency:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status != \"Stopped\"\n and ifnull(`tabSales Order Item`.billed_amt,0) < ifnull(`tabSales Order Item`.amount,0)\norder by `tabSales Order`.transaction_date asc",
- "ref_doctype": "Sales Invoice",
- "report_name": "Ordered Items To Be Billed",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Ordered Items To Be Billed"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-21 14:26:44.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Ordered Items To Be Billed",
+ "owner": "Administrator",
+ "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project_name` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.base_amount as \"Amount:Currency:110\",\n (`tabSales Order Item`.billed_amt * ifnull(`tabSales Order`.conversion_rate, 1)) as \"Billed Amount:Currency:110\",\n (ifnull(`tabSales Order Item`.base_amount, 0) - (ifnull(`tabSales Order Item`.billed_amt, 0) * ifnull(`tabSales Order`.conversion_rate, 1))) as \"Pending Amount:Currency:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status != \"Stopped\"\n and ifnull(`tabSales Order Item`.billed_amt,0) < ifnull(`tabSales Order Item`.amount,0)\norder by `tabSales Order`.transaction_date asc",
+ "ref_doctype": "Sales Invoice",
+ "report_name": "Ordered Items To Be Billed",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.txt b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.txt
index e48ea69..a717ff5 100644
--- a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.txt
+++ b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-12-02 17:06:37",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Journal Voucher",
- "report_name": "Payment Period Based On Invoice Date",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Payment Period Based On Invoice Date"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-12-02 17:06:37.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Payment Period Based On Invoice Date",
+ "owner": "Administrator",
+ "ref_doctype": "Journal Voucher",
+ "report_name": "Payment Period Based On Invoice Date",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt
index 20e5a53..26d199b 100644
--- a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt
+++ b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-13 18:46:55",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Purchase Invoice",
- "report_name": "Purchase Invoice Trends",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Purchase Invoice Trends"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-13 18:46:55.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Purchase Invoice Trends",
+ "owner": "Administrator",
+ "ref_doctype": "Purchase Invoice",
+ "report_name": "Purchase Invoice Trends",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.txt b/erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.txt
index 88990cb..0b9804c 100644
--- a/erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.txt
+++ b/erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.txt
@@ -1,24 +1,17 @@
-[
- {
- "creation": "2013-05-28 15:54:16",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "query": "select \n `tabPurchase Order`.`name` as \"Purchase Order:Link/Purchase Order:120\",\n `tabPurchase Order`.`transaction_date` as \"Date:Date:100\",\n\t`tabPurchase Order`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Order Item`.`project_name` as \"Project\",\n\t`tabPurchase Order Item`.item_code as \"Item Code:Link/Item:120\",\n\t`tabPurchase Order Item`.base_amount as \"Amount:Currency:100\",\n\t`tabPurchase Order Item`.billed_amt as \"Billed Amount:Currency:100\", \n\t(`tabPurchase Order Item`.base_amount - ifnull(`tabPurchase Order Item`.billed_amt, 0)) as \"Amount to Bill:Currency:100\",\n\t`tabPurchase Order Item`.item_name as \"Item Name::150\",\n\t`tabPurchase Order Item`.description as \"Description::200\"\nfrom\n\t`tabPurchase Order`, `tabPurchase Order Item`\nwhere\n\t`tabPurchase Order Item`.`parent` = `tabPurchase Order`.`name`\n\tand `tabPurchase Order`.docstatus = 1\n\tand `tabPurchase Order`.status != \"Stopped\"\n\tand ifnull(`tabPurchase Order Item`.billed_amt, 0) < ifnull(`tabPurchase Order Item`.base_amount, 0)\norder by `tabPurchase Order`.transaction_date asc",
- "ref_doctype": "Purchase Invoice",
- "report_name": "Purchase Order Items To Be Billed",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Purchase Order Items To Be Billed"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-05-28 15:54:16.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Purchase Order Items To Be Billed",
+ "owner": "Administrator",
+ "query": "select \n `tabPurchase Order`.`name` as \"Purchase Order:Link/Purchase Order:120\",\n `tabPurchase Order`.`transaction_date` as \"Date:Date:100\",\n\t`tabPurchase Order`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Order Item`.`project_name` as \"Project\",\n\t`tabPurchase Order Item`.item_code as \"Item Code:Link/Item:120\",\n\t`tabPurchase Order Item`.base_amount as \"Amount:Currency:100\",\n\t`tabPurchase Order Item`.billed_amt as \"Billed Amount:Currency:100\", \n\t(`tabPurchase Order Item`.base_amount - ifnull(`tabPurchase Order Item`.billed_amt, 0)) as \"Amount to Bill:Currency:100\",\n\t`tabPurchase Order Item`.item_name as \"Item Name::150\",\n\t`tabPurchase Order Item`.description as \"Description::200\"\nfrom\n\t`tabPurchase Order`, `tabPurchase Order Item`\nwhere\n\t`tabPurchase Order Item`.`parent` = `tabPurchase Order`.`name`\n\tand `tabPurchase Order`.docstatus = 1\n\tand `tabPurchase Order`.status != \"Stopped\"\n\tand ifnull(`tabPurchase Order Item`.billed_amt, 0) < ifnull(`tabPurchase Order Item`.base_amount, 0)\norder by `tabPurchase Order`.transaction_date asc",
+ "ref_doctype": "Purchase Invoice",
+ "report_name": "Purchase Order Items To Be Billed",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/purchase_register/purchase_register.txt b/erpnext/accounts/report/purchase_register/purchase_register.txt
index f04f8e6..592f410 100644
--- a/erpnext/accounts/report/purchase_register/purchase_register.txt
+++ b/erpnext/accounts/report/purchase_register/purchase_register.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-04-29 16:13:11",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Purchase Invoice",
- "report_name": "Purchase Register",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Purchase Register"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-04-29 16:13:11.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Purchase Register",
+ "owner": "Administrator",
+ "ref_doctype": "Purchase Invoice",
+ "report_name": "Purchase Register",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.txt b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.txt
index 3ecb2d8..097ddd2 100644
--- a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.txt
+++ b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-07-30 18:35:10",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "query": "select\n `tabPurchase Receipt`.`name` as \"Purchase Receipt:Link/Purchase Receipt:120\",\n `tabPurchase Receipt`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Receipt`.`posting_date` as \"Date:Date\",\n\t`tabPurchase Receipt Item`.`project_name` as \"Project\",\n\t`tabPurchase Receipt Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabPurchase Receipt Item`.`qty` - ifnull((select sum(qty) from `tabPurchase Invoice Item` \n\t where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n\t `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\n\t\tas \"Qty:Float:110\",\n\t(`tabPurchase Receipt Item`.`base_amount` - ifnull((select sum(base_amount) from `tabPurchase Invoice Item` \n where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\n\t\tas \"Amount:Currency:110\",\n\t`tabPurchase Receipt Item`.`item_name` as \"Item Name::150\",\n\t`tabPurchase Receipt Item`.`description` as \"Description::200\"\nfrom `tabPurchase Receipt`, `tabPurchase Receipt Item`\nwhere\n `tabPurchase Receipt`.docstatus = 1 and\n\t`tabPurchase Receipt`.`status` != \"Stopped\" and\n `tabPurchase Receipt`.name = `tabPurchase Receipt Item`.parent and\n (`tabPurchase Receipt Item`.qty > ifnull((select sum(qty) from `tabPurchase Invoice Item` \n where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\norder by `tabPurchase Receipt`.`name` desc",
- "ref_doctype": "Purchase Invoice",
- "report_name": "Received Items To Be Billed",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Received Items To Be Billed"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-07-30 18:35:10.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Received Items To Be Billed",
+ "owner": "Administrator",
+ "query": "select\n `tabPurchase Receipt`.`name` as \"Purchase Receipt:Link/Purchase Receipt:120\",\n `tabPurchase Receipt`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Receipt`.`posting_date` as \"Date:Date\",\n\t`tabPurchase Receipt Item`.`project_name` as \"Project\",\n\t`tabPurchase Receipt Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabPurchase Receipt Item`.`qty` - ifnull((select sum(qty) from `tabPurchase Invoice Item` \n\t where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n\t `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\n\t\tas \"Qty:Float:110\",\n\t(`tabPurchase Receipt Item`.`base_amount` - ifnull((select sum(base_amount) from `tabPurchase Invoice Item` \n where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\n\t\tas \"Amount:Currency:110\",\n\t`tabPurchase Receipt Item`.`item_name` as \"Item Name::150\",\n\t`tabPurchase Receipt Item`.`description` as \"Description::200\"\nfrom `tabPurchase Receipt`, `tabPurchase Receipt Item`\nwhere\n `tabPurchase Receipt`.docstatus = 1 and\n\t`tabPurchase Receipt`.`status` != \"Stopped\" and\n `tabPurchase Receipt`.name = `tabPurchase Receipt Item`.parent and\n (`tabPurchase Receipt Item`.qty > ifnull((select sum(qty) from `tabPurchase Invoice Item` \n where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\norder by `tabPurchase Receipt`.`name` desc",
+ "ref_doctype": "Purchase Invoice",
+ "report_name": "Received Items To Be Billed",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt
index 4ffc349..768c087 100644
--- a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt
+++ b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-13 18:44:21",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Sales Invoice",
- "report_name": "Sales Invoice Trends",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Sales Invoice Trends"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-13 18:44:21.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Invoice Trends",
+ "owner": "Administrator",
+ "ref_doctype": "Sales Invoice",
+ "report_name": "Sales Invoice Trends",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt b/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt
index e79d415..c4dd074 100644
--- a/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt
+++ b/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-05-06 12:28:23",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "query": "SELECT\n sales_partner as \"Sales Partner:Link/Sales Partner:150\",\n\tsum(net_total) as \"Invoiced Amount (Exculsive Tax):Currency:210\",\n\tsum(total_commission) as \"Total Commission:Currency:150\",\n\tsum(total_commission)*100/sum(net_total) as \"Average Commission Rate:Currency:170\"\nFROM\n\t`tabSales Invoice`\nWHERE\n\tdocstatus = 1 and ifnull(net_total, 0) > 0 and ifnull(total_commission, 0) > 0\nGROUP BY\n\tsales_partner\nORDER BY\n\t\"Total Commission:Currency:120\"",
- "ref_doctype": "Sales Invoice",
- "report_name": "Sales Partners Commission",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Sales Partners Commission"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-05-06 12:28:23.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Partners Commission",
+ "owner": "Administrator",
+ "query": "SELECT\n sales_partner as \"Sales Partner:Link/Sales Partner:150\",\n\tsum(net_total) as \"Invoiced Amount (Exculsive Tax):Currency:210\",\n\tsum(total_commission) as \"Total Commission:Currency:150\",\n\tsum(total_commission)*100/sum(net_total) as \"Average Commission Rate:Currency:170\"\nFROM\n\t`tabSales Invoice`\nWHERE\n\tdocstatus = 1 and ifnull(net_total, 0) > 0 and ifnull(total_commission, 0) > 0\nGROUP BY\n\tsales_partner\nORDER BY\n\t\"Total Commission:Currency:120\"",
+ "ref_doctype": "Sales Invoice",
+ "report_name": "Sales Partners Commission",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/sales_register/sales_register.txt b/erpnext/accounts/report/sales_register/sales_register.txt
index 40ac3b5..703d903 100644
--- a/erpnext/accounts/report/sales_register/sales_register.txt
+++ b/erpnext/accounts/report/sales_register/sales_register.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-04-23 18:15:29",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Sales Invoice",
- "report_name": "Sales Register",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Sales Register"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-04-23 18:15:29.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Sales Register",
+ "owner": "Administrator",
+ "ref_doctype": "Sales Invoice",
+ "report_name": "Sales Register",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt b/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt
index cf6e322..d973c8a 100644
--- a/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt
+++ b/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-04 12:56:17",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Accounts",
- "name": "__common__",
- "ref_doctype": "Account",
- "report_name": "Supplier Account Head",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Supplier Account Head"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-04 12:56:17.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Supplier Account Head",
+ "owner": "Administrator",
+ "ref_doctype": "Account",
+ "report_name": "Supplier Account Head",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py
index 1b00efc..260344c 100644
--- a/erpnext/accounts/utils.py
+++ b/erpnext/accounts/utils.py
@@ -5,7 +5,6 @@
import frappe
from frappe.utils import nowdate, cstr, flt, now, getdate, add_months
-from frappe.model.doc import addchild
from frappe import msgprint, throw, _
from frappe.utils import formatdate
from erpnext.utilities import build_filter_conditions
@@ -182,7 +181,7 @@
jvd = frappe.db.sql("""select cost_center, balance, against_account, is_advance
from `tabJournal Voucher Detail` where name = %s""", d['voucher_detail_no'])
# new entry with balance amount
- ch = addchild(jv_obj.doc, 'entries', 'Journal Voucher Detail')
+ ch = jv_obj.append("entries")
ch.account = d['account']
ch.cost_center = cstr(jvd[0][0])
ch.balance = cstr(jvd[0][1])
@@ -243,7 +242,7 @@
if not value:
throw(_("Please mention default value for '") +
- _(frappe.get_doctype("company").get_label(fieldname) +
+ _(frappe.get_meta("Company").get_label(fieldname) +
_("' in Company: ") + company))
return value
diff --git a/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt
index 88d750e..2df5496 100644
--- a/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt
+++ b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2012-04-17 11:29:12",
- "docstatus": 0,
- "modified": "2014-02-11 20:00:45",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Purchase Order",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Georgia\", serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Georgia\", serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table thead {\n\t\tborder-bottom: 1px solid black;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px 0px;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Purchase Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'po_details',\n\t\t\t\t'Purchase Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Purchase Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\trows +=\n\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount / (doc.conversion_rate || 1), doc.currency) + '</td>\\n' +\n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.supplier_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Purchase Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_import</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n",
- "module": "Buying",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Purchase Order Classic"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-04-17 11:29:12.000000",
+ "doc_type": "Purchase Order",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Georgia\", serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Georgia\", serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table thead {\n\t\tborder-bottom: 1px solid black;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px 0px;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Purchase Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'po_details',\n\t\t\t\t'Purchase Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Purchase Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\trows +=\n\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount / (doc.conversion_rate || 1), doc.currency) + '</td>\\n' +\n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.supplier_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Purchase Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_import</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n",
+ "idx": 1,
+ "modified": "2014-02-11 20:00:45.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Purchase Order Classic",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt
index 73f850a..6edb421 100644
--- a/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt
+++ b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2012-04-17 11:29:12",
- "docstatus": 0,
- "modified": "2014-02-11 20:12:05",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Purchase Order",
- "doctype": "Print Format",
- "html": "<!--\n Sample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n line-height: 150%;\n\t}\n\n\t.common {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t\tborder-style: none !important;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t\tborder-style: none !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h1 {\n\t\ttext-transform: uppercase;\n\t\tcolor: white;\n\t\tfont-size: 55px;\n\t\tfont-style: italic;\n\t}\n\n\ttable.header-table thead tr:nth-child(1) div {\n\t\theight: 24px;\n\t\tbackground-color: #696969;\n\t\tvertical-align: middle;\n\t\tpadding: 12px 0px 0px 0px;\n\t\twidth: 100%;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body table tr td {\n\t\tbackground-color: #DCDCDC !important;\n\t}\n\n\tdiv.page-body table tr:nth-child(1) td {\n\t\tbackground-color: #696969 !important;\n\t\tcolor: white !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table tfoot td {\n\t\tbackground-color: #696969;\n\t\theight: 10px;\n\t}\n\n\t.imp-details {\n\t\tbackground-color: #DCDCDC;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Purchase Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'po_details',\n\t\t\t\t'Purchase Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Purchase Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\trows +=\n\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount / (doc.conversion_rate || 1), doc.currency) + '</td>\\n' +\n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></div></td></tr>\n\t\t\t<tr><td colspan=2><div style=\"height:15px\"></div></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.supplier_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr class='imp-details'>\n\t\t\t\t\t\t<td><b>Purchase Order No.</b></td>\n\t\t\t\t\t\t<td><script>cur_frm.docname</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Purchase Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr style='font-weight: bold' class='imp-details'>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_import</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr><td colspan=2><div></div></td><tr>\n\t\t</tfoot>\n\t</table>\n</div>\n",
- "module": "Buying",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Purchase Order Modern"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-04-17 11:29:12.000000",
+ "doc_type": "Purchase Order",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n Sample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n line-height: 150%;\n\t}\n\n\t.common {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t\tborder-style: none !important;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t\tborder-style: none !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h1 {\n\t\ttext-transform: uppercase;\n\t\tcolor: white;\n\t\tfont-size: 55px;\n\t\tfont-style: italic;\n\t}\n\n\ttable.header-table thead tr:nth-child(1) div {\n\t\theight: 24px;\n\t\tbackground-color: #696969;\n\t\tvertical-align: middle;\n\t\tpadding: 12px 0px 0px 0px;\n\t\twidth: 100%;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body table tr td {\n\t\tbackground-color: #DCDCDC !important;\n\t}\n\n\tdiv.page-body table tr:nth-child(1) td {\n\t\tbackground-color: #696969 !important;\n\t\tcolor: white !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table tfoot td {\n\t\tbackground-color: #696969;\n\t\theight: 10px;\n\t}\n\n\t.imp-details {\n\t\tbackground-color: #DCDCDC;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Purchase Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'po_details',\n\t\t\t\t'Purchase Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Purchase Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\trows +=\n\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount / (doc.conversion_rate || 1), doc.currency) + '</td>\\n' +\n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></div></td></tr>\n\t\t\t<tr><td colspan=2><div style=\"height:15px\"></div></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.supplier_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr class='imp-details'>\n\t\t\t\t\t\t<td><b>Purchase Order No.</b></td>\n\t\t\t\t\t\t<td><script>cur_frm.docname</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Purchase Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr style='font-weight: bold' class='imp-details'>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_import</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr><td colspan=2><div></div></td><tr>\n\t\t</tfoot>\n\t</table>\n</div>\n",
+ "idx": 1,
+ "modified": "2014-02-11 20:12:05.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Purchase Order Modern",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt
index 1d6168e..d4347c4 100644
--- a/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt
+++ b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2012-04-17 11:29:12",
- "docstatus": 0,
- "modified": "2014-02-11 20:01:38",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Purchase Order",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 0px;\n\t}\n\n\ttable {\n\t\twidth: 100% !important;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\n\ttable, td {\n\t\tborder-collapse: collapse !important;\n\t\tpadding: 0px;\n\t\tmargin: 0px !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px;\n\t}\n\n\ttable.header-table > thead,\n\ttable.header-table > tbody > tr > td,\n\ttable.footer-table > tbody > tr > td {\n\t\tborder: 1px solid black;\n\t\tpadding: 5px;\n\t}\n\n\ttable.footer-table > tbody,\n\ttable.header-table > thead {\n\t\tborder-bottom: 3px solid black;\n\t}\n\n\ttable.header-table > thead {\n\t\tborder-top: 3px solid black;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body td {\n\t\tbackground-color: white !important;\n\t\tborder: 1px solid black !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Purchase Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'po_details',\n\t\t\t\t'Purchase Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Purchase Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\trows +=\n\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount / (doc.conversion_rate || 1), doc.currency) + '</td>\\n' +\n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.supplier_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Purchase Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_import</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n",
- "module": "Buying",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Purchase Order Spartan"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-04-17 11:29:12.000000",
+ "doc_type": "Purchase Order",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 0px;\n\t}\n\n\ttable {\n\t\twidth: 100% !important;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\n\ttable, td {\n\t\tborder-collapse: collapse !important;\n\t\tpadding: 0px;\n\t\tmargin: 0px !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px;\n\t}\n\n\ttable.header-table > thead,\n\ttable.header-table > tbody > tr > td,\n\ttable.footer-table > tbody > tr > td {\n\t\tborder: 1px solid black;\n\t\tpadding: 5px;\n\t}\n\n\ttable.footer-table > tbody,\n\ttable.header-table > thead {\n\t\tborder-bottom: 3px solid black;\n\t}\n\n\ttable.header-table > thead {\n\t\tborder-top: 3px solid black;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body td {\n\t\tbackground-color: white !important;\n\t\tborder: 1px solid black !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Purchase Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'po_details',\n\t\t\t\t'Purchase Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t]\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Purchase Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\trows +=\n\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount / (doc.conversion_rate || 1), doc.currency) + '</td>\\n' +\n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Purchase Order') + '</h1>'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.supplier_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Purchase Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_import, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_import</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n",
+ "idx": 1,
+ "modified": "2014-02-11 20:01:38.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Purchase Order Spartan",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.py b/erpnext/buying/doctype/buying_settings/buying_settings.py
index 9776fda..1f63798 100644
--- a/erpnext/buying/doctype/buying_settings/buying_settings.py
+++ b/erpnext/buying/doctype/buying_settings/buying_settings.py
@@ -6,9 +6,9 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class BuyingSettings(Document):
def validate(self):
for key in ["supplier_type", "supp_master_name", "maintain_same_rate", "buying_price_list"]:
diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.txt b/erpnext/buying/doctype/buying_settings/buying_settings.txt
index fbbe367..808c39d 100644
--- a/erpnext/buying/doctype/buying_settings/buying_settings.txt
+++ b/erpnext/buying/doctype/buying_settings/buying_settings.txt
@@ -1,94 +1,75 @@
-[
- {
- "creation": "2013-06-25 11:04:03",
- "docstatus": 0,
- "modified": "2014-02-19 19:02:00",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "description": "Settings for Buying Module",
- "doctype": "DocType",
- "document_type": "Other",
- "icon": "icon-cog",
- "issingle": 1,
- "module": "Buying",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Buying Settings",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Buying Settings",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "role": "System Manager",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Buying Settings"
- },
- {
- "default": "Supplier Name",
- "doctype": "DocField",
- "fieldname": "supp_master_name",
- "fieldtype": "Select",
- "label": "Supplier Naming By",
- "options": "Supplier Name\nNaming Series"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_type",
- "fieldtype": "Link",
- "label": "Default Supplier Type",
- "options": "Supplier Type"
- },
- {
- "doctype": "DocField",
- "fieldname": "buying_price_list",
- "fieldtype": "Link",
- "label": "Default Buying Price List",
- "options": "Price List"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "maintain_same_rate",
- "fieldtype": "Check",
- "label": "Maintain same rate throughout purchase cycle"
- },
- {
- "doctype": "DocField",
- "fieldname": "po_required",
- "fieldtype": "Select",
- "label": "Purchase Order Required",
- "options": "No\nYes"
- },
- {
- "doctype": "DocField",
- "fieldname": "pr_required",
- "fieldtype": "Select",
- "label": "Purchase Receipt Required",
- "options": "No\nYes"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-25 11:04:03.000000",
+ "description": "Settings for Buying Module",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "fields": [
+ {
+ "default": "Supplier Name",
+ "fieldname": "supp_master_name",
+ "fieldtype": "Select",
+ "label": "Supplier Naming By",
+ "options": "Supplier Name\nNaming Series",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "supplier_type",
+ "fieldtype": "Link",
+ "label": "Default Supplier Type",
+ "options": "Supplier Type",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "buying_price_list",
+ "fieldtype": "Link",
+ "label": "Default Buying Price List",
+ "options": "Price List",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "maintain_same_rate",
+ "fieldtype": "Check",
+ "label": "Maintain same rate throughout purchase cycle",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "po_required",
+ "fieldtype": "Select",
+ "label": "Purchase Order Required",
+ "options": "No\nYes",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "pr_required",
+ "fieldtype": "Select",
+ "label": "Purchase Receipt Required",
+ "options": "No\nYes",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-cog",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2014-02-19 19:02:00.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Buying Settings",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "System Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js
index 6afcd95..e18b3ef 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.js
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.js
@@ -78,7 +78,7 @@
},
price_list_rate: function(doc, cdt, cdn) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
frappe.model.round_floats_in(item, ["price_list_rate", "discount_percentage"]);
item.rate = flt(item.price_list_rate * (1 - item.discount_percentage / 100.0),
@@ -92,7 +92,7 @@
},
rate: function(doc, cdt, cdn) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
frappe.model.round_floats_in(item, ["rate", "discount_percentage"]);
if(item.price_list_rate) {
@@ -107,7 +107,7 @@
uom: function(doc, cdt, cdn) {
var me = this;
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
if(item.item_code && item.uom) {
return this.frm.call({
method: "erpnext.buying.utils.get_conversion_factor",
@@ -132,7 +132,7 @@
conversion_factor: function(doc, cdt, cdn) {
if(frappe.meta.get_docfield(cdt, "stock_qty", cdn)) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
frappe.model.round_floats_in(item, ["qty", "conversion_factor"]);
item.stock_qty = flt(item.qty * item.conversion_factor, precision("stock_qty", item));
refresh_field("stock_qty", item.name, item.parentfield);
@@ -140,7 +140,7 @@
},
warehouse: function(doc, cdt, cdn) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
if(item.item_code && item.warehouse) {
return this.frm.call({
method: "erpnext.buying.utils.get_projected_qty",
@@ -154,9 +154,9 @@
},
project_name: function(doc, cdt, cdn) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
if(item.project_name) {
- $.each(frappe.model.get_doclist(this.frm.doc.doctype, this.frm.doc.name, {parentfield: this.fname}),
+ $.each(this.frm.doc[this.fname],
function(i, other_item) {
if(!other_item.project_name) {
other_item.project_name = item.project_name;
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py
index 3fefeba..8ae3649 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.py
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.py
@@ -11,10 +11,7 @@
from erpnext.stock.doctype.item.item import get_last_purchase_details
from erpnext.controllers.buying_controller import BuyingController
-class DocType(BuyingController):
- def __init__(self, doc, doclist=None):
- self.doc = doc
- self.doclist = doclist
+class PurchaseCommon(BuyingController):
def update_last_purchase_rate(self, obj, is_submit):
"""updates last_purchase_rate in item table for each item"""
diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.txt b/erpnext/buying/doctype/purchase_common/purchase_common.txt
index c796c04..2f5ada8 100644
--- a/erpnext/buying/doctype/purchase_common/purchase_common.txt
+++ b/erpnext/buying/doctype/purchase_common/purchase_common.txt
@@ -1,19 +1,12 @@
-[
- {
- "creation": "2012-03-27 14:35:51",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "issingle": 1,
- "module": "Buying",
- "name": "__common__"
- },
- {
- "doctype": "DocType",
- "name": "Purchase Common"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-03-27 14:35:51.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-12-20 19:23:27.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Purchase Common",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index 0db8d6f..1dfb78e 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -128,7 +128,7 @@
}
cur_frm.cscript.get_last_purchase_rate = function(doc, cdt, cdn){
- return $c_obj(make_doclist(doc.doctype, doc.name), 'get_last_purchase_rate', '', function(r, rt) {
+ return $c_obj(doc, 'get_last_purchase_rate', '', function(r, rt) {
refresh_field(cur_frm.cscript.fname);
var doc = locals[cdt][cdn];
cur_frm.cscript.calc_amount( doc, 2);
@@ -140,7 +140,7 @@
var check = confirm(frappe._("Do you really want to STOP ") + doc.name);
if (check) {
- return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': frappe.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
+ return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs':doc}, function(r,rt) {
cur_frm.refresh();
});
}
@@ -151,7 +151,7 @@
var check = confirm(frappe._("Do you really want to UNSTOP ") + doc.name);
if (check) {
- return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted', 'docs': frappe.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
+ return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted', 'docs':doc}, function(r,rt) {
cur_frm.refresh();
});
}
@@ -170,7 +170,7 @@
out ='';
- var cl = getchildren('Purchase Order Item',doc.name,'po_details');
+ var cl = doc.po_details || [];
// outer table
var out='<div><table class="noborder" style="width:100%"><tr><td style="width: 50%"></td><td>';
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py
index fca61e3..587256e 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.py
@@ -11,10 +11,7 @@
from erpnext.controllers.buying_controller import BuyingController
-class DocType(BuyingController):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class PurchaseOrder(BuyingController):
self.tname = 'Purchase Order Item'
self.fname = 'po_details'
self.status_updater = [{
@@ -65,7 +62,7 @@
})
def get_schedule_dates(self):
- for d in getlist(self.doclist, 'po_details'):
+ for d in self.get('po_details'):
if d.prevdoc_detail_docname and not d.schedule_date:
d.schedule_date = frappe.db.get_value("Material Request Item",
d.prevdoc_detail_docname, "schedule_date")
@@ -76,7 +73,7 @@
# Check for Stopped status
def check_for_stopped_status(self, pc_obj):
check_list =[]
- for d in getlist(self.doclist, 'po_details'):
+ for d in self.get('po_details'):
if d.fields.has_key('prevdoc_docname') and d.prevdoc_docname and d.prevdoc_docname not in check_list:
check_list.append(d.prevdoc_docname)
pc_obj.check_for_stopped_status( d.prevdoc_doctype, d.prevdoc_docname)
@@ -85,7 +82,7 @@
def update_bin(self, is_submit, is_stopped = 0):
from erpnext.stock.utils import update_bin
pc_obj = get_obj('Purchase Common')
- for d in getlist(self.doclist, 'po_details'):
+ for d in self.get('po_details'):
#1. Check if is_stock_item == 'Yes'
if frappe.db.get_value("Item", d.item_code, "is_stock_item") == "Yes":
# this happens when item is changed from non-stock to stock item
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.txt b/erpnext/buying/doctype/purchase_order/purchase_order.txt
index 2dbafd2..53038fc 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.txt
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.txt
@@ -1,707 +1,700 @@
-[
- {
- "creation": "2013-05-21 16:16:39",
- "docstatus": 0,
- "modified": "2014-01-29 15:26:21",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "document_type": "Transaction",
- "icon": "icon-file-text",
- "is_submittable": 1,
- "module": "Buying",
- "name": "__common__",
- "read_only_onload": 1,
- "search_fields": "status, transaction_date, supplier,grand_total"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Purchase Order",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Purchase Order",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Purchase Order"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_section",
- "fieldtype": "Section Break",
- "label": "Supplier",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "\nPO",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "description": "Supplier (vendor) name as entered in supplier master",
- "doctype": "DocField",
- "fieldname": "supplier",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Supplier",
- "oldfieldname": "supplier",
- "oldfieldtype": "Link",
- "options": "Supplier",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Name",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Address",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_mobile",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Mobile No",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_email",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Contact Email",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 0,
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "transaction_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Purchase Order Date",
- "oldfieldname": "transaction_date",
- "oldfieldtype": "Date",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0
- },
- {
- "description": "Select the relevant company name if you have multiple companies",
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "no_copy": 0,
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_and_currency",
- "fieldtype": "Section Break",
- "label": "Currency and Price List",
- "options": "icon-tag"
- },
- {
- "doctype": "DocField",
- "fieldname": "cb_currency",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "currency",
- "fieldtype": "Link",
- "label": "Currency",
- "no_copy": 0,
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "description": "Rate at which supplier's currency is converted to company's base currency",
- "doctype": "DocField",
- "fieldname": "conversion_rate",
- "fieldtype": "Float",
- "hidden": 0,
- "label": "Exchange Rate",
- "no_copy": 0,
- "oldfieldname": "conversion_rate",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cb_price_list",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "buying_price_list",
- "fieldtype": "Link",
- "label": "Price List",
- "options": "Price List",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_currency",
- "fieldtype": "Link",
- "label": "Price List Currency",
- "options": "Currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "plc_conversion_rate",
- "fieldtype": "Float",
- "label": "Price List Exchange Rate",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "items",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart"
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "po_details",
- "fieldtype": "Table",
- "label": "Purchase Order Items",
- "no_copy": 0,
- "oldfieldname": "po_details",
- "oldfieldtype": "Table",
- "options": "Purchase Order Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "sb_last_purchase",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total_import",
- "fieldtype": "Currency",
- "label": "Net Total",
- "no_copy": 0,
- "oldfieldname": "net_total_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "get_last_purchase_rate",
- "fieldtype": "Button",
- "label": "Get Last Purchase Rate",
- "oldfieldtype": "Button",
- "print_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_26",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "label": "Net Total (Company Currency)",
- "no_copy": 1,
- "oldfieldname": "net_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "taxes",
- "fieldtype": "Section Break",
- "label": "Taxes and Charges",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "print_hide": 0
- },
- {
- "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.",
- "doctype": "DocField",
- "fieldname": "taxes_and_charges",
- "fieldtype": "Link",
- "label": "Taxes and Charges",
- "no_copy": 0,
- "oldfieldname": "purchase_other_charges",
- "oldfieldtype": "Link",
- "options": "Purchase Taxes and Charges Master",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges",
- "fieldtype": "Table",
- "label": "Purchase Taxes and Charges",
- "no_copy": 0,
- "oldfieldname": "purchase_tax_details",
- "oldfieldtype": "Table",
- "options": "Purchase Taxes and Charges"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_calculation",
- "fieldtype": "HTML",
- "label": "Taxes and Charges Calculation",
- "no_copy": 1,
- "oldfieldtype": "HTML",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "label": "Totals",
- "oldfieldtype": "Section Break",
- "options": "icon-money"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_added_import",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Added",
- "no_copy": 0,
- "oldfieldname": "other_charges_added_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_deducted_import",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Deducted",
- "no_copy": 0,
- "oldfieldname": "other_charges_deducted_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total_import",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Grand Total",
- "no_copy": 0,
- "oldfieldname": "grand_total_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "in_words_import",
- "fieldtype": "Data",
- "label": "In Words",
- "oldfieldname": "in_words_import",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break4",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_added",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Added (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "other_charges_added",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_deducted",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Deducted (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "other_charges_deducted",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_tax",
- "fieldtype": "Currency",
- "label": "Total Tax (Company Currency)",
- "no_copy": 1,
- "oldfieldname": "total_tax",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total",
- "fieldtype": "Currency",
- "label": "Grand Total (Company Currency)",
- "no_copy": 1,
- "oldfieldname": "grand_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rounded_total",
- "fieldtype": "Currency",
- "label": "Rounded Total (Company Currency)",
- "oldfieldname": "rounded_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "description": "In Words will be visible once you save the Purchase Order.",
- "doctype": "DocField",
- "fieldname": "in_words",
- "fieldtype": "Data",
- "label": "In Words (Company Currency)",
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "icon-legal"
- },
- {
- "doctype": "DocField",
- "fieldname": "tc_name",
- "fieldtype": "Link",
- "label": "Terms",
- "oldfieldname": "tc_name",
- "oldfieldtype": "Link",
- "options": "Terms and Conditions",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "terms",
- "fieldtype": "Text Editor",
- "label": "Terms and Conditions",
- "oldfieldname": "terms",
- "oldfieldtype": "Text Editor"
- },
- {
- "depends_on": "supplier",
- "doctype": "DocField",
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "label": "Contact Info",
- "options": "icon-bullhorn"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_address",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Supplier Address",
- "options": "Address",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cb_contact",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Contact Person",
- "options": "Contact",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nDraft\nSubmitted\nStopped\nCancelled",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "default": "No",
- "doctype": "DocField",
- "fieldname": "is_subcontracted",
- "fieldtype": "Select",
- "label": "Is Subcontracted",
- "options": "\nYes\nNo",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "ref_sq",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Ref SQ",
- "no_copy": 1,
- "oldfieldname": "ref_sq",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "letter_head",
- "fieldtype": "Select",
- "label": "Letter Head",
- "oldfieldname": "letter_head",
- "oldfieldtype": "Select",
- "options": "link:Letter Head",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "no_copy": 0,
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "label": "Print Heading",
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break5",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 1,
- "print_width": "50%",
- "width": "50%"
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "description": "% of materials received against this Purchase Order",
- "doctype": "DocField",
- "fieldname": "per_received",
- "fieldtype": "Percent",
- "in_list_view": 1,
- "label": "% Received",
- "no_copy": 1,
- "oldfieldname": "per_received",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "description": "% of materials billed against this Purchase Order.",
- "doctype": "DocField",
- "fieldname": "per_billed",
- "fieldtype": "Percent",
- "in_list_view": 1,
- "label": "% Billed",
- "no_copy": 1,
- "oldfieldname": "per_billed",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "description": "Required raw materials issued to the supplier for producing a sub - contracted item.",
- "doctype": "DocField",
- "fieldname": "raw_material_details",
- "fieldtype": "Section Break",
- "label": "Raw Materials Supplied",
- "oldfieldtype": "Section Break",
- "options": "icon-truck",
- "print_hide": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "po_raw_material_details",
- "fieldtype": "Table",
- "label": "Purchase Order Items Supplied",
- "no_copy": 0,
- "oldfieldname": "po_raw_material_details",
- "oldfieldtype": "Table",
- "options": "Purchase Order Item Supplied",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Material User",
- "submit": 0,
- "write": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Purchase Manager",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Purchase User",
- "submit": 1,
- "write": 1
- },
- {
- "cancel": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Supplier"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-05-21 16:16:39.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "fieldname": "supplier_section",
+ "fieldtype": "Section Break",
+ "label": "Supplier",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "\nPO",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "description": "Supplier (vendor) name as entered in supplier master",
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Supplier",
+ "oldfieldname": "supplier",
+ "oldfieldtype": "Link",
+ "options": "Supplier",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "supplier_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Address",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_mobile",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Mobile No",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_email",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Contact Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Purchase Order Date",
+ "oldfieldname": "transaction_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0
+ },
+ {
+ "description": "Select the relevant company name if you have multiple companies",
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "no_copy": 0,
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "price_list_and_currency",
+ "fieldtype": "Section Break",
+ "label": "Currency and Price List",
+ "options": "icon-tag",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "cb_currency",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "label": "Currency",
+ "no_copy": 0,
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "description": "Rate at which supplier's currency is converted to company's base currency",
+ "fieldname": "conversion_rate",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "label": "Exchange Rate",
+ "no_copy": 0,
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "cb_price_list",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "buying_price_list",
+ "fieldtype": "Link",
+ "label": "Price List",
+ "options": "Price List",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "price_list_currency",
+ "fieldtype": "Link",
+ "label": "Price List Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "plc_conversion_rate",
+ "fieldtype": "Float",
+ "label": "Price List Exchange Rate",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "items",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "po_details",
+ "fieldtype": "Table",
+ "label": "Purchase Order Items",
+ "no_copy": 0,
+ "oldfieldname": "po_details",
+ "oldfieldtype": "Table",
+ "options": "Purchase Order Item",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sb_last_purchase",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total_import",
+ "fieldtype": "Currency",
+ "label": "Net Total",
+ "no_copy": 0,
+ "oldfieldname": "net_total_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "get_last_purchase_rate",
+ "fieldtype": "Button",
+ "label": "Get Last Purchase Rate",
+ "oldfieldtype": "Button",
+ "permlevel": 0,
+ "print_hide": 0
+ },
+ {
+ "fieldname": "column_break_26",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "label": "Net Total (Company Currency)",
+ "no_copy": 1,
+ "oldfieldname": "net_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "taxes",
+ "fieldtype": "Section Break",
+ "label": "Taxes and Charges",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 0
+ },
+ {
+ "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.",
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "label": "Taxes and Charges",
+ "no_copy": 0,
+ "oldfieldname": "purchase_other_charges",
+ "oldfieldtype": "Link",
+ "options": "Purchase Taxes and Charges Master",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "other_charges",
+ "fieldtype": "Table",
+ "label": "Purchase Taxes and Charges",
+ "no_copy": 0,
+ "oldfieldname": "purchase_tax_details",
+ "oldfieldtype": "Table",
+ "options": "Purchase Taxes and Charges",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_calculation",
+ "fieldtype": "HTML",
+ "label": "Taxes and Charges Calculation",
+ "no_copy": 1,
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "label": "Totals",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_added_import",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Added",
+ "no_copy": 0,
+ "oldfieldname": "other_charges_added_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "other_charges_deducted_import",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Deducted",
+ "no_copy": 0,
+ "oldfieldname": "other_charges_deducted_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "grand_total_import",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Grand Total",
+ "no_copy": 0,
+ "oldfieldname": "grand_total_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "in_words_import",
+ "fieldtype": "Data",
+ "label": "In Words",
+ "oldfieldname": "in_words_import",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0
+ },
+ {
+ "fieldname": "other_charges_added",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Added (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "other_charges_added",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "other_charges_deducted",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Deducted (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "other_charges_deducted",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "total_tax",
+ "fieldtype": "Currency",
+ "label": "Total Tax (Company Currency)",
+ "no_copy": 1,
+ "oldfieldname": "total_tax",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "label": "Grand Total (Company Currency)",
+ "no_copy": 1,
+ "oldfieldname": "grand_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "rounded_total",
+ "fieldtype": "Currency",
+ "label": "Rounded Total (Company Currency)",
+ "oldfieldname": "rounded_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "description": "In Words will be visible once you save the Purchase Order.",
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "label": "In Words (Company Currency)",
+ "oldfieldname": "in_words",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "label": "Terms and Conditions",
+ "oldfieldtype": "Section Break",
+ "options": "icon-legal",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "label": "Terms",
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "label": "Terms and Conditions",
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "supplier",
+ "fieldname": "contact_section",
+ "fieldtype": "Section Break",
+ "label": "Contact Info",
+ "options": "icon-bullhorn",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "supplier_address",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Supplier Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "cb_contact",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Contact Person",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nDraft\nSubmitted\nStopped\nCancelled",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "default": "No",
+ "fieldname": "is_subcontracted",
+ "fieldtype": "Select",
+ "label": "Is Subcontracted",
+ "options": "\nYes\nNo",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "ref_sq",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Ref SQ",
+ "no_copy": 1,
+ "oldfieldname": "ref_sq",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "letter_head",
+ "fieldtype": "Select",
+ "label": "Letter Head",
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "link:Letter Head",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "no_copy": 0,
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "label": "Print Heading",
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "column_break5",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "description": "% of materials received against this Purchase Order",
+ "fieldname": "per_received",
+ "fieldtype": "Percent",
+ "in_list_view": 1,
+ "label": "% Received",
+ "no_copy": 1,
+ "oldfieldname": "per_received",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "description": "% of materials billed against this Purchase Order.",
+ "fieldname": "per_billed",
+ "fieldtype": "Percent",
+ "in_list_view": 1,
+ "label": "% Billed",
+ "no_copy": 1,
+ "oldfieldname": "per_billed",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "description": "Required raw materials issued to the supplier for producing a sub - contracted item.",
+ "fieldname": "raw_material_details",
+ "fieldtype": "Section Break",
+ "label": "Raw Materials Supplied",
+ "oldfieldtype": "Section Break",
+ "options": "icon-truck",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "po_raw_material_details",
+ "fieldtype": "Table",
+ "label": "Purchase Order Items Supplied",
+ "no_copy": 0,
+ "oldfieldname": "po_raw_material_details",
+ "oldfieldtype": "Table",
+ "options": "Purchase Order Item Supplied",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-29 15:26:21.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Purchase Order",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Supplier"
+ }
+ ],
+ "read_only_onload": 1,
+ "search_fields": "status, transaction_date, supplier,grand_total"
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py
index d58ce17..d0df0df 100644
--- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py
+++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py
@@ -95,7 +95,7 @@
def test_subcontracting(self):
po = frappe.bean(copy=test_records[0])
po.insert()
- self.assertEquals(len(po.doclist.get({"parentfield": "po_raw_material_details"})), 2)
+ self.assertEquals(len(po.get("po_raw_material_details")), 2)
def test_warehouse_company_validation(self):
from erpnext.stock.utils import InvalidWarehouseCompany
diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.py b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.py
index 26c87f1..8c7c0a8 100644
--- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.py
+++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class PurchaseOrderItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
index 192b206..23fb1c0 100755
--- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
+++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt
@@ -1,495 +1,482 @@
-[
- {
- "creation": "2013-05-24 19:29:06",
- "docstatus": 0,
- "modified": "2014-02-28 11:26:25",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "POD/.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Buying",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Purchase Order Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Purchase Order Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "print_hide": 0,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "description": "If Supplier Part Number exists for given Item, it gets stored here",
- "doctype": "DocField",
- "fieldname": "supplier_part_no",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Supplier Part Number",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "schedule_date",
- "fieldtype": "Date",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Reqd By Date",
- "no_copy": 0,
- "oldfieldname": "schedule_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "print_width": "300px",
- "read_only": 0,
- "reqd": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "quantity_and_rate",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Quantity and Rate"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Quantity",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "print_width": "60px",
- "read_only": 0,
- "reqd": 1,
- "width": "60px"
- },
- {
- "doctype": "DocField",
- "fieldname": "uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "UOM",
- "oldfieldname": "uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "print_hide": 0,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "hidden": 0,
- "in_list_view": 0,
- "label": "Stock UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "hidden": 0,
- "in_list_view": 0,
- "label": "UOM Conversion Factor",
- "oldfieldname": "conversion_factor",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "sec_break1",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate",
- "options": "currency",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "discount_percentage",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Discount %",
- "print_hide": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate (Company Currency)",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sec_break2",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Currency",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Rate ",
- "oldfieldname": "import_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "import_amount",
- "oldfieldtype": "Currency",
- "options": "currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break4",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Rate (Company Currency)",
- "oldfieldname": "purchase_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_amount",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Amount (Company Currency)",
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_price",
- "fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse_and_reference",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Warehouse and Reference"
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "hidden": 0,
- "in_list_view": 0,
- "label": "Warehouse",
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "project_name",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Project Name",
- "options": "Project",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_doctype",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Prevdoc DocType",
- "no_copy": 1,
- "oldfieldname": "prevdoc_doctype",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_docname",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Material Request No",
- "no_copy": 1,
- "oldfieldname": "prevdoc_docname",
- "oldfieldtype": "Link",
- "options": "Material Request",
- "print_hide": 1,
- "print_width": "120px",
- "read_only": 1,
- "search_index": 1,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_detail_docname",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Material Request Detail No",
- "no_copy": 1,
- "oldfieldname": "prevdoc_detail_docname",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_quotation",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Supplier Quotation",
- "no_copy": 1,
- "options": "Supplier Quotation",
- "read_only": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_quotation_item",
- "fieldtype": "Link",
- "hidden": 1,
- "in_list_view": 1,
- "label": "Supplier Quotation Item",
- "no_copy": 1,
- "options": "Supplier Quotation Item",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break5",
- "fieldtype": "Column Break"
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 1,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Group",
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Link",
- "hidden": 1,
- "in_list_view": 1,
- "label": "Brand",
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_qty",
- "fieldtype": "Float",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Qty as per Stock UOM",
- "no_copy": 1,
- "oldfieldname": "stock_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "received_qty",
- "fieldtype": "Float",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Received Qty",
- "no_copy": 1,
- "oldfieldname": "received_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "billed_amt",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Billed Amt",
- "no_copy": 1,
- "options": "currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges",
- "doctype": "DocField",
- "fieldname": "item_tax_rate",
- "fieldtype": "Small Text",
- "hidden": 1,
- "in_list_view": 1,
- "label": "Item Tax Rate",
- "oldfieldname": "item_tax_rate",
- "oldfieldtype": "Small Text",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "page_break",
- "fieldtype": "Check",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Page Break",
- "no_copy": 1,
- "oldfieldname": "page_break",
- "oldfieldtype": "Check",
- "print_hide": 1,
- "read_only": 0
- }
-]
\ No newline at end of file
+{
+ "autoname": "POD/.#####",
+ "creation": "2013-05-24 19:29:06.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "description": "If Supplier Part Number exists for given Item, it gets stored here",
+ "fieldname": "supplier_part_no",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Supplier Part Number",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "schedule_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Reqd By Date",
+ "no_copy": 0,
+ "oldfieldname": "schedule_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Quantity and Rate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Quantity",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "60px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "60px"
+ },
+ {
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "oldfieldname": "uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_list_view": 0,
+ "label": "Stock UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "in_list_view": 0,
+ "label": "UOM Conversion Factor",
+ "oldfieldname": "conversion_factor",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "sec_break1",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "discount_percentage",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Discount %",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "base_price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate (Company Currency)",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "sec_break2",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Rate ",
+ "oldfieldname": "import_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "import_amount",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "base_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Rate (Company Currency)",
+ "oldfieldname": "purchase_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "base_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Amount (Company Currency)",
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "warehouse_and_reference",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Warehouse and Reference",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_list_view": 0,
+ "label": "Warehouse",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Project Name",
+ "options": "Project",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "prevdoc_doctype",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Prevdoc DocType",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_doctype",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "prevdoc_docname",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Material Request No",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_docname",
+ "oldfieldtype": "Link",
+ "options": "Material Request",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "120px",
+ "read_only": 1,
+ "search_index": 1,
+ "width": "120px"
+ },
+ {
+ "fieldname": "prevdoc_detail_docname",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Material Request Detail No",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_detail_docname",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "supplier_quotation",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Supplier Quotation",
+ "no_copy": 1,
+ "options": "Supplier Quotation",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "supplier_quotation_item",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_list_view": 1,
+ "label": "Supplier Quotation Item",
+ "no_copy": 1,
+ "options": "Supplier Quotation Item",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "col_break5",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Group",
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_list_view": 1,
+ "label": "Brand",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "stock_qty",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Qty as per Stock UOM",
+ "no_copy": 1,
+ "oldfieldname": "stock_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "received_qty",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Received Qty",
+ "no_copy": 1,
+ "oldfieldname": "received_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "billed_amt",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Billed Amt",
+ "no_copy": 1,
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges",
+ "fieldname": "item_tax_rate",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "in_list_view": 1,
+ "label": "Item Tax Rate",
+ "oldfieldname": "item_tax_rate",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Page Break",
+ "no_copy": 1,
+ "oldfieldname": "page_break",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-28 11:26:25.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Purchase Order Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py
index 26c87f1..d1542fc 100644
--- a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py
+++ b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class PurchaseOrderItemSupplied(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt
index f2860cd..df947e6 100644
--- a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt
+++ b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt
@@ -1,121 +1,108 @@
-[
- {
- "creation": "2013-02-22 01:27:42",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:33",
- "modified_by": "Administrator",
- "owner": "dhanalekshmi@webnotestech.com"
- },
- {
- "doctype": "DocType",
- "hide_toolbar": 1,
- "istable": 1,
- "module": "Buying",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Purchase Order Item Supplied",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Purchase Order Item Supplied"
- },
- {
- "doctype": "DocField",
- "fieldname": "reference_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Reference Name",
- "oldfieldname": "reference_name",
- "oldfieldtype": "Data",
- "read_only": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "bom_detail_no",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "BOM Detail No",
- "oldfieldname": "bom_detail_no",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "main_item_code",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "main_item_code",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rm_item_code",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Raw Material Item Code",
- "oldfieldname": "rm_item_code",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "required_qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Required Qty",
- "oldfieldname": "required_qty",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Rate",
- "oldfieldname": "rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Currency",
- "label": "Amount",
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "hidden": 1,
- "label": "Conversion Factor",
- "oldfieldname": "conversion_factor",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "label": "Stock Uom",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "read_only": 1
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:42.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "reference_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Reference Name",
+ "oldfieldname": "reference_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "bom_detail_no",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "BOM Detail No",
+ "oldfieldname": "bom_detail_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "main_item_code",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "main_item_code",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "rm_item_code",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Raw Material Item Code",
+ "oldfieldname": "rm_item_code",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "required_qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Required Qty",
+ "oldfieldname": "required_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Rate",
+ "oldfieldname": "rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "label": "Amount",
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "label": "Conversion Factor",
+ "oldfieldname": "conversion_factor",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "label": "Stock Uom",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "hide_toolbar": 1,
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:33.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Purchase Order Item Supplied",
+ "owner": "dhanalekshmi@webnotestech.com"
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py
index 26c87f1..1270cf0 100644
--- a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py
+++ b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class PurchaseReceiptItemSupplied(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt
index e28bdb7..25ff1da 100644
--- a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt
+++ b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt
@@ -1,158 +1,145 @@
-[
- {
- "creation": "2013-02-22 01:27:42",
- "docstatus": 0,
- "modified": "2014-02-13 11:29:35",
- "modified_by": "Administrator",
- "owner": "wasim@webnotestech.com"
- },
- {
- "doctype": "DocType",
- "hide_toolbar": 0,
- "istable": 1,
- "module": "Buying",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Purchase Receipt Item Supplied",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Purchase Receipt Item Supplied"
- },
- {
- "doctype": "DocField",
- "fieldname": "main_item_code",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "main_item_code",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rm_item_code",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Raw Material Item Code",
- "oldfieldname": "rm_item_code",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Data",
- "print_width": "300px",
- "read_only": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "required_qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Required Qty",
- "oldfieldname": "required_qty",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "consumed_qty",
- "fieldtype": "Float",
- "label": "Consumed Qty",
- "oldfieldname": "consumed_qty",
- "oldfieldtype": "Currency",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "label": "Stock Uom",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Currency",
- "label": "Rate",
- "oldfieldname": "rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Currency",
- "label": "Amount",
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "hidden": 1,
- "label": "Conversion Factor",
- "oldfieldname": "conversion_factor",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "current_stock",
- "fieldtype": "Float",
- "hidden": 1,
- "label": "Current Stock",
- "oldfieldname": "current_stock",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "reference_name",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Reference Name",
- "oldfieldname": "reference_name",
- "oldfieldtype": "Data",
- "read_only": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "bom_detail_no",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 1,
- "label": "BOM Detail No",
- "oldfieldname": "bom_detail_no",
- "oldfieldtype": "Data",
- "read_only": 1
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:42.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "main_item_code",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "main_item_code",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "rm_item_code",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Raw Material Item Code",
+ "oldfieldname": "rm_item_code",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_width": "300px",
+ "read_only": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "required_qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Required Qty",
+ "oldfieldname": "required_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "consumed_qty",
+ "fieldtype": "Float",
+ "label": "Consumed Qty",
+ "oldfieldname": "consumed_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "label": "Stock Uom",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "label": "Rate",
+ "oldfieldname": "rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "label": "Amount",
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "label": "Conversion Factor",
+ "oldfieldname": "conversion_factor",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "current_stock",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "label": "Current Stock",
+ "oldfieldname": "current_stock",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "reference_name",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Reference Name",
+ "oldfieldname": "reference_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "bom_detail_no",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 1,
+ "label": "BOM Detail No",
+ "oldfieldname": "bom_detail_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "hide_toolbar": 0,
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-13 11:29:35.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Purchase Receipt Item Supplied",
+ "owner": "wasim@webnotestech.com"
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/quality_inspection/quality_inspection.py b/erpnext/buying/doctype/quality_inspection/quality_inspection.py
index 4222d68..4e289dc 100644
--- a/erpnext/buying/doctype/quality_inspection/quality_inspection.py
+++ b/erpnext/buying/doctype/quality_inspection/quality_inspection.py
@@ -4,19 +4,17 @@
from __future__ import unicode_literals
import frappe
-from frappe.model.doc import addchild
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class QualityInspection(Document):
def get_item_specification_details(self):
- self.doclist = self.doc.clear_table(self.doclist, 'qa_specification_details')
+ self.set('qa_specification_details', [])
specification = frappe.db.sql("select specification, value from `tabItem Quality Inspection Parameter` \
where parent = '%s' order by idx" % (self.doc.item_code))
for d in specification:
- child = addchild(self.doc, 'qa_specification_details', 'Quality Inspection Reading', self.doclist)
+ child = self.doc.append('qa_specification_details', {})
child.specification = d[0]
child.value = d[1]
child.status = 'Accepted'
diff --git a/erpnext/buying/doctype/quality_inspection/quality_inspection.txt b/erpnext/buying/doctype/quality_inspection/quality_inspection.txt
index 899d3f8..fcd5439 100644
--- a/erpnext/buying/doctype/quality_inspection/quality_inspection.txt
+++ b/erpnext/buying/doctype/quality_inspection/quality_inspection.txt
@@ -1,247 +1,228 @@
-[
- {
- "creation": "2013-04-30 13:13:03",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:14",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "naming_series:",
- "doctype": "DocType",
- "icon": "icon-search",
- "is_submittable": 1,
- "module": "Buying",
- "name": "__common__",
- "search_fields": "item_code, report_date, purchase_receipt_no, delivery_note_no"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Quality Inspection",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Quality Inspection",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Quality Manager",
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Quality Inspection"
- },
- {
- "doctype": "DocField",
- "fieldname": "qa_inspection",
- "fieldtype": "Section Break",
- "label": "QA Inspection",
- "no_copy": 0,
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "options": "\nQAI/11-12/",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "inspection_type",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Inspection Type",
- "oldfieldname": "inspection_type",
- "oldfieldtype": "Select",
- "options": "\nIncoming\nOutgoing\nIn Process",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "report_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Report Date",
- "oldfieldname": "report_date",
- "oldfieldtype": "Date",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sample_size",
- "fieldtype": "Float",
- "in_filter": 0,
- "label": "Sample Size",
- "oldfieldname": "sample_size",
- "oldfieldtype": "Currency",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "in_filter": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "search_index": 0,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_serial_no",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Item Serial No",
- "oldfieldname": "item_serial_no",
- "oldfieldtype": "Link",
- "options": "Serial No",
- "print_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "batch_no",
- "fieldtype": "Link",
- "label": "Batch No",
- "oldfieldname": "batch_no",
- "oldfieldtype": "Link",
- "options": "Batch"
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_receipt_no",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Purchase Receipt No",
- "oldfieldname": "purchase_receipt_no",
- "oldfieldtype": "Link",
- "options": "Purchase Receipt",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "delivery_note_no",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Delivery Note No",
- "oldfieldname": "delivery_note_no",
- "oldfieldtype": "Link",
- "options": "Delivery Note",
- "print_hide": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "inspected_by",
- "fieldtype": "Data",
- "label": "Inspected By",
- "oldfieldname": "inspected_by",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "remarks",
- "fieldtype": "Text",
- "label": "Remarks",
- "no_copy": 1,
- "oldfieldname": "remarks",
- "oldfieldtype": "Text"
- },
- {
- "doctype": "DocField",
- "fieldname": "verified_by",
- "fieldtype": "Data",
- "label": "Verified By",
- "oldfieldname": "verified_by",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "specification_details",
- "fieldtype": "Section Break",
- "label": "Specification Details",
- "oldfieldtype": "Section Break",
- "options": "Simple"
- },
- {
- "doctype": "DocField",
- "fieldname": "get_specification_details",
- "fieldtype": "Button",
- "label": "Get Specification Details",
- "options": "get_item_specification_details"
- },
- {
- "doctype": "DocField",
- "fieldname": "qa_specification_details",
- "fieldtype": "Table",
- "label": "Quality Inspection Readings",
- "oldfieldname": "qa_specification_details",
- "oldfieldtype": "Table",
- "options": "Quality Inspection Reading"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "autoname": "naming_series:",
+ "creation": "2013-04-30 13:13:03.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "qa_inspection",
+ "fieldtype": "Section Break",
+ "label": "QA Inspection",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "options": "\nQAI/11-12/",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "inspection_type",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Inspection Type",
+ "oldfieldname": "inspection_type",
+ "oldfieldtype": "Select",
+ "options": "\nIncoming\nOutgoing\nIn Process",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "report_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Report Date",
+ "oldfieldname": "report_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "sample_size",
+ "fieldtype": "Float",
+ "in_filter": 0,
+ "label": "Sample Size",
+ "oldfieldname": "sample_size",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_filter": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "search_index": 0,
+ "width": "300px"
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "item_serial_no",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Item Serial No",
+ "oldfieldname": "item_serial_no",
+ "oldfieldtype": "Link",
+ "options": "Serial No",
+ "permlevel": 0,
+ "print_hide": 0
+ },
+ {
+ "fieldname": "batch_no",
+ "fieldtype": "Link",
+ "label": "Batch No",
+ "oldfieldname": "batch_no",
+ "oldfieldtype": "Link",
+ "options": "Batch",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "purchase_receipt_no",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Purchase Receipt No",
+ "oldfieldname": "purchase_receipt_no",
+ "oldfieldtype": "Link",
+ "options": "Purchase Receipt",
+ "permlevel": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "delivery_note_no",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Delivery Note No",
+ "oldfieldname": "delivery_note_no",
+ "oldfieldtype": "Link",
+ "options": "Delivery Note",
+ "permlevel": 0,
+ "print_hide": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "inspected_by",
+ "fieldtype": "Data",
+ "label": "Inspected By",
+ "oldfieldname": "inspected_by",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "remarks",
+ "fieldtype": "Text",
+ "label": "Remarks",
+ "no_copy": 1,
+ "oldfieldname": "remarks",
+ "oldfieldtype": "Text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "verified_by",
+ "fieldtype": "Data",
+ "label": "Verified By",
+ "oldfieldname": "verified_by",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "specification_details",
+ "fieldtype": "Section Break",
+ "label": "Specification Details",
+ "oldfieldtype": "Section Break",
+ "options": "Simple",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "get_specification_details",
+ "fieldtype": "Button",
+ "label": "Get Specification Details",
+ "options": "get_item_specification_details",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qa_specification_details",
+ "fieldtype": "Table",
+ "label": "Quality Inspection Readings",
+ "oldfieldname": "qa_specification_details",
+ "oldfieldtype": "Table",
+ "options": "Quality Inspection Reading",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-search",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-20 17:49:14.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Quality Inspection",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Quality Manager",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "search_fields": "item_code, report_date, purchase_receipt_no, delivery_note_no"
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.py b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.py
index 26c87f1..1e36103 100644
--- a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.py
+++ b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class QualityInspectionReading(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt
index f08e7cd..21712ef 100644
--- a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt
+++ b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt
@@ -1,141 +1,128 @@
-[
- {
- "creation": "2013-02-22 01:27:43",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:39",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "QASD/.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Buying",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Quality Inspection Reading",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Quality Inspection Reading"
- },
- {
- "doctype": "DocField",
- "fieldname": "specification",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Parameter",
- "oldfieldname": "specification",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "value",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Acceptance Criteria",
- "oldfieldname": "value",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "reading_1",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Reading 1",
- "oldfieldname": "reading_1",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "reading_2",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Reading 2",
- "oldfieldname": "reading_2",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "reading_3",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Reading 3",
- "oldfieldname": "reading_3",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "reading_4",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Reading 4",
- "oldfieldname": "reading_4",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "reading_5",
- "fieldtype": "Data",
- "label": "Reading 5",
- "oldfieldname": "reading_5",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "reading_6",
- "fieldtype": "Data",
- "label": "Reading 6",
- "oldfieldname": "reading_6",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "reading_7",
- "fieldtype": "Data",
- "label": "Reading 7",
- "oldfieldname": "reading_7",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "reading_8",
- "fieldtype": "Data",
- "label": "Reading 8",
- "oldfieldname": "reading_8",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "reading_9",
- "fieldtype": "Data",
- "label": "Reading 9",
- "oldfieldname": "reading_9",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "reading_10",
- "fieldtype": "Data",
- "label": "Reading 10",
- "oldfieldname": "reading_10",
- "oldfieldtype": "Data"
- },
- {
- "default": "Accepted",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "label": "Status",
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "Accepted\nRejected"
- }
-]
\ No newline at end of file
+{
+ "autoname": "QASD/.#####",
+ "creation": "2013-02-22 01:27:43.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "specification",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Parameter",
+ "oldfieldname": "specification",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "value",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Acceptance Criteria",
+ "oldfieldname": "value",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reading_1",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Reading 1",
+ "oldfieldname": "reading_1",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reading_2",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Reading 2",
+ "oldfieldname": "reading_2",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reading_3",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Reading 3",
+ "oldfieldname": "reading_3",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reading_4",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Reading 4",
+ "oldfieldname": "reading_4",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reading_5",
+ "fieldtype": "Data",
+ "label": "Reading 5",
+ "oldfieldname": "reading_5",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reading_6",
+ "fieldtype": "Data",
+ "label": "Reading 6",
+ "oldfieldname": "reading_6",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reading_7",
+ "fieldtype": "Data",
+ "label": "Reading 7",
+ "oldfieldname": "reading_7",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reading_8",
+ "fieldtype": "Data",
+ "label": "Reading 8",
+ "oldfieldname": "reading_8",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reading_9",
+ "fieldtype": "Data",
+ "label": "Reading 9",
+ "oldfieldname": "reading_9",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reading_10",
+ "fieldtype": "Data",
+ "label": "Reading 10",
+ "oldfieldname": "reading_10",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "default": "Accepted",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "label": "Status",
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "Accepted\nRejected",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:39.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Quality Inspection Reading",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js
index cfe526f..05288c3 100644
--- a/erpnext/buying/doctype/supplier/supplier.js
+++ b/erpnext/buying/doctype/supplier/supplier.js
@@ -17,7 +17,7 @@
cur_frm.cscript.make_contact(doc,dt,dn);
cur_frm.communication_view = new frappe.views.CommunicationList({
- list: frappe.model.get("Communication", {"supplier": doc.name}),
+ list: frappe.get_list("Communication", {"supplier": doc.name}),
parent: cur_frm.fields_dict.communication_html.wrapper,
doc: doc
})
diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py
index f937958..0102edc 100644
--- a/erpnext/buying/doctype/supplier/supplier.py
+++ b/erpnext/buying/doctype/supplier/supplier.py
@@ -7,15 +7,12 @@
from frappe.utils import cint
from frappe import msgprint, _
-from frappe.model.doc import make_autoname
+from frappe.model.naming import make_autoname
from erpnext.accounts.party import create_party_account
from erpnext.utilities.transaction_base import TransactionBase
-class DocType(TransactionBase):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class Supplier(TransactionBase):
def autoname(self):
supp_master_name = frappe.defaults.get_global_default('supp_master_name')
diff --git a/erpnext/buying/doctype/supplier/supplier.txt b/erpnext/buying/doctype/supplier/supplier.txt
index a5d100f..e43c628 100644
--- a/erpnext/buying/doctype/supplier/supplier.txt
+++ b/erpnext/buying/doctype/supplier/supplier.txt
@@ -1,234 +1,222 @@
-[
- {
- "creation": "2013-01-10 16:34:11",
- "docstatus": 0,
- "modified": "2014-01-28 19:05:55",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "naming_series:",
- "description": "Supplier of Goods or Services.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-user",
- "module": "Buying",
- "name": "__common__",
- "search_fields": "supplier_name,supplier_type"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Supplier",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Supplier",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Supplier"
- },
- {
- "doctype": "DocField",
- "fieldname": "basic_info",
- "fieldtype": "Section Break",
- "label": "Basic Info",
- "oldfieldtype": "Section Break",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "\nSUPP\nSUPP/10-11/"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Supplier Name",
- "no_copy": 1,
- "oldfieldname": "supplier_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_type",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Supplier Type",
- "oldfieldname": "supplier_type",
- "oldfieldtype": "Link",
- "options": "Supplier Type",
- "reqd": 1
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "address_contacts",
- "fieldtype": "Section Break",
- "label": "Address & Contacts",
- "oldfieldtype": "Column Break",
- "options": "icon-map-marker"
- },
- {
- "doctype": "DocField",
- "fieldname": "address_html",
- "fieldtype": "HTML",
- "label": "Address HTML",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_html",
- "fieldtype": "HTML",
- "label": "Contact HTML",
- "read_only": 1
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "communication_history",
- "fieldtype": "Section Break",
- "label": "Communication History",
- "options": "icon-comments",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "communication_html",
- "fieldtype": "HTML",
- "label": "Communication HTML",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text"
- },
- {
- "description": "Enter the company name under which Account Head will be created for this Supplier",
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "default_currency",
- "fieldtype": "Link",
- "label": "Default Currency",
- "no_copy": 1,
- "options": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "default_price_list",
- "fieldtype": "Link",
- "label": "Price List",
- "options": "Price List"
- },
- {
- "doctype": "DocField",
- "fieldname": "default_taxes_and_charges",
- "fieldtype": "Link",
- "label": "Taxes and Charges",
- "options": "Purchase Taxes and Charges Master"
- },
- {
- "doctype": "DocField",
- "fieldname": "credit_days",
- "fieldtype": "Int",
- "label": "Credit Days"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "website",
- "fieldtype": "Data",
- "label": "Website",
- "oldfieldname": "website",
- "oldfieldtype": "Data"
- },
- {
- "description": "Statutory info and other general information about your Supplier",
- "doctype": "DocField",
- "fieldname": "supplier_details",
- "fieldtype": "Text",
- "label": "Supplier Details",
- "oldfieldname": "supplier_details",
- "oldfieldtype": "Code"
- },
- {
- "doctype": "DocField",
- "fieldname": "communications",
- "fieldtype": "Table",
- "hidden": 1,
- "label": "Communications",
- "options": "Communication",
- "print_hide": 1
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Purchase Manager",
- "write": 0
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Purchase Master Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-01-10 16:34:11.000000",
+ "description": "Supplier of Goods or Services.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "basic_info",
+ "fieldtype": "Section Break",
+ "label": "Basic Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "\nSUPP\nSUPP/10-11/",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "supplier_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Supplier Name",
+ "no_copy": 1,
+ "oldfieldname": "supplier_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "supplier_type",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Supplier Type",
+ "oldfieldname": "supplier_type",
+ "oldfieldtype": "Link",
+ "options": "Supplier Type",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "address_contacts",
+ "fieldtype": "Section Break",
+ "label": "Address & Contacts",
+ "oldfieldtype": "Column Break",
+ "options": "icon-map-marker",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "address_html",
+ "fieldtype": "HTML",
+ "label": "Address HTML",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "contact_html",
+ "fieldtype": "HTML",
+ "label": "Contact HTML",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "communication_history",
+ "fieldtype": "Section Break",
+ "label": "Communication History",
+ "options": "icon-comments",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "communication_html",
+ "fieldtype": "HTML",
+ "label": "Communication HTML",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0
+ },
+ {
+ "description": "Enter the company name under which Account Head will be created for this Supplier",
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "default_currency",
+ "fieldtype": "Link",
+ "label": "Default Currency",
+ "no_copy": 1,
+ "options": "Currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "default_price_list",
+ "fieldtype": "Link",
+ "label": "Price List",
+ "options": "Price List",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "default_taxes_and_charges",
+ "fieldtype": "Link",
+ "label": "Taxes and Charges",
+ "options": "Purchase Taxes and Charges Master",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "credit_days",
+ "fieldtype": "Int",
+ "label": "Credit Days",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "website",
+ "fieldtype": "Data",
+ "label": "Website",
+ "oldfieldname": "website",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "description": "Statutory info and other general information about your Supplier",
+ "fieldname": "supplier_details",
+ "fieldtype": "Text",
+ "label": "Supplier Details",
+ "oldfieldname": "supplier_details",
+ "oldfieldtype": "Code",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "icon": "icon-user",
+ "idx": 1,
+ "modified": "2014-01-28 19:05:55.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Supplier",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Manager",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Master Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "search_fields": "supplier_name,supplier_type"
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py
index f6a3ffc..edebfb3 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py
@@ -6,7 +6,7 @@
from frappe.model.code import get_obj
from erpnext.controllers.buying_controller import BuyingController
-class DocType(BuyingController):
+class SupplierQuotation(BuyingController):
def __init__(self, doc, doclist=None):
self.doc, self.doclist = doc, doclist or []
self.tname, self.fname = "Supplier Quotation Item", "quotation_items"
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt
index 0a4a3ec..ba098c0 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt
@@ -1,647 +1,644 @@
-[
- {
- "creation": "2013-05-21 16:16:45",
- "docstatus": 0,
- "modified": "2014-01-29 15:25:52",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "document_type": "Transaction",
- "icon": "icon-shopping-cart",
- "is_submittable": 1,
- "module": "Buying",
- "name": "__common__",
- "read_only_onload": 1,
- "search_fields": "status, transaction_date, supplier,grand_total"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Supplier Quotation",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Supplier Quotation",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Supplier Quotation"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_section",
- "fieldtype": "Section Break",
- "label": "Supplier",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "SQTN",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "description": "Supplier (vendor) name as entered in supplier master",
- "doctype": "DocField",
- "fieldname": "supplier",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Supplier",
- "oldfieldname": "supplier",
- "oldfieldtype": "Link",
- "options": "Supplier",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Name",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Address",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_mobile",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Mobile No",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_email",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Contact Email",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 0,
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "transaction_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Quotation Date",
- "oldfieldname": "transaction_date",
- "oldfieldtype": "Date",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0
- },
- {
- "description": "Select the relevant company name if you have multiple companies",
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "no_copy": 0,
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "currency_price_list",
- "fieldtype": "Section Break",
- "label": "Currency and Price List",
- "options": "icon-tag"
- },
- {
- "doctype": "DocField",
- "fieldname": "currency",
- "fieldtype": "Link",
- "label": "Currency",
- "no_copy": 0,
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "description": "Rate at which supplier's currency is converted to company's base currency",
- "doctype": "DocField",
- "fieldname": "conversion_rate",
- "fieldtype": "Float",
- "hidden": 0,
- "label": "Exchange Rate",
- "no_copy": 1,
- "oldfieldname": "conversion_rate",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cb_price_list",
- "fieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "buying_price_list",
- "fieldtype": "Link",
- "label": "Price List",
- "options": "Price List",
- "print_hide": 1
- },
- {
- "depends_on": "buying_price_list",
- "doctype": "DocField",
- "fieldname": "price_list_currency",
- "fieldtype": "Link",
- "label": "Price List Currency",
- "options": "Currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "depends_on": "buying_price_list",
- "doctype": "DocField",
- "fieldname": "plc_conversion_rate",
- "fieldtype": "Float",
- "label": "Price List Exchange Rate",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "items",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart"
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "quotation_items",
- "fieldtype": "Table",
- "label": "Quotation Items",
- "no_copy": 0,
- "oldfieldname": "po_details",
- "oldfieldtype": "Table",
- "options": "Supplier Quotation Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_22",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total_import",
- "fieldtype": "Currency",
- "label": "Net Total",
- "no_copy": 0,
- "oldfieldname": "net_total_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_24",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "label": "Net Total (Company Currency)",
- "no_copy": 1,
- "oldfieldname": "net_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "taxes",
- "fieldtype": "Section Break",
- "label": "Taxes and Charges",
- "oldfieldtype": "Section Break",
- "options": "icon-money"
- },
- {
- "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.",
- "doctype": "DocField",
- "fieldname": "taxes_and_charges",
- "fieldtype": "Link",
- "label": "Taxes and Charges",
- "no_copy": 1,
- "oldfieldname": "purchase_other_charges",
- "oldfieldtype": "Link",
- "options": "Purchase Taxes and Charges Master",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges",
- "fieldtype": "Table",
- "label": "Purchase Taxes and Charges",
- "no_copy": 0,
- "oldfieldname": "purchase_tax_details",
- "oldfieldtype": "Table",
- "options": "Purchase Taxes and Charges"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_calculation",
- "fieldtype": "HTML",
- "label": "Taxes and Charges Calculation",
- "no_copy": 1,
- "oldfieldtype": "HTML",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "label": "Totals",
- "oldfieldtype": "Section Break",
- "options": "icon-money"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_added_import",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Added",
- "no_copy": 0,
- "oldfieldname": "other_charges_added_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_deducted_import",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Deducted",
- "no_copy": 0,
- "oldfieldname": "other_charges_deducted_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total_import",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Grand Total",
- "no_copy": 0,
- "oldfieldname": "grand_total_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "in_words_import",
- "fieldtype": "Data",
- "label": "In Words",
- "oldfieldname": "in_words_import",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break4",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_added",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Added (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "other_charges_added",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_deducted",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Deducted (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "other_charges_deducted",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_tax",
- "fieldtype": "Currency",
- "label": "Total Tax (Company Currency)",
- "no_copy": 1,
- "oldfieldname": "total_tax",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total",
- "fieldtype": "Currency",
- "label": "Grand Total (Company Currency)",
- "no_copy": 1,
- "oldfieldname": "grand_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rounded_total",
- "fieldtype": "Currency",
- "label": "Rounded Total (Company Currency)",
- "oldfieldname": "rounded_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "description": "In Words will be visible once you save the Purchase Order.",
- "doctype": "DocField",
- "fieldname": "in_words",
- "fieldtype": "Data",
- "label": "In Words (Company Currency)",
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "icon-legal"
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "letter_head",
- "fieldtype": "Select",
- "label": "Letter Head",
- "oldfieldname": "letter_head",
- "oldfieldtype": "Select",
- "options": "link:Letter Head",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "tc_name",
- "fieldtype": "Link",
- "label": "Terms",
- "oldfieldname": "tc_name",
- "oldfieldtype": "Link",
- "options": "Terms and Conditions",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "get_terms",
- "fieldtype": "Button",
- "label": "Get Terms and Conditions",
- "oldfieldtype": "Button"
- },
- {
- "doctype": "DocField",
- "fieldname": "terms",
- "fieldtype": "Text Editor",
- "label": "Terms and Conditions",
- "oldfieldname": "terms",
- "oldfieldtype": "Text Editor"
- },
- {
- "depends_on": "supplier",
- "doctype": "DocField",
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "label": "Contact Info",
- "options": "icon-bullhorn"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_address",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Supplier Address",
- "options": "Address",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Contact Person",
- "options": "Contact",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text"
- },
- {
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nDraft\nSubmitted\nStopped\nCancelled",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "default": "No",
- "doctype": "DocField",
- "fieldname": "is_subcontracted",
- "fieldtype": "Select",
- "label": "Is Subcontracted",
- "options": "\nYes\nNo",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_57",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "no_copy": 0,
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "label": "Print Heading",
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Manufacturing Manager",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Purchase Manager",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Purchase User",
- "submit": 0,
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Material User",
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Supplier",
- "submit": 0,
- "write": 0
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-05-21 16:16:45.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "fieldname": "supplier_section",
+ "fieldtype": "Section Break",
+ "label": "Supplier",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "SQTN",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "description": "Supplier (vendor) name as entered in supplier master",
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Supplier",
+ "oldfieldname": "supplier",
+ "oldfieldtype": "Link",
+ "options": "Supplier",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "supplier_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Address",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_mobile",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Mobile No",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_email",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Contact Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Quotation Date",
+ "oldfieldname": "transaction_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0
+ },
+ {
+ "description": "Select the relevant company name if you have multiple companies",
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "no_copy": 0,
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "currency_price_list",
+ "fieldtype": "Section Break",
+ "label": "Currency and Price List",
+ "options": "icon-tag",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "label": "Currency",
+ "no_copy": 0,
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "description": "Rate at which supplier's currency is converted to company's base currency",
+ "fieldname": "conversion_rate",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "label": "Exchange Rate",
+ "no_copy": 1,
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "cb_price_list",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "buying_price_list",
+ "fieldtype": "Link",
+ "label": "Price List",
+ "options": "Price List",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "depends_on": "buying_price_list",
+ "fieldname": "price_list_currency",
+ "fieldtype": "Link",
+ "label": "Price List Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "depends_on": "buying_price_list",
+ "fieldname": "plc_conversion_rate",
+ "fieldtype": "Float",
+ "label": "Price List Exchange Rate",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "items",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "quotation_items",
+ "fieldtype": "Table",
+ "label": "Quotation Items",
+ "no_copy": 0,
+ "oldfieldname": "po_details",
+ "oldfieldtype": "Table",
+ "options": "Supplier Quotation Item",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "section_break_22",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total_import",
+ "fieldtype": "Currency",
+ "label": "Net Total",
+ "no_copy": 0,
+ "oldfieldname": "net_total_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_24",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "label": "Net Total (Company Currency)",
+ "no_copy": 1,
+ "oldfieldname": "net_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "taxes",
+ "fieldtype": "Section Break",
+ "label": "Taxes and Charges",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0
+ },
+ {
+ "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.",
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "label": "Taxes and Charges",
+ "no_copy": 1,
+ "oldfieldname": "purchase_other_charges",
+ "oldfieldtype": "Link",
+ "options": "Purchase Taxes and Charges Master",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "other_charges",
+ "fieldtype": "Table",
+ "label": "Purchase Taxes and Charges",
+ "no_copy": 0,
+ "oldfieldname": "purchase_tax_details",
+ "oldfieldtype": "Table",
+ "options": "Purchase Taxes and Charges",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_calculation",
+ "fieldtype": "HTML",
+ "label": "Taxes and Charges Calculation",
+ "no_copy": 1,
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "label": "Totals",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_added_import",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Added",
+ "no_copy": 0,
+ "oldfieldname": "other_charges_added_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "other_charges_deducted_import",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Deducted",
+ "no_copy": 0,
+ "oldfieldname": "other_charges_deducted_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "grand_total_import",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Grand Total",
+ "no_copy": 0,
+ "oldfieldname": "grand_total_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "in_words_import",
+ "fieldtype": "Data",
+ "label": "In Words",
+ "oldfieldname": "in_words_import",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0
+ },
+ {
+ "fieldname": "other_charges_added",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Added (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "other_charges_added",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "other_charges_deducted",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Deducted (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "other_charges_deducted",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "total_tax",
+ "fieldtype": "Currency",
+ "label": "Total Tax (Company Currency)",
+ "no_copy": 1,
+ "oldfieldname": "total_tax",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "label": "Grand Total (Company Currency)",
+ "no_copy": 1,
+ "oldfieldname": "grand_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "rounded_total",
+ "fieldtype": "Currency",
+ "label": "Rounded Total (Company Currency)",
+ "oldfieldname": "rounded_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "description": "In Words will be visible once you save the Purchase Order.",
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "label": "In Words (Company Currency)",
+ "oldfieldname": "in_words",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "label": "Terms and Conditions",
+ "oldfieldtype": "Section Break",
+ "options": "icon-legal",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "letter_head",
+ "fieldtype": "Select",
+ "label": "Letter Head",
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "link:Letter Head",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "label": "Terms",
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "get_terms",
+ "fieldtype": "Button",
+ "label": "Get Terms and Conditions",
+ "oldfieldtype": "Button",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "label": "Terms and Conditions",
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "supplier",
+ "fieldname": "contact_section",
+ "fieldtype": "Section Break",
+ "label": "Contact Info",
+ "options": "icon-bullhorn",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "supplier_address",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Supplier Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Contact Person",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nDraft\nSubmitted\nStopped\nCancelled",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "default": "No",
+ "fieldname": "is_subcontracted",
+ "fieldtype": "Select",
+ "label": "Is Subcontracted",
+ "options": "\nYes\nNo",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "column_break_57",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "no_copy": 0,
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "label": "Print Heading",
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ }
+ ],
+ "icon": "icon-shopping-cart",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-29 15:25:52.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Supplier Quotation",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Manufacturing Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Supplier",
+ "submit": 0,
+ "write": 0
+ }
+ ],
+ "read_only_onload": 1,
+ "search_fields": "status, transaction_date, supplier,grand_total"
+}
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py
index 26c87f1..16e6e12 100644
--- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py
+++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SupplierQuotationItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
index 18b9216..11cb9d9 100644
--- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
+++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt
@@ -1,375 +1,362 @@
-[
- {
- "creation": "2013-05-22 12:43:10",
- "docstatus": 0,
- "modified": "2014-02-28 11:25:38",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "SQI-.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Buying",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Supplier Quotation Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Supplier Quotation Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "print_hide": 0,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "description": "If Supplier Part Number exists for given Item, it gets stored here",
- "doctype": "DocField",
- "fieldname": "supplier_part_no",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Supplier Part Number",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "print_width": "300px",
- "read_only": 0,
- "reqd": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "quantity_and_rate",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Quantity and Rate"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Quantity",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "print_width": "60px",
- "read_only": 0,
- "reqd": 1,
- "width": "60px"
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate",
- "options": "currency",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "discount_percentage",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Discount %",
- "print_hide": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "UOM",
- "oldfieldname": "uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "print_hide": 0,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate (Company Currency)",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sec_break1",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Currency",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Rate ",
- "oldfieldname": "import_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "import_amount",
- "oldfieldtype": "Currency",
- "options": "currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Rate (Company Currency)",
- "oldfieldname": "purchase_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_amount",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Amount (Company Currency)",
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_price",
- "fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse_and_reference",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Warehouse and Reference"
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "hidden": 0,
- "in_list_view": 0,
- "label": "Warehouse",
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "project_name",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Project Name",
- "options": "Project",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_doctype",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Prevdoc DocType",
- "no_copy": 1,
- "oldfieldname": "prevdoc_doctype",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_docname",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Material Request No",
- "no_copy": 1,
- "oldfieldname": "prevdoc_docname",
- "oldfieldtype": "Link",
- "options": "Material Request",
- "print_hide": 1,
- "print_width": "120px",
- "read_only": 1,
- "search_index": 1,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break4",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_detail_docname",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Material Request Detail No",
- "no_copy": 1,
- "oldfieldname": "prevdoc_detail_docname",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Link",
- "hidden": 0,
- "in_list_view": 0,
- "label": "Brand",
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Item Group",
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 0
- },
- {
- "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges",
- "doctype": "DocField",
- "fieldname": "item_tax_rate",
- "fieldtype": "Small Text",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Item Tax Rate",
- "oldfieldname": "item_tax_rate",
- "oldfieldtype": "Small Text",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "page_break",
- "fieldtype": "Check",
- "hidden": 0,
- "in_list_view": 0,
- "label": "Page Break",
- "no_copy": 1,
- "oldfieldname": "page_break",
- "oldfieldtype": "Check",
- "print_hide": 1,
- "read_only": 0
- }
-]
\ No newline at end of file
+{
+ "autoname": "SQI-.#####",
+ "creation": "2013-05-22 12:43:10.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "description": "If Supplier Part Number exists for given Item, it gets stored here",
+ "fieldname": "supplier_part_no",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Supplier Part Number",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Quantity and Rate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Quantity",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "60px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "60px"
+ },
+ {
+ "fieldname": "price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "discount_percentage",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Discount %",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "oldfieldname": "uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "base_price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate (Company Currency)",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "sec_break1",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Rate ",
+ "oldfieldname": "import_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "import_amount",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "base_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Rate (Company Currency)",
+ "oldfieldname": "purchase_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "base_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Amount (Company Currency)",
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "warehouse_and_reference",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Warehouse and Reference",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_list_view": 0,
+ "label": "Warehouse",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Project Name",
+ "options": "Project",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "prevdoc_doctype",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Prevdoc DocType",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_doctype",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "prevdoc_docname",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Material Request No",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_docname",
+ "oldfieldtype": "Link",
+ "options": "Material Request",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "120px",
+ "read_only": 1,
+ "search_index": 1,
+ "width": "120px"
+ },
+ {
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "prevdoc_detail_docname",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Material Request Detail No",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_detail_docname",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_list_view": 0,
+ "label": "Brand",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Item Group",
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges",
+ "fieldname": "item_tax_rate",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Item Tax Rate",
+ "oldfieldname": "item_tax_rate",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "in_list_view": 0,
+ "label": "Page Break",
+ "no_copy": 1,
+ "oldfieldname": "page_break",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-28 11:25:38.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Supplier Quotation Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/buying/page/purchase_analytics/purchase_analytics.txt b/erpnext/buying/page/purchase_analytics/purchase_analytics.txt
index 34ba8e1..407d888 100644
--- a/erpnext/buying/page/purchase_analytics/purchase_analytics.txt
+++ b/erpnext/buying/page/purchase_analytics/purchase_analytics.txt
@@ -1,37 +1,23 @@
-[
- {
- "creation": "2012-09-21 20:15:16",
- "docstatus": 0,
- "modified": "2013-07-11 14:43:52",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-bar-chart",
- "module": "Buying",
- "name": "__common__",
- "page_name": "purchase-analytics",
- "standard": "Yes",
- "title": "Purchase Analytics"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "purchase-analytics",
- "parentfield": "roles",
- "parenttype": "Page"
- },
- {
- "doctype": "Page",
- "name": "purchase-analytics"
- },
- {
- "doctype": "Page Role",
- "role": "Analytics"
- },
- {
- "doctype": "Page Role",
- "role": "Purchase Manager"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-09-21 20:15:16.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-bar-chart",
+ "idx": 1,
+ "modified": "2013-07-11 14:43:52.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "purchase-analytics",
+ "owner": "Administrator",
+ "page_name": "purchase-analytics",
+ "roles": [
+ {
+ "role": "Analytics"
+ },
+ {
+ "role": "Purchase Manager"
+ }
+ ],
+ "standard": "Yes",
+ "title": "Purchase Analytics"
+}
\ No newline at end of file
diff --git a/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.txt b/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.txt
index 1995990..b15a571 100644
--- a/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.txt
+++ b/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.txt
@@ -1,24 +1,17 @@
-[
- {
- "creation": "2013-05-03 14:55:53",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Buying",
- "name": "__common__",
- "query": "select\n po_item.item_code as \"Item Code:Link/Item:120\",\n\tpo_item.item_name as \"Item Name::120\",\n\tpo_item.description as \"Description::150\",\n\tpo_item.qty as \"Qty:Float:100\",\n\tpo_item.stock_uom as \"UOM:Link/UOM:80\",\n\tpo_item.base_rate as \"Rate:Currency:120\",\n\tpo_item.base_amount as \"Amount:Currency:120\",\n\tpo.name as \"Purchase Order:Link/Purchase Order:120\",\n\tpo.transaction_date as \"Transaction Date:Date:140\",\n\tpo.supplier as \"Supplier:Link/Supplier:130\",\n\tpo_item.project_name as \"Project:Link/Project:130\",\n\tifnull(po_item.received_qty, 0) as \"Received Qty:Float:120\"\nfrom\n\t`tabPurchase Order` po, `tabPurchase Order Item` po_item\nwhere\n\tpo.name = po_item.parent and po.docstatus = 1\norder by po.name desc",
- "ref_doctype": "Purchase Order",
- "report_name": "Item-wise Purchase History",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Item-wise Purchase History"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-05-03 14:55:53.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Item-wise Purchase History",
+ "owner": "Administrator",
+ "query": "select\n po_item.item_code as \"Item Code:Link/Item:120\",\n\tpo_item.item_name as \"Item Name::120\",\n\tpo_item.description as \"Description::150\",\n\tpo_item.qty as \"Qty:Float:100\",\n\tpo_item.stock_uom as \"UOM:Link/UOM:80\",\n\tpo_item.base_rate as \"Rate:Currency:120\",\n\tpo_item.base_amount as \"Amount:Currency:120\",\n\tpo.name as \"Purchase Order:Link/Purchase Order:120\",\n\tpo.transaction_date as \"Transaction Date:Date:140\",\n\tpo.supplier as \"Supplier:Link/Supplier:130\",\n\tpo_item.project_name as \"Project:Link/Project:130\",\n\tifnull(po_item.received_qty, 0) as \"Received Qty:Float:120\"\nfrom\n\t`tabPurchase Order` po, `tabPurchase Order Item` po_item\nwhere\n\tpo.name = po_item.parent and po.docstatus = 1\norder by po.name desc",
+ "ref_doctype": "Purchase Order",
+ "report_name": "Item-wise Purchase History",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt
index 683279f..e33c657 100644
--- a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt
+++ b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-13 18:45:01",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Buying",
- "name": "__common__",
- "ref_doctype": "Purchase Order",
- "report_name": "Purchase Order Trends",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Purchase Order Trends"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-13 18:45:01.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Purchase Order Trends",
+ "owner": "Administrator",
+ "ref_doctype": "Purchase Order",
+ "report_name": "Purchase Order Trends",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.txt b/erpnext/buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.txt
index c3e91ae..76dec76 100644
--- a/erpnext/buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.txt
+++ b/erpnext/buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.txt
@@ -1,24 +1,17 @@
-[
- {
- "creation": "2013-05-13 16:10:02",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Buying",
- "name": "__common__",
- "query": "select \n mr.name as \"Material Request:Link/Material Request:120\",\n\tmr.transaction_date as \"Date:Date:100\",\n\tmr_item.item_code as \"Item Code:Link/Item:120\",\n\tsum(ifnull(mr_item.qty, 0)) as \"Qty:Float:100\",\n\tsum(ifnull(mr_item.ordered_qty, 0)) as \"Ordered Qty:Float:100\", \n\t(sum(mr_item.qty) - sum(ifnull(mr_item.ordered_qty, 0))) as \"Qty to Order:Float:100\",\n\tmr_item.item_name as \"Item Name::150\",\n\tmr_item.description as \"Description::200\"\nfrom\n\t`tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n\tmr_item.parent = mr.name\n\tand mr.material_request_type = \"Purchase\"\n\tand mr.docstatus = 1\n\tand mr.status != \"Stopped\"\ngroup by mr.name, mr_item.item_code\nhaving\n\tsum(ifnull(mr_item.ordered_qty, 0)) < sum(ifnull(mr_item.qty, 0))\norder by mr.transaction_date asc",
- "ref_doctype": "Purchase Order",
- "report_name": "Requested Items To Be Ordered",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Requested Items To Be Ordered"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-05-13 16:10:02.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Requested Items To Be Ordered",
+ "owner": "Administrator",
+ "query": "select \n mr.name as \"Material Request:Link/Material Request:120\",\n\tmr.transaction_date as \"Date:Date:100\",\n\tmr_item.item_code as \"Item Code:Link/Item:120\",\n\tsum(ifnull(mr_item.qty, 0)) as \"Qty:Float:100\",\n\tsum(ifnull(mr_item.ordered_qty, 0)) as \"Ordered Qty:Float:100\", \n\t(sum(mr_item.qty) - sum(ifnull(mr_item.ordered_qty, 0))) as \"Qty to Order:Float:100\",\n\tmr_item.item_name as \"Item Name::150\",\n\tmr_item.description as \"Description::200\"\nfrom\n\t`tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n\tmr_item.parent = mr.name\n\tand mr.material_request_type = \"Purchase\"\n\tand mr.docstatus = 1\n\tand mr.status != \"Stopped\"\ngroup by mr.name, mr_item.item_code\nhaving\n\tsum(ifnull(mr_item.ordered_qty, 0)) < sum(ifnull(mr_item.qty, 0))\norder by mr.transaction_date asc",
+ "ref_doctype": "Purchase Order",
+ "report_name": "Requested Items To Be Ordered",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.txt b/erpnext/buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.txt
index 25c11e7..69c9d8f 100644
--- a/erpnext/buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.txt
+++ b/erpnext/buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-10-09 10:38:40",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Buying",
- "name": "__common__",
- "query": "SELECT\n `tabSupplier`.name as \"Supplier:Link/Supplier:120\",\n\t`tabSupplier`.supplier_name as \"Supplier Name::120\",\n\t`tabSupplier`.supplier_type as \"Supplier Type:Link/Supplier Type:120\",\n\tconcat_ws(', ', \n\t\ttrim(',' from `tabAddress`.address_line1), \n\t\ttrim(',' from tabAddress.address_line2), \n\t\ttabAddress.state, tabAddress.pincode, tabAddress.country\n\t) as 'Address::180',\n concat_ws(', ', `tabContact`.first_name, `tabContact`.last_name) as 'Contact Name::180',\n\t`tabContact`.phone as \"Phone\",\n\t`tabContact`.mobile_no as \"Mobile No\",\n\t`tabContact`.email_id as \"Email Id::120\",\n\t`tabContact`.is_primary_contact as \"Is Primary Contact::120\"\nFROM\n\t`tabSupplier`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.supplier=`tabSupplier`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.supplier=`tabSupplier`.name\n\t)\nWHERE\n\t`tabSupplier`.docstatus<2\nORDER BY\n\t`tabSupplier`.name asc",
- "ref_doctype": "Supplier",
- "report_name": "Supplier Addresses and Contacts",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Supplier Addresses and Contacts"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-10-09 10:38:40.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Buying",
+ "name": "Supplier Addresses and Contacts",
+ "owner": "Administrator",
+ "query": "SELECT\n `tabSupplier`.name as \"Supplier:Link/Supplier:120\",\n\t`tabSupplier`.supplier_name as \"Supplier Name::120\",\n\t`tabSupplier`.supplier_type as \"Supplier Type:Link/Supplier Type:120\",\n\tconcat_ws(', ', \n\t\ttrim(',' from `tabAddress`.address_line1), \n\t\ttrim(',' from tabAddress.address_line2), \n\t\ttabAddress.state, tabAddress.pincode, tabAddress.country\n\t) as 'Address::180',\n concat_ws(', ', `tabContact`.first_name, `tabContact`.last_name) as 'Contact Name::180',\n\t`tabContact`.phone as \"Phone\",\n\t`tabContact`.mobile_no as \"Mobile No\",\n\t`tabContact`.email_id as \"Email Id::120\",\n\t`tabContact`.is_primary_contact as \"Is Primary Contact::120\"\nFROM\n\t`tabSupplier`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.supplier=`tabSupplier`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.supplier=`tabSupplier`.name\n\t)\nWHERE\n\t`tabSupplier`.docstatus<2\nORDER BY\n\t`tabSupplier`.name asc",
+ "ref_doctype": "Supplier",
+ "report_name": "Supplier Addresses and Contacts",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py
index 7ad5d86..3eac80f 100644
--- a/erpnext/controllers/accounts_controller.py
+++ b/erpnext/controllers/accounts_controller.py
@@ -87,7 +87,7 @@
def set_missing_item_details(self):
"""set missing item values"""
from erpnext.stock.get_item_details import get_item_details
- for item in self.doclist.get({"parentfield": self.fname}):
+ for item in self.get(self.fname):
if item.fields.get("item_code"):
args = item.fields.copy()
args.update(self.doc.fields)
@@ -103,7 +103,7 @@
tax_master_doctype = self.meta.get_field(tax_master_field).options
- if not self.doclist.get({"parentfield": tax_parentfield}):
+ if not self.get(tax_parentfield):
if not self.doc.fields.get(tax_master_field):
# get the default tax master
self.doc.fields[tax_master_field] = \
@@ -121,20 +121,14 @@
from frappe.model import default_fields
tax_master = frappe.bean(tax_master_doctype, self.doc.fields.get(tax_master_field))
- for i, tax in enumerate(tax_master.doclist.get({"parentfield": tax_parentfield})):
+ for i, tax in enumerate(tax_master.get(tax_parentfield)):
for fieldname in default_fields:
- tax.fields[fieldname] = None
-
- tax.fields.update({
- "doctype": tax_doctype,
- "parentfield": tax_parentfield,
- "idx": i+1
- })
-
- self.doclist.append(tax)
+ tax.set(fieldname, None)
+
+ self.append(tax_parentfield, tax)
def get_other_charges(self):
- self.doclist = self.doc.clear_table(self.doclist, "other_charges")
+ self.set("other_charges", [])
self.set_taxes("other_charges", "taxes_and_charges")
def calculate_taxes_and_totals(self):
@@ -156,8 +150,8 @@
self.meta.get_label("conversion_rate"), self.doc.company)
self.doc.conversion_rate = flt(self.doc.conversion_rate)
- self.item_doclist = self.doclist.get({"parentfield": self.fname})
- self.tax_doclist = self.doclist.get({"parentfield": self.other_fname})
+ self.item_doclist = self.get(self.fname)
+ self.tax_doclist = self.get(self.other_fname)
self.calculate_item_values()
self.initialize_taxes()
@@ -368,7 +362,7 @@
def calculate_total_advance(self, parenttype, advance_parentfield):
if self.doc.doctype == parenttype and self.doc.docstatus < 2:
sum_of_allocated_amount = sum([flt(adv.allocated_amount, self.precision("allocated_amount", adv))
- for adv in self.doclist.get({"parentfield": advance_parentfield})])
+ for adv in self.get(advance_parentfield)])
self.doc.total_advance = flt(sum_of_allocated_amount, self.precision("total_advance"))
@@ -408,11 +402,10 @@
and t1.docstatus = 1 order by t1.posting_date""" %
(dr_or_cr, '%s'), account_head, as_dict=1)
- self.doclist = self.doc.clear_table(self.doclist, parentfield)
+ self.set(parentfield, [])
for d in res:
- self.doclist.append({
+ self.append(parentfield, {
"doctype": child_doctype,
- "parentfield": parentfield,
"journal_voucher": d.jv_no,
"jv_detail_no": d.jv_detail_no,
"remarks": d.remark,
@@ -425,7 +418,7 @@
item_tolerance = {}
global_tolerance = None
- for item in self.doclist.get({"parentfield": "entries"}):
+ for item in self.get("entries"):
if item.fields.get(item_ref_dn):
ref_amt = flt(frappe.db.get_value(ref_dt + " Item",
item.fields[item_ref_dn], based_on), self.precision(based_on, item))
@@ -467,7 +460,7 @@
def get_stock_items(self):
stock_items = []
item_codes = list(set(item.item_code for item in
- self.doclist.get({"parentfield": self.fname})))
+ self.get(self.fname)))
if item_codes:
stock_items = [r[0] for r in frappe.db.sql("""select name
from `tabItem` where name in (%s) and is_stock_item='Yes'""" % \
diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py
index 4ca6c19..6392e58 100644
--- a/erpnext/controllers/buying_controller.py
+++ b/erpnext/controllers/buying_controller.py
@@ -58,7 +58,7 @@
def validate_stock_or_nonstock_items(self):
if not self.get_stock_items():
tax_for_valuation = [d.account_head for d in
- self.doclist.get({"parentfield": "other_charges"})
+ self.get("other_charges")
if d.category in ["Valuation", "Valuation and Total"]]
if tax_for_valuation:
frappe.msgprint(_("""Tax Category can not be 'Valuation' or 'Valuation and Total' as all items are non-stock items"""), raise_exception=1)
@@ -171,19 +171,19 @@
stock_items_qty, stock_items_amount = 0, 0
last_stock_item_idx = 1
- for d in self.doclist.get({"parentfield": parentfield}):
+ for d in self.get(parentfield):
if d.item_code and d.item_code in stock_items:
stock_items_qty += flt(d.qty)
stock_items_amount += flt(d.base_amount)
last_stock_item_idx = d.idx
total_valuation_amount = sum([flt(d.tax_amount) for d in
- self.doclist.get({"parentfield": "other_charges"})
+ self.get("other_charges")
if d.category in ["Valuation", "Valuation and Total"]])
valuation_amount_adjustment = total_valuation_amount
- for i, item in enumerate(self.doclist.get({"parentfield": parentfield})):
+ for i, item in enumerate(self.get(parentfield)):
if item.item_code and item.qty and item.item_code in stock_items:
item_proportion = flt(item.base_amount) / stock_items_amount if stock_items_amount \
else flt(item.qty) / stock_items_qty
@@ -218,9 +218,9 @@
raise_exception=1)
def update_raw_materials_supplied(self, raw_material_table):
- self.doclist = self.doc.clear_table(self.doclist, raw_material_table)
+ self.set(raw_material_table, [])
if self.doc.is_subcontracted=="Yes":
- for item in self.doclist.get({"parentfield": self.fname}):
+ for item in self.get(self.fname):
if item.item_code in self.sub_contracted_items:
self.add_bom_items(item, raw_material_table)
@@ -230,7 +230,6 @@
for item in bom_items:
required_qty = flt(item.qty_consumed_per_unit) * flt(d.qty) * flt(d.conversion_factor)
rm_doclist = {
- "parentfield": raw_material_table,
"doctype": self.doc.doctype + " Item Supplied",
"reference_name": d.name,
"bom_detail_no": item.name,
@@ -248,7 +247,7 @@
"description": item.description,
})
- self.doclist.append(rm_doclist)
+ self.append(raw_material_table, rm_doclist)
raw_materials_cost += required_qty * flt(item.rate)
@@ -271,7 +270,7 @@
if not hasattr(self, "_sub_contracted_items"):
self._sub_contracted_items = []
item_codes = list(set(item.item_code for item in
- self.doclist.get({"parentfield": self.fname})))
+ self.get(self.fname)))
if item_codes:
self._sub_contracted_items = [r[0] for r in frappe.db.sql("""select name
from `tabItem` where name in (%s) and is_sub_contracted_item='Yes'""" % \
@@ -284,7 +283,7 @@
if not hasattr(self, "_purchase_items"):
self._purchase_items = []
item_codes = list(set(item.item_code for item in
- self.doclist.get({"parentfield": self.fname})))
+ self.get(self.fname)))
if item_codes:
self._purchase_items = [r[0] for r in frappe.db.sql("""select name
from `tabItem` where name in (%s) and is_purchase_item='Yes'""" % \
@@ -294,5 +293,5 @@
def is_item_table_empty(self):
- if not len(self.doclist.get({"parentfield": self.fname})):
+ if not len(self.get(self.fname)):
frappe.throw(_("Item table can not be blank"))
\ No newline at end of file
diff --git a/erpnext/controllers/js/contact_address_common.js b/erpnext/controllers/js/contact_address_common.js
index 6a66469..d06f6a0 100644
--- a/erpnext/controllers/js/contact_address_common.js
+++ b/erpnext/controllers/js/contact_address_common.js
@@ -23,7 +23,7 @@
"Installation Note", "Opportunity", "Customer Issue", "Maintenance Visit",
"Maintenance Schedule"]
.indexOf(doctype)!==-1) {
- var refdoc = frappe.model.get_doc(doctype, docname);
+ var refdoc = frappe.get_doc(doctype, docname);
if(refdoc.doctype == "Quotation" ? refdoc.quotation_to=="Customer" : true) {
cur_frm.set_value("customer", refdoc.customer || refdoc.name);
@@ -34,7 +34,7 @@
}
if(["Supplier", "Supplier Quotation", "Purchase Order", "Purchase Invoice", "Purchase Receipt"]
.indexOf(doctype)!==-1) {
- var refdoc = frappe.model.get_doc(doctype, docname);
+ var refdoc = frappe.get_doc(doctype, docname);
cur_frm.set_value("supplier", refdoc.supplier || refdoc.name);
cur_frm.set_value("supplier_name", refdoc.supplier_name);
if(cur_frm.doc.doctype==="Address")
@@ -42,7 +42,7 @@
}
if(["Lead", "Quotation"]
.indexOf(doctype)!==-1) {
- var refdoc = frappe.model.get_doc(doctype, docname);
+ var refdoc = frappe.get_doc(doctype, docname);
if(refdoc.doctype == "Quotation" ? refdoc.quotation_to=="Lead" : true) {
cur_frm.set_value("lead", refdoc.lead || refdoc.name);
diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py
index f583668..a3d140b 100644
--- a/erpnext/controllers/selling_controller.py
+++ b/erpnext/controllers/selling_controller.py
@@ -54,14 +54,13 @@
# shipping rule calculation based on item's net weight
shipping_amount = 0.0
- for condition in shipping_rule.doclist.get({"parentfield": "shipping_rule_conditions"}):
+ for condition in shipping_rule.get("shipping_rule_conditions"):
if not condition.to_value or (flt(condition.from_value) <= value <= flt(condition.to_value)):
shipping_amount = condition.shipping_amount
break
- self.doclist.append({
+ self.append("other_charges", {
"doctype": "Sales Taxes and Charges",
- "parentfield": "other_charges",
"charge_type": "Actual",
"account_head": shipping_rule.doc.account,
"cost_center": shipping_rule.doc.cost_center,
@@ -242,7 +241,7 @@
def calculate_contribution(self):
total = 0.0
- sales_team = self.doclist.get({"parentfield": "sales_team"})
+ sales_team = self.get("sales_team")
for sales_person in sales_team:
self.round_floats_in(sales_person)
@@ -279,7 +278,7 @@
outstanding_including_current)
def validate_max_discount(self):
- for d in self.doclist.get({"parentfield": self.fname}):
+ for d in self.get(self.fname):
discount = flt(frappe.db.get_value("Item", d.item_code, "max_discount"))
if discount and flt(d.discount_percentage) > discount:
@@ -288,7 +287,7 @@
def get_item_list(self):
il = []
- for d in self.doclist.get({"parentfield": self.fname}):
+ for d in self.get(self.fname):
reserved_warehouse = ""
reserved_qty_for_main_item = 0
@@ -315,7 +314,7 @@
reserved_qty_for_main_item = -flt(d.qty)
if self.has_sales_bom(d.item_code):
- for p in self.doclist.get({"parentfield": "packing_details"}):
+ for p in self.get("packing_details"):
if p.parent_detail_docname == d.name and p.parent_item == d.item_code:
# the packing details table's qty is already multiplied with parent's qty
il.append(frappe._dict({
@@ -362,7 +361,7 @@
return so_qty, so_warehouse
def check_stop_sales_order(self, ref_fieldname):
- for d in self.doclist.get({"parentfield": self.fname}):
+ for d in self.get(self.fname):
if d.fields.get(ref_fieldname):
status = frappe.db.get_value("Sales Order", d.fields[ref_fieldname], "status")
if status == "Stopped":
diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py
index 7411d09..30bc02e 100644
--- a/erpnext/controllers/status_updater.py
+++ b/erpnext/controllers/status_updater.py
@@ -240,7 +240,7 @@
all_zero_amount_refdoc = frappe.db.sql_list("""select name from `tab%s`
where docstatus=1 and net_total = 0""" % ref_dt)
- for item in self.doclist.get({"parentfield": "entries"}):
+ for item in self.get("entries"):
if item.fields.get(ref_fieldname) \
and item.fields.get(ref_fieldname) in all_zero_amount_refdoc \
and item.fields.get(ref_fieldname) not in zero_amount_refdoc:
diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py
index 47bcdd4..3c4c566 100644
--- a/erpnext/controllers/stock_controller.py
+++ b/erpnext/controllers/stock_controller.py
@@ -72,7 +72,7 @@
def get_voucher_details(self, stock_ledger, default_expense_account, default_cost_center):
if not default_expense_account:
- details = self.doclist.get({"parentfield": self.fname})
+ details = self.get(self.fname)
for d in details:
self.check_expense_account(d)
else:
@@ -158,7 +158,7 @@
future_stock_vouchers = []
if hasattr(self, "fname"):
- item_list = [d.item_code for d in self.doclist.get({"parentfield": self.fname})]
+ item_list = [d.item_code for d in self.get(self.fname)]
condition = ''.join(['and item_code in (\'', '\', \''.join(item_list) ,'\')'])
else:
condition = ""
@@ -331,4 +331,4 @@
def get_warehouse_account():
warehouse_account = dict(frappe.db.sql("""select master_name, name from tabAccount
where account_type = 'Warehouse' and ifnull(master_name, '') != ''"""))
- return warehouse_account
\ No newline at end of file
+ return warehouse_account
diff --git a/erpnext/home/__init__.py b/erpnext/home/__init__.py
index 2aae0b0..75fab1c 100644
--- a/erpnext/home/__init__.py
+++ b/erpnext/home/__init__.py
@@ -59,8 +59,7 @@
def make_feed(feedtype, doctype, name, owner, subject, color):
"makes a new Feed record"
#msgprint(subject)
- from frappe.model.doc import Document
- from frappe.utils import get_fullname
+ from frappe.utils import get_fullname
if feedtype in ('Login', 'Comment', 'Assignment'):
# delete old login, comment feed
@@ -72,7 +71,7 @@
where doc_type=%s and doc_name=%s
and ifnull(feed_type,'') != 'Comment'""", (doctype, name))
- f = Document('Feed')
+ f = frappe.get_doc('Feed')
f.owner = owner
f.feed_type = feedtype
f.doc_type = doctype
diff --git a/erpnext/home/doctype/feed/feed.py b/erpnext/home/doctype/feed/feed.py
index 0a12d26..45d8ea1 100644
--- a/erpnext/home/doctype/feed/feed.py
+++ b/erpnext/home/doctype/feed/feed.py
@@ -4,15 +4,10 @@
from __future__ import unicode_literals
import frappe
-from frappe.model import db_exists
-from frappe.model.bean import copy_doclist
+from frappe.model.document import Document
-
-
-
-class DocType:
- def __init__(self,d,dl):
- self.doc, self.doclist = d, dl
+class Feed(Document):
+ pass
def on_doctype_update():
if not frappe.db.sql("""show index from `tabFeed`
diff --git a/erpnext/home/doctype/feed/feed.txt b/erpnext/home/doctype/feed/feed.txt
index 8821b7d..6578d48 100644
--- a/erpnext/home/doctype/feed/feed.txt
+++ b/erpnext/home/doctype/feed/feed.txt
@@ -1,80 +1,61 @@
-[
- {
- "creation": "2012-07-03 13:29:42",
- "docstatus": 0,
- "modified": "2013-12-20 19:24:07",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "_FEED.#####",
- "doctype": "DocType",
- "icon": "icon-rss",
- "module": "Home",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Feed",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Feed",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager"
- },
- {
- "doctype": "DocType",
- "name": "Feed"
- },
- {
- "doctype": "DocField",
- "fieldname": "feed_type",
- "fieldtype": "Select",
- "label": "Feed Type"
- },
- {
- "doctype": "DocField",
- "fieldname": "doc_type",
- "fieldtype": "Data",
- "label": "Doc Type"
- },
- {
- "doctype": "DocField",
- "fieldname": "doc_name",
- "fieldtype": "Data",
- "label": "Doc Name"
- },
- {
- "doctype": "DocField",
- "fieldname": "subject",
- "fieldtype": "Data",
- "label": "Subject"
- },
- {
- "doctype": "DocField",
- "fieldname": "color",
- "fieldtype": "Data",
- "label": "Color"
- },
- {
- "doctype": "DocField",
- "fieldname": "full_name",
- "fieldtype": "Data",
- "label": "Full Name"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "autoname": "_FEED.#####",
+ "creation": "2012-07-03 13:29:42.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "feed_type",
+ "fieldtype": "Select",
+ "label": "Feed Type",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "doc_type",
+ "fieldtype": "Data",
+ "label": "Doc Type",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "doc_name",
+ "fieldtype": "Data",
+ "label": "Doc Name",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "subject",
+ "fieldtype": "Data",
+ "label": "Subject",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "color",
+ "fieldtype": "Data",
+ "label": "Color",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "full_name",
+ "fieldtype": "Data",
+ "label": "Full Name",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-rss",
+ "idx": 1,
+ "modified": "2013-12-20 19:24:07.000000",
+ "modified_by": "Administrator",
+ "module": "Home",
+ "name": "Feed",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/home/page/activity/activity.txt b/erpnext/home/page/activity/activity.txt
index 7c9783d..a65057e 100644
--- a/erpnext/home/page/activity/activity.txt
+++ b/erpnext/home/page/activity/activity.txt
@@ -1,33 +1,20 @@
-[
- {
- "creation": "2013-04-09 11:45:31",
- "docstatus": 0,
- "modified": "2013-07-11 14:40:20",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-play",
- "module": "Home",
- "name": "__common__",
- "page_name": "activity",
- "standard": "Yes",
- "title": "Activity"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "activity",
- "parentfield": "roles",
- "parenttype": "Page",
- "role": "All"
- },
- {
- "doctype": "Page",
- "name": "activity"
- },
- {
- "doctype": "Page Role"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-09 11:45:31.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-play",
+ "idx": 1,
+ "modified": "2013-07-11 14:40:20.000000",
+ "modified_by": "Administrator",
+ "module": "Home",
+ "name": "activity",
+ "owner": "Administrator",
+ "page_name": "activity",
+ "roles": [
+ {
+ "role": "All"
+ }
+ ],
+ "standard": "Yes",
+ "title": "Activity"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/appraisal/appraisal.js b/erpnext/hr/doctype/appraisal/appraisal.js
index 5bcb96d..a87607c 100644
--- a/erpnext/hr/doctype/appraisal/appraisal.js
+++ b/erpnext/hr/doctype/appraisal/appraisal.js
@@ -32,7 +32,7 @@
cur_frm.cscript.calculate_total_score = function(doc,cdt,cdn){
//return get_server_fields('calculate_total','','',doc,cdt,cdn,1);
- var val = getchildren('Appraisal Goal', doc.name, 'appraisal_details', doc.doctype);
+ var val = doc.appraisal_details || [];
var total =0;
for(var i = 0; i<val.length; i++){
total = flt(total)+flt(val[i].score_earned)
@@ -61,7 +61,7 @@
}
cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
- var val = getchildren('Appraisal Goal', doc.name, 'appraisal_details', doc.doctype);
+ var val = doc.appraisal_details || [];
var total =0;
for(var i = 0; i<val.length; i++){
total = flt(total)+flt(val[i].score_earned);
diff --git a/erpnext/hr/doctype/appraisal/appraisal.py b/erpnext/hr/doctype/appraisal/appraisal.py
index 8abeab8..761e385 100644
--- a/erpnext/hr/doctype/appraisal/appraisal.py
+++ b/erpnext/hr/doctype/appraisal/appraisal.py
@@ -8,10 +8,9 @@
from frappe.model.bean import getlist
from frappe import msgprint
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class Appraisal(Document):
def validate(self):
if not self.doc.status:
@@ -45,7 +44,7 @@
def calculate_total(self):
total, total_w = 0, 0
- for d in getlist(self.doclist, 'appraisal_details'):
+ for d in self.get('appraisal_details'):
if d.score:
d.score_earned = flt(d.score) * flt(d.per_weightage) / 100
total = total + d.score_earned
diff --git a/erpnext/hr/doctype/appraisal/appraisal.txt b/erpnext/hr/doctype/appraisal/appraisal.txt
index da57097..b0082f3 100644
--- a/erpnext/hr/doctype/appraisal/appraisal.txt
+++ b/erpnext/hr/doctype/appraisal/appraisal.txt
@@ -1,256 +1,249 @@
-[
- {
- "creation": "2013-01-10 16:34:12",
- "docstatus": 0,
- "modified": "2014-01-22 16:05:34",
- "modified_by": "Administrator",
- "owner": "ashwini@webnotestech.com"
- },
- {
- "autoname": "APRSL.#####",
- "doctype": "DocType",
- "icon": "icon-thumbs-up",
- "is_submittable": 1,
- "module": "HR",
- "name": "__common__",
- "search_fields": "status, employee, employee_name"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Appraisal",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Appraisal",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Appraisal"
- },
- {
- "doctype": "DocField",
- "fieldname": "employee_details",
- "fieldtype": "Section Break",
- "label": "Employee Details",
- "oldfieldtype": "Section Break"
- },
- {
- "description": "Select template from which you want to get the Goals",
- "doctype": "DocField",
- "fieldname": "kra_template",
- "fieldtype": "Link",
- "label": "Appraisal Template",
- "oldfieldname": "kra_template",
- "oldfieldtype": "Link",
- "options": "Appraisal Template",
- "reqd": 1
- },
- {
- "depends_on": "kra_template",
- "description": "Select the Employee for whom you are creating the Appraisal.",
- "doctype": "DocField",
- "fieldname": "employee",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "For Employee",
- "oldfieldname": "employee",
- "oldfieldtype": "Link",
- "options": "Employee",
- "reqd": 1,
- "search_index": 1
- },
- {
- "depends_on": "kra_template",
- "doctype": "DocField",
- "fieldname": "employee_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "For Employee Name",
- "oldfieldname": "employee_name",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "depends_on": "kra_template",
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "default": "Draft",
- "depends_on": "kra_template",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nDraft\nSubmitted\nCompleted\nCancelled",
- "read_only": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "depends_on": "kra_template",
- "doctype": "DocField",
- "fieldname": "start_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Start Date",
- "oldfieldname": "start_date",
- "oldfieldtype": "Date",
- "reqd": 1
- },
- {
- "depends_on": "kra_template",
- "doctype": "DocField",
- "fieldname": "end_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "End Date",
- "oldfieldname": "end_date",
- "oldfieldtype": "Date",
- "reqd": 1
- },
- {
- "depends_on": "kra_template",
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "label": "Goals",
- "oldfieldtype": "Section Break",
- "options": "Simple"
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "appraisal_details",
- "fieldtype": "Table",
- "label": "Appraisal Goals",
- "oldfieldname": "appraisal_details",
- "oldfieldtype": "Table",
- "options": "Appraisal Goal"
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "calculate_total_score",
- "fieldtype": "Button",
- "label": "Calculate Total Score",
- "oldfieldtype": "Button",
- "options": "calculate_total"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_score",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Total Score (Out of 5)",
- "no_copy": 1,
- "oldfieldname": "total_score",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "depends_on": "kra_template",
- "doctype": "DocField",
- "fieldname": "section_break1",
- "fieldtype": "Section Break"
- },
- {
- "description": "Any other comments, noteworthy effort that should go in the records.",
- "doctype": "DocField",
- "fieldname": "comments",
- "fieldtype": "Text",
- "label": "Comments"
- },
- {
- "depends_on": "kra_template",
- "doctype": "DocField",
- "fieldname": "other_details",
- "fieldtype": "Section Break",
- "label": "Other Details"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "link:Company",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 1,
- "width": "150px"
- },
- {
- "cancel": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "restricted": 1,
- "role": "Employee",
- "submit": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "System Manager",
- "submit": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "HR User",
- "submit": 1
- }
-]
\ No newline at end of file
+{
+ "autoname": "APRSL.#####",
+ "creation": "2013-01-10 16:34:12.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "employee_details",
+ "fieldtype": "Section Break",
+ "label": "Employee Details",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "description": "Select template from which you want to get the Goals",
+ "fieldname": "kra_template",
+ "fieldtype": "Link",
+ "label": "Appraisal Template",
+ "oldfieldname": "kra_template",
+ "oldfieldtype": "Link",
+ "options": "Appraisal Template",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "kra_template",
+ "description": "Select the Employee for whom you are creating the Appraisal.",
+ "fieldname": "employee",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "For Employee",
+ "oldfieldname": "employee",
+ "oldfieldtype": "Link",
+ "options": "Employee",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "depends_on": "kra_template",
+ "fieldname": "employee_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "For Employee Name",
+ "oldfieldname": "employee_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "kra_template",
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "default": "Draft",
+ "depends_on": "kra_template",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nDraft\nSubmitted\nCompleted\nCancelled",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "depends_on": "kra_template",
+ "fieldname": "start_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Start Date",
+ "oldfieldname": "start_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "kra_template",
+ "fieldname": "end_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "End Date",
+ "oldfieldname": "end_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "kra_template",
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "label": "Goals",
+ "oldfieldtype": "Section Break",
+ "options": "Simple",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "appraisal_details",
+ "fieldtype": "Table",
+ "label": "Appraisal Goals",
+ "oldfieldname": "appraisal_details",
+ "oldfieldtype": "Table",
+ "options": "Appraisal Goal",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "calculate_total_score",
+ "fieldtype": "Button",
+ "label": "Calculate Total Score",
+ "oldfieldtype": "Button",
+ "options": "calculate_total",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "total_score",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Total Score (Out of 5)",
+ "no_copy": 1,
+ "oldfieldname": "total_score",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "kra_template",
+ "fieldname": "section_break1",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "description": "Any other comments, noteworthy effort that should go in the records.",
+ "fieldname": "comments",
+ "fieldtype": "Text",
+ "label": "Comments",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "kra_template",
+ "fieldname": "other_details",
+ "fieldtype": "Section Break",
+ "label": "Other Details",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "link:Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1,
+ "width": "150px"
+ }
+ ],
+ "icon": "icon-thumbs-up",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-22 16:05:34.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Appraisal",
+ "owner": "ashwini@webnotestech.com",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "restricted": 1,
+ "role": "Employee",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "search_fields": "status, employee, employee_name"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py
index 26c87f1..c13c42b 100644
--- a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py
+++ b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class AppraisalGoal(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt
index 5c15ac6..a40b2bc 100644
--- a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt
+++ b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt
@@ -1,77 +1,67 @@
-[
- {
- "creation": "2013-02-22 01:27:44",
- "docstatus": 0,
- "modified": "2013-12-20 19:22:53",
- "modified_by": "Administrator",
- "owner": "ashwini@webnotestech.com"
- },
- {
- "autoname": "APRSLD.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Appraisal Goal",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Appraisal Goal"
- },
- {
- "description": "Key Responsibility Area",
- "doctype": "DocField",
- "fieldname": "kra",
- "fieldtype": "Small Text",
- "label": "Goal",
- "oldfieldname": "kra",
- "oldfieldtype": "Small Text",
- "print_width": "240px",
- "reqd": 1,
- "width": "240px"
- },
- {
- "doctype": "DocField",
- "fieldname": "per_weightage",
- "fieldtype": "Float",
- "label": "Weightage (%)",
- "oldfieldname": "per_weightage",
- "oldfieldtype": "Currency",
- "print_width": "70px",
- "reqd": 1,
- "width": "70px"
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "score",
- "fieldtype": "Float",
- "label": "Score (0-5)",
- "no_copy": 1,
- "oldfieldname": "score",
- "oldfieldtype": "Select",
- "options": "\n0\n1\n2\n3\n4\n5",
- "print_width": "70px",
- "width": "70px"
- },
- {
- "doctype": "DocField",
- "fieldname": "score_earned",
- "fieldtype": "Float",
- "label": "Score Earned",
- "no_copy": 1,
- "oldfieldname": "score_earned",
- "oldfieldtype": "Currency",
- "print_width": "70px",
- "read_only": 1,
- "width": "70px"
- }
-]
\ No newline at end of file
+{
+ "autoname": "APRSLD.#####",
+ "creation": "2013-02-22 01:27:44.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "Key Responsibility Area",
+ "fieldname": "kra",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Goal",
+ "oldfieldname": "kra",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "240px",
+ "reqd": 1,
+ "width": "240px"
+ },
+ {
+ "fieldname": "per_weightage",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Weightage (%)",
+ "oldfieldname": "per_weightage",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "70px",
+ "reqd": 1,
+ "width": "70px"
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "score",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Score (0-5)",
+ "no_copy": 1,
+ "oldfieldname": "score",
+ "oldfieldtype": "Select",
+ "options": "\n0\n1\n2\n3\n4\n5",
+ "permlevel": 0,
+ "print_width": "70px",
+ "width": "70px"
+ },
+ {
+ "fieldname": "score_earned",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Score Earned",
+ "no_copy": 1,
+ "oldfieldname": "score_earned",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "70px",
+ "read_only": 1,
+ "width": "70px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:22:53.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Appraisal Goal",
+ "owner": "ashwini@webnotestech.com"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template.py b/erpnext/hr/doctype/appraisal_template/appraisal_template.py
index 0f78a4a..e4fba2c 100644
--- a/erpnext/hr/doctype/appraisal_template/appraisal_template.py
+++ b/erpnext/hr/doctype/appraisal_template/appraisal_template.py
@@ -5,9 +5,9 @@
import frappe
from frappe import _
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class AppraisalTemplate(Document):
def validate(self):
self.doc.total_points = 0
diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template.txt b/erpnext/hr/doctype/appraisal_template/appraisal_template.txt
index ff887c4..1ef6307 100644
--- a/erpnext/hr/doctype/appraisal_template/appraisal_template.txt
+++ b/erpnext/hr/doctype/appraisal_template/appraisal_template.txt
@@ -1,82 +1,63 @@
-[
- {
- "creation": "2012-07-03 13:30:39",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:55",
- "modified_by": "Administrator",
- "owner": "ashwini@webnotestech.com"
- },
- {
- "allow_import": 1,
- "autoname": "field:kra_title",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-file-text",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Appraisal Template",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Appraisal Template",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "HR User",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Appraisal Template"
- },
- {
- "doctype": "DocField",
- "fieldname": "kra_title",
- "fieldtype": "Data",
- "label": "Appraisal Template Title",
- "oldfieldname": "kra_title",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "print_width": "300px",
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "kra_sheet",
- "fieldtype": "Table",
- "label": "Appraisal Template Goal",
- "oldfieldname": "kra_sheet",
- "oldfieldtype": "Table",
- "options": "Appraisal Template Goal"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_points",
- "fieldtype": "Int",
- "label": "Total Points"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:kra_title",
+ "creation": "2012-07-03 13:30:39.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "kra_title",
+ "fieldtype": "Data",
+ "label": "Appraisal Template Title",
+ "oldfieldname": "kra_title",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "width": "300px"
+ },
+ {
+ "fieldname": "kra_sheet",
+ "fieldtype": "Table",
+ "label": "Appraisal Template Goal",
+ "oldfieldname": "kra_sheet",
+ "oldfieldtype": "Table",
+ "options": "Appraisal Template Goal",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "total_points",
+ "fieldtype": "Int",
+ "label": "Total Points",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "modified": "2013-12-20 19:23:55.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Appraisal Template",
+ "owner": "ashwini@webnotestech.com",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py
index 26c87f1..0cdd921 100644
--- a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py
+++ b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class AppraisalTemplateGoal(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt
index 0657f64..f23ec8c 100644
--- a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt
+++ b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt
@@ -1,51 +1,40 @@
-[
- {
- "creation": "2013-02-22 01:27:44",
- "docstatus": 0,
- "modified": "2013-12-20 19:22:54",
- "modified_by": "Administrator",
- "owner": "ashwini@webnotestech.com"
- },
- {
- "autoname": "KSHEET.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Appraisal Template Goal",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "reqd": 1
- },
- {
- "doctype": "DocType",
- "name": "Appraisal Template Goal"
- },
- {
- "description": "Key Performance Area",
- "doctype": "DocField",
- "fieldname": "kra",
- "fieldtype": "Small Text",
- "label": "KRA",
- "oldfieldname": "kra",
- "oldfieldtype": "Small Text",
- "print_width": "200px",
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "per_weightage",
- "fieldtype": "Float",
- "label": "Weightage (%)",
- "oldfieldname": "per_weightage",
- "oldfieldtype": "Currency",
- "print_width": "100px",
- "width": "100px"
- }
-]
\ No newline at end of file
+{
+ "autoname": "KSHEET.#####",
+ "creation": "2013-02-22 01:27:44.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "Key Performance Area",
+ "fieldname": "kra",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "KRA",
+ "oldfieldname": "kra",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "200px",
+ "reqd": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "per_weightage",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Weightage (%)",
+ "oldfieldname": "per_weightage",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "100px",
+ "reqd": 1,
+ "width": "100px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:22:54.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Appraisal Template Goal",
+ "owner": "ashwini@webnotestech.com"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py
index 9abef76..42cb7b0 100644
--- a/erpnext/hr/doctype/attendance/attendance.py
+++ b/erpnext/hr/doctype/attendance/attendance.py
@@ -8,10 +8,9 @@
from frappe import msgprint, _
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class Attendance(Document):
def validate_duplicate_record(self):
res = frappe.db.sql("""select name from `tabAttendance` where employee = %s and att_date = %s
diff --git a/erpnext/hr/doctype/attendance/attendance.txt b/erpnext/hr/doctype/attendance/attendance.txt
index 894e981..101f618 100644
--- a/erpnext/hr/doctype/attendance/attendance.txt
+++ b/erpnext/hr/doctype/attendance/attendance.txt
@@ -1,180 +1,179 @@
-[
- {
- "creation": "2013-01-10 16:34:13",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:23",
- "modified_by": "Administrator",
- "owner": "ashwini@webnotestech.com"
- },
- {
- "allow_import": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-ok",
- "is_submittable": 1,
- "module": "HR",
- "name": "__common__",
- "search_fields": "employee, employee_name, att_date, status"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Attendance",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Attendance",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Attendance"
- },
- {
- "doctype": "DocField",
- "fieldname": "attendance_details",
- "fieldtype": "Section Break",
- "label": "Attendance Details",
- "oldfieldtype": "Section Break",
- "options": "Simple"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "ATT",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "employee",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Employee",
- "oldfieldname": "employee",
- "oldfieldtype": "Link",
- "options": "Employee",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "employee_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Employee Name",
- "oldfieldname": "employee_name",
- "oldfieldtype": "Data"
- },
- {
- "default": "Present",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nPresent\nAbsent\nHalf Day",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "leave_type",
- "fieldtype": "Link",
- "hidden": 1,
- "in_list_view": 1,
- "label": "Leave Type",
- "oldfieldname": "leave_type",
- "oldfieldtype": "Link",
- "options": "Leave Type",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "att_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Attendance Date",
- "oldfieldname": "att_date",
- "oldfieldtype": "Date",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "link:Company",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "options": "Attendance",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocPerm",
- "role": "System Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "HR User"
- },
- {
- "doctype": "DocPerm",
- "role": "HR Manager"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-01-10 16:34:13.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "attendance_details",
+ "fieldtype": "Section Break",
+ "label": "Attendance Details",
+ "oldfieldtype": "Section Break",
+ "options": "Simple",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "ATT",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "employee",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Employee",
+ "oldfieldname": "employee",
+ "oldfieldtype": "Link",
+ "options": "Employee",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "employee_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Employee Name",
+ "oldfieldname": "employee_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "default": "Present",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nPresent\nAbsent\nHalf Day",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "leave_type",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_list_view": 1,
+ "label": "Leave Type",
+ "oldfieldname": "leave_type",
+ "oldfieldtype": "Link",
+ "options": "Leave Type",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "att_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Attendance Date",
+ "oldfieldname": "att_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "link:Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "options": "Attendance",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-ok",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-20 17:48:23.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Attendance",
+ "owner": "ashwini@webnotestech.com",
+ "permissions": [
+ {
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "search_fields": "employee, employee_name, att_date, status"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/branch/branch.py b/erpnext/hr/doctype/branch/branch.py
index 58ecbe8..f5dbe18 100644
--- a/erpnext/hr/doctype/branch/branch.py
+++ b/erpnext/hr/doctype/branch/branch.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
-
+from frappe.model.document import Document
+
+class Branch(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/branch/branch.txt b/erpnext/hr/doctype/branch/branch.txt
index 6ef13e2..28bc74a 100644
--- a/erpnext/hr/doctype/branch/branch.txt
+++ b/erpnext/hr/doctype/branch/branch.txt
@@ -1,74 +1,64 @@
-[
- {
- "creation": "2013-01-10 16:34:13",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:26",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:branch",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-code-fork",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Branch",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Branch",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Branch"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "branch",
- "fieldtype": "Data",
- "label": "Branch",
- "oldfieldname": "branch",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocPerm",
- "role": "HR User"
- },
- {
- "doctype": "DocPerm",
- "role": "HR Manager"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:branch",
+ "creation": "2013-01-10 16:34:13.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "branch",
+ "fieldtype": "Data",
+ "label": "Branch",
+ "oldfieldname": "branch",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "icon": "icon-code-fork",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:26.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Branch",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/deduction_type/deduction_type.py b/erpnext/hr/doctype/deduction_type/deduction_type.py
index 26c87f1..c18f569 100644
--- a/erpnext/hr/doctype/deduction_type/deduction_type.py
+++ b/erpnext/hr/doctype/deduction_type/deduction_type.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class DeductionType(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/deduction_type/deduction_type.txt b/erpnext/hr/doctype/deduction_type/deduction_type.txt
index b70cf35..ccfbf03 100644
--- a/erpnext/hr/doctype/deduction_type/deduction_type.txt
+++ b/erpnext/hr/doctype/deduction_type/deduction_type.txt
@@ -1,79 +1,60 @@
-[
- {
- "creation": "2013-01-22 16:50:30",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:34",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:deduction_name",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-flag",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Deduction Type",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Deduction Type",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "HR User",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Deduction Type"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "deduction_name",
- "fieldtype": "Data",
- "label": "Name",
- "oldfieldname": "deduction_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "width": "300px"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:deduction_name",
+ "creation": "2013-01-22 16:50:30.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "deduction_name",
+ "fieldtype": "Data",
+ "label": "Name",
+ "oldfieldname": "deduction_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "width": "300px"
+ }
+ ],
+ "icon": "icon-flag",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:34.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Deduction Type",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/department/department.py b/erpnext/hr/doctype/department/department.py
index 5015bed..bf15491 100644
--- a/erpnext/hr/doctype/department/department.py
+++ b/erpnext/hr/doctype/department/department.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
-
\ No newline at end of file
+from frappe.model.document import Document
+
+class Department(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/department/department.txt b/erpnext/hr/doctype/department/department.txt
index 269afa7..927f564 100644
--- a/erpnext/hr/doctype/department/department.txt
+++ b/erpnext/hr/doctype/department/department.txt
@@ -1,77 +1,58 @@
-[
- {
- "creation": "2013-02-05 11:48:26",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:38",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:department_name",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-sitemap",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Department",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Department",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "HR User",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Department"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "department_name",
- "fieldtype": "Data",
- "label": "Department",
- "oldfieldname": "department_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "description": "Days for which Holidays are blocked for this department.",
- "doctype": "DocField",
- "fieldname": "leave_block_list",
- "fieldtype": "Link",
- "label": "Leave Block List",
- "options": "Leave Block List"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:department_name",
+ "creation": "2013-02-05 11:48:26.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "department_name",
+ "fieldtype": "Data",
+ "label": "Department",
+ "oldfieldname": "department_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Days for which Holidays are blocked for this department.",
+ "fieldname": "leave_block_list",
+ "fieldtype": "Link",
+ "label": "Leave Block List",
+ "options": "Leave Block List",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-sitemap",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:38.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Department",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/designation/designation.py b/erpnext/hr/doctype/designation/designation.py
index 58ecbe8..fb53047 100644
--- a/erpnext/hr/doctype/designation/designation.py
+++ b/erpnext/hr/doctype/designation/designation.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
-
+from frappe.model.document import Document
+
+class Designation(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/designation/designation.txt b/erpnext/hr/doctype/designation/designation.txt
index e8debd1..39a4eee 100644
--- a/erpnext/hr/doctype/designation/designation.txt
+++ b/erpnext/hr/doctype/designation/designation.txt
@@ -1,70 +1,51 @@
-[
- {
- "creation": "2013-01-10 16:34:13",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:38",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:designation_name",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-bookmark",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Designation",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Designation",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "HR User",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Designation"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "designation_name",
- "fieldtype": "Data",
- "label": "Designation",
- "oldfieldname": "designation_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:designation_name",
+ "creation": "2013-01-10 16:34:13.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "designation_name",
+ "fieldtype": "Data",
+ "label": "Designation",
+ "oldfieldname": "designation_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "icon": "icon-bookmark",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:38.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Designation",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/earning_type/earning_type.py b/erpnext/hr/doctype/earning_type/earning_type.py
index 26c87f1..8f7450e 100644
--- a/erpnext/hr/doctype/earning_type/earning_type.py
+++ b/erpnext/hr/doctype/earning_type/earning_type.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class EarningType(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/earning_type/earning_type.txt b/erpnext/hr/doctype/earning_type/earning_type.txt
index 9d3b90f..f4678b4 100644
--- a/erpnext/hr/doctype/earning_type/earning_type.txt
+++ b/erpnext/hr/doctype/earning_type/earning_type.txt
@@ -1,100 +1,81 @@
-[
- {
- "creation": "2013-01-24 11:03:32",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:38",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:earning_name",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-flag",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Earning Type",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Earning Type",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "HR User",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Earning Type"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "earning_name",
- "fieldtype": "Data",
- "label": "Name",
- "oldfieldname": "earning_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "reqd": 0,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "taxable",
- "fieldtype": "Select",
- "label": "Taxable",
- "oldfieldname": "taxable",
- "oldfieldtype": "Select",
- "options": "\nYes\nNo",
- "reqd": 1
- },
- {
- "depends_on": "eval:doc.taxable=='No'",
- "doctype": "DocField",
- "fieldname": "exemption_limit",
- "fieldtype": "Float",
- "hidden": 0,
- "label": "Exemption Limit",
- "oldfieldname": "exemption_limit",
- "oldfieldtype": "Currency"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:earning_name",
+ "creation": "2013-01-24 11:03:32.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "earning_name",
+ "fieldtype": "Data",
+ "label": "Name",
+ "oldfieldname": "earning_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "reqd": 0,
+ "width": "300px"
+ },
+ {
+ "fieldname": "taxable",
+ "fieldtype": "Select",
+ "label": "Taxable",
+ "oldfieldname": "taxable",
+ "oldfieldtype": "Select",
+ "options": "\nYes\nNo",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:doc.taxable=='No'",
+ "fieldname": "exemption_limit",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "label": "Exemption Limit",
+ "oldfieldname": "exemption_limit",
+ "oldfieldtype": "Currency",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-flag",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:38.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Earning Type",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee/employee.js b/erpnext/hr/doctype/employee/employee.js
index c27a4c5..88cf7ca 100644
--- a/erpnext/hr/doctype/employee/employee.js
+++ b/erpnext/hr/doctype/employee/employee.js
@@ -68,7 +68,7 @@
Go to the active Salary Structure and set \"Is Active\" = \"No\""));
} else if(!r.exc) {
frappe.model.map({
- source: frappe.model.get_doclist(me.frm.doc.doctype, me.frm.doc.name),
+ source: me.frm.doc,
target: "Salary Structure"
});
}
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index 3ec44e6..d6f1241 100644
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -5,13 +5,13 @@
import frappe
from frappe.utils import getdate, validate_email_add, cstr, cint
-from frappe.model.doc import make_autoname
+from frappe.model.naming import make_autoname
from frappe import msgprint, throw, _
import frappe.permissions
from frappe.defaults import get_restrictions
from frappe.model.controller import DocListController
-class DocType(DocListController):
+class Employee(DocListController):
def autoname(self):
naming_method = frappe.db.get_value("HR Settings", None, "emp_created_by")
if not naming_method:
@@ -57,7 +57,7 @@
def restrict_leave_approver(self):
"""restrict to this employee for leave approver"""
- employee_leave_approvers = [d.leave_approver for d in self.doclist.get({"parentfield": "employee_leave_approvers"})]
+ employee_leave_approvers = [d.leave_approver for d in self.get("employee_leave_approvers")]
if self.doc.reports_to and self.doc.reports_to not in employee_leave_approvers:
employee_leave_approvers.append(frappe.db.get_value("Employee", self.doc.reports_to, "user_id"))
@@ -167,7 +167,7 @@
from frappe.utils.user import User
from erpnext.hr.doctype.leave_application.leave_application import InvalidLeaveApproverError
- for l in self.doclist.get({"parentfield": "employee_leave_approvers"}):
+ for l in self.get("employee_leave_approvers"):
if "Leave Approver" not in User(l.leave_approver).get_roles():
throw(_("Invalid Leave Approver") + ": \"" + l.leave_approver + "\"",
exc=InvalidLeaveApproverError)
diff --git a/erpnext/hr/doctype/employee/employee.txt b/erpnext/hr/doctype/employee/employee.txt
index bc21ff9..e80dabe 100644
--- a/erpnext/hr/doctype/employee/employee.txt
+++ b/erpnext/hr/doctype/employee/employee.txt
@@ -1,782 +1,777 @@
-[
- {
- "creation": "2013-03-07 09:04:18",
- "docstatus": 0,
- "modified": "2014-02-03 18:06:04",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-user",
- "module": "HR",
- "name": "__common__",
- "search_fields": "employee_name"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Employee",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Employee",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Employee"
- },
- {
- "doctype": "DocField",
- "fieldname": "basic_information",
- "fieldtype": "Section Break",
- "label": "Basic Information",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "image_view",
- "fieldtype": "Image",
- "in_list_view": 0,
- "label": "Image View",
- "options": "image"
- },
- {
- "doctype": "DocField",
- "fieldname": "employee",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Employee",
- "no_copy": 1,
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "EMP/",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "salutation",
- "fieldtype": "Select",
- "label": "Salutation",
- "oldfieldname": "salutation",
- "oldfieldtype": "Select",
- "options": "\nMr\nMs",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "employee_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Full Name",
- "oldfieldname": "employee_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "image",
- "fieldtype": "Select",
- "label": "Image",
- "options": "attach_files:"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "description": "System User (login) ID. If set, it will become default for all HR forms.",
- "doctype": "DocField",
- "fieldname": "user_id",
- "fieldtype": "Link",
- "label": "User ID",
- "options": "User"
- },
- {
- "doctype": "DocField",
- "fieldname": "employee_number",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Employee Number",
- "oldfieldname": "employee_number",
- "oldfieldtype": "Data",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "date_of_joining",
- "fieldtype": "Date",
- "label": "Date of Joining",
- "oldfieldname": "date_of_joining",
- "oldfieldtype": "Date",
- "reqd": 1
- },
- {
- "description": "You can enter any date manually",
- "doctype": "DocField",
- "fieldname": "date_of_birth",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Date of Birth",
- "oldfieldname": "date_of_birth",
- "oldfieldtype": "Date",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "gender",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Gender",
- "oldfieldname": "gender",
- "oldfieldtype": "Select",
- "options": "\nMale\nFemale",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Company",
- "options": "link:Company",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "employment_details",
- "fieldtype": "Section Break",
- "label": "Employment Details"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break_21",
- "fieldtype": "Column Break"
- },
- {
- "default": "Active",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Status",
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nActive\nLeft",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "employment_type",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Employment Type",
- "oldfieldname": "employment_type",
- "oldfieldtype": "Link",
- "options": "Employment Type",
- "search_index": 0
- },
- {
- "description": "Applicable Holiday List",
- "doctype": "DocField",
- "fieldname": "holiday_list",
- "fieldtype": "Link",
- "label": "Holiday List",
- "oldfieldname": "holiday_list",
- "oldfieldtype": "Link",
- "options": "Holiday List"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break_22",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "scheduled_confirmation_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Offer Date",
- "oldfieldname": "scheduled_confirmation_date",
- "oldfieldtype": "Date",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "final_confirmation_date",
- "fieldtype": "Date",
- "label": "Confirmation Date",
- "oldfieldname": "final_confirmation_date",
- "oldfieldtype": "Date",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "contract_end_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Contract End Date",
- "oldfieldname": "contract_end_date",
- "oldfieldtype": "Date",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "date_of_retirement",
- "fieldtype": "Date",
- "label": "Date Of Retirement",
- "oldfieldname": "date_of_retirement",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "job_profile",
- "fieldtype": "Section Break",
- "label": "Job Profile"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "branch",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Branch",
- "oldfieldname": "branch",
- "oldfieldtype": "Link",
- "options": "Branch",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "department",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Department",
- "oldfieldname": "department",
- "oldfieldtype": "Link",
- "options": "Department",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "designation",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Designation",
- "oldfieldname": "designation",
- "oldfieldtype": "Link",
- "options": "Designation",
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "grade",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Grade",
- "oldfieldname": "grade",
- "oldfieldtype": "Link",
- "options": "Grade",
- "reqd": 0
- },
- {
- "description": "Provide email id registered in company",
- "doctype": "DocField",
- "fieldname": "company_email",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Company Email",
- "oldfieldname": "company_email",
- "oldfieldtype": "Data",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "notice_number_of_days",
- "fieldtype": "Int",
- "label": "Notice (days)",
- "oldfieldname": "notice_number_of_days",
- "oldfieldtype": "Int"
- },
- {
- "doctype": "DocField",
- "fieldname": "salary_information",
- "fieldtype": "Column Break",
- "label": "Salary Information",
- "oldfieldtype": "Section Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "salary_mode",
- "fieldtype": "Select",
- "label": "Salary Mode",
- "oldfieldname": "salary_mode",
- "oldfieldtype": "Select",
- "options": "\nBank\nCash\nCheque"
- },
- {
- "depends_on": "eval:doc.salary_mode == 'Bank'",
- "doctype": "DocField",
- "fieldname": "bank_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_filter": 1,
- "label": "Bank Name",
- "oldfieldname": "bank_name",
- "oldfieldtype": "Link",
- "options": "Suggest"
- },
- {
- "depends_on": "eval:doc.salary_mode == 'Bank'",
- "doctype": "DocField",
- "fieldname": "bank_ac_no",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Bank A/C No.",
- "oldfieldname": "bank_ac_no",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "esic_card_no",
- "fieldtype": "Data",
- "label": "ESIC CARD No",
- "oldfieldname": "esic_card_no",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "pf_number",
- "fieldtype": "Data",
- "label": "PF Number",
- "oldfieldname": "pf_number",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "gratuity_lic_id",
- "fieldtype": "Data",
- "label": "Gratuity LIC ID",
- "oldfieldname": "gratuity_lic_id",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "organization_profile",
- "fieldtype": "Section Break",
- "label": "Organization Profile"
- },
- {
- "doctype": "DocField",
- "fieldname": "reports_to",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Reports to",
- "oldfieldname": "reports_to",
- "oldfieldtype": "Link",
- "options": "Employee"
- },
- {
- "description": "The first Leave Approver in the list will be set as the default Leave Approver",
- "doctype": "DocField",
- "fieldname": "employee_leave_approvers",
- "fieldtype": "Table",
- "label": "Leave Approvers",
- "options": "Employee Leave Approver"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_details",
- "fieldtype": "Section Break",
- "label": "Contact Details"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "cell_number",
- "fieldtype": "Data",
- "label": "Cell Number"
- },
- {
- "doctype": "DocField",
- "fieldname": "personal_email",
- "fieldtype": "Data",
- "label": "Personal Email"
- },
- {
- "doctype": "DocField",
- "fieldname": "unsubscribed",
- "fieldtype": "Check",
- "label": "Unsubscribed"
- },
- {
- "doctype": "DocField",
- "fieldname": "emergency_contact_details",
- "fieldtype": "HTML",
- "label": "Emergency Contact Details",
- "options": "<h4 class=\"text-muted\">Emergency Contact Details</h4>"
- },
- {
- "doctype": "DocField",
- "fieldname": "person_to_be_contacted",
- "fieldtype": "Data",
- "label": "Emergency Contact"
- },
- {
- "doctype": "DocField",
- "fieldname": "relation",
- "fieldtype": "Data",
- "label": "Relation"
- },
- {
- "doctype": "DocField",
- "fieldname": "emergency_phone_number",
- "fieldtype": "Data",
- "label": "Emergency Phone"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break4",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "permanent_accommodation_type",
- "fieldtype": "Select",
- "label": "Permanent Address Is",
- "options": "\nRented\nOwned"
- },
- {
- "doctype": "DocField",
- "fieldname": "permanent_address",
- "fieldtype": "Small Text",
- "label": "Permanent Address"
- },
- {
- "doctype": "DocField",
- "fieldname": "current_accommodation_type",
- "fieldtype": "Select",
- "label": "Current Address Is",
- "options": "\nRented\nOwned"
- },
- {
- "doctype": "DocField",
- "fieldname": "current_address",
- "fieldtype": "Small Text",
- "label": "Current Address"
- },
- {
- "doctype": "DocField",
- "fieldname": "sb53",
- "fieldtype": "Section Break",
- "label": "Bio"
- },
- {
- "description": "Short biography for website and other publications.",
- "doctype": "DocField",
- "fieldname": "bio",
- "fieldtype": "Text Editor",
- "label": "Bio"
- },
- {
- "doctype": "DocField",
- "fieldname": "personal_details",
- "fieldtype": "Section Break",
- "label": "Personal Details"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break5",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "pan_number",
- "fieldtype": "Data",
- "label": "PAN Number"
- },
- {
- "doctype": "DocField",
- "fieldname": "passport_number",
- "fieldtype": "Data",
- "label": "Passport Number"
- },
- {
- "doctype": "DocField",
- "fieldname": "date_of_issue",
- "fieldtype": "Date",
- "label": "Date of Issue"
- },
- {
- "doctype": "DocField",
- "fieldname": "valid_upto",
- "fieldtype": "Date",
- "label": "Valid Upto"
- },
- {
- "doctype": "DocField",
- "fieldname": "place_of_issue",
- "fieldtype": "Data",
- "label": "Place of Issue"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break6",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "marital_status",
- "fieldtype": "Select",
- "label": "Marital Status",
- "options": "\nSingle\nMarried\nDivorced\nWidowed"
- },
- {
- "doctype": "DocField",
- "fieldname": "blood_group",
- "fieldtype": "Select",
- "label": "Blood Group",
- "options": "\nA+\nA-\nB+\nB-\nAB+\nAB-\nO+\nO-"
- },
- {
- "description": "Here you can maintain family details like name and occupation of parent, spouse and children",
- "doctype": "DocField",
- "fieldname": "family_background",
- "fieldtype": "Small Text",
- "label": "Family Background"
- },
- {
- "description": "Here you can maintain height, weight, allergies, medical concerns etc",
- "doctype": "DocField",
- "fieldname": "health_details",
- "fieldtype": "Small Text",
- "label": "Health Details"
- },
- {
- "doctype": "DocField",
- "fieldname": "educational_qualification",
- "fieldtype": "Section Break",
- "label": "Educational Qualification"
- },
- {
- "doctype": "DocField",
- "fieldname": "educational_qualification_details",
- "fieldtype": "Table",
- "label": "Educational Qualification Details",
- "options": "Employee Education"
- },
- {
- "doctype": "DocField",
- "fieldname": "previous_work_experience",
- "fieldtype": "Section Break",
- "label": "Previous Work Experience",
- "options": "Simple"
- },
- {
- "doctype": "DocField",
- "fieldname": "previous_experience_details",
- "fieldtype": "Table",
- "label": "Employee External Work History",
- "options": "Employee External Work History"
- },
- {
- "doctype": "DocField",
- "fieldname": "history_in_company",
- "fieldtype": "Section Break",
- "label": "History In Company",
- "options": "Simple"
- },
- {
- "doctype": "DocField",
- "fieldname": "experience_in_company_details",
- "fieldtype": "Table",
- "label": "Employee Internal Work Historys",
- "options": "Employee Internal Work History"
- },
- {
- "doctype": "DocField",
- "fieldname": "exit",
- "fieldtype": "Section Break",
- "label": "Exit",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break7",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "resignation_letter_date",
- "fieldtype": "Date",
- "label": "Resignation Letter Date",
- "oldfieldname": "resignation_letter_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "relieving_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Relieving Date",
- "oldfieldname": "relieving_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "reason_for_leaving",
- "fieldtype": "Data",
- "label": "Reason for Leaving",
- "oldfieldname": "reason_for_leaving",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "leave_encashed",
- "fieldtype": "Select",
- "label": "Leave Encashed?",
- "oldfieldname": "leave_encashed",
- "oldfieldtype": "Select",
- "options": "\nYes\nNo"
- },
- {
- "doctype": "DocField",
- "fieldname": "encashment_date",
- "fieldtype": "Date",
- "label": "Encashment Date",
- "oldfieldname": "encashment_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "exit_interview_details",
- "fieldtype": "Column Break",
- "label": "Exit Interview Details",
- "oldfieldname": "col_brk6",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "held_on",
- "fieldtype": "Date",
- "label": "Held On",
- "oldfieldname": "held_on",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "reason_for_resignation",
- "fieldtype": "Select",
- "label": "Reason for Resignation",
- "oldfieldname": "reason_for_resignation",
- "oldfieldtype": "Select",
- "options": "\nBetter Prospects\nHealth Concerns"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_workplace",
- "fieldtype": "Data",
- "label": "New Workplace",
- "oldfieldname": "new_workplace",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "feedback",
- "fieldtype": "Small Text",
- "label": "Feedback",
- "oldfieldname": "feedback",
- "oldfieldtype": "Text"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Employee",
- "write": 0
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "restrict": 0,
- "role": "HR User",
- "write": 1
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "restrict": 1,
- "role": "HR Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-03-07 09:04:18.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "basic_information",
+ "fieldtype": "Section Break",
+ "label": "Basic Information",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "image_view",
+ "fieldtype": "Image",
+ "in_list_view": 0,
+ "label": "Image View",
+ "options": "image",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "employee",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Employee",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "EMP/",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "salutation",
+ "fieldtype": "Select",
+ "label": "Salutation",
+ "oldfieldname": "salutation",
+ "oldfieldtype": "Select",
+ "options": "\nMr\nMs",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "employee_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Full Name",
+ "oldfieldname": "employee_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "image",
+ "fieldtype": "Select",
+ "label": "Image",
+ "options": "attach_files:",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "description": "System User (login) ID. If set, it will become default for all HR forms.",
+ "fieldname": "user_id",
+ "fieldtype": "Link",
+ "label": "User ID",
+ "options": "User",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "employee_number",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Employee Number",
+ "oldfieldname": "employee_number",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "date_of_joining",
+ "fieldtype": "Date",
+ "label": "Date of Joining",
+ "oldfieldname": "date_of_joining",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "You can enter any date manually",
+ "fieldname": "date_of_birth",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Date of Birth",
+ "oldfieldname": "date_of_birth",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "gender",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Gender",
+ "oldfieldname": "gender",
+ "oldfieldtype": "Select",
+ "options": "\nMale\nFemale",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Company",
+ "options": "link:Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "employment_details",
+ "fieldtype": "Section Break",
+ "label": "Employment Details",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "col_break_21",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "default": "Active",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Status",
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nActive\nLeft",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "employment_type",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Employment Type",
+ "oldfieldname": "employment_type",
+ "oldfieldtype": "Link",
+ "options": "Employment Type",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "description": "Applicable Holiday List",
+ "fieldname": "holiday_list",
+ "fieldtype": "Link",
+ "label": "Holiday List",
+ "oldfieldname": "holiday_list",
+ "oldfieldtype": "Link",
+ "options": "Holiday List",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "col_break_22",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "scheduled_confirmation_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Offer Date",
+ "oldfieldname": "scheduled_confirmation_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "final_confirmation_date",
+ "fieldtype": "Date",
+ "label": "Confirmation Date",
+ "oldfieldname": "final_confirmation_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "contract_end_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Contract End Date",
+ "oldfieldname": "contract_end_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "date_of_retirement",
+ "fieldtype": "Date",
+ "label": "Date Of Retirement",
+ "oldfieldname": "date_of_retirement",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "job_profile",
+ "fieldtype": "Section Break",
+ "label": "Job Profile",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "branch",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Branch",
+ "oldfieldname": "branch",
+ "oldfieldtype": "Link",
+ "options": "Branch",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "department",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Department",
+ "oldfieldname": "department",
+ "oldfieldtype": "Link",
+ "options": "Department",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "designation",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Designation",
+ "oldfieldname": "designation",
+ "oldfieldtype": "Link",
+ "options": "Designation",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "grade",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Grade",
+ "oldfieldname": "grade",
+ "oldfieldtype": "Link",
+ "options": "Grade",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "description": "Provide email id registered in company",
+ "fieldname": "company_email",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Company Email",
+ "oldfieldname": "company_email",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "notice_number_of_days",
+ "fieldtype": "Int",
+ "label": "Notice (days)",
+ "oldfieldname": "notice_number_of_days",
+ "oldfieldtype": "Int",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "salary_information",
+ "fieldtype": "Column Break",
+ "label": "Salary Information",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "salary_mode",
+ "fieldtype": "Select",
+ "label": "Salary Mode",
+ "oldfieldname": "salary_mode",
+ "oldfieldtype": "Select",
+ "options": "\nBank\nCash\nCheque",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.salary_mode == 'Bank'",
+ "fieldname": "bank_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Bank Name",
+ "oldfieldname": "bank_name",
+ "oldfieldtype": "Link",
+ "options": "Suggest",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.salary_mode == 'Bank'",
+ "fieldname": "bank_ac_no",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Bank A/C No.",
+ "oldfieldname": "bank_ac_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "esic_card_no",
+ "fieldtype": "Data",
+ "label": "ESIC CARD No",
+ "oldfieldname": "esic_card_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "pf_number",
+ "fieldtype": "Data",
+ "label": "PF Number",
+ "oldfieldname": "pf_number",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "gratuity_lic_id",
+ "fieldtype": "Data",
+ "label": "Gratuity LIC ID",
+ "oldfieldname": "gratuity_lic_id",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "organization_profile",
+ "fieldtype": "Section Break",
+ "label": "Organization Profile",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reports_to",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Reports to",
+ "oldfieldname": "reports_to",
+ "oldfieldtype": "Link",
+ "options": "Employee",
+ "permlevel": 0
+ },
+ {
+ "description": "The first Leave Approver in the list will be set as the default Leave Approver",
+ "fieldname": "employee_leave_approvers",
+ "fieldtype": "Table",
+ "label": "Leave Approvers",
+ "options": "Employee Leave Approver",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "contact_details",
+ "fieldtype": "Section Break",
+ "label": "Contact Details",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "cell_number",
+ "fieldtype": "Data",
+ "label": "Cell Number",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "personal_email",
+ "fieldtype": "Data",
+ "label": "Personal Email",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "unsubscribed",
+ "fieldtype": "Check",
+ "label": "Unsubscribed",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "emergency_contact_details",
+ "fieldtype": "HTML",
+ "label": "Emergency Contact Details",
+ "options": "<h4 class=\"text-muted\">Emergency Contact Details</h4>",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "person_to_be_contacted",
+ "fieldtype": "Data",
+ "label": "Emergency Contact",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "relation",
+ "fieldtype": "Data",
+ "label": "Relation",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "emergency_phone_number",
+ "fieldtype": "Data",
+ "label": "Emergency Phone",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "permanent_accommodation_type",
+ "fieldtype": "Select",
+ "label": "Permanent Address Is",
+ "options": "\nRented\nOwned",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "permanent_address",
+ "fieldtype": "Small Text",
+ "label": "Permanent Address",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "current_accommodation_type",
+ "fieldtype": "Select",
+ "label": "Current Address Is",
+ "options": "\nRented\nOwned",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "current_address",
+ "fieldtype": "Small Text",
+ "label": "Current Address",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sb53",
+ "fieldtype": "Section Break",
+ "label": "Bio",
+ "permlevel": 0
+ },
+ {
+ "description": "Short biography for website and other publications.",
+ "fieldname": "bio",
+ "fieldtype": "Text Editor",
+ "label": "Bio",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "personal_details",
+ "fieldtype": "Section Break",
+ "label": "Personal Details",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break5",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "pan_number",
+ "fieldtype": "Data",
+ "label": "PAN Number",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "passport_number",
+ "fieldtype": "Data",
+ "label": "Passport Number",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "date_of_issue",
+ "fieldtype": "Date",
+ "label": "Date of Issue",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "valid_upto",
+ "fieldtype": "Date",
+ "label": "Valid Upto",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "place_of_issue",
+ "fieldtype": "Data",
+ "label": "Place of Issue",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break6",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "marital_status",
+ "fieldtype": "Select",
+ "label": "Marital Status",
+ "options": "\nSingle\nMarried\nDivorced\nWidowed",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "blood_group",
+ "fieldtype": "Select",
+ "label": "Blood Group",
+ "options": "\nA+\nA-\nB+\nB-\nAB+\nAB-\nO+\nO-",
+ "permlevel": 0
+ },
+ {
+ "description": "Here you can maintain family details like name and occupation of parent, spouse and children",
+ "fieldname": "family_background",
+ "fieldtype": "Small Text",
+ "label": "Family Background",
+ "permlevel": 0
+ },
+ {
+ "description": "Here you can maintain height, weight, allergies, medical concerns etc",
+ "fieldname": "health_details",
+ "fieldtype": "Small Text",
+ "label": "Health Details",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "educational_qualification",
+ "fieldtype": "Section Break",
+ "label": "Educational Qualification",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "educational_qualification_details",
+ "fieldtype": "Table",
+ "label": "Educational Qualification Details",
+ "options": "Employee Education",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "previous_work_experience",
+ "fieldtype": "Section Break",
+ "label": "Previous Work Experience",
+ "options": "Simple",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "previous_experience_details",
+ "fieldtype": "Table",
+ "label": "Employee External Work History",
+ "options": "Employee External Work History",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "history_in_company",
+ "fieldtype": "Section Break",
+ "label": "History In Company",
+ "options": "Simple",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "experience_in_company_details",
+ "fieldtype": "Table",
+ "label": "Employee Internal Work Historys",
+ "options": "Employee Internal Work History",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "exit",
+ "fieldtype": "Section Break",
+ "label": "Exit",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break7",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "resignation_letter_date",
+ "fieldtype": "Date",
+ "label": "Resignation Letter Date",
+ "oldfieldname": "resignation_letter_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "relieving_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Relieving Date",
+ "oldfieldname": "relieving_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reason_for_leaving",
+ "fieldtype": "Data",
+ "label": "Reason for Leaving",
+ "oldfieldname": "reason_for_leaving",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "leave_encashed",
+ "fieldtype": "Select",
+ "label": "Leave Encashed?",
+ "oldfieldname": "leave_encashed",
+ "oldfieldtype": "Select",
+ "options": "\nYes\nNo",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "encashment_date",
+ "fieldtype": "Date",
+ "label": "Encashment Date",
+ "oldfieldname": "encashment_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "exit_interview_details",
+ "fieldtype": "Column Break",
+ "label": "Exit Interview Details",
+ "oldfieldname": "col_brk6",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "held_on",
+ "fieldtype": "Date",
+ "label": "Held On",
+ "oldfieldname": "held_on",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reason_for_resignation",
+ "fieldtype": "Select",
+ "label": "Reason for Resignation",
+ "oldfieldname": "reason_for_resignation",
+ "oldfieldtype": "Select",
+ "options": "\nBetter Prospects\nHealth Concerns",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_workplace",
+ "fieldtype": "Data",
+ "label": "New Workplace",
+ "oldfieldname": "new_workplace",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "feedback",
+ "fieldtype": "Small Text",
+ "label": "Feedback",
+ "oldfieldname": "feedback",
+ "oldfieldtype": "Text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-user",
+ "idx": 1,
+ "modified": "2014-02-03 18:06:04.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Employee",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Employee",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "restrict": 0,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "restrict": 1,
+ "role": "HR Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "search_fields": "employee_name"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_education/employee_education.py b/erpnext/hr/doctype/employee_education/employee_education.py
index 26c87f1..2cc0f26 100644
--- a/erpnext/hr/doctype/employee_education/employee_education.py
+++ b/erpnext/hr/doctype/employee_education/employee_education.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class EmployeeEducation(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_education/employee_education.txt b/erpnext/hr/doctype/employee_education/employee_education.txt
index 9204c63..e1dbb1a 100644
--- a/erpnext/hr/doctype/employee_education/employee_education.txt
+++ b/erpnext/hr/doctype/employee_education/employee_education.txt
@@ -1,79 +1,71 @@
-[
- {
- "creation": "2013-02-22 01:27:45",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:12",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Employee Education",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Employee Education"
- },
- {
- "doctype": "DocField",
- "fieldname": "school_univ",
- "fieldtype": "Small Text",
- "label": "School/University",
- "oldfieldname": "school_univ",
- "oldfieldtype": "Small Text"
- },
- {
- "doctype": "DocField",
- "fieldname": "qualification",
- "fieldtype": "Data",
- "label": "Qualification",
- "oldfieldname": "qualification",
- "oldfieldtype": "Data",
- "print_width": "100px",
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "level",
- "fieldtype": "Select",
- "label": "Level",
- "oldfieldname": "level",
- "oldfieldtype": "Select",
- "options": "Graduate\nPost Graduate\nUnder Graduate"
- },
- {
- "doctype": "DocField",
- "fieldname": "year_of_passing",
- "fieldtype": "Int",
- "label": "Year of Passing",
- "oldfieldname": "year_of_passing",
- "oldfieldtype": "Int"
- },
- {
- "doctype": "DocField",
- "fieldname": "class_per",
- "fieldtype": "Data",
- "label": "Class / Percentage",
- "oldfieldname": "class_per",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "maj_opt_subj",
- "fieldtype": "Text",
- "label": "Major/Optional Subjects",
- "oldfieldname": "maj_opt_subj",
- "oldfieldtype": "Text"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:45.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "school_univ",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "School/University",
+ "oldfieldname": "school_univ",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qualification",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Qualification",
+ "oldfieldname": "qualification",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_width": "100px",
+ "width": "100px"
+ },
+ {
+ "fieldname": "level",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Level",
+ "oldfieldname": "level",
+ "oldfieldtype": "Select",
+ "options": "Graduate\nPost Graduate\nUnder Graduate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "year_of_passing",
+ "fieldtype": "Int",
+ "in_list_view": 1,
+ "label": "Year of Passing",
+ "oldfieldname": "year_of_passing",
+ "oldfieldtype": "Int",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "class_per",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Class / Percentage",
+ "oldfieldname": "class_per",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "maj_opt_subj",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Major/Optional Subjects",
+ "oldfieldname": "maj_opt_subj",
+ "oldfieldtype": "Text",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:12.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Employee Education",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py
index 26c87f1..a99e4de 100644
--- a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py
+++ b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class EmployeeExternalWorkHistory(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt
index 962c981..41a110f 100644
--- a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt
+++ b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt
@@ -1,77 +1,69 @@
-[
- {
- "creation": "2013-02-22 01:27:45",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:12",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Employee External Work History",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Employee External Work History"
- },
- {
- "doctype": "DocField",
- "fieldname": "company_name",
- "fieldtype": "Data",
- "label": "Company",
- "oldfieldname": "company_name",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "designation",
- "fieldtype": "Data",
- "label": "Designation",
- "oldfieldname": "designation",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "salary",
- "fieldtype": "Currency",
- "label": "Salary",
- "oldfieldname": "salary",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "address",
- "fieldtype": "Small Text",
- "label": "Address",
- "oldfieldname": "address",
- "oldfieldtype": "Small Text"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact",
- "fieldtype": "Data",
- "label": "Contact",
- "oldfieldname": "contact",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_experience",
- "fieldtype": "Data",
- "label": "Total Experience",
- "oldfieldname": "total_experience",
- "oldfieldtype": "Data"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:45.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "company_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Company",
+ "oldfieldname": "company_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "designation",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Designation",
+ "oldfieldname": "designation",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "salary",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Salary",
+ "oldfieldname": "salary",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "address",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Address",
+ "oldfieldname": "address",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "contact",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Contact",
+ "oldfieldname": "contact",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "total_experience",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Total Experience",
+ "oldfieldname": "total_experience",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:12.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Employee External Work History",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py
index 26c87f1..65dfa44 100644
--- a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py
+++ b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class EmployeeInternalWorkHistory(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt
index 2c964fa..d358990 100644
--- a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt
+++ b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt
@@ -1,80 +1,72 @@
-[
- {
- "creation": "2013-02-22 01:27:45",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:12",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Employee Internal Work History",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Employee Internal Work History"
- },
- {
- "doctype": "DocField",
- "fieldname": "branch",
- "fieldtype": "Select",
- "label": "Branch",
- "oldfieldname": "branch",
- "oldfieldtype": "Select",
- "options": "link:Branch"
- },
- {
- "doctype": "DocField",
- "fieldname": "department",
- "fieldtype": "Select",
- "label": "Department",
- "oldfieldname": "department",
- "oldfieldtype": "Select",
- "options": "link:Department"
- },
- {
- "doctype": "DocField",
- "fieldname": "designation",
- "fieldtype": "Select",
- "label": "Designation",
- "oldfieldname": "designation",
- "oldfieldtype": "Select",
- "options": "link:Designation"
- },
- {
- "doctype": "DocField",
- "fieldname": "grade",
- "fieldtype": "Select",
- "label": "Grade",
- "oldfieldname": "grade",
- "oldfieldtype": "Select",
- "options": "link:Grade"
- },
- {
- "doctype": "DocField",
- "fieldname": "from_date",
- "fieldtype": "Date",
- "label": "From Date",
- "oldfieldname": "from_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "to_date",
- "fieldtype": "Date",
- "label": "To Date",
- "oldfieldname": "to_date",
- "oldfieldtype": "Date"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:45.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "branch",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Branch",
+ "oldfieldname": "branch",
+ "oldfieldtype": "Select",
+ "options": "link:Branch",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "department",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Department",
+ "oldfieldname": "department",
+ "oldfieldtype": "Select",
+ "options": "link:Department",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "designation",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Designation",
+ "oldfieldname": "designation",
+ "oldfieldtype": "Select",
+ "options": "link:Designation",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "grade",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Grade",
+ "oldfieldname": "grade",
+ "oldfieldtype": "Select",
+ "options": "link:Grade",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "from_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "From Date",
+ "oldfieldname": "from_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "to_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "To Date",
+ "oldfieldname": "to_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:12.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Employee Internal Work History",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.py b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.py
index 968a25b..8736c4f 100644
--- a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.py
+++ b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class EmployeeLeaveApprover(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt
index 4b176d1..c0cb78d 100644
--- a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt
+++ b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt
@@ -1,40 +1,27 @@
-[
- {
- "creation": "2013-04-12 06:56:15",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:12",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 0,
- "autoname": "LAPPR-/.#####",
- "description": "Users who can approve a specific employee's leave applications",
- "doctype": "DocType",
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "fieldname": "leave_approver",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Leave Approver",
- "name": "__common__",
- "parent": "Employee Leave Approver",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "print_hide": 1,
- "reqd": 1,
- "width": "200"
- },
- {
- "doctype": "DocType",
- "name": "Employee Leave Approver"
- },
- {
- "doctype": "DocField"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 0,
+ "autoname": "LAPPR-/.#####",
+ "creation": "2013-04-12 06:56:15.000000",
+ "description": "Users who can approve a specific employee's leave applications",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "leave_approver",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Leave Approver",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "width": "200"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:12.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Employee Leave Approver",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employment_type/employment_type.py b/erpnext/hr/doctype/employment_type/employment_type.py
index 5015bed..87a8634 100644
--- a/erpnext/hr/doctype/employment_type/employment_type.py
+++ b/erpnext/hr/doctype/employment_type/employment_type.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
-
\ No newline at end of file
+from frappe.model.document import Document
+
+class EmploymentType(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/employment_type/employment_type.txt b/erpnext/hr/doctype/employment_type/employment_type.txt
index a91e145..4fa41fe 100644
--- a/erpnext/hr/doctype/employment_type/employment_type.txt
+++ b/erpnext/hr/doctype/employment_type/employment_type.txt
@@ -1,73 +1,63 @@
-[
- {
- "creation": "2013-01-10 16:34:14",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:43",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:employee_type_name",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-flag",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Employment Type",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Employment Type",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Employment Type"
- },
- {
- "doctype": "DocField",
- "fieldname": "employee_type_name",
- "fieldtype": "Data",
- "label": "Employment Type",
- "oldfieldname": "employee_type_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocPerm",
- "role": "HR User"
- },
- {
- "doctype": "DocPerm",
- "role": "HR Manager"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:employee_type_name",
+ "creation": "2013-01-10 16:34:14.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "employee_type_name",
+ "fieldtype": "Data",
+ "label": "Employment Type",
+ "oldfieldname": "employee_type_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-flag",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:43.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Employment Type",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js
index 6ff1d3f..a399d5f 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.js
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.js
@@ -69,8 +69,7 @@
}
cur_frm.cscript.clear_sanctioned = function(doc) {
- var val = getchildren('Expense Claim Detail', doc.name,
- 'expense_voucher_details', doc.doctype);
+ var val = doc.expense_voucher_details || [];
for(var i = 0; i<val.length; i++){
val[i].sanctioned_amount ='';
}
@@ -125,7 +124,7 @@
cur_frm.cscript.calculate_total = function(doc,cdt,cdn){
doc.total_claimed_amount = 0;
doc.total_sanctioned_amount = 0;
- $.each(frappe.model.get("Expense Claim Detail", {parent:doc.name}), function(i, d) {
+ $.each((doc.expense_voucher_details || []), function(i, d) {
doc.total_claimed_amount += d.claim_amount;
if(d.sanctioned_amount==null) {
d.sanctioned_amount = d.claim_amount;
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.py b/erpnext/hr/doctype/expense_claim/expense_claim.py
index 0fbfde5..1d02e87 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.py
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.py
@@ -7,10 +7,9 @@
from frappe.model.bean import getlist
from frappe import msgprint
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class ExpenseClaim(Document):
def validate(self):
self.validate_fiscal_year()
@@ -26,6 +25,6 @@
validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, "Posting Date")
def validate_exp_details(self):
- if not getlist(self.doclist, 'expense_voucher_details'):
+ if not self.get('expense_voucher_details'):
msgprint("Please add expense voucher details")
raise Exception
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.txt b/erpnext/hr/doctype/expense_claim/expense_claim.txt
index ac7f788..103831c 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.txt
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.txt
@@ -1,245 +1,238 @@
-[
- {
- "creation": "2013-01-10 16:34:14",
- "docstatus": 0,
- "modified": "2014-01-22 16:05:34",
- "modified_by": "Administrator",
- "owner": "harshada@webnotestech.com"
- },
- {
- "autoname": "EXP.######",
- "doctype": "DocType",
- "icon": "icon-money",
- "is_submittable": 1,
- "module": "HR",
- "name": "__common__",
- "search_fields": "approval_status,employee,employee_name"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Expense Claim",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Expense Claim",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Expense Claim"
- },
- {
- "default": "Draft",
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "approval_status",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Approval Status",
- "no_copy": 1,
- "oldfieldname": "approval_status",
- "oldfieldtype": "Select",
- "options": "Draft\nApproved\nRejected",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "exp_approver",
- "fieldtype": "Select",
- "label": "Approver",
- "oldfieldname": "exp_approver",
- "oldfieldtype": "Select",
- "width": "160px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_claimed_amount",
- "fieldtype": "Currency",
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Total Claimed Amount",
- "no_copy": 1,
- "oldfieldname": "total_claimed_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1,
- "reqd": 0,
- "width": "160px"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_sanctioned_amount",
- "fieldtype": "Currency",
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Total Sanctioned Amount",
- "no_copy": 1,
- "oldfieldname": "total_sanctioned_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1,
- "width": "160px"
- },
- {
- "doctype": "DocField",
- "fieldname": "expense_details",
- "fieldtype": "Section Break",
- "label": "Expense Details",
- "oldfieldtype": "Section Break"
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "expense_voucher_details",
- "fieldtype": "Table",
- "label": "Expense Claim Details",
- "oldfieldname": "expense_voucher_details",
- "oldfieldtype": "Table",
- "options": "Expense Claim Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "sb1",
- "fieldtype": "Section Break",
- "options": "Simple"
- },
- {
- "doctype": "DocField",
- "fieldname": "employee",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "From Employee",
- "oldfieldname": "employee",
- "oldfieldtype": "Link",
- "options": "Employee",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "employee_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Employee Name",
- "oldfieldname": "employee_name",
- "oldfieldtype": "Data",
- "read_only": 1,
- "search_index": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "link:Company",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cb1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Posting Date",
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "reqd": 1
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "remark",
- "fieldtype": "Small Text",
- "label": "Remark",
- "no_copy": 1,
- "oldfieldname": "remark",
- "oldfieldtype": "Small Text"
- },
- {
- "doctype": "DocField",
- "fieldname": "email_id",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Employees Email Id",
- "oldfieldname": "email_id",
- "oldfieldtype": "Data",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 1,
- "width": "160px"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "restricted": 1,
- "role": "Employee"
- },
- {
- "amend": 1,
- "cancel": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Expense Approver",
- "submit": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "HR User",
- "submit": 1
- }
-]
\ No newline at end of file
+{
+ "autoname": "EXP.######",
+ "creation": "2013-01-10 16:34:14.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "default": "Draft",
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "approval_status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Approval Status",
+ "no_copy": 1,
+ "oldfieldname": "approval_status",
+ "oldfieldtype": "Select",
+ "options": "Draft\nApproved\nRejected",
+ "permlevel": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "exp_approver",
+ "fieldtype": "Select",
+ "label": "Approver",
+ "oldfieldname": "exp_approver",
+ "oldfieldtype": "Select",
+ "permlevel": 0,
+ "width": "160px"
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "total_claimed_amount",
+ "fieldtype": "Currency",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Total Claimed Amount",
+ "no_copy": 1,
+ "oldfieldname": "total_claimed_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "width": "160px"
+ },
+ {
+ "fieldname": "total_sanctioned_amount",
+ "fieldtype": "Currency",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Total Sanctioned Amount",
+ "no_copy": 1,
+ "oldfieldname": "total_sanctioned_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "width": "160px"
+ },
+ {
+ "fieldname": "expense_details",
+ "fieldtype": "Section Break",
+ "label": "Expense Details",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "expense_voucher_details",
+ "fieldtype": "Table",
+ "label": "Expense Claim Details",
+ "oldfieldname": "expense_voucher_details",
+ "oldfieldtype": "Table",
+ "options": "Expense Claim Detail",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sb1",
+ "fieldtype": "Section Break",
+ "options": "Simple",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "employee",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "From Employee",
+ "oldfieldname": "employee",
+ "oldfieldtype": "Link",
+ "options": "Employee",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "employee_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Employee Name",
+ "oldfieldname": "employee_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "link:Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "cb1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Posting Date",
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "remark",
+ "fieldtype": "Small Text",
+ "label": "Remark",
+ "no_copy": 1,
+ "oldfieldname": "remark",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "email_id",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Employees Email Id",
+ "oldfieldname": "email_id",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1,
+ "width": "160px"
+ }
+ ],
+ "icon": "icon-money",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-22 16:05:34.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Expense Claim",
+ "owner": "harshada@webnotestech.com",
+ "permissions": [
+ {
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "restricted": 1,
+ "role": "Employee",
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Expense Approver",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "search_fields": "approval_status,employee,employee_name"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py
index 26c87f1..fe6cb1e 100644
--- a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py
+++ b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ExpenseClaimDetail(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt
index 18b8036..54bedc4 100644
--- a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt
+++ b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt
@@ -1,86 +1,77 @@
-[
- {
- "creation": "2013-02-22 01:27:46",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:13",
- "modified_by": "Administrator",
- "owner": "harshada@webnotestech.com"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Expense Claim Detail",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Expense Claim Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "expense_date",
- "fieldtype": "Date",
- "label": "Expense Date",
- "oldfieldname": "expense_date",
- "oldfieldtype": "Date",
- "print_width": "150px",
- "reqd": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "expense_type",
- "fieldtype": "Select",
- "label": "Expense Claim Type",
- "oldfieldname": "expense_type",
- "oldfieldtype": "Link",
- "options": "link:Expense Claim Type",
- "print_width": "150px",
- "reqd": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "print_width": "300px",
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "claim_amount",
- "fieldtype": "Currency",
- "label": "Claim Amount",
- "oldfieldname": "claim_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_width": "150px",
- "reqd": 1,
- "width": "150px"
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "sanctioned_amount",
- "fieldtype": "Currency",
- "label": "Sanctioned Amount",
- "no_copy": 1,
- "oldfieldname": "sanctioned_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_width": "150px",
- "width": "150px"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:46.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "expense_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Expense Date",
+ "oldfieldname": "expense_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_width": "150px",
+ "reqd": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "expense_type",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Expense Claim Type",
+ "oldfieldname": "expense_type",
+ "oldfieldtype": "Link",
+ "options": "link:Expense Claim Type",
+ "permlevel": 0,
+ "print_width": "150px",
+ "reqd": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "width": "300px"
+ },
+ {
+ "fieldname": "claim_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Claim Amount",
+ "oldfieldname": "claim_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_width": "150px",
+ "reqd": 1,
+ "width": "150px"
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "sanctioned_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Sanctioned Amount",
+ "no_copy": 1,
+ "oldfieldname": "sanctioned_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_width": "150px",
+ "width": "150px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:13.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Expense Claim Detail",
+ "owner": "harshada@webnotestech.com"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py
index 26c87f1..bc0db7f 100644
--- a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py
+++ b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ExpenseClaimType(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt
index 689da6e..e733da0 100644
--- a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt
+++ b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt
@@ -1,68 +1,49 @@
-[
- {
- "creation": "2012-03-27 14:35:55",
- "docstatus": 0,
- "modified": "2013-12-20 19:24:07",
- "modified_by": "Administrator",
- "owner": "harshada@webnotestech.com"
- },
- {
- "allow_import": 1,
- "autoname": "field:expense_type",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-flag",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Expense Claim Type",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Expense Claim Type",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "HR Manager",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Expense Claim Type"
- },
- {
- "doctype": "DocField",
- "fieldname": "expense_type",
- "fieldtype": "Data",
- "in_filter": 0,
- "label": "Expense Claim Type",
- "oldfieldname": "expense_type",
- "oldfieldtype": "Data",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "width": "300px"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:expense_type",
+ "creation": "2012-03-27 14:35:55.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "expense_type",
+ "fieldtype": "Data",
+ "in_filter": 0,
+ "label": "Expense Claim Type",
+ "oldfieldname": "expense_type",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "width": "300px"
+ }
+ ],
+ "icon": "icon-flag",
+ "idx": 1,
+ "modified": "2013-12-20 19:24:07.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Expense Claim Type",
+ "owner": "harshada@webnotestech.com",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/grade/grade.py b/erpnext/hr/doctype/grade/grade.py
index 58ecbe8..04e3e97 100644
--- a/erpnext/hr/doctype/grade/grade.py
+++ b/erpnext/hr/doctype/grade/grade.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
-
+from frappe.model.document import Document
+
+class Grade(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/grade/grade.txt b/erpnext/hr/doctype/grade/grade.txt
index dcadd63..24de355 100644
--- a/erpnext/hr/doctype/grade/grade.txt
+++ b/erpnext/hr/doctype/grade/grade.txt
@@ -1,60 +1,41 @@
-[
- {
- "creation": "2013-01-10 16:34:14",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:46",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:grade_name",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-star-half-empty",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "fieldname": "grade_name",
- "fieldtype": "Data",
- "label": "Grade",
- "name": "__common__",
- "oldfieldname": "grade_name",
- "oldfieldtype": "Data",
- "parent": "Grade",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "reqd": 1
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Grade",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "HR User",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Grade"
- },
- {
- "doctype": "DocField"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:grade_name",
+ "creation": "2013-01-10 16:34:14.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "grade_name",
+ "fieldtype": "Data",
+ "label": "Grade",
+ "oldfieldname": "grade_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "icon": "icon-star-half-empty",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:46.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Grade",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/holiday/holiday.py b/erpnext/hr/doctype/holiday/holiday.py
index 26c87f1..2e64a10 100644
--- a/erpnext/hr/doctype/holiday/holiday.py
+++ b/erpnext/hr/doctype/holiday/holiday.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class Holiday(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/holiday/holiday.txt b/erpnext/hr/doctype/holiday/holiday.txt
index ad8ddb0..a00fbe8 100644
--- a/erpnext/hr/doctype/holiday/holiday.txt
+++ b/erpnext/hr/doctype/holiday/holiday.txt
@@ -1,44 +1,32 @@
-[
- {
- "creation": "2013-02-22 01:27:46",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:14",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Holiday",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Holiday"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "label": "Description",
- "print_width": "300px",
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "holiday_date",
- "fieldtype": "Date",
- "label": "Date",
- "oldfieldname": "holiday_date",
- "oldfieldtype": "Date"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:46.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "permlevel": 0,
+ "print_width": "300px",
+ "width": "300px"
+ },
+ {
+ "fieldname": "holiday_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Date",
+ "oldfieldname": "holiday_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:14.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Holiday",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.py b/erpnext/hr/doctype/holiday_list/holiday_list.py
index 8fdfccc..80c1413 100644
--- a/erpnext/hr/doctype/holiday_list/holiday_list.py
+++ b/erpnext/hr/doctype/holiday_list/holiday_list.py
@@ -5,17 +5,13 @@
import frappe
from frappe.utils import add_days, add_years, cint, getdate
-from frappe.model import db_exists
-from frappe.model.doc import addchild, make_autoname
-from frappe.model.bean import copy_doclist
+from frappe.model.naming import make_autoname
from frappe import msgprint, throw, _
import datetime
-class DocType:
- def __init__(self,doc,doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+class HolidayList(Document):
def autoname(self):
self.doc.name = make_autoname(self.doc.fiscal_year + "/" + self.doc.holiday_list_name + "/.###")
@@ -29,7 +25,7 @@
last_idx = max([cint(d.idx) for d in self.doclist.get(
{"parentfield": "holiday_list_details"})] or [0,])
for i, d in enumerate(date_list):
- ch = addchild(self.doc, 'holiday_list_details', 'Holiday', self.doclist)
+ ch = self.doc.append('holiday_list_details', {})
ch.description = self.doc.weekly_off
ch.holiday_date = d
ch.idx = last_idx + i + 1
@@ -63,7 +59,7 @@
return date_list
def clear_table(self):
- self.doclist = self.doc.clear_table(self.doclist, 'holiday_list_details')
+ self.set('holiday_list_details', [])
def update_default_holiday_list(self):
frappe.db.sql("""update `tabHoliday List` set is_default = 0
diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.txt b/erpnext/hr/doctype/holiday_list/holiday_list.txt
index 3122583..11b6911 100644
--- a/erpnext/hr/doctype/holiday_list/holiday_list.txt
+++ b/erpnext/hr/doctype/holiday_list/holiday_list.txt
@@ -1,119 +1,100 @@
-[
- {
- "creation": "2013-01-10 16:34:14",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:46",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-calendar",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Holiday List",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Holiday List",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "HR Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Holiday List"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "holiday_list_name",
- "fieldtype": "Data",
- "label": "Holiday List Name",
- "oldfieldname": "holiday_list_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "is_default",
- "fieldtype": "Check",
- "label": "Default"
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Link",
- "options": "link:Fiscal Year",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "weekly_off",
- "fieldtype": "Select",
- "label": "Weekly Off",
- "no_copy": 1,
- "options": "\nSunday\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "get_weekly_off_dates",
- "fieldtype": "Button",
- "label": "Get Weekly Off Dates",
- "options": "get_weekly_off_dates"
- },
- {
- "doctype": "DocField",
- "fieldname": "holiday_list_details",
- "fieldtype": "Table",
- "label": "Holidays",
- "oldfieldname": "holiday_list_details",
- "oldfieldtype": "Table",
- "options": "Holiday",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "clear_table",
- "fieldtype": "Button",
- "label": "Clear Table",
- "options": "clear_table"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "creation": "2013-01-10 16:34:14.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "holiday_list_name",
+ "fieldtype": "Data",
+ "label": "Holiday List Name",
+ "oldfieldname": "holiday_list_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "is_default",
+ "fieldtype": "Check",
+ "label": "Default",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Link",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "weekly_off",
+ "fieldtype": "Select",
+ "label": "Weekly Off",
+ "no_copy": 1,
+ "options": "\nSunday\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "get_weekly_off_dates",
+ "fieldtype": "Button",
+ "label": "Get Weekly Off Dates",
+ "options": "get_weekly_off_dates",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "holiday_list_details",
+ "fieldtype": "Table",
+ "label": "Holidays",
+ "oldfieldname": "holiday_list_details",
+ "oldfieldtype": "Table",
+ "options": "Holiday",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "clear_table",
+ "fieldtype": "Button",
+ "label": "Clear Table",
+ "options": "clear_table",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-calendar",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:46.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Holiday List",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.py b/erpnext/hr/doctype/hr_settings/hr_settings.py
index e9e44d4..6d5f8e0 100644
--- a/erpnext/hr/doctype/hr_settings/hr_settings.py
+++ b/erpnext/hr/doctype/hr_settings/hr_settings.py
@@ -8,9 +8,9 @@
from frappe.utils import cint
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class HrSettings(Document):
def validate(self):
self.update_birthday_reminders()
diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.txt b/erpnext/hr/doctype/hr_settings/hr_settings.txt
index d30dc0a..15443db 100644
--- a/erpnext/hr/doctype/hr_settings/hr_settings.txt
+++ b/erpnext/hr/doctype/hr_settings/hr_settings.txt
@@ -1,81 +1,62 @@
-[
- {
- "creation": "2013-08-02 13:45:23",
- "docstatus": 0,
- "modified": "2014-02-19 17:40:18",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "document_type": "Other",
- "icon": "icon-cog",
- "issingle": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "HR Settings",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "HR Settings",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "role": "System Manager",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "HR Settings"
- },
- {
- "doctype": "DocField",
- "fieldname": "employee_settings",
- "fieldtype": "Section Break",
- "label": "Employee Settings"
- },
- {
- "default": "Naming Series",
- "description": "Employee record is created using selected field. ",
- "doctype": "DocField",
- "fieldname": "emp_created_by",
- "fieldtype": "Select",
- "label": "Employee Records to be created by",
- "options": "Naming Series\nEmployee Number"
- },
- {
- "description": "Don't send Employee Birthday Reminders",
- "doctype": "DocField",
- "fieldname": "stop_birthday_reminders",
- "fieldtype": "Check",
- "label": "Stop Birthday Reminders"
- },
- {
- "doctype": "DocField",
- "fieldname": "payroll_settings",
- "fieldtype": "Section Break",
- "label": "Payroll Settings"
- },
- {
- "description": "If checked, Total no. of Working Days will include holidays, and this will reduce the value of Salary Per Day",
- "doctype": "DocField",
- "fieldname": "include_holidays_in_total_working_days",
- "fieldtype": "Check",
- "label": "Include holidays in Total no. of Working Days"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-08-02 13:45:23.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "fields": [
+ {
+ "fieldname": "employee_settings",
+ "fieldtype": "Section Break",
+ "label": "Employee Settings",
+ "permlevel": 0
+ },
+ {
+ "default": "Naming Series",
+ "description": "Employee record is created using selected field. ",
+ "fieldname": "emp_created_by",
+ "fieldtype": "Select",
+ "label": "Employee Records to be created by",
+ "options": "Naming Series\nEmployee Number",
+ "permlevel": 0
+ },
+ {
+ "description": "Don't send Employee Birthday Reminders",
+ "fieldname": "stop_birthday_reminders",
+ "fieldtype": "Check",
+ "label": "Stop Birthday Reminders",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "payroll_settings",
+ "fieldtype": "Section Break",
+ "label": "Payroll Settings",
+ "permlevel": 0
+ },
+ {
+ "description": "If checked, Total no. of Working Days will include holidays, and this will reduce the value of Salary Per Day",
+ "fieldname": "include_holidays_in_total_working_days",
+ "fieldtype": "Check",
+ "label": "Include holidays in Total no. of Working Days",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-cog",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2014-02-19 17:40:18.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "HR Settings",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "System Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.js b/erpnext/hr/doctype/job_applicant/job_applicant.js
index f0fe443..6186535 100644
--- a/erpnext/hr/doctype/job_applicant/job_applicant.js
+++ b/erpnext/hr/doctype/job_applicant/job_applicant.js
@@ -15,7 +15,7 @@
},
make_listing: function(doc) {
cur_frm.communication_view = new frappe.views.CommunicationList({
- list: frappe.model.get("Communication", {"parent": doc.name, "parenttype": "Job Applicant"}),
+ list: frappe.get_list("Communication", {"parent": doc.name, "parenttype": "Job Applicant"}),
parent: cur_frm.fields_dict['thread_html'].wrapper,
doc: doc,
recipients: doc.email_id
diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.py b/erpnext/hr/doctype/job_applicant/job_applicant.py
index 41fc5f3..3640304 100644
--- a/erpnext/hr/doctype/job_applicant/job_applicant.py
+++ b/erpnext/hr/doctype/job_applicant/job_applicant.py
@@ -8,9 +8,7 @@
from erpnext.utilities.transaction_base import TransactionBase
from frappe.utils import extract_email_id
-class DocType(TransactionBase):
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+class JobApplicant(TransactionBase):
def get_sender(self, comm):
return frappe.db.get_value('Jobs Email Settings',None,'email_id')
diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.txt b/erpnext/hr/doctype/job_applicant/job_applicant.txt
index fd463fb..ae9e9f6 100644
--- a/erpnext/hr/doctype/job_applicant/job_applicant.txt
+++ b/erpnext/hr/doctype/job_applicant/job_applicant.txt
@@ -1,107 +1,88 @@
-[
- {
- "creation": "2013-01-29 19:25:37",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:50",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "autoname": "field:applicant_name",
- "description": "Applicant for a Job",
- "doctype": "DocType",
- "document_type": "Transaction",
- "icon": "icon-user",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Job Applicant",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Job Applicant",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "HR User",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Job Applicant"
- },
- {
- "doctype": "DocField",
- "fieldname": "applicant_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Applicant Name",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "email_id",
- "fieldtype": "Data",
- "label": "Email Id"
- },
- {
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Status",
- "options": "Open\nReplied\nRejected\nHold"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_3",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "job_opening",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Job Opening",
- "options": "Job Opening"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_5",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "thread_html",
- "fieldtype": "HTML",
- "label": "Thread HTML"
- },
- {
- "doctype": "DocField",
- "fieldname": "communications",
- "fieldtype": "Table",
- "hidden": 1,
- "label": "Communications",
- "options": "Communication",
- "print_hide": 1
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "autoname": "field:applicant_name",
+ "creation": "2013-01-29 19:25:37.000000",
+ "description": "Applicant for a Job",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "fieldname": "applicant_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Applicant Name",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "email_id",
+ "fieldtype": "Data",
+ "label": "Email Id",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Status",
+ "options": "Open\nReplied\nRejected\nHold",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "job_opening",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Job Opening",
+ "options": "Job Opening",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "section_break_5",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "thread_html",
+ "fieldtype": "HTML",
+ "label": "Thread HTML",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "icon": "icon-user",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:50.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Job Applicant",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/job_opening/job_opening.py b/erpnext/hr/doctype/job_opening/job_opening.py
index 968a25b..4224207 100644
--- a/erpnext/hr/doctype/job_opening/job_opening.py
+++ b/erpnext/hr/doctype/job_opening/job_opening.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class JobOpening(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/job_opening/job_opening.txt b/erpnext/hr/doctype/job_opening/job_opening.txt
index b118b6a..a5bff4b 100644
--- a/erpnext/hr/doctype/job_opening/job_opening.txt
+++ b/erpnext/hr/doctype/job_opening/job_opening.txt
@@ -1,71 +1,52 @@
-[
- {
- "creation": "2013-01-15 16:13:36",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:51",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "field:job_title",
- "description": "Description of a Job Opening",
- "doctype": "DocType",
- "document_type": "Transaction",
- "icon": "icon-bookmark",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Job Opening",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Job Opening",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "HR User",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Job Opening"
- },
- {
- "doctype": "DocField",
- "fieldname": "job_title",
- "fieldtype": "Data",
- "label": "Job Title",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "label": "Status",
- "options": "Open\nClosed"
- },
- {
- "description": "Job profile, qualifications required etc.",
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text Editor",
- "label": "Description"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "autoname": "field:job_title",
+ "creation": "2013-01-15 16:13:36.000000",
+ "description": "Description of a Job Opening",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "fieldname": "job_title",
+ "fieldtype": "Data",
+ "label": "Job Title",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "label": "Status",
+ "options": "Open\nClosed",
+ "permlevel": 0
+ },
+ {
+ "description": "Job profile, qualifications required etc.",
+ "fieldname": "description",
+ "fieldtype": "Text Editor",
+ "label": "Description",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-bookmark",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:51.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Job Opening",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.py b/erpnext/hr/doctype/leave_allocation/leave_allocation.py
index 7648ba5..a78dc1a 100755
--- a/erpnext/hr/doctype/leave_allocation/leave_allocation.py
+++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.py
@@ -6,7 +6,9 @@
from frappe.utils import cint, flt
from frappe import msgprint
-class DocType:
+from frappe.model.document import Document
+
+class LeaveAllocation(Document):
def __init__(self, doc, doclist):
self.doc, self.doclist = doc, doclist
diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.txt b/erpnext/hr/doctype/leave_allocation/leave_allocation.txt
index 60f2523..c8d67ca 100644
--- a/erpnext/hr/doctype/leave_allocation/leave_allocation.txt
+++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.txt
@@ -1,181 +1,172 @@
-[
- {
- "creation": "2013-02-20 19:10:38",
- "docstatus": 0,
- "modified": "2014-01-22 16:05:35",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "LAL/.#####",
- "doctype": "DocType",
- "icon": "icon-ok",
- "is_submittable": 1,
- "module": "HR",
- "name": "__common__",
- "search_fields": "employee,employee_name,leave_type,total_leaves_allocated,fiscal_year"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Leave Allocation",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Leave Allocation",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Leave Allocation"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "employee",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Employee",
- "oldfieldname": "employee",
- "oldfieldtype": "Link",
- "options": "Employee",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "employee_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Employee Name",
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "leave_type",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Leave Type",
- "oldfieldname": "leave_type",
- "oldfieldtype": "Link",
- "options": "link:Leave Type",
- "reqd": 1,
- "search_index": 1
- },
- {
- "default": "Today",
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "hidden": 0,
- "label": "Posting Date",
- "no_copy": 1,
- "oldfieldname": "date",
- "oldfieldtype": "Date",
- "read_only": 1,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Data",
- "options": "link:Fiscal Year",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "hidden": 0,
- "label": "Description",
- "oldfieldname": "reason",
- "oldfieldtype": "Small Text",
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "carry_forward",
- "fieldtype": "Check",
- "label": "Carry Forward"
- },
- {
- "depends_on": "carry_forward",
- "doctype": "DocField",
- "fieldname": "carry_forwarded_leaves",
- "fieldtype": "Float",
- "label": "Carry Forwarded Leaves",
- "read_only": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "new_leaves_allocated",
- "fieldtype": "Float",
- "label": "New Leaves Allocated"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_leaves_allocated",
- "fieldtype": "Float",
- "label": "Total Leaves Allocated",
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocPerm",
- "restricted": 1,
- "role": "HR User"
- },
- {
- "doctype": "DocPerm",
- "role": "HR Manager"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "LAL/.#####",
+ "creation": "2013-02-20 19:10:38.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "employee",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Employee",
+ "oldfieldname": "employee",
+ "oldfieldtype": "Link",
+ "options": "Employee",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "employee_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Employee Name",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "leave_type",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Leave Type",
+ "oldfieldname": "leave_type",
+ "oldfieldtype": "Link",
+ "options": "link:Leave Type",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "default": "Today",
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "label": "Posting Date",
+ "no_copy": 1,
+ "oldfieldname": "date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Data",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "label": "Description",
+ "oldfieldname": "reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "width": "300px"
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "carry_forward",
+ "fieldtype": "Check",
+ "label": "Carry Forward",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "carry_forward",
+ "fieldname": "carry_forwarded_leaves",
+ "fieldtype": "Float",
+ "label": "Carry Forwarded Leaves",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "new_leaves_allocated",
+ "fieldtype": "Float",
+ "label": "New Leaves Allocated",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "total_leaves_allocated",
+ "fieldtype": "Float",
+ "label": "Total Leaves Allocated",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-ok",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-22 16:05:35.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Leave Allocation",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "restricted": 1,
+ "role": "HR User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "search_fields": "employee,employee_name,leave_type,total_leaves_allocated,fiscal_year"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index 1630e14..03045a4 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -15,7 +15,7 @@
class LeaveApproverIdentityError(frappe.ValidationError): pass
from frappe.model.controller import DocListController
-class DocType(DocListController):
+class LeaveApplication(DocListController):
def setup(self):
if frappe.db.exists(self.doc.doctype, self.doc.name):
self.previous_doc = frappe.doc(self.doc.doctype, self.doc.name)
@@ -149,7 +149,7 @@
def validate_leave_approver(self):
employee = frappe.bean("Employee", self.doc.employee)
leave_approvers = [l.leave_approver for l in
- employee.doclist.get({"parentfield": "employee_leave_approvers"})]
+ employee.get("employee_leave_approvers")]
if len(leave_approvers) and self.doc.leave_approver not in leave_approvers:
msgprint(("[" + _("For Employee") + ' "' + self.doc.employee + '"] '
diff --git a/erpnext/hr/doctype/leave_application/leave_application.txt b/erpnext/hr/doctype/leave_application/leave_application.txt
index b56a0ed..777d036 100644
--- a/erpnext/hr/doctype/leave_application/leave_application.txt
+++ b/erpnext/hr/doctype/leave_application/leave_application.txt
@@ -1,305 +1,267 @@
-[
- {
- "creation": "2013-02-20 11:18:11",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:56",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "autoname": "LAP/.#####",
- "description": "Apply / Approve Leaves",
- "doctype": "DocType",
- "document_type": "Transaction",
- "icon": "icon-calendar",
- "is_submittable": 1,
- "max_attachments": 3,
- "module": "HR",
- "name": "__common__",
- "search_fields": "employee,employee_name,leave_type,from_date,to_date,total_leave_days,fiscal_year"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Leave Application",
- "parentfield": "fields",
- "parenttype": "DocType"
- },
- {
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Leave Application",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "read": 1
- },
- {
- "doctype": "DocType",
- "name": "Leave Application"
- },
- {
- "default": "Open",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "options": "Open\nApproved\nRejected",
- "permlevel": 1
- },
- {
- "description": "Leave can be approved by users with Role, \"Leave Approver\"",
- "doctype": "DocField",
- "fieldname": "leave_approver",
- "fieldtype": "Select",
- "label": "Leave Approver",
- "options": "link:User",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "leave_type",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Leave Type",
- "options": "link:Leave Type",
- "permlevel": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "from_date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "label": "From Date",
- "permlevel": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "to_date",
- "fieldtype": "Date",
- "in_list_view": 0,
- "label": "To Date",
- "permlevel": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "half_day",
- "fieldtype": "Check",
- "label": "Half Day",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "label": "Reason",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "employee",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Employee",
- "options": "Employee",
- "permlevel": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "employee_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Employee Name",
- "permlevel": 0,
- "read_only": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "leave_balance",
- "fieldtype": "Float",
- "label": "Leave Balance Before Application",
- "no_copy": 1,
- "permlevel": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_leave_days",
- "fieldtype": "Float",
- "label": "Total Leave Days",
- "no_copy": 1,
- "permlevel": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sb10",
- "fieldtype": "Section Break",
- "label": "More Info",
- "permlevel": 0
- },
- {
- "allow_on_submit": 1,
- "default": "1",
- "doctype": "DocField",
- "fieldname": "follow_via_email",
- "fieldtype": "Check",
- "label": "Follow via Email",
- "permlevel": 0,
- "print_hide": 1
- },
- {
- "default": "Today",
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "label": "Posting Date",
- "no_copy": 1,
- "permlevel": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "options": "link:Fiscal Year",
- "permlevel": 0,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_17",
- "fieldtype": "Column Break",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "options": "Company",
- "permlevel": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "letter_head",
- "fieldtype": "Link",
- "label": "Letter Head",
- "options": "Letter Head",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "options": "Leave Application",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1
- },
- {
- "create": 1,
- "delete": 0,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "report": 1,
- "role": "Employee",
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "permlevel": 1,
- "role": "All",
- "submit": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "report": 1,
- "restrict": 1,
- "role": "HR User",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "report": 1,
- "role": "Leave Approver",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "permlevel": 1,
- "report": 1,
- "role": "HR User",
- "submit": 0,
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "permlevel": 1,
- "report": 1,
- "role": "Leave Approver",
- "submit": 0,
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "autoname": "LAP/.#####",
+ "creation": "2013-02-20 11:18:11.000000",
+ "description": "Apply / Approve Leaves",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "default": "Open",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "options": "Open\nApproved\nRejected",
+ "permlevel": 1
+ },
+ {
+ "description": "Leave can be approved by users with Role, \"Leave Approver\"",
+ "fieldname": "leave_approver",
+ "fieldtype": "Select",
+ "label": "Leave Approver",
+ "options": "link:User",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "leave_type",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Leave Type",
+ "options": "link:Leave Type",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "from_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "From Date",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "to_date",
+ "fieldtype": "Date",
+ "in_list_view": 0,
+ "label": "To Date",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "half_day",
+ "fieldtype": "Check",
+ "label": "Half Day",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "label": "Reason",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "employee",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Employee",
+ "options": "Employee",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "employee_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Employee Name",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "leave_balance",
+ "fieldtype": "Float",
+ "label": "Leave Balance Before Application",
+ "no_copy": 1,
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "total_leave_days",
+ "fieldtype": "Float",
+ "label": "Total Leave Days",
+ "no_copy": 1,
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "sb10",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "default": "1",
+ "fieldname": "follow_via_email",
+ "fieldtype": "Check",
+ "label": "Follow via Email",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "default": "Today",
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "label": "Posting Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "column_break_17",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "letter_head",
+ "fieldtype": "Link",
+ "label": "Letter Head",
+ "options": "Letter Head",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "options": "Leave Application",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-calendar",
+ "idx": 1,
+ "is_submittable": 1,
+ "max_attachments": 3,
+ "modified": "2014-01-20 17:48:56.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Leave Application",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Employee",
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "permlevel": 1,
+ "read": 1,
+ "role": "All",
+ "submit": 0
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "restrict": 1,
+ "role": "HR User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Leave Approver",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "permlevel": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "permlevel": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Leave Approver",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "search_fields": "employee,employee_name,leave_type,from_date,to_date,total_leave_days,fiscal_year"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py
index 30f0cb7..cb8f77e 100644
--- a/erpnext/hr/doctype/leave_application/test_leave_application.py
+++ b/erpnext/hr/doctype/leave_application/test_leave_application.py
@@ -24,9 +24,8 @@
temp_session_user = frappe.session.user
frappe.set_user("Administrator")
employee = frappe.bean("Employee", employee)
- employee.doclist.append({
+ employee.append("employee_leave_approvers", {
"doctype": "Employee Leave Approver",
- "parentfield": "employee_leave_approvers",
"leave_approver": leave_approver
})
employee.save()
diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list.py b/erpnext/hr/doctype/leave_block_list/leave_block_list.py
index cdbb2d0..e1cbf1b 100644
--- a/erpnext/hr/doctype/leave_block_list/leave_block_list.py
+++ b/erpnext/hr/doctype/leave_block_list/leave_block_list.py
@@ -8,9 +8,9 @@
from erpnext.accounts.utils import validate_fiscal_year
from frappe import _
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class LeaveBlockList(Document):
def validate(self):
dates = []
diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list.txt b/erpnext/hr/doctype/leave_block_list/leave_block_list.txt
index 6f331b0..cb3b653 100644
--- a/erpnext/hr/doctype/leave_block_list/leave_block_list.txt
+++ b/erpnext/hr/doctype/leave_block_list/leave_block_list.txt
@@ -1,106 +1,87 @@
-[
- {
- "creation": "2013-02-18 17:43:12",
- "docstatus": 0,
- "modified": "2013-12-20 19:24:13",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:leave_block_list_name",
- "description": "Block Holidays on important days.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-calendar",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Leave Block List",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Leave Block List",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "role": "HR User",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Leave Block List"
- },
- {
- "doctype": "DocField",
- "fieldname": "leave_block_list_name",
- "fieldtype": "Data",
- "label": "Leave Block List Name",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "year",
- "fieldtype": "Link",
- "label": "Year",
- "options": "Fiscal Year",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "options": "Company",
- "reqd": 1
- },
- {
- "description": "If not checked, the list will have to be added to each Department where it has to be applied.",
- "doctype": "DocField",
- "fieldname": "applies_to_all_departments",
- "fieldtype": "Check",
- "label": "Applies to Company"
- },
- {
- "description": "Stop users from making Leave Applications on following days.",
- "doctype": "DocField",
- "fieldname": "block_days",
- "fieldtype": "Section Break",
- "label": "Block Days"
- },
- {
- "doctype": "DocField",
- "fieldname": "leave_block_list_dates",
- "fieldtype": "Table",
- "label": "Leave Block List Dates",
- "options": "Leave Block List Date"
- },
- {
- "description": "Allow the following users to approve Leave Applications for block days.",
- "doctype": "DocField",
- "fieldname": "allow_list",
- "fieldtype": "Section Break",
- "label": "Allow Users"
- },
- {
- "doctype": "DocField",
- "fieldname": "leave_block_list_allowed",
- "fieldtype": "Table",
- "label": "Leave Block List Allowed",
- "options": "Leave Block List Allow"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:leave_block_list_name",
+ "creation": "2013-02-18 17:43:12.000000",
+ "description": "Block Holidays on important days.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "leave_block_list_name",
+ "fieldtype": "Data",
+ "label": "Leave Block List Name",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "year",
+ "fieldtype": "Link",
+ "label": "Year",
+ "options": "Fiscal Year",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "If not checked, the list will have to be added to each Department where it has to be applied.",
+ "fieldname": "applies_to_all_departments",
+ "fieldtype": "Check",
+ "label": "Applies to Company",
+ "permlevel": 0
+ },
+ {
+ "description": "Stop users from making Leave Applications on following days.",
+ "fieldname": "block_days",
+ "fieldtype": "Section Break",
+ "label": "Block Days",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "leave_block_list_dates",
+ "fieldtype": "Table",
+ "label": "Leave Block List Dates",
+ "options": "Leave Block List Date",
+ "permlevel": 0
+ },
+ {
+ "description": "Allow the following users to approve Leave Applications for block days.",
+ "fieldname": "allow_list",
+ "fieldtype": "Section Break",
+ "label": "Allow Users",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "leave_block_list_allowed",
+ "fieldtype": "Table",
+ "label": "Leave Block List Allowed",
+ "options": "Leave Block List Allow",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-calendar",
+ "idx": 1,
+ "modified": "2013-12-20 19:24:13.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Leave Block List",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "HR User",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py
index 968a25b..684e178 100644
--- a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py
+++ b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class LeaveBlockListAllow(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt
index ea54800..bec2313 100644
--- a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt
+++ b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt
@@ -1,38 +1,25 @@
-[
- {
- "creation": "2013-02-22 01:27:47",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:18",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "fieldname": "allow_user",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Allow User",
- "name": "__common__",
- "options": "User",
- "parent": "Leave Block List Allow",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "print_width": "200px",
- "reqd": 1,
- "width": "200px"
- },
- {
- "doctype": "DocType",
- "name": "Leave Block List Allow"
- },
- {
- "doctype": "DocField"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:47.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "allow_user",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Allow User",
+ "options": "User",
+ "permlevel": 0,
+ "print_width": "200px",
+ "reqd": 1,
+ "width": "200px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:18.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Leave Block List Allow",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py
index 968a25b..3db4798 100644
--- a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py
+++ b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class LeaveBlockListDate(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt
index 138c9e4..f620501 100644
--- a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt
+++ b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt
@@ -1,43 +1,34 @@
-[
- {
- "creation": "2013-02-22 01:27:47",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:19",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Leave Block List Date",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "print_width": "200px",
- "reqd": 1,
- "width": "200px"
- },
- {
- "doctype": "DocType",
- "name": "Leave Block List Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "block_date",
- "fieldtype": "Date",
- "label": "Block Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "reason",
- "fieldtype": "Text",
- "label": "Reason"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:47.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "block_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Block Date",
+ "permlevel": 0,
+ "print_width": "200px",
+ "reqd": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "reason",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Reason",
+ "permlevel": 0,
+ "print_width": "200px",
+ "reqd": 1,
+ "width": "200px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:19.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Leave Block List Date",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js
index be9096c..16ede67 100644
--- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js
+++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js
@@ -9,7 +9,7 @@
}
cur_frm.cscript.to_date = function(doc, cdt, cdn) {
- return $c('runserverobj', args={'method':'to_date_validation','docs':frappe.model.compress(make_doclist(doc.doctype, doc.name))},
+ return $c('runserverobj', args={'method':'to_date_validation','docs':doc},
function(r, rt) {
var doc = locals[cdt][cdn];
if (r.message) {
diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py
index 001d0d5..bf91265 100644
--- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py
+++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py
@@ -5,14 +5,15 @@
import frappe
from frappe.utils import cint, cstr, flt, nowdate
-from frappe.model.doc import Document
from frappe.model.code import get_obj
from frappe import msgprint, _
-class DocType:
+from frappe.model.document import Document
+
+class LeaveControlPanel(Document):
def __init__(self, doc, doclist):
self.doc = doc
self.doclist = doclist
@@ -36,10 +37,9 @@
return e
def validate_values(self):
- meta = frappe.get_doctype(self.doc.doctype)
for f in ["fiscal_year", "leave_type", "no_of_days"]:
- if not self.doc.fields[f]:
- frappe.throw(_(meta.get_label(f)) + _(" is mandatory"))
+ if not self.get(f):
+ frappe.throw(_(self.meta.get_label(f)) + _(" is mandatory"))
def allocate_leave(self):
self.validate_values()
@@ -50,7 +50,8 @@
for d in self.get_employees():
try:
- la = Document('Leave Allocation')
+ la = frappe.get_doc('Leave Allocation')
+ la.set("__islocal", 1)
la.employee = cstr(d[0])
la.employee_name = frappe.db.get_value('Employee',cstr(d[0]),'employee_name')
la.leave_type = self.doc.leave_type
@@ -58,11 +59,8 @@
la.posting_date = nowdate()
la.carry_forward = cint(self.doc.carry_forward)
la.new_leaves_allocated = flt(self.doc.no_of_days)
- la_obj = get_obj(doc=la)
- la_obj.doc.docstatus = 1
- la_obj.validate()
- la_obj.on_update()
- la_obj.doc.save(1)
+ la.docstatus = 1
+ la.save()
leave_allocated_for.append(d[0])
except:
pass
diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt
index bee3123..65fa38d 100644
--- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt
+++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt
@@ -1,141 +1,122 @@
-[
- {
- "creation": "2013-01-10 16:34:15",
- "docstatus": 0,
- "modified": "2013-07-05 14:44:50",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_copy": 1,
- "allow_email": 1,
- "allow_print": 1,
- "doctype": "DocType",
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "icon-cog",
- "issingle": 1,
- "module": "HR",
- "name": "__common__",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Leave Control Panel",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Leave Control Panel",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "report": 0,
- "role": "HR User",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Leave Control Panel"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "description": "Leave blank if considered for all employee types",
- "doctype": "DocField",
- "fieldname": "employee_type",
- "fieldtype": "Select",
- "label": "Employee Type",
- "options": "link:Employment Type"
- },
- {
- "description": "Leave blank if considered for all branches",
- "doctype": "DocField",
- "fieldname": "branch",
- "fieldtype": "Select",
- "label": "Branch",
- "options": "link:Branch"
- },
- {
- "description": "Leave blank if considered for all departments",
- "doctype": "DocField",
- "fieldname": "department",
- "fieldtype": "Select",
- "label": "Department",
- "options": "link:Department"
- },
- {
- "description": "Leave blank if considered for all designations",
- "doctype": "DocField",
- "fieldname": "designation",
- "fieldtype": "Select",
- "label": "Designation",
- "options": "link:Designation"
- },
- {
- "description": "Leave blank if considered for all grades",
- "doctype": "DocField",
- "fieldname": "grade",
- "fieldtype": "Select",
- "label": "Grade",
- "options": "link:Grade"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "options": "link:Fiscal Year",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "leave_type",
- "fieldtype": "Select",
- "label": "Leave Type",
- "options": "link:Leave Type",
- "reqd": 1
- },
- {
- "description": "Please select Carry Forward if you also want to include previous fiscal year's balance leaves to this fiscal year",
- "doctype": "DocField",
- "fieldname": "carry_forward",
- "fieldtype": "Check",
- "label": "Carry Forward"
- },
- {
- "doctype": "DocField",
- "fieldname": "no_of_days",
- "fieldtype": "Float",
- "label": "New Leaves Allocated (In Days)",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "allocate",
- "fieldtype": "Button",
- "label": "Allocate",
- "options": "allocate_leave"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_copy": 1,
+ "allow_email": 1,
+ "allow_print": 1,
+ "creation": "2013-01-10 16:34:15.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "description": "Leave blank if considered for all employee types",
+ "fieldname": "employee_type",
+ "fieldtype": "Select",
+ "label": "Employee Type",
+ "options": "link:Employment Type",
+ "permlevel": 0
+ },
+ {
+ "description": "Leave blank if considered for all branches",
+ "fieldname": "branch",
+ "fieldtype": "Select",
+ "label": "Branch",
+ "options": "link:Branch",
+ "permlevel": 0
+ },
+ {
+ "description": "Leave blank if considered for all departments",
+ "fieldname": "department",
+ "fieldtype": "Select",
+ "label": "Department",
+ "options": "link:Department",
+ "permlevel": 0
+ },
+ {
+ "description": "Leave blank if considered for all designations",
+ "fieldname": "designation",
+ "fieldtype": "Select",
+ "label": "Designation",
+ "options": "link:Designation",
+ "permlevel": 0
+ },
+ {
+ "description": "Leave blank if considered for all grades",
+ "fieldname": "grade",
+ "fieldtype": "Select",
+ "label": "Grade",
+ "options": "link:Grade",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "leave_type",
+ "fieldtype": "Select",
+ "label": "Leave Type",
+ "options": "link:Leave Type",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Please select Carry Forward if you also want to include previous fiscal year's balance leaves to this fiscal year",
+ "fieldname": "carry_forward",
+ "fieldtype": "Check",
+ "label": "Carry Forward",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "no_of_days",
+ "fieldtype": "Float",
+ "label": "New Leaves Allocated (In Days)",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "allocate",
+ "fieldtype": "Button",
+ "label": "Allocate",
+ "options": "allocate_leave",
+ "permlevel": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "icon-cog",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-07-05 14:44:50.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Leave Control Panel",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "permlevel": 0,
+ "read": 1,
+ "report": 0,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 1
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_type/leave_type.py b/erpnext/hr/doctype/leave_type/leave_type.py
index 5015bed..426bc73 100644
--- a/erpnext/hr/doctype/leave_type/leave_type.py
+++ b/erpnext/hr/doctype/leave_type/leave_type.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
-
\ No newline at end of file
+from frappe.model.document import Document
+
+class LeaveType(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_type/leave_type.txt b/erpnext/hr/doctype/leave_type/leave_type.txt
index 13d7e72..be3123f 100644
--- a/erpnext/hr/doctype/leave_type/leave_type.txt
+++ b/erpnext/hr/doctype/leave_type/leave_type.txt
@@ -1,113 +1,103 @@
-[
- {
- "creation": "2013-02-21 09:55:58",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:56",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:leave_type_name",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-flag",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Leave Type",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Leave Type",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Leave Type"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "leave_type_name",
- "fieldtype": "Data",
- "label": "Leave Type Name",
- "oldfieldname": "leave_type_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "max_days_allowed",
- "fieldtype": "Data",
- "label": "Max Days Leave Allowed",
- "oldfieldname": "max_days_allowed",
- "oldfieldtype": "Data",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "is_carry_forward",
- "fieldtype": "Check",
- "label": "Is Carry Forward",
- "oldfieldname": "is_carry_forward",
- "oldfieldtype": "Check"
- },
- {
- "doctype": "DocField",
- "fieldname": "is_encash",
- "fieldtype": "Check",
- "hidden": 1,
- "label": "Is Encash",
- "oldfieldname": "is_encash",
- "oldfieldtype": "Check",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "is_lwp",
- "fieldtype": "Check",
- "label": "Is LWP"
- },
- {
- "doctype": "DocField",
- "fieldname": "allow_negative",
- "fieldtype": "Check",
- "label": "Allow Negative Balance"
- },
- {
- "doctype": "DocPerm",
- "role": "HR User"
- },
- {
- "doctype": "DocPerm",
- "role": "HR Manager"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:leave_type_name",
+ "creation": "2013-02-21 09:55:58.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "leave_type_name",
+ "fieldtype": "Data",
+ "label": "Leave Type Name",
+ "oldfieldname": "leave_type_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "max_days_allowed",
+ "fieldtype": "Data",
+ "label": "Max Days Leave Allowed",
+ "oldfieldname": "max_days_allowed",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "is_carry_forward",
+ "fieldtype": "Check",
+ "label": "Is Carry Forward",
+ "oldfieldname": "is_carry_forward",
+ "oldfieldtype": "Check",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "is_encash",
+ "fieldtype": "Check",
+ "hidden": 1,
+ "label": "Is Encash",
+ "oldfieldname": "is_encash",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "is_lwp",
+ "fieldtype": "Check",
+ "label": "Is LWP",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "allow_negative",
+ "fieldtype": "Check",
+ "label": "Allow Negative Balance",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-flag",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:56.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Leave Type",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.js b/erpnext/hr/doctype/salary_manager/salary_manager.js
index 312a06d..3745ee5 100644
--- a/erpnext/hr/doctype/salary_manager/salary_manager.js
+++ b/erpnext/hr/doctype/salary_manager/salary_manager.js
@@ -15,7 +15,7 @@
if (r.message)
display_activity_log(r.message);
}
- return $c('runserverobj', args={'method':'create_sal_slip','docs':frappe.model.compress(make_doclist (cdt, cdn))},callback);
+ return $c('runserverobj', args={'method':'create_sal_slip','docs':doc},callback);
}
cur_frm.cscript.submit_salary_slip = function(doc, cdt, cdn) {
@@ -25,7 +25,7 @@
if (r.message)
display_activity_log(r.message);
}
- return $c('runserverobj', args={'method':'submit_salary_slip','docs':frappe.model.compress(make_doclist (cdt, cdn))},callback);
+ return $c('runserverobj', args={'method':'submit_salary_slip','docs':doc},callback);
}
}
@@ -59,5 +59,5 @@
loaddoc('Journal Voucher', jv.name);
}
- return $c_obj(make_doclist(dt, dn), 'get_acc_details', '', call_back);
+ return $c_obj(doc, 'get_acc_details', '', call_back);
}
diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.py b/erpnext/hr/doctype/salary_manager/salary_manager.py
index 0420f77..d0af7be 100644
--- a/erpnext/hr/doctype/salary_manager/salary_manager.py
+++ b/erpnext/hr/doctype/salary_manager/salary_manager.py
@@ -7,10 +7,9 @@
from frappe.model.code import get_obj
from frappe import msgprint
-class DocType:
- def __init__(self, doc, doclist):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class SalaryManager(Document):
def get_emp_list(self):
"""
diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.txt b/erpnext/hr/doctype/salary_manager/salary_manager.txt
index 423e789..7a65b3f 100644
--- a/erpnext/hr/doctype/salary_manager/salary_manager.txt
+++ b/erpnext/hr/doctype/salary_manager/salary_manager.txt
@@ -1,185 +1,166 @@
-[
- {
- "creation": "2012-03-27 14:35:59",
- "docstatus": 0,
- "modified": "2013-07-22 15:22:58",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_copy": 1,
- "allow_email": 1,
- "allow_print": 1,
- "doctype": "DocType",
- "document_type": "Other",
- "icon": "icon-cog",
- "issingle": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Salary Manager",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Salary Manager",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "role": "HR Manager",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Salary Manager"
- },
- {
- "doctype": "DocField",
- "fieldname": "document_description",
- "fieldtype": "HTML",
- "label": "Document Description",
- "options": "<div class=\"field_description\">You can generate multiple salary slips based on the selected criteria, submit and mail those to the employee directly from here</div>"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "label": "Company",
- "options": "link:Company",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "branch",
- "fieldtype": "Link",
- "label": "Branch",
- "options": "Branch"
- },
- {
- "doctype": "DocField",
- "fieldname": "department",
- "fieldtype": "Link",
- "label": "Department",
- "options": "Department"
- },
- {
- "doctype": "DocField",
- "fieldname": "designation",
- "fieldtype": "Link",
- "label": "Designation",
- "options": "Designation"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "grade",
- "fieldtype": "Select",
- "label": "Grade",
- "options": "link:Grade"
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "label": "Fiscal Year",
- "options": "link:Fiscal Year",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "month",
- "fieldtype": "Select",
- "label": "Month",
- "options": "\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12",
- "reqd": 1
- },
- {
- "description": "Check if you want to send salary slip in mail to each employee while submitting salary slip",
- "doctype": "DocField",
- "fieldname": "send_email",
- "fieldtype": "Check",
- "label": "Send Email"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break1",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "description": "Creates salary slip for above mentioned criteria.",
- "doctype": "DocField",
- "fieldname": "create_salary_slip",
- "fieldtype": "Button",
- "label": "Create Salary Slip"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "width": "25%"
- },
- {
- "description": "Submit all salary slips for the above selected criteria",
- "doctype": "DocField",
- "fieldname": "submit_salary_slip",
- "fieldtype": "Button",
- "label": "Submit Salary Slip"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break4",
- "fieldtype": "Column Break",
- "width": "25%"
- },
- {
- "description": "Create Bank Voucher for the total salary paid for the above selected criteria",
- "doctype": "DocField",
- "fieldname": "make_bank_voucher",
- "fieldtype": "Button",
- "label": "Make Bank Voucher"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break2",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "activity_log",
- "fieldtype": "HTML",
- "label": "Activity Log"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_copy": 1,
+ "allow_email": 1,
+ "allow_print": 1,
+ "creation": "2012-03-27 14:35:59.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "fields": [
+ {
+ "fieldname": "document_description",
+ "fieldtype": "HTML",
+ "label": "Document Description",
+ "options": "<div class=\"field_description\">You can generate multiple salary slips based on the selected criteria, submit and mail those to the employee directly from here</div>",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "label": "Company",
+ "options": "link:Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "branch",
+ "fieldtype": "Link",
+ "label": "Branch",
+ "options": "Branch",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "department",
+ "fieldtype": "Link",
+ "label": "Department",
+ "options": "Department",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "designation",
+ "fieldtype": "Link",
+ "label": "Designation",
+ "options": "Designation",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "grade",
+ "fieldtype": "Select",
+ "label": "Grade",
+ "options": "link:Grade",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "label": "Fiscal Year",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "month",
+ "fieldtype": "Select",
+ "label": "Month",
+ "options": "\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Check if you want to send salary slip in mail to each employee while submitting salary slip",
+ "fieldname": "send_email",
+ "fieldtype": "Check",
+ "label": "Send Email",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "section_break1",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "description": "Creates salary slip for above mentioned criteria.",
+ "fieldname": "create_salary_slip",
+ "fieldtype": "Button",
+ "label": "Create Salary Slip",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "25%"
+ },
+ {
+ "description": "Submit all salary slips for the above selected criteria",
+ "fieldname": "submit_salary_slip",
+ "fieldtype": "Button",
+ "label": "Submit Salary Slip",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "25%"
+ },
+ {
+ "description": "Create Bank Voucher for the total salary paid for the above selected criteria",
+ "fieldname": "make_bank_voucher",
+ "fieldtype": "Button",
+ "label": "Make Bank Voucher",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "section_break2",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "activity_log",
+ "fieldtype": "HTML",
+ "label": "Activity Log",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-cog",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-07-22 15:22:58.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Salary Manager",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "permlevel": 0,
+ "read": 1,
+ "role": "HR Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js
index ceab148..3c11f9d 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.js
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.js
@@ -21,7 +21,7 @@
// Get leave details
//---------------------------------------------------------------------
cur_frm.cscript.fiscal_year = function(doc,dt,dn){
- return $c_obj(make_doclist(doc.doctype,doc.name), 'get_emp_and_leave_details','',function(r, rt) {
+ return $c_obj(doc, 'get_emp_and_leave_details','',function(r, rt) {
var doc = locals[dt][dn];
cur_frm.refresh();
calculate_all(doc, dt, dn);
@@ -32,7 +32,7 @@
cur_frm.cscript.leave_without_pay = function(doc,dt,dn){
if (doc.employee && doc.fiscal_year && doc.month) {
- return $c_obj(make_doclist(doc.doctype,doc.name), 'get_leave_details',doc.leave_without_pay,function(r, rt) {
+ return $c_obj(doc, 'get_leave_details',doc.leave_without_pay,function(r, rt) {
var doc = locals[dt][dn];
cur_frm.refresh();
calculate_all(doc, dt, dn);
@@ -65,7 +65,7 @@
// Calculate earning total
// ------------------------------------------------------------------------
var calculate_earning_total = function(doc, dt, dn) {
- var tbl = getchildren('Salary Slip Earning', doc.name, 'earning_details', doc.doctype);
+ var tbl = doc.earning_details || [];
var total_earn = 0;
for(var i = 0; i < tbl.length; i++){
@@ -82,7 +82,7 @@
// Calculate deduction total
// ------------------------------------------------------------------------
var calculate_ded_total = function(doc, dt, dn) {
- var tbl = getchildren('Salary Slip Deduction', doc.name, 'deduction_details', doc.doctype);
+ var tbl = doc.deduction_details || [];
var total_ded = 0;
for(var i = 0; i < tbl.length; i++){
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py
index a264c1c..e167835 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.py
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.py
@@ -5,7 +5,7 @@
import frappe
from frappe.utils import add_days, cint, cstr, flt, getdate, nowdate, _round
-from frappe.model.doc import make_autoname
+from frappe.model.naming import make_autoname
from frappe.model.bean import getlist
from frappe.model.code import get_obj
from frappe import msgprint, _
@@ -14,11 +14,7 @@
from erpnext.utilities.transaction_base import TransactionBase
-class DocType(TransactionBase):
- def __init__(self,doc,doclist=[]):
- self.doc = doc
- self.doclist = doclist
-
+class SalarySlip(TransactionBase):
def autoname(self):
self.doc.name = make_autoname('Sal Slip/' +self.doc.employee + '/.#####')
@@ -146,8 +142,8 @@
from frappe.utils import money_in_words
self.check_existing()
- if not (len(self.doclist.get({"parentfield": "earning_details"})) or
- len(self.doclist.get({"parentfield": "deduction_details"}))):
+ if not (len(self.get("earning_details")) or
+ len(self.get("deduction_details"))):
self.get_emp_and_leave_details()
else:
self.get_leave_details(self.doc.leave_without_pay)
@@ -160,7 +156,7 @@
def calculate_earning_total(self):
self.doc.gross_pay = flt(self.doc.arrear_amount) + flt(self.doc.leave_encashment_amount)
- for d in self.doclist.get({"parentfield": "earning_details"}):
+ for d in self.get("earning_details"):
if cint(d.e_depends_on_lwp) == 1:
d.e_modified_amount = _round(flt(d.e_amount) * flt(self.doc.payment_days)
/ cint(self.doc.total_days_in_month), 2)
@@ -172,7 +168,7 @@
def calculate_ded_total(self):
self.doc.total_deduction = 0
- for d in getlist(self.doclist, 'deduction_details'):
+ for d in self.get('deduction_details'):
if cint(d.d_depends_on_lwp) == 1:
d.d_modified_amount = _round(flt(d.d_amount) * flt(self.doc.payment_days)
/ cint(self.doc.total_days_in_month), 2)
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.txt b/erpnext/hr/doctype/salary_slip/salary_slip.txt
index e47e8d8..2896f11 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.txt
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.txt
@@ -1,404 +1,392 @@
-[
- {
- "creation": "2013-01-10 16:34:15",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:18",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "icon": "icon-file-text",
- "is_submittable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Salary Slip",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Salary Slip",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Salary Slip"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "employee",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Employee",
- "oldfieldname": "employee",
- "oldfieldtype": "Link",
- "options": "Employee",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "employee_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Employee Name",
- "oldfieldname": "employee_name",
- "oldfieldtype": "Data",
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "department",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Department",
- "oldfieldname": "department",
- "oldfieldtype": "Link",
- "options": "Department",
- "read_only": 1,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "designation",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Designation",
- "oldfieldname": "designation",
- "oldfieldtype": "Link",
- "options": "Designation",
- "read_only": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "branch",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Branch",
- "oldfieldname": "branch",
- "oldfieldtype": "Link",
- "options": "Branch",
- "read_only": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "grade",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Grade",
- "oldfieldname": "grade",
- "oldfieldtype": "Link",
- "options": "Grade",
- "read_only": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "pf_no",
- "fieldtype": "Data",
- "label": "PF No.",
- "oldfieldname": "pf_no",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "esic_no",
- "fieldtype": "Data",
- "label": "ESIC No.",
- "oldfieldname": "esic_no",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "letter_head",
- "fieldtype": "Link",
- "label": "Letter Head",
- "options": "Letter Head"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Data",
- "options": "Fiscal Year",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Company",
- "options": "link:Company",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "month",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Month",
- "oldfieldname": "month",
- "oldfieldtype": "Select",
- "options": "\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12",
- "reqd": 1,
- "search_index": 1,
- "width": "37%"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_days_in_month",
- "fieldtype": "Data",
- "label": "Total Working Days In The Month",
- "oldfieldname": "total_days_in_month",
- "oldfieldtype": "Int",
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "leave_without_pay",
- "fieldtype": "Float",
- "label": "Leave Without Pay",
- "oldfieldname": "leave_without_pay",
- "oldfieldtype": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "payment_days",
- "fieldtype": "Float",
- "label": "Payment Days",
- "oldfieldname": "payment_days",
- "oldfieldtype": "Float",
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "bank_name",
- "fieldtype": "Data",
- "label": "Bank Name",
- "oldfieldname": "bank_name",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "bank_account_no",
- "fieldtype": "Data",
- "label": "Bank Account No.",
- "oldfieldname": "bank_account_no",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "email_check",
- "fieldtype": "Check",
- "label": "Email",
- "no_copy": 1,
- "oldfieldname": "email_check",
- "oldfieldtype": "Check",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "earning_deduction",
- "fieldtype": "Section Break",
- "label": "Earning & Deduction",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "earning",
- "fieldtype": "Column Break",
- "label": "Earning",
- "oldfieldtype": "Column Break",
- "reqd": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "earning_details",
- "fieldtype": "Table",
- "label": "Salary Structure Earnings",
- "oldfieldname": "earning_details",
- "oldfieldtype": "Table",
- "options": "Salary Slip Earning"
- },
- {
- "doctype": "DocField",
- "fieldname": "deduction",
- "fieldtype": "Column Break",
- "label": "Deduction",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "deduction_details",
- "fieldtype": "Table",
- "label": "Deductions",
- "oldfieldname": "deduction_details",
- "oldfieldtype": "Table",
- "options": "Salary Slip Deduction"
- },
- {
- "doctype": "DocField",
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "label": "Totals",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "arrear_amount",
- "fieldtype": "Currency",
- "label": "Arrear Amount",
- "oldfieldname": "arrear_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "leave_encashment_amount",
- "fieldtype": "Currency",
- "label": "Leave Encashment Amount",
- "oldfieldname": "encashment_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "gross_pay",
- "fieldtype": "Currency",
- "label": "Gross Pay",
- "oldfieldname": "gross_pay",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_deduction",
- "fieldtype": "Currency",
- "label": "Total Deduction",
- "oldfieldname": "total_deduction",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "description": "Gross Pay + Arrear Amount +Encashment Amount - Total Deduction",
- "doctype": "DocField",
- "fieldname": "net_pay",
- "fieldtype": "Currency",
- "label": "Net Pay",
- "oldfieldname": "net_pay",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rounded_total",
- "fieldtype": "Currency",
- "label": "Rounded Total",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "description": "Net Pay (in words) will be visible once you save the Salary Slip.",
- "doctype": "DocField",
- "fieldname": "total_in_words",
- "fieldtype": "Data",
- "label": "Total in words",
- "oldfieldname": "net_pay_in_words",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "amend": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "HR User"
- },
- {
- "amend": 1,
- "cancel": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "HR Manager"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-10 16:34:15.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "employee",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Employee",
+ "oldfieldname": "employee",
+ "oldfieldtype": "Link",
+ "options": "Employee",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "employee_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Employee Name",
+ "oldfieldname": "employee_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "department",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Department",
+ "oldfieldname": "department",
+ "oldfieldtype": "Link",
+ "options": "Department",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "designation",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Designation",
+ "oldfieldname": "designation",
+ "oldfieldtype": "Link",
+ "options": "Designation",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "branch",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Branch",
+ "oldfieldname": "branch",
+ "oldfieldtype": "Link",
+ "options": "Branch",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "grade",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Grade",
+ "oldfieldname": "grade",
+ "oldfieldtype": "Link",
+ "options": "Grade",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "pf_no",
+ "fieldtype": "Data",
+ "label": "PF No.",
+ "oldfieldname": "pf_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "esic_no",
+ "fieldtype": "Data",
+ "label": "ESIC No.",
+ "oldfieldname": "esic_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "letter_head",
+ "fieldtype": "Link",
+ "label": "Letter Head",
+ "options": "Letter Head",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Data",
+ "options": "Fiscal Year",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Company",
+ "options": "link:Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "month",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Month",
+ "oldfieldname": "month",
+ "oldfieldtype": "Select",
+ "options": "\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "37%"
+ },
+ {
+ "fieldname": "total_days_in_month",
+ "fieldtype": "Data",
+ "label": "Total Working Days In The Month",
+ "oldfieldname": "total_days_in_month",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "leave_without_pay",
+ "fieldtype": "Float",
+ "label": "Leave Without Pay",
+ "oldfieldname": "leave_without_pay",
+ "oldfieldtype": "Currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "payment_days",
+ "fieldtype": "Float",
+ "label": "Payment Days",
+ "oldfieldname": "payment_days",
+ "oldfieldtype": "Float",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "bank_name",
+ "fieldtype": "Data",
+ "label": "Bank Name",
+ "oldfieldname": "bank_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "bank_account_no",
+ "fieldtype": "Data",
+ "label": "Bank Account No.",
+ "oldfieldname": "bank_account_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "email_check",
+ "fieldtype": "Check",
+ "label": "Email",
+ "no_copy": 1,
+ "oldfieldname": "email_check",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "earning_deduction",
+ "fieldtype": "Section Break",
+ "label": "Earning & Deduction",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "earning",
+ "fieldtype": "Column Break",
+ "label": "Earning",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "reqd": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "earning_details",
+ "fieldtype": "Table",
+ "label": "Salary Structure Earnings",
+ "oldfieldname": "earning_details",
+ "oldfieldtype": "Table",
+ "options": "Salary Slip Earning",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "deduction",
+ "fieldtype": "Column Break",
+ "label": "Deduction",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "deduction_details",
+ "fieldtype": "Table",
+ "label": "Deductions",
+ "oldfieldname": "deduction_details",
+ "oldfieldtype": "Table",
+ "options": "Salary Slip Deduction",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "label": "Totals",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "arrear_amount",
+ "fieldtype": "Currency",
+ "label": "Arrear Amount",
+ "oldfieldname": "arrear_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "leave_encashment_amount",
+ "fieldtype": "Currency",
+ "label": "Leave Encashment Amount",
+ "oldfieldname": "encashment_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "gross_pay",
+ "fieldtype": "Currency",
+ "label": "Gross Pay",
+ "oldfieldname": "gross_pay",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "total_deduction",
+ "fieldtype": "Currency",
+ "label": "Total Deduction",
+ "oldfieldname": "total_deduction",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "description": "Gross Pay + Arrear Amount +Encashment Amount - Total Deduction",
+ "fieldname": "net_pay",
+ "fieldtype": "Currency",
+ "label": "Net Pay",
+ "oldfieldname": "net_pay",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "rounded_total",
+ "fieldtype": "Currency",
+ "label": "Rounded Total",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "description": "Net Pay (in words) will be visible once you save the Salary Slip.",
+ "fieldname": "total_in_words",
+ "fieldtype": "Data",
+ "label": "Total in words",
+ "oldfieldname": "net_pay_in_words",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-20 17:49:18.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Salary Slip",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "submit": 1,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.py b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.py
index 26c87f1..422ee28 100644
--- a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.py
+++ b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SalarySlipDeduction(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt
index 2b29090..ae07c2c 100644
--- a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt
+++ b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt
@@ -1,62 +1,52 @@
-[
- {
- "creation": "2013-02-22 01:27:48",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:42",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Salary Slip Deduction",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Salary Slip Deduction"
- },
- {
- "doctype": "DocField",
- "fieldname": "d_type",
- "fieldtype": "Link",
- "label": "Type",
- "oldfieldname": "d_type",
- "oldfieldtype": "Data",
- "options": "Deduction Type",
- "print_width": "200px",
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "d_amount",
- "fieldtype": "Currency",
- "label": "Amount",
- "oldfieldname": "d_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "d_modified_amount",
- "fieldtype": "Currency",
- "label": "Modified Amount",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "d_depends_on_lwp",
- "fieldtype": "Check",
- "label": "Depends on LWP"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:48.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "d_type",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Type",
+ "oldfieldname": "d_type",
+ "oldfieldtype": "Data",
+ "options": "Deduction Type",
+ "permlevel": 0,
+ "print_width": "200px",
+ "width": "200px"
+ },
+ {
+ "fieldname": "d_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "d_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "d_modified_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Modified Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "d_depends_on_lwp",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Depends on LWP",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:42.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Salary Slip Deduction",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.py b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.py
index 26c87f1..c4a7b4e 100644
--- a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.py
+++ b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SalarySlipEarning(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt
index 3375ab5..eae6447 100644
--- a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt
+++ b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt
@@ -1,62 +1,52 @@
-[
- {
- "creation": "2013-02-22 01:27:48",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:43",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Salary Slip Earning",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Salary Slip Earning"
- },
- {
- "doctype": "DocField",
- "fieldname": "e_type",
- "fieldtype": "Link",
- "label": "Type",
- "oldfieldname": "e_type",
- "oldfieldtype": "Data",
- "options": "Earning Type",
- "print_width": "200px",
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "e_amount",
- "fieldtype": "Currency",
- "label": "Amount",
- "oldfieldname": "e_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "e_modified_amount",
- "fieldtype": "Currency",
- "label": "Modified Amount",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "e_depends_on_lwp",
- "fieldtype": "Check",
- "label": "Depends on LWP"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:48.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "e_type",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Type",
+ "oldfieldname": "e_type",
+ "oldfieldtype": "Data",
+ "options": "Earning Type",
+ "permlevel": 0,
+ "print_width": "200px",
+ "width": "200px"
+ },
+ {
+ "fieldname": "e_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "e_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "e_modified_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Modified Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "e_depends_on_lwp",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Depends on LWP",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:43.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Salary Slip Earning",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.js b/erpnext/hr/doctype/salary_structure/salary_structure.js
index 3b90ee6..0cfb6c4 100644
--- a/erpnext/hr/doctype/salary_structure/salary_structure.js
+++ b/erpnext/hr/doctype/salary_structure/salary_structure.js
@@ -4,10 +4,10 @@
cur_frm.add_fetch('employee', 'company', 'company');
cur_frm.cscript.onload = function(doc, dt, dn){
- e_tbl = getchildren('Salary Structure Earning', doc.name, 'earning_details', doc.doctype);
- d_tbl = getchildren('Salary Structure Deduction', doc.name, 'deduction_details', doc.doctype);
+ e_tbl = doc.earning_details || [];
+ d_tbl = doc.deduction_details || [];
if (e_tbl.length == 0 && d_tbl.length == 0)
- return $c_obj(make_doclist(doc.doctype,doc.name),'make_earn_ded_table','', function(r, rt) { refresh_many(['earning_details', 'deduction_details']);});
+ return $c_obj(doc,'make_earn_ded_table','', function(r, rt) { refresh_many(['earning_details', 'deduction_details']);});
}
cur_frm.cscript.refresh = function(doc, dt, dn){
@@ -39,8 +39,8 @@
}
var calculate_totals = function(doc, cdt, cdn) {
- var tbl1 = getchildren('Salary Structure Earning', doc.name, 'earning_details', doc.doctype);
- var tbl2 = getchildren('Salary Structure Deduction', doc.name, 'deduction_details', doc.doctype);
+ var tbl1 = doc.earning_details || [];
+ var tbl2 = doc.deduction_details || [];
var total_earn = 0; var total_ded = 0;
for(var i = 0; i < tbl1.length; i++){
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py
index 8d59f2b..ab73a09 100644
--- a/erpnext/hr/doctype/salary_structure/salary_structure.py
+++ b/erpnext/hr/doctype/salary_structure/salary_structure.py
@@ -5,15 +5,13 @@
import frappe
from frappe.utils import cstr, flt
-from frappe.model.doc import addchild, make_autoname
+from frappe.model.naming import make_autoname
from frappe import msgprint, _
-class DocType:
- def __init__(self,doc,doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+class SalaryStructure(Document):
def autoname(self):
self.doc.name = make_autoname(self.doc.employee + '/.SST' + '/.#####')
@@ -44,7 +42,7 @@
def make_table(self, doct_name, tab_fname, tab_name):
list1 = frappe.db.sql("select name from `tab%s` where docstatus != 2" % doct_name)
for li in list1:
- child = addchild(self.doc, tab_fname, tab_name, self.doclist)
+ child = self.doc.append(tab_fname, {})
if(tab_fname == 'earning_details'):
child.e_type = cstr(li[0])
child.modified_value = 0
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.txt b/erpnext/hr/doctype/salary_structure/salary_structure.txt
index e54ebd7..9394fce 100644
--- a/erpnext/hr/doctype/salary_structure/salary_structure.txt
+++ b/erpnext/hr/doctype/salary_structure/salary_structure.txt
@@ -1,284 +1,273 @@
-[
- {
- "creation": "2013-03-07 18:50:29",
- "docstatus": 0,
- "modified": "2013-12-20 19:24:28",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "doctype": "DocType",
- "icon": "icon-file-text",
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Salary Structure",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Salary Structure",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Salary Structure"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "employee",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Employee",
- "oldfieldname": "employee",
- "oldfieldtype": "Link",
- "options": "Employee",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "employee_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Employee Name",
- "oldfieldname": "employee_name",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "branch",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Branch",
- "oldfieldname": "branch",
- "oldfieldtype": "Select",
- "options": "link:Branch",
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "designation",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Designation",
- "oldfieldname": "designation",
- "oldfieldtype": "Select",
- "options": "link:Designation",
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "department",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Department",
- "oldfieldname": "department",
- "oldfieldtype": "Select",
- "options": "link:Department",
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "grade",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Grade",
- "oldfieldname": "grade",
- "oldfieldtype": "Select",
- "options": "link:Grade",
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "default": "Yes",
- "doctype": "DocField",
- "fieldname": "is_active",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Is Active",
- "oldfieldname": "is_active",
- "oldfieldtype": "Select",
- "options": "\nYes\nNo",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "from_date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "label": "From Date",
- "oldfieldname": "from_date",
- "oldfieldtype": "Date",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "to_date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "label": "To Date",
- "oldfieldname": "to_date",
- "oldfieldtype": "Date",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Company",
- "options": "link:Company",
- "read_only": 0,
- "reqd": 1
- },
- {
- "description": "Salary breakup based on Earning and Deduction.",
- "doctype": "DocField",
- "fieldname": "earning_deduction",
- "fieldtype": "Section Break",
- "label": "Monthly Earning & Deduction",
- "oldfieldname": "earning_deduction",
- "oldfieldtype": "Section Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "earning",
- "fieldtype": "Column Break",
- "hidden": 0,
- "label": "Earning",
- "oldfieldname": "col_brk2",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "earning_details",
- "fieldtype": "Table",
- "hidden": 0,
- "label": "Earning1",
- "oldfieldname": "earning_details",
- "oldfieldtype": "Table",
- "options": "Salary Structure Earning",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "deduction",
- "fieldtype": "Column Break",
- "hidden": 0,
- "label": "Deduction",
- "oldfieldname": "col_brk3",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "deduction_details",
- "fieldtype": "Table",
- "hidden": 0,
- "label": "Deduction1",
- "oldfieldname": "deduction_details",
- "oldfieldtype": "Table",
- "options": "Salary Structure Deduction",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "options": "Simple",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_earning",
- "fieldtype": "Currency",
- "label": "Total Earning",
- "oldfieldname": "total_earning",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_deduction",
- "fieldtype": "Currency",
- "label": "Total Deduction",
- "oldfieldname": "total_deduction",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_pay",
- "fieldtype": "Currency",
- "label": "Net Pay",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocPerm",
- "role": "HR User"
- },
- {
- "doctype": "DocPerm",
- "role": "HR Manager"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "creation": "2013-03-07 18:50:29.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "employee",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Employee",
+ "oldfieldname": "employee",
+ "oldfieldtype": "Link",
+ "options": "Employee",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "employee_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Employee Name",
+ "oldfieldname": "employee_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "branch",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Branch",
+ "oldfieldname": "branch",
+ "oldfieldtype": "Select",
+ "options": "link:Branch",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "designation",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Designation",
+ "oldfieldname": "designation",
+ "oldfieldtype": "Select",
+ "options": "link:Designation",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "department",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Department",
+ "oldfieldname": "department",
+ "oldfieldtype": "Select",
+ "options": "link:Department",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "grade",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Grade",
+ "oldfieldname": "grade",
+ "oldfieldtype": "Select",
+ "options": "link:Grade",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "default": "Yes",
+ "fieldname": "is_active",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Is Active",
+ "oldfieldname": "is_active",
+ "oldfieldtype": "Select",
+ "options": "\nYes\nNo",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "from_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "From Date",
+ "oldfieldname": "from_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "to_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "To Date",
+ "oldfieldname": "to_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Company",
+ "options": "link:Company",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Salary breakup based on Earning and Deduction.",
+ "fieldname": "earning_deduction",
+ "fieldtype": "Section Break",
+ "label": "Monthly Earning & Deduction",
+ "oldfieldname": "earning_deduction",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "earning",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "label": "Earning",
+ "oldfieldname": "col_brk2",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "earning_details",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "label": "Earning1",
+ "oldfieldname": "earning_details",
+ "oldfieldtype": "Table",
+ "options": "Salary Structure Earning",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "deduction",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "label": "Deduction",
+ "oldfieldname": "col_brk3",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "deduction_details",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "label": "Deduction1",
+ "oldfieldname": "deduction_details",
+ "oldfieldtype": "Table",
+ "options": "Salary Structure Deduction",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "options": "Simple",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "total_earning",
+ "fieldtype": "Currency",
+ "label": "Total Earning",
+ "oldfieldname": "total_earning",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "total_deduction",
+ "fieldtype": "Currency",
+ "label": "Total Deduction",
+ "oldfieldname": "total_deduction",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "net_pay",
+ "fieldtype": "Currency",
+ "label": "Net Pay",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "modified": "2013-12-20 19:24:28.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Salary Structure",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.py b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.py
index 26c87f1..95300e1 100644
--- a/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.py
+++ b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SalaryStructureDeduction(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt
index 845a70f..7f9f1a4 100644
--- a/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt
+++ b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt
@@ -1,59 +1,46 @@
-[
- {
- "creation": "2013-02-22 01:27:48",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:43",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Salary Structure Deduction",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Salary Structure Deduction"
- },
- {
- "doctype": "DocField",
- "fieldname": "d_type",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Type",
- "oldfieldname": "d_type",
- "oldfieldtype": "Select",
- "options": "Deduction Type",
- "print_width": "200px",
- "reqd": 1,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "d_modified_amt",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "d_modified_amt",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "depend_on_lwp",
- "fieldtype": "Check",
- "in_list_view": 0,
- "label": "Reduce Deduction for Leave Without Pay (LWP)",
- "oldfieldname": "depend_on_lwp",
- "oldfieldtype": "Check"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:48.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "d_type",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Type",
+ "oldfieldname": "d_type",
+ "oldfieldtype": "Select",
+ "options": "Deduction Type",
+ "permlevel": 0,
+ "print_width": "200px",
+ "reqd": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "d_modified_amt",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "d_modified_amt",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "depend_on_lwp",
+ "fieldtype": "Check",
+ "in_list_view": 0,
+ "label": "Reduce Deduction for Leave Without Pay (LWP)",
+ "oldfieldname": "depend_on_lwp",
+ "oldfieldtype": "Check",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:43.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Salary Structure Deduction",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.py b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.py
index 26c87f1..79f7972 100644
--- a/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.py
+++ b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SalaryStructureEarning(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt
index d90c3cd..534ff29 100644
--- a/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt
+++ b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt
@@ -1,61 +1,48 @@
-[
- {
- "creation": "2013-02-22 01:27:48",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:43",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "hide_heading": 0,
- "hide_toolbar": 0,
- "istable": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Salary Structure Earning",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Salary Structure Earning"
- },
- {
- "doctype": "DocField",
- "fieldname": "e_type",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Type",
- "oldfieldname": "e_type",
- "oldfieldtype": "Data",
- "options": "Earning Type",
- "print_width": "200px",
- "reqd": 1,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "modified_value",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "modified_value",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "depend_on_lwp",
- "fieldtype": "Check",
- "in_list_view": 0,
- "label": "Reduce Earning for Leave Without Pay (LWP)",
- "oldfieldname": "depend_on_lwp",
- "oldfieldtype": "Check"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:48.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "e_type",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Type",
+ "oldfieldname": "e_type",
+ "oldfieldtype": "Data",
+ "options": "Earning Type",
+ "permlevel": 0,
+ "print_width": "200px",
+ "reqd": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "modified_value",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "modified_value",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "depend_on_lwp",
+ "fieldtype": "Check",
+ "in_list_view": 0,
+ "label": "Reduce Earning for Leave Without Pay (LWP)",
+ "oldfieldname": "depend_on_lwp",
+ "oldfieldtype": "Check",
+ "permlevel": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:43.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Salary Structure Earning",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.py b/erpnext/hr/doctype/upload_attendance/upload_attendance.py
index 3da1078..8a54415 100644
--- a/erpnext/hr/doctype/upload_attendance/upload_attendance.py
+++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.py
@@ -8,14 +8,13 @@
from frappe.utils import cstr, add_days, date_diff
from frappe import msgprint, _
from frappe.utils.datautils import UnicodeWriter
+from frappe.model.document import Document
# doclist = None
doclist = frappe.local('uploadattendance_doclist')
-class DocType():
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class UploadAttendance(Document):
+ pass
@frappe.whitelist()
def get_template():
@@ -121,7 +120,7 @@
error = False
from frappe.utils.datautils import check_record, import_doc
- doctype_dl = frappe.get_doctype("Attendance")
+ doctype_dl = frappe.get_meta("Attendance")
for i, row in enumerate(rows[5:]):
if not row: continue
@@ -132,7 +131,7 @@
d["docstatus"] = frappe.db.get_value("Attendance", d.name, "docstatus")
try:
- check_record(d, doctype_dl=doctype_dl)
+ check_record(d)
ret.append(import_doc(d, "Attendance", 1, row_idx, submit=True))
except Exception, e:
error = True
diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.txt b/erpnext/hr/doctype/upload_attendance/upload_attendance.txt
index 5c72761..5037b3e 100644
--- a/erpnext/hr/doctype/upload_attendance/upload_attendance.txt
+++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.txt
@@ -1,102 +1,90 @@
-[
- {
- "creation": "2013-01-25 11:34:53",
- "docstatus": 0,
- "modified": "2013-12-20 19:21:54",
- "modified_by": "Administrator",
- "owner": "harshada@webnotestech.com"
- },
- {
- "allow_attach": 0,
- "doctype": "DocType",
- "icon": "icon-upload-alt",
- "issingle": 1,
- "max_attachments": 1,
- "module": "HR",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Upload Attendance",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Upload Attendance",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 0,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Upload Attendance"
- },
- {
- "description": "Download the Template, fill appropriate data and attach the modified file.\nAll dates and employee combination in the selected period will come in the template, with existing attendance records",
- "doctype": "DocField",
- "fieldname": "download_template",
- "fieldtype": "Section Break",
- "label": "Download Template"
- },
- {
- "doctype": "DocField",
- "fieldname": "att_fr_date",
- "fieldtype": "Date",
- "label": "Attendance From Date",
- "oldfieldname": "attenadnce_date",
- "oldfieldtype": "Date",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "att_to_date",
- "fieldtype": "Date",
- "label": "Attendance To Date",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "get_template",
- "fieldtype": "Button",
- "label": "Get Template",
- "oldfieldtype": "Button"
- },
- {
- "doctype": "DocField",
- "fieldname": "upload_attendance_data",
- "fieldtype": "Section Break",
- "label": "Import Attendance"
- },
- {
- "doctype": "DocField",
- "fieldname": "upload_html",
- "fieldtype": "HTML",
- "label": "Upload HTML"
- },
- {
- "doctype": "DocField",
- "fieldname": "import_log",
- "fieldtype": "HTML",
- "hidden": 0,
- "label": "Import Log"
- },
- {
- "doctype": "DocPerm",
- "role": "HR User"
- },
- {
- "doctype": "DocPerm",
- "role": "HR Manager"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 0,
+ "creation": "2013-01-25 11:34:53.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "Download the Template, fill appropriate data and attach the modified file.\nAll dates and employee combination in the selected period will come in the template, with existing attendance records",
+ "fieldname": "download_template",
+ "fieldtype": "Section Break",
+ "label": "Download Template",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "att_fr_date",
+ "fieldtype": "Date",
+ "label": "Attendance From Date",
+ "oldfieldname": "attenadnce_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "att_to_date",
+ "fieldtype": "Date",
+ "label": "Attendance To Date",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "get_template",
+ "fieldtype": "Button",
+ "label": "Get Template",
+ "oldfieldtype": "Button",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "upload_attendance_data",
+ "fieldtype": "Section Break",
+ "label": "Import Attendance",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "upload_html",
+ "fieldtype": "HTML",
+ "label": "Upload HTML",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "import_log",
+ "fieldtype": "HTML",
+ "hidden": 0,
+ "label": "Import Log",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-upload-alt",
+ "idx": 1,
+ "issingle": 1,
+ "max_attachments": 1,
+ "modified": "2013-12-20 19:21:54.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Upload Attendance",
+ "owner": "harshada@webnotestech.com",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "HR Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/hr/report/employee_birthday/employee_birthday.txt b/erpnext/hr/report/employee_birthday/employee_birthday.txt
index a114e5c..5839d01 100644
--- a/erpnext/hr/report/employee_birthday/employee_birthday.txt
+++ b/erpnext/hr/report/employee_birthday/employee_birthday.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-05-06 17:56:03",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "HR",
- "name": "__common__",
- "ref_doctype": "Employee",
- "report_name": "Employee Birthday",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Employee Birthday"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-05-06 17:56:03.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Employee Birthday",
+ "owner": "Administrator",
+ "ref_doctype": "Employee",
+ "report_name": "Employee Birthday",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/hr/report/employee_information/employee_information.txt b/erpnext/hr/report/employee_information/employee_information.txt
index 8bd3c4c..0dc3d40 100644
--- a/erpnext/hr/report/employee_information/employee_information.txt
+++ b/erpnext/hr/report/employee_information/employee_information.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-05-06 18:43:53",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "json": "{\"filters\":[],\"columns\":[[\"name\",\"Employee\"],[\"employee_number\",\"Employee\"],[\"date_of_joining\",\"Employee\"],[\"branch\",\"Employee\"],[\"department\",\"Employee\"],[\"designation\",\"Employee\"],[\"gender\",\"Employee\"],[\"status\",\"Employee\"],[\"company\",\"Employee\"],[\"employment_type\",\"Employee\"],[\"grade\",\"Employee\"],[\"reports_to\",\"Employee\"],[\"company_email\",\"Employee\"]],\"sort_by\":\"Employee.bank_ac_no\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
- "module": "HR",
- "name": "__common__",
- "ref_doctype": "Employee",
- "report_name": "Employee Information",
- "report_type": "Report Builder"
- },
- {
- "doctype": "Report",
- "name": "Employee Information"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-05-06 18:43:53.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "json": "{\"filters\":[],\"columns\":[[\"name\",\"Employee\"],[\"employee_number\",\"Employee\"],[\"date_of_joining\",\"Employee\"],[\"branch\",\"Employee\"],[\"department\",\"Employee\"],[\"designation\",\"Employee\"],[\"gender\",\"Employee\"],[\"status\",\"Employee\"],[\"company\",\"Employee\"],[\"employment_type\",\"Employee\"],[\"grade\",\"Employee\"],[\"reports_to\",\"Employee\"],[\"company_email\",\"Employee\"]],\"sort_by\":\"Employee.bank_ac_no\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Employee Information",
+ "owner": "Administrator",
+ "ref_doctype": "Employee",
+ "report_name": "Employee Information",
+ "report_type": "Report Builder"
+}
\ No newline at end of file
diff --git a/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt
index f682c64..4ffd7c8 100644
--- a/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt
+++ b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-02-22 15:29:34",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "HR",
- "name": "__common__",
- "ref_doctype": "Employee",
- "report_name": "Employee Leave Balance",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Employee Leave Balance"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 15:29:34.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Employee Leave Balance",
+ "owner": "Administrator",
+ "ref_doctype": "Employee",
+ "report_name": "Employee Leave Balance",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt
index 5c51c4b..5f55fee 100644
--- a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt
+++ b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-05-13 14:04:03",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 0,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "HR",
- "name": "__common__",
- "ref_doctype": "Attendance",
- "report_name": "Monthly Attendance Sheet",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Monthly Attendance Sheet"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 0,
+ "creation": "2013-05-13 14:04:03.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Monthly Attendance Sheet",
+ "owner": "Administrator",
+ "ref_doctype": "Attendance",
+ "report_name": "Monthly Attendance Sheet",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt
index 80b0c13..51b8e2c 100644
--- a/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt
+++ b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-05-07 18:09:42",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "HR",
- "name": "__common__",
- "ref_doctype": "Salary Slip",
- "report_name": "Monthly Salary Register",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Monthly Salary Register"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-05-07 18:09:42.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Monthly Salary Register",
+ "owner": "Administrator",
+ "ref_doctype": "Salary Slip",
+ "report_name": "Monthly Salary Register",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js
index 363ab75..d0e9cc7 100644
--- a/erpnext/manufacturing/doctype/bom/bom.js
+++ b/erpnext/manufacturing/doctype/bom/bom.js
@@ -34,7 +34,7 @@
}
var set_operation_no = function(doc) {
- var op_table = getchildren('BOM Operation', doc.name, 'bom_operations');
+ var op_table = doc.bom_operations || [];
var operations = [];
for (var i=0, j=op_table.length; i<j; i++) {
@@ -45,7 +45,7 @@
frappe.meta.get_docfield("BOM Item", "operation_no",
cur_frm.docname).options = operations.join("\n");
- $.each(getchildren("BOM Item", doc.name, "bom_materials"), function(i, v) {
+ $.each(doc.bom_materials || [], function(i, v) {
if(!inList(operations, cstr(v.operation_no))) v.operation_no = null;
});
@@ -132,7 +132,7 @@
}
var calculate_op_cost = function(doc) {
- var op = getchildren('BOM Operation', doc.name, 'bom_operations');
+ var op = doc.bom_operations || [];
total_op_cost = 0;
for(var i=0;i<op.length;i++) {
op_cost = flt(flt(op[i].hour_rate) * flt(op[i].time_in_mins) / 60, 2);
@@ -144,7 +144,7 @@
}
var calculate_rm_cost = function(doc) {
- var rm = getchildren('BOM Item', doc.name, 'bom_materials');
+ var rm = doc.bom_materials || [];
total_rm_cost = 0;
for(var i=0;i<rm.length;i++) {
amt = flt(rm[i].rate) * flt(rm[i].qty);
diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py
index 2c6d642..bd5642e 100644
--- a/erpnext/manufacturing/doctype/bom/bom.py
+++ b/erpnext/manufacturing/doctype/bom/bom.py
@@ -4,17 +4,15 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, cstr, flt, now, nowdate
-from frappe.model.doc import addchild
from frappe.model.bean import getlist
from frappe.model.code import get_obj
from frappe import msgprint, _
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class Bom(Document):
def autoname(self):
last_name = frappe.db.sql("""select max(name) from `tabBOM`
@@ -75,7 +73,7 @@
msgprint("Item %s does not exist in system" % item[0]['item_code'], raise_exception = 1)
def set_bom_material_details(self):
- for item in self.doclist.get({"parentfield": "bom_materials"}):
+ for item in self.get("bom_materials"):
ret = self.get_bom_material_detail({"item_code": item.item_code, "bom_no": item.bom_no,
"qty": item.qty})
@@ -128,7 +126,7 @@
return rate
def update_cost(self):
- for d in self.doclist.get({"parentfield": "bom_materials"}):
+ for d in self.get("bom_materials"):
d.rate = self.get_bom_material_detail({
'item_code': d.item_code,
'bom_no': d.bom_no,
@@ -188,8 +186,8 @@
def clear_operations(self):
if not self.doc.with_operations:
- self.doclist = self.doc.clear_table(self.doclist, 'bom_operations')
- for d in self.doclist.get({"parentfield": "bom_materials"}):
+ self.set('bom_operations', [])
+ for d in self.get("bom_materials"):
d.operation_no = None
def validate_main_item(self):
@@ -210,7 +208,7 @@
def validate_operations(self):
""" Check duplicate operation no"""
self.op = []
- for d in getlist(self.doclist, 'bom_operations'):
+ for d in self.get('bom_operations'):
if cstr(d.operation_no) in self.op:
msgprint("Operation no: %s is repeated in Operations Table" %
d.operation_no, raise_exception=1)
@@ -221,7 +219,7 @@
def validate_materials(self):
""" Validate raw material entries """
check_list = []
- for m in getlist(self.doclist, 'bom_materials'):
+ for m in self.get('bom_materials'):
# check if operation no not in op table
if self.doc.with_operations and cstr(m.operation_no) not in self.op:
msgprint("""Operation no: %s against item: %s at row no: %s \
@@ -315,7 +313,7 @@
def calculate_op_cost(self):
"""Update workstation rate and calculates totals"""
total_op_cost = 0
- for d in getlist(self.doclist, 'bom_operations'):
+ for d in self.get('bom_operations'):
if d.workstation and not d.hour_rate:
d.hour_rate = frappe.db.get_value("Workstation", d.workstation, "hour_rate")
if d.hour_rate and d.time_in_mins:
@@ -326,7 +324,7 @@
def calculate_rm_cost(self):
"""Fetch RM rate as per today's valuation rate and calculate totals"""
total_rm_cost = 0
- for d in getlist(self.doclist, 'bom_materials'):
+ for d in self.get('bom_materials'):
if d.bom_no:
d.rate = self.get_bom_unitcost(d.bom_no)
d.amount = flt(d.rate) * flt(d.qty)
@@ -343,7 +341,7 @@
def get_exploded_items(self):
""" Get all raw materials including items from child bom"""
self.cur_exploded_items = {}
- for d in getlist(self.doclist, 'bom_materials'):
+ for d in self.get('bom_materials'):
if d.bom_no:
self.get_child_exploded_items(d.bom_no, d.qty)
else:
@@ -379,9 +377,9 @@
def add_exploded_items(self):
"Add items to Flat BOM table"
- self.doclist = self.doc.clear_table(self.doclist, 'flat_bom_details', 1)
+ self.set('flat_bom_details', [])
for d in self.cur_exploded_items:
- ch = addchild(self.doc, 'flat_bom_details', 'BOM Explosion Item', self.doclist)
+ ch = self.doc.append('flat_bom_details', {})
for i in self.cur_exploded_items[d].keys():
ch.fields[i] = self.cur_exploded_items[d][i]
ch.amount = flt(ch.qty) * flt(ch.rate)
diff --git a/erpnext/manufacturing/doctype/bom/bom.txt b/erpnext/manufacturing/doctype/bom/bom.txt
index 4afc160..54299d0 100644
--- a/erpnext/manufacturing/doctype/bom/bom.txt
+++ b/erpnext/manufacturing/doctype/bom/bom.txt
@@ -1,281 +1,271 @@
-[
- {
- "creation": "2013-01-22 15:11:38",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:26",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 0,
- "allow_copy": 0,
- "allow_import": 1,
- "allow_rename": 0,
- "doctype": "DocType",
- "document_type": "Master",
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "icon-sitemap",
- "in_create": 0,
- "is_submittable": 1,
- "issingle": 0,
- "istable": 0,
- "module": "Manufacturing",
- "name": "__common__",
- "read_only": 0,
- "search_fields": "item"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "BOM",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "BOM",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "BOM"
- },
- {
- "description": "Item to be manufactured or repacked",
- "doctype": "DocField",
- "fieldname": "item",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Item",
- "oldfieldname": "item",
- "oldfieldtype": "Link",
- "options": "Item",
- "reqd": 1,
- "search_index": 1
- },
- {
- "allow_on_submit": 1,
- "default": "1",
- "doctype": "DocField",
- "fieldname": "is_active",
- "fieldtype": "Check",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Is Active",
- "no_copy": 1,
- "oldfieldname": "is_active",
- "oldfieldtype": "Select",
- "reqd": 0
- },
- {
- "allow_on_submit": 1,
- "default": "1",
- "doctype": "DocField",
- "fieldname": "is_default",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Is Default",
- "no_copy": 1,
- "oldfieldname": "is_default",
- "oldfieldtype": "Check"
- },
- {
- "doctype": "DocField",
- "fieldname": "cb0",
- "fieldtype": "Column Break"
- },
- {
- "description": "Manage cost of operations",
- "doctype": "DocField",
- "fieldname": "with_operations",
- "fieldtype": "Check",
- "label": "With Operations"
- },
- {
- "doctype": "DocField",
- "fieldname": "rm_cost_as_per",
- "fieldtype": "Select",
- "label": "Rate Of Materials Based On",
- "options": "Valuation Rate\nLast Purchase Rate\nPrice List"
- },
- {
- "depends_on": "eval:doc.rm_cost_as_per===\"Price List\"",
- "doctype": "DocField",
- "fieldname": "buying_price_list",
- "fieldtype": "Link",
- "label": "Price List",
- "options": "Price List"
- },
- {
- "depends_on": "with_operations",
- "description": "Specify the operations, operating cost and give a unique Operation no to your operations.",
- "doctype": "DocField",
- "fieldname": "operations",
- "fieldtype": "Section Break",
- "label": "Operations",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "bom_operations",
- "fieldtype": "Table",
- "label": "BOM Operations",
- "oldfieldname": "bom_operations",
- "oldfieldtype": "Table",
- "options": "BOM Operation"
- },
- {
- "doctype": "DocField",
- "fieldname": "materials",
- "fieldtype": "Section Break",
- "label": "Materials",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "bom_materials",
- "fieldtype": "Table",
- "label": "BOM Item",
- "oldfieldname": "bom_materials",
- "oldfieldtype": "Table",
- "options": "BOM Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "costing",
- "fieldtype": "Section Break",
- "label": "Costing",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_cost",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Total Cost",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cb1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "raw_material_cost",
- "fieldtype": "Float",
- "label": "Total Raw Material Cost",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "operating_cost",
- "fieldtype": "Float",
- "label": "Total Operating Cost",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info_section",
- "fieldtype": "Section Break",
- "label": "More Info"
- },
- {
- "default": "1",
- "description": "Quantity of item obtained after manufacturing / repacking from given quantities of raw materials",
- "doctype": "DocField",
- "fieldname": "quantity",
- "fieldtype": "Float",
- "label": "Quantity",
- "oldfieldname": "quantity",
- "oldfieldtype": "Currency",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "uom",
- "fieldtype": "Select",
- "label": "Item UOM",
- "options": "link:UOM",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break23",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "project_name",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Project Name",
- "oldfieldname": "project_name",
- "oldfieldtype": "Link",
- "options": "Project"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Item Desription",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "options": "BOM",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "hidden": 0,
- "label": "Materials Required (Exploded)",
- "print_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "flat_bom_details",
- "fieldtype": "Table",
- "hidden": 0,
- "label": "Materials Required (Exploded)",
- "no_copy": 1,
- "oldfieldname": "flat_bom_details",
- "oldfieldtype": "Table",
- "options": "BOM Explosion Item",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocPerm",
- "role": "Manufacturing Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Manufacturing User"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 0,
+ "allow_copy": 0,
+ "allow_import": 1,
+ "allow_rename": 0,
+ "creation": "2013-01-22 15:11:38.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "description": "Item to be manufactured or repacked",
+ "fieldname": "item",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Item",
+ "oldfieldname": "item",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "default": "1",
+ "fieldname": "is_active",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Is Active",
+ "no_copy": 1,
+ "oldfieldname": "is_active",
+ "oldfieldtype": "Select",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "default": "1",
+ "fieldname": "is_default",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Is Default",
+ "no_copy": 1,
+ "oldfieldname": "is_default",
+ "oldfieldtype": "Check",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "cb0",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "Manage cost of operations",
+ "fieldname": "with_operations",
+ "fieldtype": "Check",
+ "label": "With Operations",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "rm_cost_as_per",
+ "fieldtype": "Select",
+ "label": "Rate Of Materials Based On",
+ "options": "Valuation Rate\nLast Purchase Rate\nPrice List",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.rm_cost_as_per===\"Price List\"",
+ "fieldname": "buying_price_list",
+ "fieldtype": "Link",
+ "label": "Price List",
+ "options": "Price List",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "with_operations",
+ "description": "Specify the operations, operating cost and give a unique Operation no to your operations.",
+ "fieldname": "operations",
+ "fieldtype": "Section Break",
+ "label": "Operations",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "bom_operations",
+ "fieldtype": "Table",
+ "label": "BOM Operations",
+ "oldfieldname": "bom_operations",
+ "oldfieldtype": "Table",
+ "options": "BOM Operation",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "materials",
+ "fieldtype": "Section Break",
+ "label": "Materials",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "bom_materials",
+ "fieldtype": "Table",
+ "label": "BOM Item",
+ "oldfieldname": "bom_materials",
+ "oldfieldtype": "Table",
+ "options": "BOM Item",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "costing",
+ "fieldtype": "Section Break",
+ "label": "Costing",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "total_cost",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Total Cost",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "cb1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "raw_material_cost",
+ "fieldtype": "Float",
+ "label": "Total Raw Material Cost",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "operating_cost",
+ "fieldtype": "Float",
+ "label": "Total Operating Cost",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "more_info_section",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "permlevel": 0
+ },
+ {
+ "default": "1",
+ "description": "Quantity of item obtained after manufacturing / repacking from given quantities of raw materials",
+ "fieldname": "quantity",
+ "fieldtype": "Float",
+ "label": "Quantity",
+ "oldfieldname": "quantity",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "uom",
+ "fieldtype": "Select",
+ "label": "Item UOM",
+ "options": "link:UOM",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "col_break23",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Project Name",
+ "oldfieldname": "project_name",
+ "oldfieldtype": "Link",
+ "options": "Project",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Item Desription",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "options": "BOM",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "label": "Materials Required (Exploded)",
+ "permlevel": 0,
+ "print_hide": 0
+ },
+ {
+ "fieldname": "flat_bom_details",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "label": "Materials Required (Exploded)",
+ "no_copy": 1,
+ "oldfieldname": "flat_bom_details",
+ "oldfieldtype": "Table",
+ "options": "BOM Explosion Item",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "icon-sitemap",
+ "idx": 1,
+ "in_create": 0,
+ "is_submittable": 1,
+ "issingle": 0,
+ "istable": 0,
+ "modified": "2014-01-20 17:48:26.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "BOM",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Manufacturing Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Manufacturing User",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "read_only": 0,
+ "search_fields": "item"
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py
index 26c87f1..bd1b1af 100644
--- a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py
+++ b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class BomExplosionItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt
index 55342aa..6465e6a 100644
--- a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt
+++ b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt
@@ -1,98 +1,91 @@
-[
- {
- "creation": "2013-03-07 11:42:57",
- "docstatus": 0,
- "modified": "2013-12-20 19:22:57",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "FBD/.######",
- "default_print_format": "Standard",
- "doctype": "DocType",
- "istable": 1,
- "module": "Manufacturing",
- "name": "__common__",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "BOM Explosion Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "doctype": "DocType",
- "name": "BOM Explosion Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "print_width": "300px",
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Qty",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Rate",
- "oldfieldname": "standard_rate",
- "oldfieldtype": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "amount_as_per_sr",
- "oldfieldtype": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Stock UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Link",
- "options": "UOM"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty_consumed_per_unit",
- "fieldtype": "Float",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Qty Consumed Per Unit",
- "no_copy": 0
- }
-]
\ No newline at end of file
+{
+ "autoname": "FBD/.######",
+ "creation": "2013-03-07 11:42:57.000000",
+ "default_print_format": "Standard",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "read_only": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Qty",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Rate",
+ "oldfieldname": "standard_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "amount_as_per_sr",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Stock UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "qty_consumed_per_unit",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Qty Consumed Per Unit",
+ "no_copy": 0,
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:22:57.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "BOM Explosion Item",
+ "owner": "Administrator",
+ "read_only": 0
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.py b/erpnext/manufacturing/doctype/bom_item/bom_item.py
index 26c87f1..f2bef2c 100644
--- a/erpnext/manufacturing/doctype/bom_item/bom_item.py
+++ b/erpnext/manufacturing/doctype/bom_item/bom_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class BomItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.txt b/erpnext/manufacturing/doctype/bom_item/bom_item.txt
index 6949b75..fbf478c 100644
--- a/erpnext/manufacturing/doctype/bom_item/bom_item.txt
+++ b/erpnext/manufacturing/doctype/bom_item/bom_item.txt
@@ -1,154 +1,141 @@
-[
- {
- "creation": "2013-02-22 01:27:49",
- "docstatus": 0,
- "modified": "2014-02-03 12:47:39",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Manufacturing",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "BOM Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "BOM Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "operation_no",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Operation No",
- "oldfieldname": "operation_no",
- "oldfieldtype": "Data",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "bom_no",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "BOM No",
- "oldfieldname": "bom_no",
- "oldfieldtype": "Link",
- "options": "BOM",
- "print_width": "150px",
- "reqd": 0,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "label": "Item Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "print_width": "250px",
- "reqd": 0,
- "width": "250px"
- },
- {
- "doctype": "DocField",
- "fieldname": "quantity_and_rate",
- "fieldtype": "Section Break",
- "label": "Quantity and Rate"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Qty",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "reqd": 1
- },
- {
- "description": "See \"Rate Of Materials Based On\" in Costing Section",
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Rate"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Stock UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "amount_as_per_mar",
- "oldfieldtype": "Currency",
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "scrap",
- "fieldtype": "Float",
- "label": "Scrap %",
- "oldfieldname": "scrap",
- "oldfieldtype": "Currency",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "qty_consumed_per_unit",
- "fieldtype": "Float",
- "hidden": 1,
- "label": "Qty Consumed Per Unit",
- "oldfieldname": "qty_consumed_per_unit",
- "oldfieldtype": "Float",
- "print_hide": 1,
- "read_only": 1
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:49.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "operation_no",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Operation No",
+ "oldfieldname": "operation_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "bom_no",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "BOM No",
+ "oldfieldname": "bom_no",
+ "oldfieldtype": "Link",
+ "options": "BOM",
+ "permlevel": 0,
+ "print_width": "150px",
+ "reqd": 0,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "label": "Item Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_width": "250px",
+ "reqd": 0,
+ "width": "250px"
+ },
+ {
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "label": "Quantity and Rate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Qty",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "See \"Rate Of Materials Based On\" in Costing Section",
+ "fieldname": "rate",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Rate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Stock UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "amount_as_per_mar",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "scrap",
+ "fieldtype": "Float",
+ "label": "Scrap %",
+ "oldfieldname": "scrap",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "qty_consumed_per_unit",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "label": "Qty Consumed Per Unit",
+ "oldfieldname": "qty_consumed_per_unit",
+ "oldfieldtype": "Float",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-03 12:47:39.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "BOM Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.py b/erpnext/manufacturing/doctype/bom_operation/bom_operation.py
index 26c87f1..df55159 100644
--- a/erpnext/manufacturing/doctype/bom_operation/bom_operation.py
+++ b/erpnext/manufacturing/doctype/bom_operation/bom_operation.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class BomOperation(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt b/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt
index b2628c1..3bf5862 100644
--- a/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt
+++ b/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt
@@ -1,94 +1,81 @@
-[
- {
- "creation": "2013-02-22 01:27:49",
- "docstatus": 0,
- "modified": "2014-02-03 12:53:03",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Manufacturing",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "BOM Operation",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "BOM Operation"
- },
- {
- "doctype": "DocField",
- "fieldname": "operation_no",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Operation No",
- "oldfieldname": "operation_no",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "opn_description",
- "fieldtype": "Text",
- "in_list_view": 1,
- "label": "Operation Description",
- "oldfieldname": "opn_description",
- "oldfieldtype": "Text",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "workstation",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Workstation",
- "oldfieldname": "workstation",
- "oldfieldtype": "Link",
- "options": "Workstation",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "hour_rate",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Hour Rate",
- "oldfieldname": "hour_rate",
- "oldfieldtype": "Currency",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "time_in_mins",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Operation Time (mins)",
- "oldfieldname": "time_in_mins",
- "oldfieldtype": "Currency",
- "reqd": 0
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "operating_cost",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Operating Cost",
- "oldfieldname": "operating_cost",
- "oldfieldtype": "Currency",
- "reqd": 0
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:49.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "operation_no",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Operation No",
+ "oldfieldname": "operation_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "opn_description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Operation Description",
+ "oldfieldname": "opn_description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "workstation",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Workstation",
+ "oldfieldname": "workstation",
+ "oldfieldtype": "Link",
+ "options": "Workstation",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "hour_rate",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Hour Rate",
+ "oldfieldname": "hour_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "time_in_mins",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Operation Time (mins)",
+ "oldfieldname": "time_in_mins",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "operating_cost",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Operating Cost",
+ "oldfieldname": "operating_cost",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-03 12:53:03.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "BOM Operation",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py
index 598d822..c406777 100644
--- a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py
+++ b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py
@@ -7,7 +7,9 @@
from frappe.model.code import get_obj
from frappe import msgprint, _
-class DocType:
+from frappe.model.document import Document
+
+class BomReplaceTool(Document):
def __init__( self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
diff --git a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt
index cdb65ee..a5e3b4d 100644
--- a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt
+++ b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt
@@ -1,80 +1,63 @@
-[
- {
- "creation": "2012-12-06 12:10:10",
- "docstatus": 0,
- "modified": "2013-07-05 14:27:52",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_copy": 1,
- "allow_email": 1,
- "allow_print": 1,
- "description": "Replace a particular BOM in all other BOMs where it is used. It will replace the old BOM link, update cost and regenerate \"BOM Explosion Item\" table as per new BOM",
- "doctype": "DocType",
- "document_type": "Other",
- "hide_heading": 1,
- "hide_toolbar": 1,
- "icon": "icon-magic",
- "in_create": 1,
- "issingle": 1,
- "module": "Manufacturing",
- "name": "__common__",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "BOM Replace Tool",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "BOM Replace Tool",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "report": 0,
- "role": "Manufacturing Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "BOM Replace Tool"
- },
- {
- "description": "The BOM which will be replaced",
- "doctype": "DocField",
- "fieldname": "current_bom",
- "fieldtype": "Link",
- "label": "Current BOM",
- "options": "BOM",
- "reqd": 1
- },
- {
- "description": "The new BOM after replacement",
- "doctype": "DocField",
- "fieldname": "new_bom",
- "fieldtype": "Link",
- "label": "New BOM",
- "options": "BOM",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "replace",
- "fieldtype": "Button",
- "label": "Replace",
- "options": "replace_bom"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_copy": 1,
+ "allow_email": 1,
+ "allow_print": 1,
+ "creation": "2012-12-06 12:10:10.000000",
+ "description": "Replace a particular BOM in all other BOMs where it is used. It will replace the old BOM link, update cost and regenerate \"BOM Explosion Item\" table as per new BOM",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "fields": [
+ {
+ "description": "The BOM which will be replaced",
+ "fieldname": "current_bom",
+ "fieldtype": "Link",
+ "label": "Current BOM",
+ "options": "BOM",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "description": "The new BOM after replacement",
+ "fieldname": "new_bom",
+ "fieldtype": "Link",
+ "label": "New BOM",
+ "options": "BOM",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "replace",
+ "fieldtype": "Button",
+ "label": "Replace",
+ "options": "replace_bom",
+ "permlevel": 0,
+ "read_only": 0
+ }
+ ],
+ "hide_heading": 1,
+ "hide_toolbar": 1,
+ "icon": "icon-magic",
+ "idx": 1,
+ "in_create": 1,
+ "issingle": 1,
+ "modified": "2013-07-05 14:27:52.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "BOM Replace Tool",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "permlevel": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Manufacturing Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 1
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js
index 86580d6..5901731 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.js
+++ b/erpnext/manufacturing/doctype/production_order/production_order.js
@@ -70,7 +70,7 @@
var doc = cur_frm.doc;
var check = confirm(frappe._("Do you really want to stop production order: " + doc.name));
if (check) {
- return $c_obj(make_doclist(doc.doctype, doc.name), 'stop_unstop', 'Stopped', function(r, rt) {cur_frm.refresh();});
+ return $c_obj(doc, 'stop_unstop', 'Stopped', function(r, rt) {cur_frm.refresh();});
}
}
@@ -78,7 +78,7 @@
var doc = cur_frm.doc;
var check = confirm(frappe._("Do really want to unstop production order: " + doc.name));
if (check)
- return $c_obj(make_doclist(doc.doctype, doc.name), 'stop_unstop', 'Unstopped', function(r, rt) {cur_frm.refresh();});
+ return $c_obj(doc, 'stop_unstop', 'Unstopped', function(r, rt) {cur_frm.refresh();});
}
cur_frm.cscript['Transfer Raw Materials'] = function() {
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index abc6cfd..aeea1c0 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -10,10 +10,9 @@
class OverProductionError(frappe.ValidationError): pass
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class ProductionOrder(Document):
def validate(self):
if self.doc.docstatus == 0:
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.txt b/erpnext/manufacturing/doctype/production_order/production_order.txt
index 41ef1ce..b1ff628 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.txt
+++ b/erpnext/manufacturing/doctype/production_order/production_order.txt
@@ -1,267 +1,248 @@
-[
- {
- "creation": "2013-01-10 16:34:16",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:01",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "icon": "icon-cogs",
- "in_create": 0,
- "is_submittable": 1,
- "module": "Manufacturing",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Production Order",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Production Order",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Manufacturing User",
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Production Order"
- },
- {
- "doctype": "DocField",
- "fieldname": "item",
- "fieldtype": "Section Break",
- "label": "Item",
- "options": "icon-gift"
- },
- {
- "default": "PRO",
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "options": "\nPRO",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "production_item",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item To Manufacture",
- "oldfieldname": "production_item",
- "oldfieldtype": "Link",
- "options": "Item",
- "read_only": 0,
- "reqd": 1
- },
- {
- "depends_on": "production_item",
- "description": "Bill of Material to be considered for manufacturing",
- "doctype": "DocField",
- "fieldname": "bom_no",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "BOM No",
- "oldfieldname": "bom_no",
- "oldfieldtype": "Link",
- "options": "BOM",
- "read_only": 0,
- "reqd": 1
- },
- {
- "default": "1",
- "description": "If checked, BOM for sub-assembly items will be considered for getting raw materials. Otherwise, all sub-assembly items will be treated as a raw material.",
- "doctype": "DocField",
- "fieldname": "use_multi_level_bom",
- "fieldtype": "Check",
- "label": "Use Multi-Level BOM"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "description": "Manufacture against Sales Order",
- "doctype": "DocField",
- "fieldname": "sales_order",
- "fieldtype": "Link",
- "label": "Sales Order",
- "options": "Sales Order",
- "read_only": 0
- },
- {
- "depends_on": "production_item",
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Qty To Manufacture",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "read_only": 0,
- "reqd": 1
- },
- {
- "depends_on": "eval:doc.docstatus==1",
- "description": "Automatically updated via Stock Entry of type Manufacture/Repack",
- "doctype": "DocField",
- "fieldname": "produced_qty",
- "fieldtype": "Float",
- "label": "Manufactured Qty",
- "no_copy": 1,
- "oldfieldname": "produced_qty",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "depends_on": "sales_order",
- "doctype": "DocField",
- "fieldname": "expected_delivery_date",
- "fieldtype": "Date",
- "label": "Expected Delivery Date",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouses",
- "fieldtype": "Section Break",
- "label": "Warehouses",
- "options": "icon-building"
- },
- {
- "depends_on": "production_item",
- "description": "Manufactured quantity will be updated in this warehouse",
- "doctype": "DocField",
- "fieldname": "fg_warehouse",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "For Warehouse",
- "options": "Warehouse",
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_12",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "wip_warehouse",
- "fieldtype": "Link",
- "label": "Work-in-Progress Warehouse",
- "options": "Warehouse",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "options": "icon-file-text",
- "read_only": 0
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nDraft\nSubmitted\nStopped\nIn Process\nCompleted\nCancelled",
- "read_only": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "label": "Item Description",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "project_name",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Project Name",
- "oldfieldname": "project_name",
- "oldfieldtype": "Link",
- "options": "Project",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "depends_on": "production_item",
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "label": "Stock UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-01-10 16:34:16.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item",
+ "fieldtype": "Section Break",
+ "label": "Item",
+ "options": "icon-gift",
+ "permlevel": 0
+ },
+ {
+ "default": "PRO",
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "options": "\nPRO",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "production_item",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item To Manufacture",
+ "oldfieldname": "production_item",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "production_item",
+ "description": "Bill of Material to be considered for manufacturing",
+ "fieldname": "bom_no",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "BOM No",
+ "oldfieldname": "bom_no",
+ "oldfieldtype": "Link",
+ "options": "BOM",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "default": "1",
+ "description": "If checked, BOM for sub-assembly items will be considered for getting raw materials. Otherwise, all sub-assembly items will be treated as a raw material.",
+ "fieldname": "use_multi_level_bom",
+ "fieldtype": "Check",
+ "label": "Use Multi-Level BOM",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "description": "Manufacture against Sales Order",
+ "fieldname": "sales_order",
+ "fieldtype": "Link",
+ "label": "Sales Order",
+ "options": "Sales Order",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "production_item",
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Qty To Manufacture",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:doc.docstatus==1",
+ "description": "Automatically updated via Stock Entry of type Manufacture/Repack",
+ "fieldname": "produced_qty",
+ "fieldtype": "Float",
+ "label": "Manufactured Qty",
+ "no_copy": 1,
+ "oldfieldname": "produced_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "sales_order",
+ "fieldname": "expected_delivery_date",
+ "fieldtype": "Date",
+ "label": "Expected Delivery Date",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "warehouses",
+ "fieldtype": "Section Break",
+ "label": "Warehouses",
+ "options": "icon-building",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "production_item",
+ "description": "Manufactured quantity will be updated in this warehouse",
+ "fieldname": "fg_warehouse",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "For Warehouse",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "column_break_12",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "wip_warehouse",
+ "fieldtype": "Link",
+ "label": "Work-in-Progress Warehouse",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nDraft\nSubmitted\nStopped\nIn Process\nCompleted\nCancelled",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "label": "Item Description",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Project Name",
+ "oldfieldname": "project_name",
+ "oldfieldtype": "Link",
+ "options": "Project",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "depends_on": "production_item",
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "label": "Stock UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-cogs",
+ "idx": 1,
+ "in_create": 0,
+ "is_submittable": 1,
+ "modified": "2014-01-20 17:49:01.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "Production Order",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Manufacturing User",
+ "submit": 1,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py
index 26c87f1..a9a9c61 100644
--- a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py
+++ b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ProductionPlanItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt
index 2068188..cb5d24f 100644
--- a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt
+++ b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt
@@ -1,125 +1,112 @@
-[
- {
- "creation": "2013-02-22 01:27:49",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:25",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "PPID/.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Manufacturing",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Production Plan Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Production Plan Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "print_width": "150px",
- "reqd": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "bom_no",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "BOM No",
- "oldfieldname": "bom_no",
- "oldfieldtype": "Link",
- "options": "BOM",
- "print_width": "100px",
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "planned_qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Planned Qty",
- "oldfieldname": "planned_qty",
- "oldfieldtype": "Currency",
- "print_width": "100px",
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_order",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Sales Order",
- "oldfieldname": "source_docname",
- "oldfieldtype": "Data",
- "options": "Sales Order",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "so_pending_qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "SO Pending Qty",
- "oldfieldname": "prevdoc_reqd_qty",
- "oldfieldtype": "Currency",
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "width": "100px"
- },
- {
- "description": "Reserved Warehouse in Sales Order / Finished Goods Warehouse",
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "label": "Warehouse",
- "options": "Warehouse",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "print_width": "80px",
- "read_only": 1,
- "reqd": 1,
- "width": "80px"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "print_width": "200px",
- "read_only": 1,
- "width": "200px"
- }
-]
\ No newline at end of file
+{
+ "autoname": "PPID/.#####",
+ "creation": "2013-02-22 01:27:49.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "print_width": "150px",
+ "reqd": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "bom_no",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "BOM No",
+ "oldfieldname": "bom_no",
+ "oldfieldtype": "Link",
+ "options": "BOM",
+ "permlevel": 0,
+ "print_width": "100px",
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "planned_qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Planned Qty",
+ "oldfieldname": "planned_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "100px",
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "sales_order",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Sales Order",
+ "oldfieldname": "source_docname",
+ "oldfieldtype": "Data",
+ "options": "Sales Order",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "so_pending_qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "SO Pending Qty",
+ "oldfieldname": "prevdoc_reqd_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "description": "Reserved Warehouse in Sales Order / Finished Goods Warehouse",
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "label": "Warehouse",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_width": "80px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "80px"
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_width": "200px",
+ "read_only": 1,
+ "width": "200px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:25.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "Production Plan Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py
index 26c87f1..c0be09e 100644
--- a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py
+++ b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ProductionPlanSalesOrder(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt
index 11a02a5..2b6c393 100644
--- a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt
+++ b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt
@@ -1,71 +1,61 @@
-[
- {
- "creation": "2013-02-22 01:27:49",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:25",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "PP/.SO/.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Manufacturing",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Production Plan Sales Order",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Production Plan Sales Order"
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_order",
- "fieldtype": "Link",
- "label": "Sales Order",
- "oldfieldname": "prevdoc_docname",
- "oldfieldtype": "Data",
- "options": "Sales Order",
- "print_width": "150px",
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_order_date",
- "fieldtype": "Date",
- "label": "SO Date",
- "oldfieldname": "document_date",
- "oldfieldtype": "Date",
- "print_width": "120px",
- "read_only": 1,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "label": "Customer",
- "options": "Customer",
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total",
- "fieldtype": "Currency",
- "label": "Grand Total",
- "options": "Company:company:default_currency",
- "print_width": "120px",
- "read_only": 1,
- "width": "120px"
- }
-]
\ No newline at end of file
+{
+ "autoname": "PP/.SO/.#####",
+ "creation": "2013-02-22 01:27:49.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "sales_order",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Sales Order",
+ "oldfieldname": "prevdoc_docname",
+ "oldfieldtype": "Data",
+ "options": "Sales Order",
+ "permlevel": 0,
+ "print_width": "150px",
+ "width": "150px"
+ },
+ {
+ "fieldname": "sales_order_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "SO Date",
+ "oldfieldname": "document_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_width": "120px",
+ "read_only": 1,
+ "width": "120px"
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Customer",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Grand Total",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_width": "120px",
+ "read_only": 1,
+ "width": "120px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:25.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "Production Plan Sales Order",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js
index fdd4db1..fc7abde 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js
@@ -25,9 +25,9 @@
}
cur_frm.cscript.download_materials_required = function(doc, cdt, cdn) {
- return $c_obj(make_doclist(cdt, cdn), 'validate_data', '', function(r, rt) {
+ return $c_obj(doc, 'validate_data', '', function(r, rt) {
if (!r['exc'])
- $c_obj_csv(make_doclist(cdt, cdn), 'download_raw_materials', '', '');
+ $c_obj_csv(doc, 'download_raw_materials', '', '');
});
}
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
index 60007cd..9f14b2c 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
@@ -4,15 +4,13 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt, cint, nowdate, add_days
-from frappe.model.doc import addchild, Document
from frappe.model.bean import getlist
from frappe.model.code import get_obj
from frappe import msgprint, _
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class ProductionPlanningTool(Document):
self.item_dict = {}
def get_so_details(self, so):
@@ -39,10 +37,10 @@
return ret
def clear_so_table(self):
- self.doclist = self.doc.clear_table(self.doclist, 'pp_so_details')
+ self.set('pp_so_details', [])
def clear_item_table(self):
- self.doclist = self.doc.clear_table(self.doclist, 'pp_details')
+ self.set('pp_details', [])
def validate_company(self):
if not self.doc.company:
@@ -84,11 +82,10 @@
""" Add sales orders in the table"""
self.clear_so_table()
- so_list = [d.sales_order for d in getlist(self.doclist, 'pp_so_details')]
+ so_list = [d.sales_order for d in self.get('pp_so_details')]
for r in open_so:
if cstr(r['name']) not in so_list:
- pp_so = addchild(self.doc, 'pp_so_details',
- 'Production Plan Sales Order', self.doclist)
+ pp_so = self.doc.append('pp_so_details', {})
pp_so.sales_order = r['name']
pp_so.sales_order_date = cstr(r['transaction_date'])
pp_so.customer = cstr(r['customer'])
@@ -103,7 +100,7 @@
self.add_items(items)
def get_items(self):
- so_list = filter(None, [d.sales_order for d in getlist(self.doclist, 'pp_so_details')])
+ so_list = filter(None, [d.sales_order for d in self.get('pp_so_details')])
if not so_list:
msgprint(_("Please enter sales order in the above table"))
return []
@@ -138,7 +135,7 @@
for p in items:
item_details = frappe.db.sql("""select description, stock_uom, default_bom
from tabItem where name=%s""", p['item_code'])
- pi = addchild(self.doc, 'pp_details', 'Production Plan Item', self.doclist)
+ pi = self.doc.append('pp_details', {})
pi.sales_order = p['parent']
pi.warehouse = p['warehouse']
pi.item_code = p['item_code']
@@ -151,7 +148,7 @@
def validate_data(self):
self.validate_company()
- for d in getlist(self.doclist, 'pp_details'):
+ for d in self.get('pp_details'):
self.validate_bom_no(d)
if not flt(d.planned_qty):
frappe.throw("Please Enter Planned Qty for item: %s at row no: %s" %
@@ -193,7 +190,7 @@
}
"""
item_dict, bom_dict = {}, {}
- for d in self.doclist.get({"parentfield": "pp_details"}):
+ for d in self.get("pp_details"):
bom_dict.setdefault(d.bom_no, []).append([d.sales_order, flt(d.planned_qty)])
item_dict[(d.item_code, d.sales_order, d.warehouse)] = {
"production_item" : d.item_code,
@@ -369,7 +366,7 @@
if items_to_be_requested:
for item in items_to_be_requested:
item_wrapper = frappe.bean("Item", item)
- pr_doclist = [{
+ pr_doc = frappe.get_doc({
"doctype": "Material Request",
"__islocal": 1,
"naming_series": "IDT",
@@ -379,12 +376,11 @@
"fiscal_year": fiscal_year,
"requested_by": frappe.session.user,
"material_request_type": "Purchase"
- }]
+ })
for sales_order, requested_qty in items_to_be_requested[item].items():
- pr_doclist.append({
+ pr_doc.append("indent_details", {
"doctype": "Material Request Item",
"__islocal": 1,
- "parentfield": "indent_details",
"item_code": item,
"item_name": item_wrapper.doc.item_name,
"description": item_wrapper.doc.description,
@@ -397,10 +393,9 @@
"sales_order_no": sales_order if sales_order!="No Sales Order" else None
})
- pr_wrapper = frappe.bean(pr_doclist)
- pr_wrapper.ignore_permissions = 1
- pr_wrapper.submit()
- purchase_request_list.append(pr_wrapper.doc.name)
+ pr_doc.ignore_permissions = 1
+ pr_doc.submit()
+ purchase_request_list.append(pr_doc.name)
if purchase_request_list:
pur_req = ["""<a href="#Form/Material Request/%s" target="_blank">%s</a>""" % \
diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt
index 4c3b065..bdfab41 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt
@@ -1,196 +1,177 @@
-[
- {
- "creation": "2013-01-21 12:03:47",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:25",
- "modified_by": "Administrator",
- "owner": "jai@webnotestech.com"
- },
- {
- "default_print_format": "Standard",
- "doctype": "DocType",
- "icon": "icon-calendar",
- "in_create": 1,
- "issingle": 1,
- "module": "Manufacturing",
- "name": "__common__",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Production Planning Tool",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Production Planning Tool",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 0,
- "role": "Manufacturing User",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Production Planning Tool"
- },
- {
- "description": "Select Sales Orders from which you want to create Production Orders.",
- "doctype": "DocField",
- "fieldname": "select_sales_orders",
- "fieldtype": "Section Break",
- "label": "Select Sales Orders"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "fg_item",
- "fieldtype": "Link",
- "label": "Filter based on item",
- "options": "Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "label": "Filter based on customer",
- "options": "Customer"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "options": "Company",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "from_date",
- "fieldtype": "Date",
- "label": "From Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "to_date",
- "fieldtype": "Date",
- "label": "To Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break1",
- "fieldtype": "Section Break",
- "options": "Simple"
- },
- {
- "description": "Pull sales orders (pending to deliver) based on the above criteria",
- "doctype": "DocField",
- "fieldname": "get_sales_orders",
- "fieldtype": "Button",
- "label": "Get Sales Orders",
- "options": "get_open_sales_orders"
- },
- {
- "doctype": "DocField",
- "fieldname": "pp_so_details",
- "fieldtype": "Table",
- "label": "Production Plan Sales Orders",
- "options": "Production Plan Sales Order"
- },
- {
- "doctype": "DocField",
- "fieldname": "items_for_production",
- "fieldtype": "Section Break",
- "label": "Select Items"
- },
- {
- "doctype": "DocField",
- "fieldname": "get_items_from_so",
- "fieldtype": "Button",
- "label": "Get Items From Sales Orders",
- "options": "get_items_from_so"
- },
- {
- "default": "1",
- "description": "If checked, BOM for sub-assembly items will be considered for getting raw materials. Otherwise, all sub-assembly items will be treated as a raw material.",
- "doctype": "DocField",
- "fieldname": "use_multi_level_bom",
- "fieldtype": "Check",
- "label": "Use Multi-Level BOM",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "pp_details",
- "fieldtype": "Table",
- "label": "Production Plan Items",
- "options": "Production Plan Item"
- },
- {
- "description": "Enter items and planned qty for which you want to raise production orders or download raw materials for analysis.",
- "doctype": "DocField",
- "fieldname": "create_production_orders",
- "fieldtype": "Section Break",
- "label": "Production Orders"
- },
- {
- "description": "Separate production order will be created for each finished good item.",
- "doctype": "DocField",
- "fieldname": "raise_production_order",
- "fieldtype": "Button",
- "label": "Create Production Orders",
- "options": "raise_production_order"
- },
- {
- "doctype": "DocField",
- "fieldname": "sb5",
- "fieldtype": "Section Break",
- "label": "Material Requirement"
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_request_for_warehouse",
- "fieldtype": "Link",
- "label": "Material Request For Warehouse",
- "options": "Warehouse"
- },
- {
- "description": "Items to be requested which are \"Out of Stock\" considering all warehouses based on projected qty and minimum order qty",
- "doctype": "DocField",
- "fieldname": "raise_purchase_request",
- "fieldtype": "Button",
- "label": "Create Material Requests",
- "options": "raise_purchase_request"
- },
- {
- "description": "Download a report containing all raw materials with their latest inventory status",
- "doctype": "DocField",
- "fieldname": "download_materials_required",
- "fieldtype": "Button",
- "label": "Download Materials Required"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-21 12:03:47.000000",
+ "default_print_format": "Standard",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "Select Sales Orders from which you want to create Production Orders.",
+ "fieldname": "select_sales_orders",
+ "fieldtype": "Section Break",
+ "label": "Select Sales Orders",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "fg_item",
+ "fieldtype": "Link",
+ "label": "Filter based on item",
+ "options": "Item",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "label": "Filter based on customer",
+ "options": "Customer",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "from_date",
+ "fieldtype": "Date",
+ "label": "From Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "to_date",
+ "fieldtype": "Date",
+ "label": "To Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "section_break1",
+ "fieldtype": "Section Break",
+ "options": "Simple",
+ "permlevel": 0
+ },
+ {
+ "description": "Pull sales orders (pending to deliver) based on the above criteria",
+ "fieldname": "get_sales_orders",
+ "fieldtype": "Button",
+ "label": "Get Sales Orders",
+ "options": "get_open_sales_orders",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "pp_so_details",
+ "fieldtype": "Table",
+ "label": "Production Plan Sales Orders",
+ "options": "Production Plan Sales Order",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "items_for_production",
+ "fieldtype": "Section Break",
+ "label": "Select Items",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "get_items_from_so",
+ "fieldtype": "Button",
+ "label": "Get Items From Sales Orders",
+ "options": "get_items_from_so",
+ "permlevel": 0
+ },
+ {
+ "default": "1",
+ "description": "If checked, BOM for sub-assembly items will be considered for getting raw materials. Otherwise, all sub-assembly items will be treated as a raw material.",
+ "fieldname": "use_multi_level_bom",
+ "fieldtype": "Check",
+ "label": "Use Multi-Level BOM",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "pp_details",
+ "fieldtype": "Table",
+ "label": "Production Plan Items",
+ "options": "Production Plan Item",
+ "permlevel": 0
+ },
+ {
+ "description": "Enter items and planned qty for which you want to raise production orders or download raw materials for analysis.",
+ "fieldname": "create_production_orders",
+ "fieldtype": "Section Break",
+ "label": "Production Orders",
+ "permlevel": 0
+ },
+ {
+ "description": "Separate production order will be created for each finished good item.",
+ "fieldname": "raise_production_order",
+ "fieldtype": "Button",
+ "label": "Create Production Orders",
+ "options": "raise_production_order",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sb5",
+ "fieldtype": "Section Break",
+ "label": "Material Requirement",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "purchase_request_for_warehouse",
+ "fieldtype": "Link",
+ "label": "Material Request For Warehouse",
+ "options": "Warehouse",
+ "permlevel": 0
+ },
+ {
+ "description": "Items to be requested which are \"Out of Stock\" considering all warehouses based on projected qty and minimum order qty",
+ "fieldname": "raise_purchase_request",
+ "fieldtype": "Button",
+ "label": "Create Material Requests",
+ "options": "raise_purchase_request",
+ "permlevel": 0
+ },
+ {
+ "description": "Download a report containing all raw materials with their latest inventory status",
+ "fieldname": "download_materials_required",
+ "fieldtype": "Button",
+ "label": "Download Materials Required",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-calendar",
+ "idx": 1,
+ "in_create": 1,
+ "issingle": 1,
+ "modified": "2013-12-20 19:23:25.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "Production Planning Tool",
+ "owner": "jai@webnotestech.com",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Manufacturing User",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 1
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py
index 2829f41..dd53c56 100644
--- a/erpnext/manufacturing/doctype/workstation/workstation.py
+++ b/erpnext/manufacturing/doctype/workstation/workstation.py
@@ -5,7 +5,9 @@
import frappe
from frappe.utils import flt
-class DocType:
+from frappe.model.document import Document
+
+class Workstation(Document):
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
diff --git a/erpnext/manufacturing/doctype/workstation/workstation.txt b/erpnext/manufacturing/doctype/workstation/workstation.txt
index b8355bf..db3b440 100644
--- a/erpnext/manufacturing/doctype/workstation/workstation.txt
+++ b/erpnext/manufacturing/doctype/workstation/workstation.txt
@@ -1,168 +1,149 @@
-[
- {
- "creation": "2013-01-10 16:34:17",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:35",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:workstation_name",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-wrench",
- "module": "Manufacturing",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Workstation",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Workstation",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Manufacturing User",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Workstation"
- },
- {
- "doctype": "DocField",
- "fieldname": "workstation_name",
- "fieldtype": "Data",
- "label": "Workstation Name",
- "oldfieldname": "workstation_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "label": "Warehouse",
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "capacity",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Capacity",
- "oldfieldname": "capacity",
- "oldfieldtype": "Data",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "capacity_units",
- "fieldtype": "Select",
- "hidden": 1,
- "label": "Capacity Units",
- "oldfieldname": "capacity_units",
- "oldfieldtype": "Select",
- "options": "\nUnits/Shifts\nUnits/Hour",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "hour_rate_labour",
- "fieldtype": "Float",
- "label": "Hour Rate Labour",
- "oldfieldname": "hour_rate_labour",
- "oldfieldtype": "Currency",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "over_heads",
- "fieldtype": "Section Break",
- "label": "Overheads",
- "oldfieldtype": "Section Break"
- },
- {
- "description": "Electricity cost per hour",
- "doctype": "DocField",
- "fieldname": "hour_rate_electricity",
- "fieldtype": "Float",
- "label": "Electricity Cost",
- "oldfieldname": "hour_rate_electricity",
- "oldfieldtype": "Currency"
- },
- {
- "description": "Consumable cost per hour",
- "doctype": "DocField",
- "fieldname": "hour_rate_consumable",
- "fieldtype": "Float",
- "label": "Consumable Cost",
- "oldfieldname": "hour_rate_consumable",
- "oldfieldtype": "Currency"
- },
- {
- "description": "Rent per hour",
- "doctype": "DocField",
- "fieldname": "hour_rate_rent",
- "fieldtype": "Float",
- "label": "Rent Cost",
- "oldfieldname": "hour_rate_rent",
- "oldfieldtype": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "overhead",
- "fieldtype": "Float",
- "label": "Overhead",
- "oldfieldname": "overhead",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "hour_rate_section_break",
- "fieldtype": "Section Break",
- "label": "Hour Rate",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "hour_rate",
- "fieldtype": "Float",
- "label": "Hour Rate",
- "oldfieldname": "hour_rate",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:workstation_name",
+ "creation": "2013-01-10 16:34:17.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "workstation_name",
+ "fieldtype": "Data",
+ "label": "Workstation Name",
+ "oldfieldname": "workstation_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "label": "Warehouse",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "width": "300px"
+ },
+ {
+ "fieldname": "capacity",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Capacity",
+ "oldfieldname": "capacity",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "capacity_units",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "label": "Capacity Units",
+ "oldfieldname": "capacity_units",
+ "oldfieldtype": "Select",
+ "options": "\nUnits/Shifts\nUnits/Hour",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "hour_rate_labour",
+ "fieldtype": "Float",
+ "label": "Hour Rate Labour",
+ "oldfieldname": "hour_rate_labour",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "over_heads",
+ "fieldtype": "Section Break",
+ "label": "Overheads",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "description": "Electricity cost per hour",
+ "fieldname": "hour_rate_electricity",
+ "fieldtype": "Float",
+ "label": "Electricity Cost",
+ "oldfieldname": "hour_rate_electricity",
+ "oldfieldtype": "Currency",
+ "permlevel": 0
+ },
+ {
+ "description": "Consumable cost per hour",
+ "fieldname": "hour_rate_consumable",
+ "fieldtype": "Float",
+ "label": "Consumable Cost",
+ "oldfieldname": "hour_rate_consumable",
+ "oldfieldtype": "Currency",
+ "permlevel": 0
+ },
+ {
+ "description": "Rent per hour",
+ "fieldname": "hour_rate_rent",
+ "fieldtype": "Float",
+ "label": "Rent Cost",
+ "oldfieldname": "hour_rate_rent",
+ "oldfieldtype": "Currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "overhead",
+ "fieldtype": "Float",
+ "label": "Overhead",
+ "oldfieldname": "overhead",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "hour_rate_section_break",
+ "fieldtype": "Section Break",
+ "label": "Hour Rate",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "hour_rate",
+ "fieldtype": "Float",
+ "label": "Hour Rate",
+ "oldfieldname": "hour_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-wrench",
+ "idx": 1,
+ "modified": "2014-01-20 17:49:35.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "Workstation",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Manufacturing User",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt b/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt
index 558ef3e..dbfd405 100644
--- a/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt
+++ b/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-08-12 12:44:27",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Manufacturing",
- "name": "__common__",
- "query": "SELECT\n `tabProduction Order`.name as \"Production Order:Link/Production Order:200\",\n `tabProduction Order`.creation as \"Date:Date:120\",\n `tabProduction Order`.production_item as \"Item:Link/Item:150\",\n `tabProduction Order`.qty as \"To Produce:Int:100\",\n `tabProduction Order`.produced_qty as \"Produced:Int:100\"\nFROM\n `tabProduction Order`\nWHERE\n `tabProduction Order`.docstatus=1\n AND ifnull(`tabProduction Order`.produced_qty,0) = `tabProduction Order`.qty",
- "ref_doctype": "Production Order",
- "report_name": "Completed Production Orders",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Completed Production Orders"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-08-12 12:44:27.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "Completed Production Orders",
+ "owner": "Administrator",
+ "query": "SELECT\n `tabProduction Order`.name as \"Production Order:Link/Production Order:200\",\n `tabProduction Order`.creation as \"Date:Date:120\",\n `tabProduction Order`.production_item as \"Item:Link/Item:150\",\n `tabProduction Order`.qty as \"To Produce:Int:100\",\n `tabProduction Order`.produced_qty as \"Produced:Int:100\"\nFROM\n `tabProduction Order`\nWHERE\n `tabProduction Order`.docstatus=1\n AND ifnull(`tabProduction Order`.produced_qty,0) = `tabProduction Order`.qty",
+ "ref_doctype": "Production Order",
+ "report_name": "Completed Production Orders",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.txt b/erpnext/manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.txt
index cb0808b..35f7225 100644
--- a/erpnext/manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.txt
+++ b/erpnext/manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.txt
@@ -1,24 +1,17 @@
-[
- {
- "creation": "2013-05-03 17:48:46",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 0,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Manufacturing",
- "name": "__common__",
- "query": "select\n ste.production_order as \"Production Order:Link/Production Order:120\",\n ste.posting_date as \"Issue Date:Date:140\",\n ste_item.item_code as \"Item Code:Link/Item:120\",\n\tste_item.description as \"Description::150\",\n\tste_item.transfer_qty as \"Qty:Float:100\",\n\tste_item.stock_uom as \"UOM:Link/UOM:80\",\n\tste_item.amount as \"Amount:Currency:120\",\n\tste_item.serial_no as \"Serial No:Link/Serial No:80\",\n\tste_item.s_warehouse as \"Source Warehouse:Link/Warehouse:120\",\n\tste_item.t_warehouse as \"Target Warehouse:Link/Warehouse:120\",\n\tpro.production_item as \"Finished Goods:Link/Item:120\", \n\tste.name as \"Stock Entry:Link/Stock Entry:120\"\nfrom\n\t`tabStock Entry` ste, `tabStock Entry Detail` ste_item, `tabProduction Order` pro\nwhere\n\tifnull(ste.production_order, '') != '' and ste.name = ste_item.parent \n\tand ste.production_order = pro.name and ste.docstatus = 1 \n\tand ste.purpose = 'Manufacture/Repack'\norder by ste.posting_date, ste.production_order, ste_item.item_code",
- "ref_doctype": "Production Order",
- "report_name": "Issued Items Against Production Order",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Issued Items Against Production Order"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 0,
+ "creation": "2013-05-03 17:48:46.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "Issued Items Against Production Order",
+ "owner": "Administrator",
+ "query": "select\n ste.production_order as \"Production Order:Link/Production Order:120\",\n ste.posting_date as \"Issue Date:Date:140\",\n ste_item.item_code as \"Item Code:Link/Item:120\",\n\tste_item.description as \"Description::150\",\n\tste_item.transfer_qty as \"Qty:Float:100\",\n\tste_item.stock_uom as \"UOM:Link/UOM:80\",\n\tste_item.amount as \"Amount:Currency:120\",\n\tste_item.serial_no as \"Serial No:Link/Serial No:80\",\n\tste_item.s_warehouse as \"Source Warehouse:Link/Warehouse:120\",\n\tste_item.t_warehouse as \"Target Warehouse:Link/Warehouse:120\",\n\tpro.production_item as \"Finished Goods:Link/Item:120\", \n\tste.name as \"Stock Entry:Link/Stock Entry:120\"\nfrom\n\t`tabStock Entry` ste, `tabStock Entry Detail` ste_item, `tabProduction Order` pro\nwhere\n\tifnull(ste.production_order, '') != '' and ste.name = ste_item.parent \n\tand ste.production_order = pro.name and ste.docstatus = 1 \n\tand ste.purpose = 'Manufacture/Repack'\norder by ste.posting_date, ste.production_order, ste_item.item_code",
+ "ref_doctype": "Production Order",
+ "report_name": "Issued Items Against Production Order",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt b/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt
index 8613925..4fbcc46 100644
--- a/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt
+++ b/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-08-12 12:32:30",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Manufacturing",
- "name": "__common__",
- "query": "SELECT\n `tabProduction Order`.name as \"Production Order:Link/Production Order:200\",\n `tabProduction Order`.creation as \"Date:Date:120\",\n `tabProduction Order`.production_item as \"Item:Link/Item:150\",\n `tabProduction Order`.qty as \"To Produce:Int:100\",\n `tabProduction Order`.produced_qty as \"Produced:Int:100\"\nFROM\n `tabProduction Order`\nWHERE\n `tabProduction Order`.docstatus=1\n AND ifnull(`tabProduction Order`.produced_qty,0) < `tabProduction Order`.qty\n AND NOT EXISTS (SELECT name from `tabStock Entry` where production_order =`tabProduction Order`.name) ",
- "ref_doctype": "Production Order",
- "report_name": "Open Production Orders",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Open Production Orders"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-08-12 12:32:30.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "Open Production Orders",
+ "owner": "Administrator",
+ "query": "SELECT\n `tabProduction Order`.name as \"Production Order:Link/Production Order:200\",\n `tabProduction Order`.creation as \"Date:Date:120\",\n `tabProduction Order`.production_item as \"Item:Link/Item:150\",\n `tabProduction Order`.qty as \"To Produce:Int:100\",\n `tabProduction Order`.produced_qty as \"Produced:Int:100\"\nFROM\n `tabProduction Order`\nWHERE\n `tabProduction Order`.docstatus=1\n AND ifnull(`tabProduction Order`.produced_qty,0) < `tabProduction Order`.qty\n AND NOT EXISTS (SELECT name from `tabStock Entry` where production_order =`tabProduction Order`.name) ",
+ "ref_doctype": "Production Order",
+ "report_name": "Open Production Orders",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/manufacturing/report/production_orders_in_progress/production_orders_in_progress.txt b/erpnext/manufacturing/report/production_orders_in_progress/production_orders_in_progress.txt
index 8c4e1d2..11f5b2b 100644
--- a/erpnext/manufacturing/report/production_orders_in_progress/production_orders_in_progress.txt
+++ b/erpnext/manufacturing/report/production_orders_in_progress/production_orders_in_progress.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-08-12 12:43:47",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Manufacturing",
- "name": "__common__",
- "query": "SELECT\n `tabProduction Order`.name as \"Production Order:Link/Production Order:200\",\n `tabProduction Order`.creation as \"Date:Date:120\",\n `tabProduction Order`.production_item as \"Item:Link/Item:150\",\n `tabProduction Order`.qty as \"To Produce:Int:100\",\n `tabProduction Order`.produced_qty as \"Produced:Int:100\"\nFROM\n `tabProduction Order`\nWHERE\n `tabProduction Order`.docstatus=1\n AND ifnull(`tabProduction Order`.produced_qty,0) < `tabProduction Order`.qty\n AND EXISTS (SELECT name from `tabStock Entry` where production_order =`tabProduction Order`.name) ",
- "ref_doctype": "Production Order",
- "report_name": "Production Orders in Progress",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Production Orders in Progress"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-08-12 12:43:47.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Manufacturing",
+ "name": "Production Orders in Progress",
+ "owner": "Administrator",
+ "query": "SELECT\n `tabProduction Order`.name as \"Production Order:Link/Production Order:200\",\n `tabProduction Order`.creation as \"Date:Date:120\",\n `tabProduction Order`.production_item as \"Item:Link/Item:150\",\n `tabProduction Order`.qty as \"To Produce:Int:100\",\n `tabProduction Order`.produced_qty as \"Produced:Int:100\"\nFROM\n `tabProduction Order`\nWHERE\n `tabProduction Order`.docstatus=1\n AND ifnull(`tabProduction Order`.produced_qty,0) < `tabProduction Order`.qty\n AND EXISTS (SELECT name from `tabStock Entry` where production_order =`tabProduction Order`.name) ",
+ "ref_doctype": "Production Order",
+ "report_name": "Production Orders in Progress",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/patches/4_0/update_user_properties.py b/erpnext/patches/4_0/update_user_properties.py
index 6dac125..262f7b8 100644
--- a/erpnext/patches/4_0/update_user_properties.py
+++ b/erpnext/patches/4_0/update_user_properties.py
@@ -39,7 +39,7 @@
doctype_matches.setdefault(doctype, []).append(match)
for doctype, user_matches in doctype_matches.items():
- meta = frappe.get_doctype(doctype)
+ meta = frappe.get_meta(doctype)
# for each user with roles of this doctype, check if match condition applies
for user in frappe.db.sql_list("""select name from `tabUser`
diff --git a/erpnext/projects/doctype/activity_type/activity_type.py b/erpnext/projects/doctype/activity_type/activity_type.py
index 26c87f1..a98d8cf 100644
--- a/erpnext/projects/doctype/activity_type/activity_type.py
+++ b/erpnext/projects/doctype/activity_type/activity_type.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ActivityType(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/projects/doctype/activity_type/activity_type.txt b/erpnext/projects/doctype/activity_type/activity_type.txt
index d8a50c5..7ef2ec1 100644
--- a/erpnext/projects/doctype/activity_type/activity_type.txt
+++ b/erpnext/projects/doctype/activity_type/activity_type.txt
@@ -1,60 +1,47 @@
-[
- {
- "creation": "2013-03-05 10:14:59",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:54",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:activity_type",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-flag",
- "in_dialog": 0,
- "module": "Projects",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "fieldname": "activity_type",
- "fieldtype": "Data",
- "label": "Activity Type",
- "name": "__common__",
- "parent": "Activity Type",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "reqd": 1
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Activity Type",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Activity Type"
- },
- {
- "doctype": "DocField"
- },
- {
- "doctype": "DocPerm",
- "role": "System Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Projects User"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:activity_type",
+ "creation": "2013-03-05 10:14:59.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "activity_type",
+ "fieldtype": "Data",
+ "label": "Activity Type",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "icon": "icon-flag",
+ "idx": 1,
+ "in_dialog": 0,
+ "modified": "2013-12-20 19:23:54.000000",
+ "modified_by": "Administrator",
+ "module": "Projects",
+ "name": "Activity Type",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Projects User",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py
index deac722..99a9d3a 100644
--- a/erpnext/projects/doctype/project/project.py
+++ b/erpnext/projects/doctype/project/project.py
@@ -8,10 +8,9 @@
from frappe import msgprint
from erpnext.utilities.transaction_base import delete_events
-class DocType:
- def __init__(self, doc, doclist=None):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class Project(Document):
def get_gross_profit(self):
pft, per_pft =0, 0
@@ -45,7 +44,7 @@
delete_events(self.doc.doctype, self.doc.name)
# add events
- for milestone in self.doclist.get({"parentfield": "project_milestones"}):
+ for milestone in self.get("project_milestones"):
if milestone.milestone_date:
description = (milestone.milestone or "Milestone") + " for " + self.doc.name
frappe.bean({
diff --git a/erpnext/projects/doctype/project/project.txt b/erpnext/projects/doctype/project/project.txt
index 4f7e38d..b757bed 100644
--- a/erpnext/projects/doctype/project/project.txt
+++ b/erpnext/projects/doctype/project/project.txt
@@ -1,309 +1,294 @@
-[
- {
- "creation": "2013-03-07 11:55:07",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:02",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "autoname": "field:project_name",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-puzzle-piece",
- "max_attachments": 4,
- "module": "Projects",
- "name": "__common__",
- "search_fields": "customer, status, priority, is_active"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Project",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Project",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Project"
- },
- {
- "doctype": "DocField",
- "fieldname": "overview",
- "fieldtype": "Section Break",
- "label": "Overview",
- "options": "icon-file"
- },
- {
- "doctype": "DocField",
- "fieldname": "cb_project_status",
- "fieldtype": "Column Break",
- "label": "Status"
- },
- {
- "description": "Project will get saved and will be searchable with project name given",
- "doctype": "DocField",
- "fieldname": "project_name",
- "fieldtype": "Data",
- "label": "Project Name",
- "no_copy": 0,
- "oldfieldname": "project_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "default": "Open",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "Open\nCompleted\nCancelled",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "is_active",
- "fieldtype": "Select",
- "label": "Is Active",
- "no_copy": 0,
- "oldfieldname": "is_active",
- "oldfieldtype": "Select",
- "options": "Yes\nNo",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "priority",
- "fieldtype": "Select",
- "label": "Priority",
- "no_copy": 0,
- "oldfieldname": "priority",
- "oldfieldtype": "Select",
- "options": "Medium\nLow\nHigh",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "cb_project_dates",
- "fieldtype": "Column Break",
- "label": "Dates"
- },
- {
- "doctype": "DocField",
- "fieldname": "project_start_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Project Start Date",
- "no_copy": 0,
- "oldfieldname": "project_start_date",
- "oldfieldtype": "Date",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "completion_date",
- "fieldtype": "Date",
- "label": "Completion Date",
- "no_copy": 0,
- "oldfieldname": "completion_date",
- "oldfieldtype": "Date",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "act_completion_date",
- "fieldtype": "Date",
- "label": "Actual Completion Date",
- "no_copy": 0,
- "oldfieldname": "act_completion_date",
- "oldfieldtype": "Date",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "project_type",
- "fieldtype": "Select",
- "label": "Project Type",
- "no_copy": 0,
- "oldfieldname": "project_type",
- "oldfieldtype": "Data",
- "options": "Internal\nExternal\nOther",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sb_milestones",
- "fieldtype": "Section Break",
- "label": "Milestones",
- "oldfieldtype": "Section Break",
- "options": "icon-flag"
- },
- {
- "description": "Milestones will be added as Events in the Calendar",
- "doctype": "DocField",
- "fieldname": "project_milestones",
- "fieldtype": "Table",
- "label": "Project Milestones",
- "no_copy": 0,
- "oldfieldname": "project_milestones",
- "oldfieldtype": "Table",
- "options": "Project Milestone",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "label": "Project Details",
- "oldfieldtype": "Section Break",
- "options": "icon-list"
- },
- {
- "doctype": "DocField",
- "fieldname": "notes",
- "fieldtype": "Text Editor",
- "label": "Notes",
- "no_copy": 0,
- "oldfieldname": "notes",
- "oldfieldtype": "Text Editor",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "percent_complete",
- "fieldtype": "Percent",
- "in_list_view": 1,
- "label": "Percent Complete",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "options": "Company"
- },
- {
- "doctype": "DocField",
- "fieldname": "project_details",
- "fieldtype": "Section Break",
- "label": "Project Costing",
- "oldfieldtype": "Section Break",
- "options": "icon-money"
- },
- {
- "doctype": "DocField",
- "fieldname": "project_value",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Project Value",
- "no_copy": 0,
- "oldfieldname": "project_value",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "est_material_cost",
- "fieldtype": "Currency",
- "label": "Estimated Material Cost",
- "no_copy": 0,
- "oldfieldname": "est_material_cost",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "label": "Margin",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "gross_margin_value",
- "fieldtype": "Currency",
- "label": "Gross Margin Value",
- "no_copy": 0,
- "oldfieldname": "gross_margin_value",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "per_gross_margin",
- "fieldtype": "Currency",
- "label": "Gross Margin %",
- "no_copy": 0,
- "oldfieldname": "per_gross_margin",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_details",
- "fieldtype": "Section Break",
- "label": "Customer Details",
- "oldfieldtype": "Section Break",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Customer",
- "no_copy": 0,
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 1,
- "reqd": 0,
- "search_index": 1
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "role": "Projects User",
- "write": 1
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "permlevel": 1,
- "role": "All"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "autoname": "field:project_name",
+ "creation": "2013-03-07 11:55:07.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "overview",
+ "fieldtype": "Section Break",
+ "label": "Overview",
+ "options": "icon-file",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "cb_project_status",
+ "fieldtype": "Column Break",
+ "label": "Status",
+ "permlevel": 0
+ },
+ {
+ "description": "Project will get saved and will be searchable with project name given",
+ "fieldname": "project_name",
+ "fieldtype": "Data",
+ "label": "Project Name",
+ "no_copy": 0,
+ "oldfieldname": "project_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "default": "Open",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "Open\nCompleted\nCancelled",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "is_active",
+ "fieldtype": "Select",
+ "label": "Is Active",
+ "no_copy": 0,
+ "oldfieldname": "is_active",
+ "oldfieldtype": "Select",
+ "options": "Yes\nNo",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "priority",
+ "fieldtype": "Select",
+ "label": "Priority",
+ "no_copy": 0,
+ "oldfieldname": "priority",
+ "oldfieldtype": "Select",
+ "options": "Medium\nLow\nHigh",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "cb_project_dates",
+ "fieldtype": "Column Break",
+ "label": "Dates",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "project_start_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Project Start Date",
+ "no_copy": 0,
+ "oldfieldname": "project_start_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "completion_date",
+ "fieldtype": "Date",
+ "label": "Completion Date",
+ "no_copy": 0,
+ "oldfieldname": "completion_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "act_completion_date",
+ "fieldtype": "Date",
+ "label": "Actual Completion Date",
+ "no_copy": 0,
+ "oldfieldname": "act_completion_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "project_type",
+ "fieldtype": "Select",
+ "label": "Project Type",
+ "no_copy": 0,
+ "oldfieldname": "project_type",
+ "oldfieldtype": "Data",
+ "options": "Internal\nExternal\nOther",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "sb_milestones",
+ "fieldtype": "Section Break",
+ "label": "Milestones",
+ "oldfieldtype": "Section Break",
+ "options": "icon-flag",
+ "permlevel": 0
+ },
+ {
+ "description": "Milestones will be added as Events in the Calendar",
+ "fieldname": "project_milestones",
+ "fieldtype": "Table",
+ "label": "Project Milestones",
+ "no_copy": 0,
+ "oldfieldname": "project_milestones",
+ "oldfieldtype": "Table",
+ "options": "Project Milestone",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "label": "Project Details",
+ "oldfieldtype": "Section Break",
+ "options": "icon-list",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "notes",
+ "fieldtype": "Text Editor",
+ "label": "Notes",
+ "no_copy": 0,
+ "oldfieldname": "notes",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "percent_complete",
+ "fieldtype": "Percent",
+ "in_list_view": 1,
+ "label": "Percent Complete",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "project_details",
+ "fieldtype": "Section Break",
+ "label": "Project Costing",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "project_value",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Project Value",
+ "no_copy": 0,
+ "oldfieldname": "project_value",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "est_material_cost",
+ "fieldtype": "Currency",
+ "label": "Estimated Material Cost",
+ "no_copy": 0,
+ "oldfieldname": "est_material_cost",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "label": "Margin",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "gross_margin_value",
+ "fieldtype": "Currency",
+ "label": "Gross Margin Value",
+ "no_copy": 0,
+ "oldfieldname": "gross_margin_value",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "per_gross_margin",
+ "fieldtype": "Currency",
+ "label": "Gross Margin %",
+ "no_copy": 0,
+ "oldfieldname": "per_gross_margin",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "customer_details",
+ "fieldtype": "Section Break",
+ "label": "Customer Details",
+ "oldfieldtype": "Section Break",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Customer",
+ "no_copy": 0,
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 0,
+ "search_index": 1
+ }
+ ],
+ "icon": "icon-puzzle-piece",
+ "idx": 1,
+ "max_attachments": 4,
+ "modified": "2014-01-20 17:49:02.000000",
+ "modified_by": "Administrator",
+ "module": "Projects",
+ "name": "Project",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Projects User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "permlevel": 1,
+ "read": 1,
+ "report": 1,
+ "role": "All",
+ "submit": 0
+ }
+ ],
+ "search_fields": "customer, status, priority, is_active"
+}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project_milestone/project_milestone.py b/erpnext/projects/doctype/project_milestone/project_milestone.py
index 26c87f1..57bcfc4 100644
--- a/erpnext/projects/doctype/project_milestone/project_milestone.py
+++ b/erpnext/projects/doctype/project_milestone/project_milestone.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ProjectMilestone(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project_milestone/project_milestone.txt b/erpnext/projects/doctype/project_milestone/project_milestone.txt
index d5be81e..7de9948 100644
--- a/erpnext/projects/doctype/project_milestone/project_milestone.txt
+++ b/erpnext/projects/doctype/project_milestone/project_milestone.txt
@@ -1,56 +1,45 @@
-[
- {
- "creation": "2013-02-22 01:27:50",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Projects",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Project Milestone",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Project Milestone"
- },
- {
- "doctype": "DocField",
- "fieldname": "milestone_date",
- "fieldtype": "Date",
- "label": "Milestone Date",
- "oldfieldname": "milestone_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "milestone",
- "fieldtype": "Text",
- "label": "Milestone",
- "oldfieldname": "milestone",
- "oldfieldtype": "Text",
- "print_width": "300px",
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "Pending\nCompleted"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:50.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "milestone_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Milestone Date",
+ "oldfieldname": "milestone_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "milestone",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Milestone",
+ "oldfieldname": "milestone",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "width": "300px"
+ },
+ {
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "Pending\nCompleted",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:27.000000",
+ "modified_by": "Administrator",
+ "module": "Projects",
+ "name": "Project Milestone",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py
index 0e76781..289903d 100644
--- a/erpnext/projects/doctype/task/task.py
+++ b/erpnext/projects/doctype/task/task.py
@@ -5,16 +5,12 @@
import frappe, json
from frappe.utils import getdate, today
-from frappe.model import db_exists
-from frappe.model.bean import copy_doclist
from frappe import msgprint
-class DocType:
- def __init__(self,doc,doclist=[]):
- self.doc = doc
- self.doclist = doclist
-
+from frappe.model.document import Document
+
+class Task(Document):
def get_project_details(self):
return {
"project": self.doc.project
diff --git a/erpnext/projects/doctype/task/task.txt b/erpnext/projects/doctype/task/task.txt
index 2dce94f..71327bb 100644
--- a/erpnext/projects/doctype/task/task.txt
+++ b/erpnext/projects/doctype/task/task.txt
@@ -1,262 +1,243 @@
-[
- {
- "creation": "2013-01-29 19:25:50",
- "docstatus": 0,
- "modified": "2014-01-24 13:01:46",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "autoname": "TASK.#####",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-check",
- "max_attachments": 5,
- "module": "Projects",
- "name": "__common__",
- "search_fields": "subject",
- "title_field": "subject"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Task",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Task",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Projects User",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Task"
- },
- {
- "doctype": "DocField",
- "fieldname": "task_details",
- "fieldtype": "Section Break",
- "label": "Task Details",
- "oldfieldtype": "Section Break",
- "print_width": "50%",
- "search_index": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "subject",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Subject",
- "oldfieldname": "subject",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "exp_start_date",
- "fieldtype": "Date",
- "label": "Expected Start Date",
- "oldfieldname": "exp_start_date",
- "oldfieldtype": "Date",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "exp_end_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Expected End Date",
- "oldfieldname": "exp_end_date",
- "oldfieldtype": "Date",
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "project",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Project",
- "oldfieldname": "project",
- "oldfieldtype": "Link",
- "options": "Project"
- },
- {
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "Open\nWorking\nPending Review\nClosed\nCancelled"
- },
- {
- "doctype": "DocField",
- "fieldname": "priority",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Priority",
- "oldfieldname": "priority",
- "oldfieldtype": "Select",
- "options": "Low\nMedium\nHigh\nUrgent",
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "oldfieldtype": "Section Break",
- "options": "Simple"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text Editor",
- "label": "Details",
- "oldfieldname": "description",
- "oldfieldtype": "Text Editor",
- "print_width": "300px",
- "reqd": 0,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "time_and_budget",
- "fieldtype": "Section Break",
- "label": "Time and Budget",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "expected",
- "fieldtype": "Column Break",
- "label": "Expected",
- "oldfieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "exp_total_hrs",
- "fieldtype": "Data",
- "label": "Total Hours (Expected)",
- "oldfieldname": "exp_total_hrs",
- "oldfieldtype": "Data",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "allocated_budget",
- "fieldtype": "Currency",
- "label": "Allocated Budget",
- "oldfieldname": "allocated_budget",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "actual",
- "fieldtype": "Column Break",
- "label": "Actual",
- "oldfieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "act_start_date",
- "fieldtype": "Date",
- "label": "Actual Start Date",
- "oldfieldname": "act_start_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "act_end_date",
- "fieldtype": "Date",
- "label": "Actual End Date",
- "oldfieldname": "act_end_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "actual_budget",
- "fieldtype": "Currency",
- "label": "Actual Budget",
- "oldfieldname": "actual_budget",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "more_details",
- "fieldtype": "Section Break",
- "label": "More Details"
- },
- {
- "depends_on": "eval:doc.status == \"Closed\" || doc.status == \"Pending Review\"",
- "doctype": "DocField",
- "fieldname": "review_date",
- "fieldtype": "Date",
- "hidden": 0,
- "label": "Review Date",
- "oldfieldname": "review_date",
- "oldfieldtype": "Date"
- },
- {
- "depends_on": "eval:doc.status == \"Closed\"",
- "doctype": "DocField",
- "fieldname": "closing_date",
- "fieldtype": "Date",
- "hidden": 0,
- "label": "Closing Date",
- "oldfieldname": "closing_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_22",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "options": "Company"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "autoname": "TASK.#####",
+ "creation": "2013-01-29 19:25:50.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "task_details",
+ "fieldtype": "Section Break",
+ "label": "Task Details",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "search_index": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "subject",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Subject",
+ "oldfieldname": "subject",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "exp_start_date",
+ "fieldtype": "Date",
+ "label": "Expected Start Date",
+ "oldfieldname": "exp_start_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "exp_end_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Expected End Date",
+ "oldfieldname": "exp_end_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "project",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Project",
+ "oldfieldname": "project",
+ "oldfieldtype": "Link",
+ "options": "Project",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "Open\nWorking\nPending Review\nClosed\nCancelled",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "priority",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Priority",
+ "oldfieldname": "priority",
+ "oldfieldtype": "Select",
+ "options": "Low\nMedium\nHigh\nUrgent",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "oldfieldtype": "Section Break",
+ "options": "Simple",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text Editor",
+ "label": "Details",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0,
+ "print_width": "300px",
+ "reqd": 0,
+ "width": "300px"
+ },
+ {
+ "fieldname": "time_and_budget",
+ "fieldtype": "Section Break",
+ "label": "Time and Budget",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "expected",
+ "fieldtype": "Column Break",
+ "label": "Expected",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "exp_total_hrs",
+ "fieldtype": "Data",
+ "label": "Total Hours (Expected)",
+ "oldfieldname": "exp_total_hrs",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "allocated_budget",
+ "fieldtype": "Currency",
+ "label": "Allocated Budget",
+ "oldfieldname": "allocated_budget",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "actual",
+ "fieldtype": "Column Break",
+ "label": "Actual",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "act_start_date",
+ "fieldtype": "Date",
+ "label": "Actual Start Date",
+ "oldfieldname": "act_start_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "act_end_date",
+ "fieldtype": "Date",
+ "label": "Actual End Date",
+ "oldfieldname": "act_end_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "actual_budget",
+ "fieldtype": "Currency",
+ "label": "Actual Budget",
+ "oldfieldname": "actual_budget",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "more_details",
+ "fieldtype": "Section Break",
+ "label": "More Details",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.status == \"Closed\" || doc.status == \"Pending Review\"",
+ "fieldname": "review_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "label": "Review Date",
+ "oldfieldname": "review_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.status == \"Closed\"",
+ "fieldname": "closing_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "label": "Closing Date",
+ "oldfieldname": "closing_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break_22",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-check",
+ "idx": 1,
+ "max_attachments": 5,
+ "modified": "2014-01-24 13:01:46.000000",
+ "modified_by": "Administrator",
+ "module": "Projects",
+ "name": "Task",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Projects User",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "search_fields": "subject",
+ "title_field": "subject"
+}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/time_log/test_time_log.py b/erpnext/projects/doctype/time_log/test_time_log.py
index b6e2741..973e89b 100644
--- a/erpnext/projects/doctype/time_log/test_time_log.py
+++ b/erpnext/projects/doctype/time_log/test_time_log.py
@@ -8,7 +8,7 @@
class TestTimeLog(unittest.TestCase):
def test_duplication(self):
- ts = frappe.bean(frappe.copy_doclist(test_records[0]))
+ ts = frappe.bean(frappe.copy_doc(test_records[0]))
self.assertRaises(OverlapError, ts.insert)
test_records = [[{
diff --git a/erpnext/projects/doctype/time_log/time_log.py b/erpnext/projects/doctype/time_log/time_log.py
index 690eb92..3dedef1 100644
--- a/erpnext/projects/doctype/time_log/time_log.py
+++ b/erpnext/projects/doctype/time_log/time_log.py
@@ -11,9 +11,9 @@
class OverlapError(frappe.ValidationError): pass
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class TimeLog(Document):
def validate(self):
self.set_status()
diff --git a/erpnext/projects/doctype/time_log/time_log.txt b/erpnext/projects/doctype/time_log/time_log.txt
index 11fa7d6..cd5a8d1 100644
--- a/erpnext/projects/doctype/time_log/time_log.txt
+++ b/erpnext/projects/doctype/time_log/time_log.txt
@@ -1,215 +1,189 @@
-[
- {
- "creation": "2013-04-03 16:38:41",
- "docstatus": 0,
- "modified": "2014-01-22 16:05:35",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "autoname": "naming_series:",
- "description": "Log of Activities performed by users against Tasks that can be used for tracking time, billing.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-time",
- "is_submittable": 1,
- "module": "Projects",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Time Log",
- "parentfield": "fields",
- "parenttype": "DocType"
- },
- {
- "amend": 1,
- "cancel": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Time Log",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Time Log"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "options": "TL-",
- "permlevel": 0,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "from_time",
- "fieldtype": "Datetime",
- "in_list_view": 1,
- "label": "From Time",
- "permlevel": 0,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "to_time",
- "fieldtype": "Datetime",
- "in_list_view": 0,
- "label": "To Time",
- "permlevel": 0,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "hours",
- "fieldtype": "Float",
- "label": "Hours",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_3",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Status",
- "options": "Draft\nSubmitted\nBatched for Billing\nBilled\nCancelled",
- "permlevel": 0,
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "activity_type",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Activity Type",
- "options": "Activity Type",
- "permlevel": 0,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "task",
- "fieldtype": "Link",
- "label": "Task",
- "options": "Task",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "billable",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Billable",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_7",
- "fieldtype": "Section Break",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "note",
- "fieldtype": "Text Editor",
- "label": "Note",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_9",
- "fieldtype": "Section Break",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "project",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Project",
- "options": "Project",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "description": "Will be updated when batched.",
- "doctype": "DocField",
- "fieldname": "time_log_batch",
- "fieldtype": "Link",
- "label": "Time Log Batch",
- "options": "Time Log Batch",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "description": "Will be updated when billed.",
- "doctype": "DocField",
- "fieldname": "sales_invoice",
- "fieldtype": "Link",
- "label": "Sales Invoice",
- "options": "Sales Invoice",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_16",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "options": "Time Log",
- "permlevel": 1,
- "print_hide": 1,
- "read_only": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "restricted": 1,
- "role": "Projects User"
- },
- {
- "doctype": "DocPerm",
- "role": "Projects Manager"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-04-03 16:38:41.000000",
+ "description": "Log of Activities performed by users against Tasks that can be used for tracking time, billing.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "options": "TL-",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "from_time",
+ "fieldtype": "Datetime",
+ "in_list_view": 1,
+ "label": "From Time",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "to_time",
+ "fieldtype": "Datetime",
+ "in_list_view": 0,
+ "label": "To Time",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "hours",
+ "fieldtype": "Float",
+ "label": "Hours",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Status",
+ "options": "Draft\nSubmitted\nBatched for Billing\nBilled\nCancelled",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "activity_type",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Activity Type",
+ "options": "Activity Type",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "task",
+ "fieldtype": "Link",
+ "label": "Task",
+ "options": "Task",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "billable",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Billable",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_7",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "note",
+ "fieldtype": "Text Editor",
+ "label": "Note",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_9",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "project",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Project",
+ "options": "Project",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "Will be updated when batched.",
+ "fieldname": "time_log_batch",
+ "fieldtype": "Link",
+ "label": "Time Log Batch",
+ "options": "Time Log Batch",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "description": "Will be updated when billed.",
+ "fieldname": "sales_invoice",
+ "fieldtype": "Link",
+ "label": "Sales Invoice",
+ "options": "Sales Invoice",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_16",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "options": "Time Log",
+ "permlevel": 1,
+ "print_hide": 1,
+ "read_only": 0
+ }
+ ],
+ "icon": "icon-time",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-22 16:05:35.000000",
+ "modified_by": "Administrator",
+ "module": "Projects",
+ "name": "Time Log",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "restricted": 1,
+ "role": "Projects User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Projects Manager",
+ "submit": 1,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.js b/erpnext/projects/doctype/time_log_batch/time_log_batch.js
index 7aa3e16..7f3a17e 100644
--- a/erpnext/projects/doctype/time_log_batch/time_log_batch.js
+++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.js
@@ -30,9 +30,8 @@
}
},
make_invoice: function() {
- var doc = cur_frm.doc;
frappe.model.map({
- source: frappe.model.get_doclist(doc.doctype, doc.name),
+ source: cur_frm.doc,
target: "Sales Invoice"
});
}
diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.py b/erpnext/projects/doctype/time_log_batch/time_log_batch.py
index 3c3e6e0..89beb9d 100644
--- a/erpnext/projects/doctype/time_log_batch/time_log_batch.py
+++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.py
@@ -7,9 +7,9 @@
import frappe
from frappe import _
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class TimeLogBatch(Document):
def validate(self):
self.set_status()
diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.txt b/erpnext/projects/doctype/time_log_batch/time_log_batch.txt
index bc803ea..9d98a34 100644
--- a/erpnext/projects/doctype/time_log_batch/time_log_batch.txt
+++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.txt
@@ -1,126 +1,107 @@
-[
- {
- "creation": "2013-02-28 17:57:33",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:34",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "naming_series:",
- "description": "Batch Time Logs for Billing.",
- "doctype": "DocType",
- "document_type": "Transaction",
- "icon": "icon-time",
- "is_submittable": 1,
- "module": "Projects",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Time Log Batch",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Time Log Batch",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Projects User",
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Time Log Batch"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "options": "TLB-",
- "reqd": 1
- },
- {
- "description": "For Sales Invoice",
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Currency",
- "label": "Rate"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_3",
- "fieldtype": "Column Break"
- },
- {
- "default": "Draft",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Status",
- "options": "Draft\nSubmitted\nBilled\nCancelled",
- "read_only": 1
- },
- {
- "description": "Will be updated after Sales Invoice is Submitted.",
- "doctype": "DocField",
- "fieldname": "sales_invoice",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Sales Invoice",
- "options": "Sales Invoice",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_5",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "time_log_batch_details",
- "fieldtype": "Table",
- "label": "Time Log Batch Details",
- "options": "Time Log Batch Detail",
- "reqd": 1
- },
- {
- "description": "In Hours",
- "doctype": "DocField",
- "fieldname": "total_hours",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Total Hours",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "options": "Time Log Batch",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "autoname": "naming_series:",
+ "creation": "2013-02-28 17:57:33.000000",
+ "description": "Batch Time Logs for Billing.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "options": "TLB-",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "For Sales Invoice",
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "label": "Rate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "default": "Draft",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Status",
+ "options": "Draft\nSubmitted\nBilled\nCancelled",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "description": "Will be updated after Sales Invoice is Submitted.",
+ "fieldname": "sales_invoice",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Sales Invoice",
+ "options": "Sales Invoice",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "section_break_5",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "time_log_batch_details",
+ "fieldtype": "Table",
+ "label": "Time Log Batch Details",
+ "options": "Time Log Batch Detail",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "In Hours",
+ "fieldname": "total_hours",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Total Hours",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "options": "Time Log Batch",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-time",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-20 17:49:34.000000",
+ "modified_by": "Administrator",
+ "module": "Projects",
+ "name": "Time Log Batch",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Projects User",
+ "submit": 1,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.py b/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.py
index 968a25b..f0c4c1b 100644
--- a/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.py
+++ b/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class TimeLogBatchDetail(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt b/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt
index 3531a87..15e7e8e 100644
--- a/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt
+++ b/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt
@@ -1,59 +1,49 @@
-[
- {
- "creation": "2013-03-05 09:11:06",
- "docstatus": 0,
- "modified": "2013-12-20 19:21:54",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Projects",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Time Log Batch Detail",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Time Log Batch Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "time_log",
- "fieldtype": "Link",
- "label": "Time Log",
- "options": "Time Log",
- "print_width": "200px",
- "reqd": 1,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "created_by",
- "fieldtype": "Link",
- "label": "Created By",
- "options": "User",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "activity_type",
- "fieldtype": "Data",
- "label": "Activity Type",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "hours",
- "fieldtype": "Float",
- "label": "Hours"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-03-05 09:11:06.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "time_log",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Time Log",
+ "options": "Time Log",
+ "permlevel": 0,
+ "print_width": "200px",
+ "reqd": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "created_by",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Created By",
+ "options": "User",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "activity_type",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Activity Type",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "hours",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Hours",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:21:54.000000",
+ "modified_by": "Administrator",
+ "module": "Projects",
+ "name": "Time Log Batch Detail",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.txt b/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.txt
index fe8feb0..1be419a 100644
--- a/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.txt
+++ b/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-04-03 11:27:52",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Projects",
- "name": "__common__",
- "ref_doctype": "Time Log",
- "report_name": "Daily Time Log Summary",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Daily Time Log Summary"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-03 11:27:52.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Projects",
+ "name": "Daily Time Log Summary",
+ "owner": "Administrator",
+ "ref_doctype": "Time Log",
+ "report_name": "Daily Time Log Summary",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.txt b/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.txt
index 4a89536..467c83e 100644
--- a/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.txt
+++ b/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-03 17:37:41",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Projects",
- "name": "__common__",
- "ref_doctype": "Project",
- "report_name": "Project wise Stock Tracking ",
- "report_type": "Report Builder"
- },
- {
- "doctype": "Report",
- "name": "Project wise Stock Tracking"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-03 17:37:41.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Projects",
+ "name": "Project wise Stock Tracking",
+ "owner": "Administrator",
+ "ref_doctype": "Project",
+ "report_name": "Project wise Stock Tracking ",
+ "report_type": "Report Builder"
+}
\ No newline at end of file
diff --git a/erpnext/public/js/controllers/stock_controller.js b/erpnext/public/js/controllers/stock_controller.js
index 9f793e4..65b81bb 100644
--- a/erpnext/public/js/controllers/stock_controller.js
+++ b/erpnext/public/js/controllers/stock_controller.js
@@ -39,7 +39,7 @@
copy_account_in_all_row: function(doc, dt, dn, fieldname) {
var d = locals[dt][dn];
if(d[fieldname]){
- var cl = getchildren(this.frm.cscript.tname, doc.name, this.frm.cscript.fname, doc.doctype);
+ var cl = doc[this.frm.cscript.fname] || [];
for(var i = 0; i < cl.length; i++) {
if(!cl[i][fieldname]) cl[i][fieldname] = d[fieldname];
}
diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js
index 2f89470..cb868b2 100644
--- a/erpnext/public/js/transaction.js
+++ b/erpnext/public/js/transaction.js
@@ -46,7 +46,6 @@
freeze: true,
callback: function(r) {
// remove this call when using client side mapper
- me.set_default_values();
me.set_dynamic_labels();
me.calculate_taxes_and_totals();
}
@@ -114,7 +113,7 @@
item_code: function(doc, cdt, cdn) {
var me = this;
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
if(item.item_code || item.barcode || item.serial_no) {
if(!this.validate_company_and_party()) {
cur_frm.fields_dict[me.frm.cscript.fname].grid.grid_rows[item.idx - 1].remove();
@@ -157,7 +156,7 @@
serial_no: function(doc, cdt, cdn) {
var me = this;
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
if (item.serial_no) {
if (!item.item_code) {
@@ -192,18 +191,7 @@
validate: function() {
this.calculate_taxes_and_totals();
},
-
- set_default_values: function() {
- $.each(frappe.model.get_doclist(this.frm.doctype, this.frm.docname), function(i, doc) {
- var updated = frappe.model.set_default_values(doc);
- if(doc.parentfield) {
- refresh_field(doc.parentfield);
- } else {
- refresh_field(updated);
- }
- });
- },
-
+
company: function() {
if(this.frm.doc.company && this.frm.fields_dict.currency) {
var company_currency = this.get_company_currency();
@@ -274,7 +262,7 @@
get_exchange_rate: function(from_currency, to_currency, callback) {
var exchange_name = from_currency + "-" + to_currency;
frappe.model.with_doc("Currency Exchange", exchange_name, function(name) {
- var exchange_doc = frappe.model.get_doc("Currency Exchange", exchange_name);
+ var exchange_doc = frappe.get_doc("Currency Exchange", exchange_name);
callback(exchange_doc ? flt(exchange_doc.exchange_rate) : 0);
});
},
@@ -316,7 +304,7 @@
},
row_id: function(doc, cdt, cdn) {
- var tax = frappe.model.get_doc(cdt, cdn);
+ var tax = frappe.get_doc(cdt, cdn);
try {
this.validate_on_previous_row(tax);
this.calculate_taxes_and_totals();
@@ -351,7 +339,7 @@
},
included_in_print_rate: function(doc, cdt, cdn) {
- var tax = frappe.model.get_doc(cdt, cdn);
+ var tax = frappe.get_doc(cdt, cdn);
try {
this.validate_on_previous_row(tax);
this.validate_inclusive_tax(tax);
@@ -517,13 +505,11 @@
},
get_item_doclist: function() {
- return frappe.model.get_doclist(this.frm.doc.doctype, this.frm.doc.name,
- {parentfield: this.fname});
+ return this.frm.doc[this.fname] || [];
},
get_tax_doclist: function() {
- return frappe.model.get_doclist(this.frm.doc.doctype, this.frm.doc.name,
- {parentfield: this.other_fname});
+ return this.frm.doc[this.other_fname] || [];
},
validate_conversion_rate: function() {
@@ -716,8 +702,7 @@
calculate_total_advance: function(parenttype, advance_parentfield) {
if(this.frm.doc.doctype == parenttype && this.frm.doc.docstatus < 2) {
- var advance_doclist = frappe.model.get_doclist(this.frm.doc.doctype, this.frm.doc.name,
- {parentfield: advance_parentfield});
+ var advance_doclist = this.frm.doc[advance_parentfield] || [];
this.frm.doc.total_advance = flt(frappe.utils.sum(
$.map(advance_doclist, function(adv) { return adv.allocated_amount })
), precision("total_advance"));
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index c5d3e0b..868ea0e 100644
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -7,7 +7,7 @@
if(!company && cur_frm)
company = cur_frm.doc.company;
if(company)
- return frappe.model.get_doc(":Company", company).default_currency || frappe.boot.sysdefaults.currency;
+ return frappe.get_doc(":Company", company).default_currency || frappe.boot.sysdefaults.currency;
else
return frappe.boot.sysdefaults.currency;
},
@@ -29,8 +29,7 @@
},
add_applicable_territory: function() {
- if(cur_frm.doc.__islocal &&
- frappe.model.get_doclist(cur_frm.doc.doctype, cur_frm.doc.name).length === 1) {
+ if(cur_frm.doc.__islocal && (cur_frm.doc.valid_for_territories || []).length===0) {
var default_territory = frappe.defaults.get_user_default("territory");
if(default_territory) {
var territory = frappe.model.add_child(cur_frm.doc, "Applicable Territory",
diff --git a/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt b/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt
index c858c26..977a225 100644
--- a/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt
+++ b/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-04-19 13:30:51",
- "docstatus": 0,
- "modified": "2014-02-11 17:45:37",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Quotation",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Georgia\", serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Georgia\", serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table thead {\n\t\tborder-bottom: 1px solid black;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px 0px;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Quotation',\n\t\t\t\tdoc.name,\n\t\t\t\t'quotation_details',\n\t\t\t\t'Quotation Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td></td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td>\n\t\t\t\t\t<script>'<h1>' + (doc.select_print_heading || 'Quotation') + '</h1>'</script>\n\t\t\t</td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Quotation Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
- "module": "Selling",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Quotation Classic"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-19 13:30:51.000000",
+ "doc_type": "Quotation",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Georgia\", serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Georgia\", serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table thead {\n\t\tborder-bottom: 1px solid black;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px 0px;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Quotation',\n\t\t\t\tdoc.name,\n\t\t\t\t'quotation_details',\n\t\t\t\t'Quotation Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td></td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td>\n\t\t\t\t\t<script>'<h1>' + (doc.select_print_heading || 'Quotation') + '</h1>'</script>\n\t\t\t</td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Quotation Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
+ "idx": 1,
+ "modified": "2014-02-11 17:45:37.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Quotation Classic",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt b/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt
index b7c3830..6b0ed48 100644
--- a/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt
+++ b/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-04-19 13:30:51",
- "docstatus": 0,
- "modified": "2014-02-11 17:45:15",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Quotation",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n line-height: 150%;\n\t}\n\n\t.common {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t\tborder-style: none !important;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t\tborder-style: none !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h1 {\n\t\ttext-transform: uppercase;\n\t\tcolor: white;\n\t\tfont-size: 55px;\n\t\tfont-style: italic;\n\t}\n\n\ttable.header-table thead tr:nth-child(1) div {\n\t\theight: 24px;\n\t\tbackground-color: #696969;\n\t\tvertical-align: middle;\n\t\tpadding: 12px 0px 0px 0px;\n\t\twidth: 100%;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body table tr td {\n\t\tbackground-color: #DCDCDC !important;\n\t}\n\n\tdiv.page-body table tr:nth-child(1) td {\n\t\tbackground-color: #696969 !important;\n\t\tcolor: white !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table tfoot td {\n\t\tbackground-color: #696969;\n\t\theight: 10px;\n\t}\n\n\t.imp-details {\n\t\tbackground-color: #DCDCDC;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Quotation',\n\t\t\t\tdoc.name,\n\t\t\t\t'quotation_details',\n\t\t\t\t'Quotation Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td></td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Quotation') + '</h1>'</script></div></td></tr>\n\t\t\t<tr><td colspan=2><div style=\"height:15px\"></div></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr class='imp-details'>\n\t\t\t\t\t\t<td><b>Quotation No.</b></td>\n\t\t\t\t\t\t<td><script>cur_frm.docname</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Quotation Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold' class='imp-details'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr><td colspan=2><div></div></td><tr>\n\t\t</tfoot>\n\t</table>\n</div>",
- "module": "Selling",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Quotation Modern"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-19 13:30:51.000000",
+ "doc_type": "Quotation",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n line-height: 150%;\n\t}\n\n\t.common {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t\tborder-style: none !important;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t\tborder-style: none !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h1 {\n\t\ttext-transform: uppercase;\n\t\tcolor: white;\n\t\tfont-size: 55px;\n\t\tfont-style: italic;\n\t}\n\n\ttable.header-table thead tr:nth-child(1) div {\n\t\theight: 24px;\n\t\tbackground-color: #696969;\n\t\tvertical-align: middle;\n\t\tpadding: 12px 0px 0px 0px;\n\t\twidth: 100%;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body table tr td {\n\t\tbackground-color: #DCDCDC !important;\n\t}\n\n\tdiv.page-body table tr:nth-child(1) td {\n\t\tbackground-color: #696969 !important;\n\t\tcolor: white !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table tfoot td {\n\t\tbackground-color: #696969;\n\t\theight: 10px;\n\t}\n\n\t.imp-details {\n\t\tbackground-color: #DCDCDC;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Quotation',\n\t\t\t\tdoc.name,\n\t\t\t\t'quotation_details',\n\t\t\t\t'Quotation Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td></td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Quotation') + '</h1>'</script></div></td></tr>\n\t\t\t<tr><td colspan=2><div style=\"height:15px\"></div></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr class='imp-details'>\n\t\t\t\t\t\t<td><b>Quotation No.</b></td>\n\t\t\t\t\t\t<td><script>cur_frm.docname</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Quotation Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold' class='imp-details'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr><td colspan=2><div></div></td><tr>\n\t\t</tfoot>\n\t</table>\n</div>",
+ "idx": 1,
+ "modified": "2014-02-11 17:45:15.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Quotation Modern",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt b/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt
index f4be36e..5e21b6c 100644
--- a/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt
+++ b/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-04-19 13:30:51",
- "docstatus": 0,
- "modified": "2014-02-11 17:45:50",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Quotation",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 0px;\n\t}\n\n\ttable {\n\t\twidth: 100% !important;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\n\ttable, td {\n\t\tborder-collapse: collapse !important;\n\t\tpadding: 0px;\n\t\tmargin: 0px !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px;\n\t}\n\n\ttable.header-table > thead,\n\ttable.header-table > tbody > tr > td,\n\ttable.footer-table > tbody > tr > td {\n\t\tborder: 1px solid black;\n\t\tpadding: 5px;\n\t}\n\n\ttable.footer-table > tbody,\n\ttable.header-table > thead {\n\t\tborder-bottom: 3px solid black;\n\t}\n\n\ttable.header-table > thead {\n\t\tborder-top: 3px solid black;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body td {\n\t\tbackground-color: white !important;\n\t\tborder: 1px solid black !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Quotation',\n\t\t\t\tdoc.name,\n\t\t\t\t'quotation_details',\n\t\t\t\t'Quotation Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td></td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Quotation') + '</h1>'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Quotation Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
- "module": "Selling",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Quotation Spartan"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-19 13:30:51.000000",
+ "doc_type": "Quotation",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 0px;\n\t}\n\n\ttable {\n\t\twidth: 100% !important;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\n\ttable, td {\n\t\tborder-collapse: collapse !important;\n\t\tpadding: 0px;\n\t\tmargin: 0px !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px;\n\t}\n\n\ttable.header-table > thead,\n\ttable.header-table > tbody > tr > td,\n\ttable.footer-table > tbody > tr > td {\n\t\tborder: 1px solid black;\n\t\tpadding: 5px;\n\t}\n\n\ttable.footer-table > tbody,\n\ttable.header-table > thead {\n\t\tborder-bottom: 3px solid black;\n\t}\n\n\ttable.header-table > thead {\n\t\tborder-top: 3px solid black;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body td {\n\t\tbackground-color: white !important;\n\t\tborder: 1px solid black !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Quotation',\n\t\t\t\tdoc.name,\n\t\t\t\t'quotation_details',\n\t\t\t\t'Quotation Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td></td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Quotation') + '</h1>'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Quotation Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
+ "idx": 1,
+ "modified": "2014-02-11 17:45:50.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Quotation Spartan",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt b/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt
index 8c0b807..3aee798 100644
--- a/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt
+++ b/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-04-19 13:30:51",
- "docstatus": 0,
- "modified": "2014-02-11 17:35:51",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Sales Order",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Georgia\", serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Georgia\", serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table thead {\n\t\tborder-bottom: 1px solid black;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px 0px;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Sales Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'sales_order_details',\n\t\t\t\t'Sales Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'base_rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '20%', '37%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td><script>'<h1>' + (doc.select_print_heading || 'Sales Order') + '</h1>'</script></td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Sales Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Delivery Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.delivery_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
- "module": "Selling",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Sales Order Classic"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-19 13:30:51.000000",
+ "doc_type": "Sales Order",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Georgia\", serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Georgia\", serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table thead {\n\t\tborder-bottom: 1px solid black;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px 0px;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Sales Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'sales_order_details',\n\t\t\t\t'Sales Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'base_rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '20%', '37%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td><script>'<h1>' + (doc.select_print_heading || 'Sales Order') + '</h1>'</script></td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Sales Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Delivery Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.delivery_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
+ "idx": 1,
+ "modified": "2014-02-11 17:35:51.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales Order Classic",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt b/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt
index a901ae2..76ee34a 100644
--- a/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt
+++ b/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-04-19 13:30:51",
- "docstatus": 0,
- "modified": "2014-02-11 17:34:24",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Sales Order",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n line-height: 150%;\n\t}\n\n\t.common {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t\tborder-style: none !important;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t\tborder-style: none !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h1 {\n\t\ttext-transform: uppercase;\n\t\tcolor: white;\n\t\tfont-size: 55px;\n\t\tfont-style: italic;\n\t}\n\n\ttable.header-table thead tr:nth-child(1) div {\n\t\theight: 24px;\n\t\tbackground-color: #696969;\n\t\tvertical-align: middle;\n\t\tpadding: 12px 0px 0px 0px;\n\t\twidth: 100%;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body table tr td {\n\t\tbackground-color: #DCDCDC !important;\n\t}\n\n\tdiv.page-body table tr:nth-child(1) td {\n\t\tbackground-color: #696969 !important;\n\t\tcolor: white !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table tfoot td {\n\t\tbackground-color: #696969;\n\t\theight: 10px;\n\t}\n\n\t.imp-details {\n\t\tbackground-color: #DCDCDC;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Sales Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'sales_order_details',\n\t\t\t\t'Sales Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'base_rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '20%', '37%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Sales Order') + '</h1>'</script></div></td></tr>\n\t\t\t<tr><td colspan=2><div style=\"height:15px\"></div></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr class='imp-details'>\n\t\t\t\t\t\t<td><b>Sales Order No.</b></td>\n\t\t\t\t\t\t<td><script>cur_frm.docname</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Sales Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Delivery Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.delivery_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold' class='imp-details'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr><td colspan=2><div></div></td><tr>\n\t\t</tfoot>\n\t</table>\n</div>",
- "module": "Selling",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Sales Order Modern"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-19 13:30:51.000000",
+ "doc_type": "Sales Order",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n line-height: 150%;\n\t}\n\n\t.common {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t\tborder-style: none !important;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t\tborder-style: none !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h1 {\n\t\ttext-transform: uppercase;\n\t\tcolor: white;\n\t\tfont-size: 55px;\n\t\tfont-style: italic;\n\t}\n\n\ttable.header-table thead tr:nth-child(1) div {\n\t\theight: 24px;\n\t\tbackground-color: #696969;\n\t\tvertical-align: middle;\n\t\tpadding: 12px 0px 0px 0px;\n\t\twidth: 100%;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body table tr td {\n\t\tbackground-color: #DCDCDC !important;\n\t}\n\n\tdiv.page-body table tr:nth-child(1) td {\n\t\tbackground-color: #696969 !important;\n\t\tcolor: white !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table tfoot td {\n\t\tbackground-color: #696969;\n\t\theight: 10px;\n\t}\n\n\t.imp-details {\n\t\tbackground-color: #DCDCDC;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Sales Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'sales_order_details',\n\t\t\t\t'Sales Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'base_rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '20%', '37%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Sales Order') + '</h1>'</script></div></td></tr>\n\t\t\t<tr><td colspan=2><div style=\"height:15px\"></div></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr class='imp-details'>\n\t\t\t\t\t\t<td><b>Sales Order No.</b></td>\n\t\t\t\t\t\t<td><script>cur_frm.docname</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Sales Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Delivery Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.delivery_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold' class='imp-details'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr><td colspan=2><div></div></td><tr>\n\t\t</tfoot>\n\t</table>\n</div>",
+ "idx": 1,
+ "modified": "2014-02-11 17:34:24.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales Order Modern",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt b/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt
index 481da0d..1628da7 100644
--- a/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt
+++ b/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-04-19 13:30:51",
- "docstatus": 0,
- "modified": "2014-02-11 17:35:29",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Sales Order",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 0px;\n\t}\n\n\ttable {\n\t\twidth: 100% !important;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\n\ttable, td {\n\t\tborder-collapse: collapse !important;\n\t\tpadding: 0px;\n\t\tmargin: 0px !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px;\n\t}\n\n\ttable.header-table > thead,\n\ttable.header-table > tbody > tr > td,\n\ttable.footer-table > tbody > tr > td {\n\t\tborder: 1px solid black;\n\t\tpadding: 5px;\n\t}\n\n\ttable.footer-table > tbody,\n\ttable.header-table > thead {\n\t\tborder-bottom: 3px solid black;\n\t}\n\n\ttable.header-table > thead {\n\t\tborder-top: 3px solid black;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body td {\n\t\tbackground-color: white !important;\n\t\tborder: 1px solid black !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Sales Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'sales_order_details',\n\t\t\t\t'Sales Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'base_rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '20%', '37%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Sales Order') + '</h1>'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Sales Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Delivery Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.delivery_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
- "module": "Selling",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Sales Order Spartan"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-19 13:30:51.000000",
+ "doc_type": "Sales Order",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 0px;\n\t}\n\n\ttable {\n\t\twidth: 100% !important;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\n\ttable, td {\n\t\tborder-collapse: collapse !important;\n\t\tpadding: 0px;\n\t\tmargin: 0px !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px;\n\t}\n\n\ttable.header-table > thead,\n\ttable.header-table > tbody > tr > td,\n\ttable.footer-table > tbody > tr > td {\n\t\tborder: 1px solid black;\n\t\tpadding: 5px;\n\t}\n\n\ttable.footer-table > tbody,\n\ttable.header-table > thead {\n\t\tborder-bottom: 3px solid black;\n\t}\n\n\ttable.header-table > thead {\n\t\tborder-top: 3px solid black;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body td {\n\t\tbackground-color: white !important;\n\t\tborder: 1px solid black !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Sales Order',\n\t\t\t\tdoc.name,\n\t\t\t\t'sales_order_details',\n\t\t\t\t'Sales Order Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'base_rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '20%', '37%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tif(data_row.discount_percentage) {\n\t\t\t\t\t\t\tvar to_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' + \n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\treturn data_row.description + to_append;\n\t\t\t\t\t\t\t} else { return data_row.description; }\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Sales Order') + '</h1>'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=39%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Sales Order Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Delivery Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.delivery_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
+ "idx": 1,
+ "modified": "2014-02-11 17:35:29.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales Order Spartan",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/campaign/campaign.py b/erpnext/selling/doctype/campaign/campaign.py
index 5015bed..523c62d 100644
--- a/erpnext/selling/doctype/campaign/campaign.py
+++ b/erpnext/selling/doctype/campaign/campaign.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
-
\ No newline at end of file
+from frappe.model.document import Document
+
+class Campaign(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/selling/doctype/campaign/campaign.txt b/erpnext/selling/doctype/campaign/campaign.txt
index 55c459c..9b45c6a 100644
--- a/erpnext/selling/doctype/campaign/campaign.txt
+++ b/erpnext/selling/doctype/campaign/campaign.txt
@@ -1,105 +1,98 @@
-[
- {
- "creation": "2013-01-10 16:34:18",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:campaign_name",
- "description": "Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. ",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-bullhorn",
- "module": "Selling",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Campaign",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Campaign",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Campaign"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "campaign",
- "fieldtype": "Section Break",
- "label": "Campaign",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "campaign_name",
- "fieldtype": "Data",
- "label": "Campaign Name",
- "oldfieldname": "campaign_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "width": "300px"
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "import": 0,
- "report": 0,
- "role": "Sales Manager",
- "write": 0
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "report": 1,
- "role": "Sales User",
- "write": 0
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "report": 1,
- "role": "Sales Master Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:campaign_name",
+ "creation": "2013-01-10 16:34:18.000000",
+ "description": "Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. ",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "campaign",
+ "fieldtype": "Section Break",
+ "label": "Campaign",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "campaign_name",
+ "fieldtype": "Data",
+ "label": "Campaign Name",
+ "oldfieldname": "campaign_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "width": "300px"
+ }
+ ],
+ "icon": "icon-bullhorn",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:27.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Campaign",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Sales Manager",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py
index d8a095f..1ab827d 100644
--- a/erpnext/selling/doctype/customer/customer.py
+++ b/erpnext/selling/doctype/customer/customer.py
@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
-from frappe.model.doc import Document, make_autoname
+from frappe.model.naming import make_autoname
from frappe import msgprint, _
import frappe.defaults
@@ -11,10 +11,7 @@
from erpnext.utilities.transaction_base import TransactionBase
from erpnext.accounts.party import create_party_account
-class DocType(TransactionBase):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class Customer(TransactionBase):
def autoname(self):
cust_master_name = frappe.defaults.get_global_default('cust_master_name')
@@ -59,7 +56,8 @@
(self.doc.name, self.doc.customer_name, self.doc.lead_name))
lead = frappe.db.get_value("Lead", self.doc.lead_name, ["lead_name", "email_id", "phone", "mobile_no"], as_dict=True)
- c = Document('Contact')
+ c = frappe.get_doc('Contact')
+ c.set("__islocal", 1)
c.first_name = lead.lead_name
c.email_id = lead.email_id
c.phone = lead.phone
@@ -68,7 +66,7 @@
c.customer_name = self.doc.customer_name
c.is_primary_contact = 1
try:
- c.save(1)
+ c.save()
except NameError, e:
pass
diff --git a/erpnext/selling/doctype/customer/customer.txt b/erpnext/selling/doctype/customer/customer.txt
index 56051d5..2bb65f3 100644
--- a/erpnext/selling/doctype/customer/customer.txt
+++ b/erpnext/selling/doctype/customer/customer.txt
@@ -1,378 +1,333 @@
-[
- {
- "creation": "2013-06-11 14:26:44",
- "docstatus": 0,
- "modified": "2014-03-03 19:05:58",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "naming_series:",
- "description": "Buyer of Goods and Services.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-user",
- "module": "Selling",
- "name": "__common__",
- "search_fields": "customer_name,customer_group,territory"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Customer",
- "parentfield": "fields",
- "parenttype": "DocType"
- },
- {
- "cancel": 0,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Customer",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "read": 1
- },
- {
- "doctype": "DocType",
- "name": "Customer"
- },
- {
- "doctype": "DocField",
- "fieldname": "basic_info",
- "fieldtype": "Section Break",
- "label": "Basic Info",
- "oldfieldtype": "Section Break",
- "options": "icon-user",
- "permlevel": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "options": "\nCUST\nCUSTMUM",
- "permlevel": 0,
- "print_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Full Name",
- "no_copy": 1,
- "oldfieldname": "customer_name",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_type",
- "fieldtype": "Select",
- "label": "Type",
- "oldfieldname": "customer_type",
- "oldfieldtype": "Select",
- "options": "\nCompany\nIndividual",
- "permlevel": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "lead_name",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "From Lead",
- "no_copy": 1,
- "oldfieldname": "lead_name",
- "oldfieldtype": "Link",
- "options": "Lead",
- "permlevel": 0,
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "width": "50%"
- },
- {
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Group",
- "oldfieldname": "customer_group",
- "oldfieldtype": "Link",
- "options": "Customer Group",
- "permlevel": 0,
- "print_hide": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Territory",
- "oldfieldname": "territory",
- "oldfieldtype": "Link",
- "options": "Territory",
- "permlevel": 0,
- "print_hide": 1,
- "reqd": 1
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "address_contacts",
- "fieldtype": "Section Break",
- "label": "Address & Contacts",
- "options": "icon-map-marker",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "address_html",
- "fieldtype": "HTML",
- "label": "Address HTML",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_html",
- "fieldtype": "HTML",
- "label": "Contact HTML",
- "oldfieldtype": "HTML",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "communication_history",
- "fieldtype": "Section Break",
- "label": "Communication History",
- "options": "icon-comments",
- "permlevel": 0,
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "communication_html",
- "fieldtype": "HTML",
- "label": "Communication HTML",
- "permlevel": 0,
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "width": "50%"
- },
- {
- "description": "To create an Account Head under a different company, select the company and save customer.",
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "permlevel": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "description": "Your Customer's TAX registration numbers (if applicable) or any general information",
- "doctype": "DocField",
- "fieldname": "customer_details",
- "fieldtype": "Text",
- "label": "Customer Details",
- "oldfieldname": "customer_details",
- "oldfieldtype": "Code",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "default_currency",
- "fieldtype": "Link",
- "label": "Currency",
- "no_copy": 1,
- "options": "Currency",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "default_price_list",
- "fieldtype": "Link",
- "label": "Price List",
- "options": "Price List",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "default_taxes_and_charges",
- "fieldtype": "Link",
- "label": "Taxes and Charges",
- "options": "Sales Taxes and Charges Master",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "credit_days",
- "fieldtype": "Int",
- "label": "Credit Days",
- "oldfieldname": "credit_days",
- "oldfieldtype": "Int",
- "permlevel": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "credit_limit",
- "fieldtype": "Currency",
- "label": "Credit Limit",
- "oldfieldname": "credit_limit",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "permlevel": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "website",
- "fieldtype": "Data",
- "label": "Website",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_team_section_break",
- "fieldtype": "Section Break",
- "label": "Sales Team",
- "oldfieldtype": "Section Break",
- "options": "icon-group",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "default_sales_partner",
- "fieldtype": "Link",
- "label": "Sales Partner",
- "oldfieldname": "default_sales_partner",
- "oldfieldtype": "Link",
- "options": "Sales Partner",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "default_commission_rate",
- "fieldtype": "Float",
- "label": "Commission Rate",
- "oldfieldname": "default_commission_rate",
- "oldfieldtype": "Currency",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_team",
- "fieldtype": "Table",
- "label": "Sales Team Details",
- "oldfieldname": "sales_team",
- "oldfieldtype": "Table",
- "options": "Sales Team",
- "permlevel": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "communications",
- "fieldtype": "Table",
- "hidden": 1,
- "label": "Communications",
- "options": "Communication",
- "permlevel": 0,
- "print_hide": 1
- },
- {
- "amend": 0,
- "create": 1,
- "delete": 0,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "report": 1,
- "role": "Sales User",
- "submit": 0,
- "write": 1
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "permlevel": 1,
- "role": "Sales User"
- },
- {
- "amend": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "report": 1,
- "restrict": 1,
- "role": "Sales Master Manager",
- "submit": 0,
- "write": 1
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "permlevel": 1,
- "role": "Sales Master Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-06-11 14:26:44.000000",
+ "description": "Buyer of Goods and Services.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "basic_info",
+ "fieldtype": "Section Break",
+ "label": "Basic Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-user",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "options": "\nCUST\nCUSTMUM",
+ "permlevel": 0,
+ "print_hide": 0
+ },
+ {
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Full Name",
+ "no_copy": 1,
+ "oldfieldname": "customer_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "customer_type",
+ "fieldtype": "Select",
+ "label": "Type",
+ "oldfieldname": "customer_type",
+ "oldfieldtype": "Select",
+ "options": "\nCompany\nIndividual",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "lead_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "From Lead",
+ "no_copy": 1,
+ "oldfieldname": "lead_name",
+ "oldfieldtype": "Link",
+ "options": "Lead",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Group",
+ "oldfieldname": "customer_group",
+ "oldfieldtype": "Link",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Territory",
+ "oldfieldname": "territory",
+ "oldfieldtype": "Link",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "address_contacts",
+ "fieldtype": "Section Break",
+ "label": "Address & Contacts",
+ "options": "icon-map-marker",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "address_html",
+ "fieldtype": "HTML",
+ "label": "Address HTML",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "contact_html",
+ "fieldtype": "HTML",
+ "label": "Contact HTML",
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "communication_history",
+ "fieldtype": "Section Break",
+ "label": "Communication History",
+ "options": "icon-comments",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "communication_html",
+ "fieldtype": "HTML",
+ "label": "Communication HTML",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "description": "To create an Account Head under a different company, select the company and save customer.",
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "description": "Your Customer's TAX registration numbers (if applicable) or any general information",
+ "fieldname": "customer_details",
+ "fieldtype": "Text",
+ "label": "Customer Details",
+ "oldfieldname": "customer_details",
+ "oldfieldtype": "Code",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "default_currency",
+ "fieldtype": "Link",
+ "label": "Currency",
+ "no_copy": 1,
+ "options": "Currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "default_price_list",
+ "fieldtype": "Link",
+ "label": "Price List",
+ "options": "Price List",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "default_taxes_and_charges",
+ "fieldtype": "Link",
+ "label": "Taxes and Charges",
+ "options": "Sales Taxes and Charges Master",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "credit_days",
+ "fieldtype": "Int",
+ "label": "Credit Days",
+ "oldfieldname": "credit_days",
+ "oldfieldtype": "Int",
+ "permlevel": 1
+ },
+ {
+ "fieldname": "credit_limit",
+ "fieldtype": "Currency",
+ "label": "Credit Limit",
+ "oldfieldname": "credit_limit",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 1
+ },
+ {
+ "fieldname": "website",
+ "fieldtype": "Data",
+ "label": "Website",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sales_team_section_break",
+ "fieldtype": "Section Break",
+ "label": "Sales Team",
+ "oldfieldtype": "Section Break",
+ "options": "icon-group",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "default_sales_partner",
+ "fieldtype": "Link",
+ "label": "Sales Partner",
+ "oldfieldname": "default_sales_partner",
+ "oldfieldtype": "Link",
+ "options": "Sales Partner",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "default_commission_rate",
+ "fieldtype": "Float",
+ "label": "Commission Rate",
+ "oldfieldname": "default_commission_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sales_team",
+ "fieldtype": "Table",
+ "label": "Sales Team Details",
+ "oldfieldname": "sales_team",
+ "oldfieldtype": "Table",
+ "options": "Sales Team",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "icon": "icon-user",
+ "idx": 1,
+ "modified": "2014-03-03 19:05:58.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Customer",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "delete": 0,
+ "permlevel": 1,
+ "read": 1,
+ "role": "Sales User"
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "restrict": 1,
+ "role": "Sales Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "delete": 0,
+ "permlevel": 1,
+ "read": 1,
+ "role": "Sales Master Manager",
+ "write": 1
+ }
+ ],
+ "search_fields": "customer_name,customer_group,territory"
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/industry_type/industry_type.py b/erpnext/selling/doctype/industry_type/industry_type.py
index 5015bed..f6bf2c8 100644
--- a/erpnext/selling/doctype/industry_type/industry_type.py
+++ b/erpnext/selling/doctype/industry_type/industry_type.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
-
\ No newline at end of file
+from frappe.model.document import Document
+
+class IndustryType(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/selling/doctype/industry_type/industry_type.txt b/erpnext/selling/doctype/industry_type/industry_type.txt
index e65fc38..2beda93 100644
--- a/erpnext/selling/doctype/industry_type/industry_type.txt
+++ b/erpnext/selling/doctype/industry_type/industry_type.txt
@@ -1,67 +1,56 @@
-[
- {
- "creation": "2012-03-27 14:36:09",
- "docstatus": 0,
- "modified": "2013-12-20 19:24:08",
- "modified_by": "Administrator",
- "owner": "harshada@webnotestech.com"
- },
- {
- "allow_import": 1,
- "autoname": "field:industry",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-flag",
- "module": "Selling",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "fieldname": "industry",
- "fieldtype": "Data",
- "label": "Industry",
- "name": "__common__",
- "oldfieldname": "industry",
- "oldfieldtype": "Data",
- "parent": "Industry Type",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "reqd": 1
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Industry Type",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Industry Type"
- },
- {
- "doctype": "DocField"
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "role": "Sales Manager",
- "write": 1
- },
- {
- "doctype": "DocPerm",
- "role": "Sales User"
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "role": "Sales Master Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:industry",
+ "creation": "2012-03-27 14:36:09.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "industry",
+ "fieldtype": "Data",
+ "label": "Industry",
+ "oldfieldname": "industry",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "icon": "icon-flag",
+ "idx": 1,
+ "modified": "2013-12-20 19:24:08.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Industry Type",
+ "owner": "harshada@webnotestech.com",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "write": 1
+ },
+ {
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User"
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/installation_note/installation_note.py b/erpnext/selling/doctype/installation_note/installation_note.py
index 3d57db7..404ad33 100644
--- a/erpnext/selling/doctype/installation_note/installation_note.py
+++ b/erpnext/selling/doctype/installation_note/installation_note.py
@@ -11,10 +11,7 @@
from erpnext.utilities.transaction_base import TransactionBase
-class DocType(TransactionBase):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class InstallationNote(TransactionBase):
self.tname = 'Installation Note Item'
self.fname = 'installed_item_details'
self.status_updater = [{
@@ -78,7 +75,7 @@
def validate_serial_no(self):
cur_s_no, prevdoc_s_no, sr_list = [], [], []
- for d in getlist(self.doclist, 'installed_item_details'):
+ for d in self.get('installed_item_details'):
self.is_serial_no_added(d.item_code, d.serial_no)
if d.serial_no:
sr_list = get_valid_serial_nos(d.serial_no, d.qty, d.item_code)
@@ -91,7 +88,7 @@
self.is_serial_no_installed(sr_list, d.item_code)
def validate_installation_date(self):
- for d in getlist(self.doclist, 'installed_item_details'):
+ for d in self.get('installed_item_details'):
if d.prevdoc_docname:
d_date = frappe.db.get_value("Delivery Note", d.prevdoc_docname, "posting_date")
if d_date > getdate(self.doc.inst_date):
@@ -99,7 +96,7 @@
" for item "+d.item_code, raise_exception=1)
def check_item_table(self):
- if not(getlist(self.doclist, 'installed_item_details')):
+ if not(self.get('installed_item_details')):
msgprint("Please fetch items from Delivery Note selected", raise_exception=1)
def on_update(self):
@@ -111,7 +108,7 @@
frappe.db.set(self.doc, 'status', 'Submitted')
def on_cancel(self):
- for d in getlist(self.doclist, 'installed_item_details'):
+ for d in self.get('installed_item_details'):
if d.serial_no:
d.serial_no = d.serial_no.replace(",", "\n")
for sr_no in d.serial_no.split("\n"):
diff --git a/erpnext/selling/doctype/installation_note/installation_note.txt b/erpnext/selling/doctype/installation_note/installation_note.txt
index 5e51982..cffd39d 100644
--- a/erpnext/selling/doctype/installation_note/installation_note.txt
+++ b/erpnext/selling/doctype/installation_note/installation_note.txt
@@ -1,285 +1,268 @@
-[
- {
- "creation": "2013-04-30 13:13:06",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:47",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "naming_series:",
- "doctype": "DocType",
- "icon": "icon-wrench",
- "is_submittable": 1,
- "module": "Selling",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Installation Note",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Installation Note",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "read": 1,
- "report": 1,
- "role": "Sales User"
- },
- {
- "doctype": "DocType",
- "name": "Installation Note"
- },
- {
- "doctype": "DocField",
- "fieldname": "installation_note",
- "fieldtype": "Section Break",
- "label": "Installation Note",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "\nIN",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "label": "Customer",
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "label": "Customer Address",
- "options": "Address",
- "print_hide": 1
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "label": "Contact Person",
- "options": "Contact",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "label": "Name",
- "oldfieldname": "customer_name",
- "oldfieldtype": "Data",
- "read_only": 1,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Address",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact",
- "read_only": 1
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_mobile",
- "fieldtype": "Text",
- "label": "Mobile No",
- "read_only": 1
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_email",
- "fieldtype": "Text",
- "label": "Contact Email",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "depends_on": "customer",
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Territory",
- "options": "Territory",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "depends_on": "customer",
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "label": "Customer Group",
- "options": "Customer Group",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "inst_date",
- "fieldtype": "Date",
- "label": "Installation Date",
- "oldfieldname": "inst_date",
- "oldfieldtype": "Date",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "inst_time",
- "fieldtype": "Time",
- "label": "Installation Time",
- "oldfieldname": "inst_time",
- "oldfieldtype": "Time"
- },
- {
- "default": "Draft",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "Draft\nSubmitted\nCancelled",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "description": "Select the relevant company name if you have multiple companies.",
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Select",
- "options": "link:Company",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "remarks",
- "fieldtype": "Small Text",
- "label": "Remarks",
- "oldfieldname": "remarks",
- "oldfieldtype": "Small Text",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_details",
- "fieldtype": "Section Break",
- "label": "Item Details",
- "oldfieldtype": "Section Break",
- "options": "Simple"
- },
- {
- "doctype": "DocField",
- "fieldname": "installed_item_details",
- "fieldtype": "Table",
- "label": "Installation Note Item",
- "oldfieldname": "installed_item_details",
- "oldfieldtype": "Table",
- "options": "Installation Note Item"
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "submit": 1,
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "permlevel": 1,
- "submit": 0
- }
-]
\ No newline at end of file
+{
+ "autoname": "naming_series:",
+ "creation": "2013-04-30 13:13:06.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "installation_note",
+ "fieldtype": "Section Break",
+ "label": "Installation Note",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "\nIN",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "label": "Customer",
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "label": "Customer Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "label": "Contact Person",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "label": "Name",
+ "oldfieldname": "customer_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Address",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_mobile",
+ "fieldtype": "Text",
+ "label": "Mobile No",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_email",
+ "fieldtype": "Text",
+ "label": "Contact Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "depends_on": "customer",
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "depends_on": "customer",
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "label": "Customer Group",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "inst_date",
+ "fieldtype": "Date",
+ "label": "Installation Date",
+ "oldfieldname": "inst_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "inst_time",
+ "fieldtype": "Time",
+ "label": "Installation Time",
+ "oldfieldname": "inst_time",
+ "oldfieldtype": "Time",
+ "permlevel": 0
+ },
+ {
+ "default": "Draft",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "Draft\nSubmitted\nCancelled",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "description": "Select the relevant company name if you have multiple companies.",
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Select",
+ "options": "link:Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "remarks",
+ "fieldtype": "Small Text",
+ "label": "Remarks",
+ "oldfieldname": "remarks",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "item_details",
+ "fieldtype": "Section Break",
+ "label": "Item Details",
+ "oldfieldtype": "Section Break",
+ "options": "Simple",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "installed_item_details",
+ "fieldtype": "Table",
+ "label": "Installation Note Item",
+ "oldfieldname": "installed_item_details",
+ "oldfieldtype": "Table",
+ "options": "Installation Note Item",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-wrench",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-20 17:48:47.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Installation Note",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "permlevel": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/installation_note_item/installation_note_item.py b/erpnext/selling/doctype/installation_note_item/installation_note_item.py
index 26c87f1..ac3aacf 100644
--- a/erpnext/selling/doctype/installation_note_item/installation_note_item.py
+++ b/erpnext/selling/doctype/installation_note_item/installation_note_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class InstallationNoteItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/selling/doctype/installation_note_item/installation_note_item.txt b/erpnext/selling/doctype/installation_note_item/installation_note_item.txt
index 94f648e..0e94d10 100644
--- a/erpnext/selling/doctype/installation_note_item/installation_note_item.txt
+++ b/erpnext/selling/doctype/installation_note_item/installation_note_item.txt
@@ -1,121 +1,108 @@
-[
- {
- "creation": "2013-02-22 01:27:51",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:14",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "IID/.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Selling",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Installation Note Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Installation Note Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Data",
- "print_width": "300px",
- "read_only": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Serial No",
- "oldfieldname": "serial_no",
- "oldfieldtype": "Small Text",
- "print_width": "180px",
- "width": "180px"
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_detail_docname",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Against Document Detail No",
- "no_copy": 1,
- "oldfieldname": "prevdoc_detail_docname",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_docname",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Against Document No",
- "no_copy": 1,
- "oldfieldname": "prevdoc_docname",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_doctype",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Document Type",
- "no_copy": 1,
- "oldfieldname": "prevdoc_doctype",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Installed Qty",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "reqd": 1
- }
-]
\ No newline at end of file
+{
+ "autoname": "IID/.#####",
+ "creation": "2013-02-22 01:27:51.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_width": "300px",
+ "read_only": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "serial_no",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Serial No",
+ "oldfieldname": "serial_no",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "180px",
+ "width": "180px"
+ },
+ {
+ "fieldname": "prevdoc_detail_docname",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Against Document Detail No",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_detail_docname",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "prevdoc_docname",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Against Document No",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_docname",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "prevdoc_doctype",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Document Type",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_doctype",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Installed Qty",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:14.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Installation Note Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js
index c942be1..570a5e0 100644
--- a/erpnext/selling/doctype/lead/lead.js
+++ b/erpnext/selling/doctype/lead/lead.js
@@ -41,7 +41,7 @@
}
cur_frm.communication_view = new frappe.views.CommunicationList({
- list: frappe.model.get("Communication", {"parenttype": "Lead", "parent":this.frm.doc.name}),
+ list: frappe.get_list("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/erpnext/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py
index 614a9c2..1472ff2 100644
--- a/erpnext/selling/doctype/lead/lead.py
+++ b/erpnext/selling/doctype/lead/lead.py
@@ -10,10 +10,7 @@
from erpnext.controllers.selling_controller import SellingController
-class DocType(SellingController):
- def __init__(self, doc, doclist):
- self.doc = doc
- self.doclist = doclist
+class Lead(SellingController):
self._prev = frappe._dict({
"contact_date": frappe.db.get_value("Lead", self.doc.name, "contact_date") if \
diff --git a/erpnext/selling/doctype/lead/lead.txt b/erpnext/selling/doctype/lead/lead.txt
index ba04cb9..c423bfa 100644
--- a/erpnext/selling/doctype/lead/lead.txt
+++ b/erpnext/selling/doctype/lead/lead.txt
@@ -1,411 +1,401 @@
-[
- {
- "creation": "2013-04-10 11:45:37",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:54",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-user",
- "module": "Selling",
- "name": "__common__",
- "search_fields": "lead_name,lead_owner,status"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Lead",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Lead",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Lead"
- },
- {
- "doctype": "DocField",
- "fieldname": "lead_details",
- "fieldtype": "Section Break",
- "label": "Lead Details",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "LEAD\nLEAD/10-11/\nLEAD/MUMBAI/",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "lead_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Contact Name",
- "oldfieldname": "lead_name",
- "oldfieldtype": "Data",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Organization Name",
- "oldfieldname": "company_name",
- "oldfieldtype": "Data",
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "email_id",
- "fieldtype": "Data",
- "label": "Email Id",
- "oldfieldname": "email_id",
- "oldfieldtype": "Data",
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cb6",
- "fieldtype": "Column Break"
- },
- {
- "default": "Lead",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "Lead\nOpen\nReplied\nOpportunity\nInterested\nConverted\nDo Not Contact",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "source",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Source",
- "no_copy": 1,
- "oldfieldname": "source",
- "oldfieldtype": "Select",
- "options": "\nAdvertisement\nBlog Post\nCampaign\nCall\nCustomer\nExhibition\nSupplier\nWebsite\nEmail",
- "reqd": 0,
- "search_index": 0
- },
- {
- "depends_on": "eval:doc.source == 'Customer'",
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "From Customer",
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer"
- },
- {
- "depends_on": "eval:doc.source == 'Campaign'",
- "description": "Enter campaign name if the source of lead is campaign.",
- "doctype": "DocField",
- "fieldname": "campaign_name",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Campaign Name",
- "oldfieldname": "campaign_name",
- "oldfieldtype": "Link",
- "options": "Campaign"
- },
- {
- "doctype": "DocField",
- "fieldname": "communication_history",
- "fieldtype": "Section Break",
- "label": "Communication",
- "options": "icon-comments",
- "print_hide": 1
- },
- {
- "default": "__user",
- "doctype": "DocField",
- "fieldname": "lead_owner",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Lead Owner",
- "oldfieldname": "lead_owner",
- "oldfieldtype": "Link",
- "options": "User",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break123",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "contact_by",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Next Contact By",
- "oldfieldname": "contact_by",
- "oldfieldtype": "Link",
- "options": "User",
- "print_hide": 0,
- "reqd": 0,
- "width": "100px"
- },
- {
- "allow_on_submit": 0,
- "description": "Add to calendar on this date",
- "doctype": "DocField",
- "fieldname": "contact_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Next Contact Date",
- "no_copy": 1,
- "oldfieldname": "contact_date",
- "oldfieldtype": "Date",
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "sec_break123",
- "fieldtype": "Section Break",
- "options": "Simple"
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "communication_html",
- "fieldtype": "HTML",
- "label": "Communication HTML",
- "oldfieldname": "follow_up",
- "oldfieldtype": "Table"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_info",
- "fieldtype": "Section Break",
- "label": "Address & Contact",
- "oldfieldtype": "Column Break",
- "options": "icon-map-marker"
- },
- {
- "depends_on": "eval:doc.__islocal",
- "doctype": "DocField",
- "fieldname": "address_desc",
- "fieldtype": "HTML",
- "hidden": 0,
- "label": "Address Desc",
- "options": "<em>Addresses will appear only when you save the lead</em>",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_html",
- "fieldtype": "HTML",
- "hidden": 0,
- "label": "Address HTML",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "phone",
- "fieldtype": "Data",
- "label": "Phone",
- "oldfieldname": "contact_no",
- "oldfieldtype": "Data",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "mobile_no",
- "fieldtype": "Data",
- "label": "Mobile No.",
- "oldfieldname": "mobile_no",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "fax",
- "fieldtype": "Data",
- "label": "Fax",
- "oldfieldname": "fax",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "website",
- "fieldtype": "Data",
- "label": "Website",
- "oldfieldname": "website",
- "oldfieldtype": "Data"
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "label": "Territory",
- "oldfieldname": "territory",
- "oldfieldtype": "Link",
- "options": "Territory",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text"
- },
- {
- "doctype": "DocField",
- "fieldname": "type",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Lead Type",
- "oldfieldname": "type",
- "oldfieldtype": "Select",
- "options": "\nClient\nChannel Partner\nConsultant"
- },
- {
- "doctype": "DocField",
- "fieldname": "market_segment",
- "fieldtype": "Select",
- "hidden": 0,
- "in_filter": 1,
- "label": "Market Segment",
- "oldfieldname": "market_segment",
- "oldfieldtype": "Select",
- "options": "\nLower Income\nMiddle Income\nUpper Income",
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "industry",
- "fieldtype": "Link",
- "label": "Industry",
- "oldfieldname": "industry",
- "oldfieldtype": "Link",
- "options": "Industry Type"
- },
- {
- "doctype": "DocField",
- "fieldname": "request_type",
- "fieldtype": "Select",
- "label": "Request Type",
- "oldfieldname": "request_type",
- "oldfieldtype": "Select",
- "options": "\nProduct Enquiry\nRequest for Information\nSuggestions\nOther"
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "hidden": 1,
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "unsubscribed",
- "fieldtype": "Check",
- "label": "Unsubscribed"
- },
- {
- "doctype": "DocField",
- "fieldname": "blog_subscriber",
- "fieldtype": "Check",
- "label": "Blog Subscriber"
- },
- {
- "doctype": "DocField",
- "fieldname": "communications",
- "fieldtype": "Table",
- "hidden": 1,
- "label": "Communications",
- "options": "Communication",
- "print_hide": 1
- },
- {
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales Manager"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales User"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-04-10 11:45:37.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "lead_details",
+ "fieldtype": "Section Break",
+ "label": "Lead Details",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "LEAD\nLEAD/10-11/\nLEAD/MUMBAI/",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "lead_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Contact Name",
+ "oldfieldname": "lead_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "company_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Organization Name",
+ "oldfieldname": "company_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "email_id",
+ "fieldtype": "Data",
+ "label": "Email Id",
+ "oldfieldname": "email_id",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "cb6",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "default": "Lead",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "Lead\nOpen\nReplied\nOpportunity\nInterested\nConverted\nDo Not Contact",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "source",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Source",
+ "no_copy": 1,
+ "oldfieldname": "source",
+ "oldfieldtype": "Select",
+ "options": "\nAdvertisement\nBlog Post\nCampaign\nCall\nCustomer\nExhibition\nSupplier\nWebsite\nEmail",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "depends_on": "eval:doc.source == 'Customer'",
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "From Customer",
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.source == 'Campaign'",
+ "description": "Enter campaign name if the source of lead is campaign.",
+ "fieldname": "campaign_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Campaign Name",
+ "oldfieldname": "campaign_name",
+ "oldfieldtype": "Link",
+ "options": "Campaign",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "communication_history",
+ "fieldtype": "Section Break",
+ "label": "Communication",
+ "options": "icon-comments",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "default": "__user",
+ "fieldname": "lead_owner",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Lead Owner",
+ "oldfieldname": "lead_owner",
+ "oldfieldtype": "Link",
+ "options": "User",
+ "permlevel": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "col_break123",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "contact_by",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Next Contact By",
+ "oldfieldname": "contact_by",
+ "oldfieldtype": "Link",
+ "options": "User",
+ "permlevel": 0,
+ "print_hide": 0,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "allow_on_submit": 0,
+ "description": "Add to calendar on this date",
+ "fieldname": "contact_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Next Contact Date",
+ "no_copy": 1,
+ "oldfieldname": "contact_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "sec_break123",
+ "fieldtype": "Section Break",
+ "options": "Simple",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "communication_html",
+ "fieldtype": "HTML",
+ "label": "Communication HTML",
+ "oldfieldname": "follow_up",
+ "oldfieldtype": "Table",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "contact_info",
+ "fieldtype": "Section Break",
+ "label": "Address & Contact",
+ "oldfieldtype": "Column Break",
+ "options": "icon-map-marker",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.__islocal",
+ "fieldname": "address_desc",
+ "fieldtype": "HTML",
+ "hidden": 0,
+ "label": "Address Desc",
+ "options": "<em>Addresses will appear only when you save the lead</em>",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "address_html",
+ "fieldtype": "HTML",
+ "hidden": 0,
+ "label": "Address HTML",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "phone",
+ "fieldtype": "Data",
+ "label": "Phone",
+ "oldfieldname": "contact_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "mobile_no",
+ "fieldtype": "Data",
+ "label": "Mobile No.",
+ "oldfieldname": "mobile_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "fax",
+ "fieldtype": "Data",
+ "label": "Fax",
+ "oldfieldname": "fax",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "website",
+ "fieldtype": "Data",
+ "label": "Website",
+ "oldfieldname": "website",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "label": "Territory",
+ "oldfieldname": "territory",
+ "oldfieldtype": "Link",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "type",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Lead Type",
+ "oldfieldname": "type",
+ "oldfieldtype": "Select",
+ "options": "\nClient\nChannel Partner\nConsultant",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "market_segment",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Market Segment",
+ "oldfieldname": "market_segment",
+ "oldfieldtype": "Select",
+ "options": "\nLower Income\nMiddle Income\nUpper Income",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "industry",
+ "fieldtype": "Link",
+ "label": "Industry",
+ "oldfieldname": "industry",
+ "oldfieldtype": "Link",
+ "options": "Industry Type",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "request_type",
+ "fieldtype": "Select",
+ "label": "Request Type",
+ "oldfieldname": "request_type",
+ "oldfieldtype": "Select",
+ "options": "\nProduct Enquiry\nRequest for Information\nSuggestions\nOther",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "unsubscribed",
+ "fieldtype": "Check",
+ "label": "Unsubscribed",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "blog_subscriber",
+ "fieldtype": "Check",
+ "label": "Blog Subscriber",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "icon": "icon-user",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:54.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Lead",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "search_fields": "lead_name,lead_owner,status"
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/opportunity/opportunity.js b/erpnext/selling/doctype/opportunity/opportunity.js
index 06cf4b1..1dc4c1e 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.js
+++ b/erpnext/selling/doctype/opportunity/opportunity.js
@@ -30,7 +30,7 @@
if(!this.frm.doc.__islocal) {
cur_frm.communication_view = new frappe.views.CommunicationList({
- list: frappe.model.get("Communication", {"opportunity": this.frm.doc.name}),
+ list: frappe.get_list("Communication", {"opportunity": this.frm.doc.name}),
parent: cur_frm.fields_dict.communication_html.wrapper,
doc: this.frm.doc,
recipients: this.frm.doc.contact_email
diff --git a/erpnext/selling/doctype/opportunity/opportunity.py b/erpnext/selling/doctype/opportunity/opportunity.py
index d2f7a2e..bbe9a60 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.py
+++ b/erpnext/selling/doctype/opportunity/opportunity.py
@@ -11,19 +11,9 @@
from erpnext.utilities.transaction_base import TransactionBase
-class DocType(TransactionBase):
- def __init__(self,doc,doclist):
- self.doc = doc
- self.doclist = doclist
- self.fname = 'enq_details'
- self.tname = 'Opportunity Item'
-
- self._prev = frappe._dict({
- "contact_date": frappe.db.get_value("Opportunity", self.doc.name, "contact_date") if \
- (not cint(self.doc.fields.get("__islocal"))) else None,
- "contact_by": frappe.db.get_value("Opportunity", self.doc.name, "contact_by") if \
- (not cint(self.doc.fields.get("__islocal"))) else None,
- })
+class Opportunity(TransactionBase):
+ fname = 'enq_details'
+ tname = 'Opportunity Item'
def get_item_details(self, item_code):
item = frappe.db.sql("""select item_name, stock_uom, description_html, description, item_group, brand
@@ -91,7 +81,7 @@
super(DocType, self).add_calendar_event(opts, force)
def validate_item_details(self):
- if not getlist(self.doclist, 'enquiry_details'):
+ if not self.get('enquiry_details'):
msgprint("Please select items for which enquiry needs to be made")
raise Exception
@@ -102,6 +92,13 @@
msgprint("Customer is mandatory if 'Opportunity From' is selected as Customer", raise_exception=1)
def validate(self):
+ self._prev = frappe._dict({
+ "contact_date": frappe.db.get_value("Opportunity", self.doc.name, "contact_date") if \
+ (not cint(self.doc.fields.get("__islocal"))) else None,
+ "contact_by": frappe.db.get_value("Opportunity", self.doc.name, "contact_by") if \
+ (not cint(self.doc.fields.get("__islocal"))) else None,
+ })
+
self.set_status()
self.validate_item_details()
self.validate_uom_is_integer("uom", "qty")
diff --git a/erpnext/selling/doctype/opportunity/opportunity.txt b/erpnext/selling/doctype/opportunity/opportunity.txt
index fd59a31..51129c5 100644
--- a/erpnext/selling/doctype/opportunity/opportunity.txt
+++ b/erpnext/selling/doctype/opportunity/opportunity.txt
@@ -1,457 +1,448 @@
-[
- {
- "creation": "2013-03-07 18:50:30",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:59",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "naming_series:",
- "description": "Potential Sales Deal",
- "doctype": "DocType",
- "document_type": "Transaction",
- "icon": "icon-info-sign",
- "is_submittable": 1,
- "module": "Selling",
- "name": "__common__",
- "search_fields": "status,transaction_date,customer,lead,enquiry_type,territory,company"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Opportunity",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Opportunity",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Opportunity"
- },
- {
- "doctype": "DocField",
- "fieldname": "from_section",
- "fieldtype": "Section Break",
- "label": "From",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "OPPT",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "enquiry_from",
- "fieldtype": "Select",
- "label": "Opportunity From",
- "oldfieldname": "enquiry_from",
- "oldfieldtype": "Select",
- "options": "\nLead\nCustomer",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1
- },
- {
- "depends_on": "eval:doc.enquiry_from===\"Customer\"",
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Customer",
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "depends_on": "eval:doc.enquiry_from===\"Lead\"",
- "doctype": "DocField",
- "fieldname": "lead",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Lead",
- "oldfieldname": "lead",
- "oldfieldtype": "Link",
- "options": "Lead",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "default": "Draft",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "Draft\nSubmitted\nQuotation\nLost\nCancelled\nReplied\nOpen",
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "enquiry_type",
- "fieldtype": "Select",
- "label": "Opportunity Type",
- "oldfieldname": "enquiry_type",
- "oldfieldtype": "Select",
- "options": "\nSales\nMaintenance",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "items",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart",
- "read_only": 0
- },
- {
- "description": "Items which do not exist in Item master can also be entered on customer's request",
- "doctype": "DocField",
- "fieldname": "enquiry_details",
- "fieldtype": "Table",
- "label": "Opportunity Items",
- "oldfieldname": "enquiry_details",
- "oldfieldtype": "Table",
- "options": "Opportunity Item",
- "read_only": 0
- },
- {
- "description": "Keep a track of communication related to this enquiry which will help for future reference.",
- "doctype": "DocField",
- "fieldname": "communication_history",
- "fieldtype": "Section Break",
- "label": "Communication History",
- "oldfieldtype": "Section Break",
- "options": "icon-comments",
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "communication_html",
- "fieldtype": "HTML",
- "label": "Communication HTML",
- "oldfieldname": "follow_up",
- "oldfieldtype": "Table",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.lead || doc.customer",
- "doctype": "DocField",
- "fieldname": "contact_info",
- "fieldtype": "Section Break",
- "label": "Contact Info",
- "options": "icon-bullhorn",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.customer || doc.lead",
- "doctype": "DocField",
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Customer / Lead Address",
- "options": "Address",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Address",
- "oldfieldname": "address",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "depends_on": "customer",
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Territory",
- "options": "Territory",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0,
- "search_index": 1
- },
- {
- "depends_on": "customer",
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Customer Group",
- "oldfieldname": "customer_group",
- "oldfieldtype": "Link",
- "options": "Customer Group",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "label": "Customer Name",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "depends_on": "eval:doc.lead || doc.customer",
- "doctype": "DocField",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Contact Person",
- "options": "Contact",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "label": "Contact",
- "read_only": 1
- },
- {
- "depends_on": "eval:doc.lead || doc.customer",
- "doctype": "DocField",
- "fieldname": "contact_email",
- "fieldtype": "Text",
- "label": "Contact Email",
- "read_only": 1
- },
- {
- "depends_on": "eval:doc.lead || doc.customer",
- "doctype": "DocField",
- "fieldname": "contact_mobile",
- "fieldtype": "Text",
- "label": "Contact Mobile No",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "default": "Today",
- "doctype": "DocField",
- "fieldname": "transaction_date",
- "fieldtype": "Date",
- "label": "Opportunity Date",
- "oldfieldname": "transaction_date",
- "oldfieldtype": "Date",
- "read_only": 0,
- "reqd": 1,
- "width": "50px"
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "source",
- "fieldtype": "Select",
- "label": "Source",
- "oldfieldname": "source",
- "oldfieldtype": "Select",
- "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign\nWalk In",
- "read_only": 0
- },
- {
- "description": "Enter name of campaign if source of enquiry is campaign",
- "doctype": "DocField",
- "fieldname": "campaign",
- "fieldtype": "Link",
- "label": "Campaign",
- "oldfieldname": "campaign",
- "oldfieldtype": "Link",
- "options": "Campaign",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "order_lost_reason",
- "fieldtype": "Text",
- "label": "Lost Reason",
- "no_copy": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "description": "Your sales person who will contact the customer in future",
- "doctype": "DocField",
- "fieldname": "contact_by",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Next Contact By",
- "oldfieldname": "contact_by",
- "oldfieldtype": "Link",
- "options": "User",
- "read_only": 0,
- "width": "75px"
- },
- {
- "description": "Your sales person will get a reminder on this date to contact the customer",
- "doctype": "DocField",
- "fieldname": "contact_date",
- "fieldtype": "Date",
- "label": "Next Contact Date",
- "oldfieldname": "contact_date",
- "oldfieldtype": "Date",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "to_discuss",
- "fieldtype": "Small Text",
- "label": "To Discuss",
- "no_copy": 1,
- "oldfieldname": "to_discuss",
- "oldfieldtype": "Small Text",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "communications",
- "fieldtype": "Table",
- "hidden": 1,
- "label": "Communications",
- "options": "Communication",
- "print_hide": 1
- },
- {
- "doctype": "DocPerm",
- "role": "Sales User"
- },
- {
- "doctype": "DocPerm",
- "role": "Sales Manager"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-03-07 18:50:30.000000",
+ "description": "Potential Sales Deal",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "fieldname": "from_section",
+ "fieldtype": "Section Break",
+ "label": "From",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "OPPT",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "enquiry_from",
+ "fieldtype": "Select",
+ "label": "Opportunity From",
+ "oldfieldname": "enquiry_from",
+ "oldfieldtype": "Select",
+ "options": "\nLead\nCustomer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:doc.enquiry_from===\"Customer\"",
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Customer",
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "depends_on": "eval:doc.enquiry_from===\"Lead\"",
+ "fieldname": "lead",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Lead",
+ "oldfieldname": "lead",
+ "oldfieldtype": "Link",
+ "options": "Lead",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "default": "Draft",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "Draft\nSubmitted\nQuotation\nLost\nCancelled\nReplied\nOpen",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "enquiry_type",
+ "fieldtype": "Select",
+ "label": "Opportunity Type",
+ "oldfieldname": "enquiry_type",
+ "oldfieldtype": "Select",
+ "options": "\nSales\nMaintenance",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "items",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "Items which do not exist in Item master can also be entered on customer's request",
+ "fieldname": "enquiry_details",
+ "fieldtype": "Table",
+ "label": "Opportunity Items",
+ "oldfieldname": "enquiry_details",
+ "oldfieldtype": "Table",
+ "options": "Opportunity Item",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "Keep a track of communication related to this enquiry which will help for future reference.",
+ "fieldname": "communication_history",
+ "fieldtype": "Section Break",
+ "label": "Communication History",
+ "oldfieldtype": "Section Break",
+ "options": "icon-comments",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "communication_html",
+ "fieldtype": "HTML",
+ "label": "Communication HTML",
+ "oldfieldname": "follow_up",
+ "oldfieldtype": "Table",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.lead || doc.customer",
+ "fieldname": "contact_info",
+ "fieldtype": "Section Break",
+ "label": "Contact Info",
+ "options": "icon-bullhorn",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.customer || doc.lead",
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Customer / Lead Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Address",
+ "oldfieldname": "address",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "customer",
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "depends_on": "customer",
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Customer Group",
+ "oldfieldname": "customer_group",
+ "oldfieldtype": "Link",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "label": "Customer Name",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:doc.lead || doc.customer",
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Contact Person",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "label": "Contact",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:doc.lead || doc.customer",
+ "fieldname": "contact_email",
+ "fieldtype": "Text",
+ "label": "Contact Email",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:doc.lead || doc.customer",
+ "fieldname": "contact_mobile",
+ "fieldtype": "Text",
+ "label": "Contact Mobile No",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "default": "Today",
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "label": "Opportunity Date",
+ "oldfieldname": "transaction_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "width": "50px"
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "source",
+ "fieldtype": "Select",
+ "label": "Source",
+ "oldfieldname": "source",
+ "oldfieldtype": "Select",
+ "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign\nWalk In",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "Enter name of campaign if source of enquiry is campaign",
+ "fieldname": "campaign",
+ "fieldtype": "Link",
+ "label": "Campaign",
+ "oldfieldname": "campaign",
+ "oldfieldtype": "Link",
+ "options": "Campaign",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "order_lost_reason",
+ "fieldtype": "Text",
+ "label": "Lost Reason",
+ "no_copy": 1,
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "description": "Your sales person who will contact the customer in future",
+ "fieldname": "contact_by",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Next Contact By",
+ "oldfieldname": "contact_by",
+ "oldfieldtype": "Link",
+ "options": "User",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "75px"
+ },
+ {
+ "description": "Your sales person will get a reminder on this date to contact the customer",
+ "fieldname": "contact_date",
+ "fieldtype": "Date",
+ "label": "Next Contact Date",
+ "oldfieldname": "contact_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "to_discuss",
+ "fieldtype": "Small Text",
+ "label": "To Discuss",
+ "no_copy": 1,
+ "oldfieldname": "to_discuss",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "icon": "icon-info-sign",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-20 17:48:59.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Opportunity",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "search_fields": "status,transaction_date,customer,lead,enquiry_type,territory,company"
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/opportunity_item/opportunity_item.py b/erpnext/selling/doctype/opportunity_item/opportunity_item.py
index 26c87f1..26b2999 100644
--- a/erpnext/selling/doctype/opportunity_item/opportunity_item.py
+++ b/erpnext/selling/doctype/opportunity_item/opportunity_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class OpportunityItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/selling/doctype/opportunity_item/opportunity_item.txt b/erpnext/selling/doctype/opportunity_item/opportunity_item.txt
index 22023ed..55c33e5 100644
--- a/erpnext/selling/doctype/opportunity_item/opportunity_item.txt
+++ b/erpnext/selling/doctype/opportunity_item/opportunity_item.txt
@@ -1,136 +1,123 @@
-[
- {
- "creation": "2013-02-22 01:27:51",
- "docstatus": 0,
- "modified": "2014-02-03 12:40:44",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Selling",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Opportunity Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Opportunity Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Item Group",
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "print_hide": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Link",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Brand",
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "print_hide": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "print_width": "300px",
- "reqd": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "quantity_and_rate",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Quantity and Rate"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Qty",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "basic_rate",
- "fieldtype": "Currency",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Basic Rate",
- "oldfieldname": "basic_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "UOM",
- "oldfieldname": "uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "search_index": 0
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:51.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Item Group",
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Brand",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "permlevel": 0,
+ "print_hide": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "reqd": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Quantity and Rate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Qty",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "basic_rate",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Basic Rate",
+ "oldfieldname": "basic_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "oldfieldname": "uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "search_index": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-03 12:40:44.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Opportunity Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js
index 28a588a..ff0894a 100644
--- a/erpnext/selling/doctype/quotation/quotation.js
+++ b/erpnext/selling/doctype/quotation/quotation.js
@@ -55,7 +55,7 @@
if (!doc.__islocal) {
cur_frm.communication_view = new frappe.views.CommunicationList({
- list: frappe.model.get("Communication", {"parent": doc.name, "parenttype": "Quotation"}),
+ list: frappe.get_list("Communication", {"parent": doc.name, "parenttype": "Quotation"}),
parent: cur_frm.fields_dict.communication_html.wrapper,
doc: doc,
recipients: doc.contact_email
diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py
index 484c487..530ad24 100644
--- a/erpnext/selling/doctype/quotation/quotation.py
+++ b/erpnext/selling/doctype/quotation/quotation.py
@@ -10,10 +10,7 @@
from erpnext.controllers.selling_controller import SellingController
-class DocType(SellingController):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class Quotation(SellingController):
self.tname = 'Quotation Item'
self.fname = 'quotation_details'
@@ -22,7 +19,7 @@
def validate_for_items(self):
chk_dupl_itm = []
- for d in getlist(self.doclist,'quotation_details'):
+ for d in self.get('quotation_details'):
if [cstr(d.item_code),cstr(d.description)] in chk_dupl_itm:
msgprint("Item %s has been entered twice. Please change description atleast to continue" % d.item_code)
raise Exception
@@ -33,7 +30,7 @@
super(DocType, self).validate_order_type()
if self.doc.order_type in ['Maintenance', 'Service']:
- for d in getlist(self.doclist, 'quotation_details'):
+ for d in self.get('quotation_details'):
is_service_item = frappe.db.sql("select is_service_item from `tabItem` where name=%s", d.item_code)
is_service_item = is_service_item and is_service_item[0][0] or 'No'
@@ -41,7 +38,7 @@
msgprint("You can not select non service item "+d.item_code+" in Maintenance Quotation")
raise Exception
else:
- for d in getlist(self.doclist, 'quotation_details'):
+ for d in self.get('quotation_details'):
is_sales_item = frappe.db.sql("select is_sales_item from `tabItem` where name=%s", d.item_code)
is_sales_item = is_sales_item and is_sales_item[0][0] or 'No'
@@ -69,7 +66,7 @@
frappe.throw(_("Cannot set as Lost as Sales Order is made."))
def check_item_table(self):
- if not getlist(self.doclist, 'quotation_details'):
+ if not self.get('quotation_details'):
msgprint("Please enter item details")
raise Exception
@@ -89,7 +86,7 @@
def print_other_charges(self,docname):
print_lst = []
- for d in getlist(self.doclist,'other_charges'):
+ for d in self.get('other_charges'):
lst1 = []
lst1.append(d.description)
lst1.append(d.total)
diff --git a/erpnext/selling/doctype/quotation/quotation.txt b/erpnext/selling/doctype/quotation/quotation.txt
index 0508e5d..4b99d9e 100644
--- a/erpnext/selling/doctype/quotation/quotation.txt
+++ b/erpnext/selling/doctype/quotation/quotation.txt
@@ -1,903 +1,900 @@
-[
- {
- "creation": "2013-05-24 19:29:08",
- "docstatus": 0,
- "modified": "2014-01-31 19:43:00",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "document_type": "Transaction",
- "hide_toolbar": 0,
- "icon": "icon-shopping-cart",
- "is_submittable": 1,
- "max_attachments": 1,
- "module": "Selling",
- "name": "__common__",
- "read_only_onload": 1,
- "search_fields": "status,transaction_date,customer,lead,order_type"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Quotation",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Quotation",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Quotation"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_section",
- "fieldtype": "Section Break",
- "label": "Customer",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "QTN",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "default": "Customer",
- "doctype": "DocField",
- "fieldname": "quotation_to",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Quotation To",
- "oldfieldname": "quotation_to",
- "oldfieldtype": "Select",
- "options": "\nLead\nCustomer",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1
- },
- {
- "depends_on": "eval:doc.quotation_to == \"Customer\"",
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Customer",
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 1,
- "read_only": 0,
- "search_index": 1
- },
- {
- "depends_on": "eval:doc.quotation_to == \"Lead\"",
- "doctype": "DocField",
- "fieldname": "lead",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Lead",
- "oldfieldname": "lead",
- "oldfieldtype": "Link",
- "options": "Lead",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 1,
- "label": "Customer Name",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "in_filter": 0,
- "label": "Address",
- "oldfieldname": "customer_address",
- "oldfieldtype": "Small Text",
- "print_hide": 0,
- "read_only": 1,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "in_filter": 0,
- "label": "Contact",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_mobile",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Mobile No",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_email",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Contact Email",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "width": "150px"
- },
- {
- "description": "Select the relevant company name if you have multiple companies.",
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0,
- "width": "150px"
- },
- {
- "default": "Today",
- "doctype": "DocField",
- "fieldname": "transaction_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Quotation Date",
- "no_copy": 1,
- "oldfieldname": "transaction_date",
- "oldfieldtype": "Date",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1,
- "width": "100px"
- },
- {
- "default": "Sales",
- "doctype": "DocField",
- "fieldname": "order_type",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Order Type",
- "oldfieldname": "order_type",
- "oldfieldtype": "Select",
- "options": "\nSales\nMaintenance\nShopping Cart",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "label": "Currency and Price List",
- "options": "icon-tag",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "currency",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Currency",
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0,
- "width": "100px"
- },
- {
- "description": "Rate at which customer's currency is converted to company's base currency",
- "doctype": "DocField",
- "fieldname": "conversion_rate",
- "fieldtype": "Float",
- "label": "Exchange Rate",
- "oldfieldname": "conversion_rate",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "selling_price_list",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Price List",
- "oldfieldname": "price_list_name",
- "oldfieldtype": "Select",
- "options": "Price List",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_currency",
- "fieldtype": "Link",
- "label": "Price List Currency",
- "options": "Currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "description": "Rate at which Price list currency is converted to company's base currency",
- "doctype": "DocField",
- "fieldname": "plc_conversion_rate",
- "fieldtype": "Float",
- "label": "Price List Exchange Rate",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "items",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart",
- "print_hide": 0,
- "read_only": 0,
- "search_index": 0
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "quotation_details",
- "fieldtype": "Table",
- "label": "Quotation Items",
- "oldfieldname": "quotation_details",
- "oldfieldtype": "Table",
- "options": "Quotation Item",
- "read_only": 0,
- "reqd": 0,
- "width": "40px"
- },
- {
- "doctype": "DocField",
- "fieldname": "sec_break23",
- "fieldtype": "Section Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total_export",
- "fieldtype": "Currency",
- "label": "Net Total",
- "options": "currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_28",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "label": "Net Total (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "net_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "taxes",
- "fieldtype": "Section Break",
- "label": "Taxes and Charges",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "taxes_and_charges",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Taxes and Charges",
- "oldfieldname": "charge",
- "oldfieldtype": "Link",
- "options": "Sales Taxes and Charges Master",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_34",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "shipping_rule",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Shipping Rule",
- "oldfieldtype": "Button",
- "options": "Shipping Rule",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_36",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges",
- "fieldtype": "Table",
- "label": "Sales Taxes and Charges",
- "oldfieldname": "other_charges",
- "oldfieldtype": "Table",
- "options": "Sales Taxes and Charges",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_calculation",
- "fieldtype": "HTML",
- "label": "Taxes and Charges Calculation",
- "oldfieldtype": "HTML",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_39",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_total_export",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Total",
- "options": "currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_42",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_total",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Total (Company Currency)",
- "oldfieldname": "other_charges_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "discount_amount",
- "fieldtype": "Currency",
- "label": "Discount Amount",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "label": "Totals",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total_export",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Grand Total",
- "no_copy": 0,
- "oldfieldname": "grand_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1,
- "reqd": 0,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "rounded_total_export",
- "fieldtype": "Currency",
- "label": "Rounded Total",
- "no_copy": 0,
- "oldfieldname": "rounded_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1,
- "reqd": 0,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "in_words_export",
- "fieldtype": "Data",
- "label": "In Words",
- "no_copy": 0,
- "oldfieldname": "in_words_export",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "read_only": 1,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 1,
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total",
- "fieldtype": "Currency",
- "label": "Grand Total (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "grand_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 0,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "rounded_total",
- "fieldtype": "Currency",
- "label": "Rounded Total (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "rounded_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "width": "200px"
- },
- {
- "description": "In Words will be visible once you save the Quotation.",
- "doctype": "DocField",
- "fieldname": "in_words",
- "fieldtype": "Data",
- "label": "In Words (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "icon-legal",
- "print_hide": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "tc_name",
- "fieldtype": "Link",
- "label": "Terms",
- "oldfieldname": "tc_name",
- "oldfieldtype": "Link",
- "options": "Terms and Conditions",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "terms",
- "fieldtype": "Text Editor",
- "label": "Term Details",
- "oldfieldname": "terms",
- "oldfieldtype": "Text Editor",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "label": "Contact Info",
- "options": "icon-bullhorn",
- "read_only": 0
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Territory",
- "options": "Territory",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "depends_on": "customer",
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Customer Group",
- "oldfieldname": "customer_group",
- "oldfieldtype": "Link",
- "options": "Customer Group",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "shipping_address_name",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Shipping Address",
- "options": "Address",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "shipping_address",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Shipping Address",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "col_break98",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Customer Address",
- "options": "Address",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.customer",
- "doctype": "DocField",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Contact Person",
- "oldfieldname": "contact_person",
- "oldfieldtype": "Link",
- "options": "Contact",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "campaign",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Campaign",
- "no_copy": 0,
- "oldfieldname": "campaign",
- "oldfieldtype": "Link",
- "options": "Campaign",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "source",
- "fieldtype": "Select",
- "hidden": 0,
- "label": "Source",
- "no_copy": 0,
- "oldfieldname": "source",
- "oldfieldtype": "Select",
- "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0
- },
- {
- "allow_on_submit": 0,
- "default": "Draft",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "Draft\nSubmitted\nOrdered\nLost\nCancelled",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1,
- "search_index": 0
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "order_lost_reason",
- "fieldtype": "Small Text",
- "label": "Quotation Lost Reason",
- "no_copy": 1,
- "oldfieldname": "order_lost_reason",
- "oldfieldtype": "Small Text",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break4",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 1,
- "read_only": 0,
- "width": "50%"
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "letter_head",
- "fieldtype": "Select",
- "label": "Letter Head",
- "oldfieldname": "letter_head",
- "oldfieldtype": "Select",
- "options": "link:Letter Head",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "label": "Print Heading",
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "enq_det",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Opportunity Item",
- "no_copy": 0,
- "oldfieldname": "enq_det",
- "oldfieldtype": "Text",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "communication_history",
- "fieldtype": "Section Break",
- "label": "Communication History",
- "oldfieldtype": "Section Break",
- "options": "icon-comments",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "communication_html",
- "fieldtype": "HTML",
- "label": "Communication HTML",
- "oldfieldname": "follow_up",
- "oldfieldtype": "Table",
- "print_hide": 1,
- "read_only": 0,
- "width": "40px"
- },
- {
- "doctype": "DocField",
- "fieldname": "communications",
- "fieldtype": "Table",
- "hidden": 1,
- "label": "Communications",
- "options": "Communication",
- "print_hide": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales Manager",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales User",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Customer",
- "submit": 0,
- "write": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Maintenance Manager",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Maintenance User",
- "submit": 1,
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-05-24 19:29:08.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "fieldname": "customer_section",
+ "fieldtype": "Section Break",
+ "label": "Customer",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "QTN",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "default": "Customer",
+ "fieldname": "quotation_to",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Quotation To",
+ "oldfieldname": "quotation_to",
+ "oldfieldtype": "Select",
+ "options": "\nLead\nCustomer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:doc.quotation_to == \"Customer\"",
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Customer",
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "search_index": 1
+ },
+ {
+ "depends_on": "eval:doc.quotation_to == \"Lead\"",
+ "fieldname": "lead",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Lead",
+ "oldfieldname": "lead",
+ "oldfieldtype": "Link",
+ "options": "Lead",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 1,
+ "label": "Customer Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "in_filter": 0,
+ "label": "Address",
+ "oldfieldname": "customer_address",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "in_filter": 0,
+ "label": "Contact",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_mobile",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Mobile No",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_email",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Contact Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "description": "Select the relevant company name if you have multiple companies.",
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "width": "150px"
+ },
+ {
+ "default": "Today",
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Quotation Date",
+ "no_copy": 1,
+ "oldfieldname": "transaction_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "default": "Sales",
+ "fieldname": "order_type",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Order Type",
+ "oldfieldname": "order_type",
+ "oldfieldtype": "Select",
+ "options": "\nSales\nMaintenance\nShopping Cart",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "label": "Currency and Price List",
+ "options": "icon-tag",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Currency",
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "width": "100px"
+ },
+ {
+ "description": "Rate at which customer's currency is converted to company's base currency",
+ "fieldname": "conversion_rate",
+ "fieldtype": "Float",
+ "label": "Exchange Rate",
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "selling_price_list",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Price List",
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Select",
+ "options": "Price List",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "price_list_currency",
+ "fieldtype": "Link",
+ "label": "Price List Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "description": "Rate at which Price list currency is converted to company's base currency",
+ "fieldname": "plc_conversion_rate",
+ "fieldtype": "Float",
+ "label": "Price List Exchange Rate",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "items",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "search_index": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "quotation_details",
+ "fieldtype": "Table",
+ "label": "Quotation Items",
+ "oldfieldname": "quotation_details",
+ "oldfieldtype": "Table",
+ "options": "Quotation Item",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 0,
+ "width": "40px"
+ },
+ {
+ "fieldname": "sec_break23",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "net_total_export",
+ "fieldtype": "Currency",
+ "label": "Net Total",
+ "options": "currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_28",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "label": "Net Total (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "net_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "taxes",
+ "fieldtype": "Section Break",
+ "label": "Taxes and Charges",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Taxes and Charges",
+ "oldfieldname": "charge",
+ "oldfieldtype": "Link",
+ "options": "Sales Taxes and Charges Master",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break_34",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "shipping_rule",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Shipping Rule",
+ "oldfieldtype": "Button",
+ "options": "Shipping Rule",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_36",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges",
+ "fieldtype": "Table",
+ "label": "Sales Taxes and Charges",
+ "oldfieldname": "other_charges",
+ "oldfieldtype": "Table",
+ "options": "Sales Taxes and Charges",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "other_charges_calculation",
+ "fieldtype": "HTML",
+ "label": "Taxes and Charges Calculation",
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_39",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_total_export",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Total",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_42",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_total",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Total (Company Currency)",
+ "oldfieldname": "other_charges_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "discount_amount",
+ "fieldtype": "Currency",
+ "label": "Discount Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "label": "Totals",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "grand_total_export",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Grand Total",
+ "no_copy": 0,
+ "oldfieldname": "grand_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "width": "200px"
+ },
+ {
+ "fieldname": "rounded_total_export",
+ "fieldtype": "Currency",
+ "label": "Rounded Total",
+ "no_copy": 0,
+ "oldfieldname": "rounded_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "width": "200px"
+ },
+ {
+ "fieldname": "in_words_export",
+ "fieldtype": "Data",
+ "label": "In Words",
+ "no_copy": 0,
+ "oldfieldname": "in_words_export",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "label": "Grand Total (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "grand_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 0,
+ "width": "200px"
+ },
+ {
+ "fieldname": "rounded_total",
+ "fieldtype": "Currency",
+ "label": "Rounded Total (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "rounded_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "width": "200px"
+ },
+ {
+ "description": "In Words will be visible once you save the Quotation.",
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "label": "In Words (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "in_words",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "label": "Terms and Conditions",
+ "oldfieldtype": "Section Break",
+ "options": "icon-legal",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "label": "Terms",
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "label": "Term Details",
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "contact_section",
+ "fieldtype": "Section Break",
+ "label": "Contact Info",
+ "options": "icon-bullhorn",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "depends_on": "customer",
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Customer Group",
+ "oldfieldname": "customer_group",
+ "oldfieldtype": "Link",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "shipping_address_name",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Shipping Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "shipping_address",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Shipping Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "col_break98",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Customer Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.customer",
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Contact Person",
+ "oldfieldname": "contact_person",
+ "oldfieldtype": "Link",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "campaign",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Campaign",
+ "no_copy": 0,
+ "oldfieldname": "campaign",
+ "oldfieldtype": "Link",
+ "options": "Campaign",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "source",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "label": "Source",
+ "no_copy": 0,
+ "oldfieldname": "source",
+ "oldfieldtype": "Select",
+ "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "default": "Draft",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "Draft\nSubmitted\nOrdered\nLost\nCancelled",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "order_lost_reason",
+ "fieldtype": "Small Text",
+ "label": "Quotation Lost Reason",
+ "no_copy": 1,
+ "oldfieldname": "order_lost_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "letter_head",
+ "fieldtype": "Select",
+ "label": "Letter Head",
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "link:Letter Head",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "label": "Print Heading",
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "enq_det",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Opportunity Item",
+ "no_copy": 0,
+ "oldfieldname": "enq_det",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "communication_history",
+ "fieldtype": "Section Break",
+ "label": "Communication History",
+ "oldfieldtype": "Section Break",
+ "options": "icon-comments",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "communication_html",
+ "fieldtype": "HTML",
+ "label": "Communication HTML",
+ "oldfieldname": "follow_up",
+ "oldfieldtype": "Table",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "width": "40px"
+ },
+ {
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "hide_toolbar": 0,
+ "icon": "icon-shopping-cart",
+ "idx": 1,
+ "is_submittable": 1,
+ "max_attachments": 1,
+ "modified": "2014-01-31 19:43:00.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Quotation",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Customer",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance User",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "read_only_onload": 1,
+ "search_fields": "status,transaction_date,customer,lead,order_type"
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.py b/erpnext/selling/doctype/quotation_item/quotation_item.py
index 26c87f1..426b199 100644
--- a/erpnext/selling/doctype/quotation_item/quotation_item.py
+++ b/erpnext/selling/doctype/quotation_item/quotation_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class QuotationItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.txt b/erpnext/selling/doctype/quotation_item/quotation_item.txt
index bbf953a..4e19ee7 100644
--- a/erpnext/selling/doctype/quotation_item/quotation_item.txt
+++ b/erpnext/selling/doctype/quotation_item/quotation_item.txt
@@ -1,374 +1,361 @@
-[
- {
- "creation": "2013-03-07 11:42:57",
- "docstatus": 0,
- "modified": "2014-02-28 11:20:34",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "QUOD/.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Selling",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Quotation Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Quotation Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "print_hide": 0,
- "print_width": "150px",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_item_code",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Customer's Item Code",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "print_hide": 0,
- "print_width": "300px",
- "read_only": 0,
- "reqd": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "quantity_and_rate",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Quantity and Rate"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Quantity",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "print_hide": 0,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "search_index": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate",
- "oldfieldname": "ref_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "discount_percentage",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Discount (%)",
- "oldfieldname": "adj_rate",
- "oldfieldtype": "Float",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "print_hide": 0,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate (Company Currency)",
- "oldfieldname": "base_ref_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "Section_break1",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Currency",
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Rate",
- "oldfieldname": "export_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 0,
- "search_index": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Currency",
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "export_amount",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "search_index": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_rate",
- "fieldtype": "Currency",
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Basic Rate (Company Currency)",
- "oldfieldname": "basic_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "search_index": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_amount",
- "fieldtype": "Currency",
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Amount (Company Currency)",
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "search_index": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_price",
- "fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "reference",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Reference"
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_doctype",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Against Doctype",
- "no_copy": 1,
- "oldfieldname": "prevdoc_doctype",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "report_hide": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_docname",
- "fieldtype": "Data",
- "in_list_view": 0,
- "label": "Against Docname",
- "no_copy": 1,
- "oldfieldname": "prevdoc_docname",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "report_hide": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_tax_rate",
- "fieldtype": "Small Text",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Item Tax Rate",
- "oldfieldname": "item_tax_rate",
- "oldfieldtype": "Small Text",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break4",
- "fieldtype": "Column Break"
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "page_break",
- "fieldtype": "Check",
- "hidden": 0,
- "in_list_view": 0,
- "label": "Page Break",
- "no_copy": 1,
- "oldfieldname": "page_break",
- "oldfieldtype": "Check",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 1,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Item Group",
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Link",
- "hidden": 1,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Brand",
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "search_index": 1,
- "width": "150px"
- }
-]
\ No newline at end of file
+{
+ "autoname": "QUOD/.#####",
+ "creation": "2013-03-07 11:42:57.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "150px",
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "customer_item_code",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Customer's Item Code",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "300px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Quantity and Rate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Quantity",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate",
+ "oldfieldname": "ref_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "discount_percentage",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Discount (%)",
+ "oldfieldname": "adj_rate",
+ "oldfieldtype": "Float",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "base_price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate (Company Currency)",
+ "oldfieldname": "base_ref_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "Section_break1",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Rate",
+ "oldfieldname": "export_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "export_amount",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "base_rate",
+ "fieldtype": "Currency",
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Basic Rate (Company Currency)",
+ "oldfieldname": "basic_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "base_amount",
+ "fieldtype": "Currency",
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Amount (Company Currency)",
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "reference",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Reference",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "prevdoc_doctype",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Against Doctype",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_doctype",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "report_hide": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "prevdoc_docname",
+ "fieldtype": "Data",
+ "in_list_view": 0,
+ "label": "Against Docname",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_docname",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "report_hide": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "item_tax_rate",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Item Tax Rate",
+ "oldfieldname": "item_tax_rate",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "hidden": 0,
+ "in_list_view": 0,
+ "label": "Page Break",
+ "no_copy": 1,
+ "oldfieldname": "page_break",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Item Group",
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Brand",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 1,
+ "width": "150px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-28 11:20:34.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Quotation Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_bom/sales_bom.py b/erpnext/selling/doctype/sales_bom/sales_bom.py
index fb46961..3e97ed9 100644
--- a/erpnext/selling/doctype/sales_bom/sales_bom.py
+++ b/erpnext/selling/doctype/sales_bom/sales_bom.py
@@ -4,9 +4,10 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self,d,dl):
- self.doc, self.doclist = d,dl
+from frappe.model.document import Document
+
+class SalesBom(Document):
+
def autoname(self):
self.doc.name = self.doc.new_item_code
diff --git a/erpnext/selling/doctype/sales_bom/sales_bom.txt b/erpnext/selling/doctype/sales_bom/sales_bom.txt
index ae40e10..91fac19 100644
--- a/erpnext/selling/doctype/sales_bom/sales_bom.txt
+++ b/erpnext/selling/doctype/sales_bom/sales_bom.txt
@@ -1,102 +1,97 @@
-[
- {
- "creation": "2013-06-20 11:53:21",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:19",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "description": "Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. \n\nThe package **Item** will have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\".\n\nFor Example: If you are selling Laptops and Backpacks separately and have a special price if the customer buys both, then the Laptop + Backpack will be a new Sales BOM Item.\n\nNote: BOM = Bill of Materials",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-sitemap",
- "is_submittable": 0,
- "module": "Selling",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Sales BOM",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Sales BOM",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Sales BOM"
- },
- {
- "doctype": "DocField",
- "fieldname": "basic_section",
- "fieldtype": "Section Break",
- "label": "Sales BOM Item"
- },
- {
- "description": "The Item that represents the Package. This Item must have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\"",
- "doctype": "DocField",
- "fieldname": "new_item_code",
- "fieldtype": "Link",
- "label": "Parent Item",
- "no_copy": 1,
- "oldfieldname": "new_item_code",
- "oldfieldtype": "Data",
- "options": "Item",
- "reqd": 1
- },
- {
- "description": "List items that form the package.",
- "doctype": "DocField",
- "fieldname": "item_section",
- "fieldtype": "Section Break",
- "label": "Package Items"
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_bom_items",
- "fieldtype": "Table",
- "label": "Sales BOM Items",
- "oldfieldname": "sales_bom_items",
- "oldfieldtype": "Table",
- "options": "Sales BOM Item",
- "reqd": 1
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Material Manager",
- "write": 1
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Material User",
- "write": 0
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales User",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "creation": "2013-06-20 11:53:21.000000",
+ "description": "Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. \n\nThe package **Item** will have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\".\n\nFor Example: If you are selling Laptops and Backpacks separately and have a special price if the customer buys both, then the Laptop + Backpack will be a new Sales BOM Item.\n\nNote: BOM = Bill of Materials",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "basic_section",
+ "fieldtype": "Section Break",
+ "label": "Sales BOM Item",
+ "permlevel": 0
+ },
+ {
+ "description": "The Item that represents the Package. This Item must have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\"",
+ "fieldname": "new_item_code",
+ "fieldtype": "Link",
+ "label": "Parent Item",
+ "no_copy": 1,
+ "oldfieldname": "new_item_code",
+ "oldfieldtype": "Data",
+ "options": "Item",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "List items that form the package.",
+ "fieldname": "item_section",
+ "fieldtype": "Section Break",
+ "label": "Package Items",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sales_bom_items",
+ "fieldtype": "Table",
+ "label": "Sales BOM Items",
+ "oldfieldname": "sales_bom_items",
+ "oldfieldtype": "Table",
+ "options": "Sales BOM Item",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "icon": "icon-sitemap",
+ "idx": 1,
+ "is_submittable": 0,
+ "modified": "2014-01-20 17:49:19.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales BOM",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.py b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.py
index 26c87f1..e1124d9 100644
--- a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.py
+++ b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SalesBomItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt
index e06d8f8..c48debd 100644
--- a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt
+++ b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt
@@ -1,81 +1,68 @@
-[
- {
- "creation": "2013-05-23 16:55:51",
- "docstatus": 0,
- "modified": "2013-12-20 19:21:38",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Selling",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Sales BOM Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Sales BOM Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Item",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Qty",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "print_width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Float",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Rate",
- "oldfieldname": "rate",
- "oldfieldtype": "Currency",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "UOM",
- "oldfieldname": "uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "read_only": 1,
- "search_index": 0
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-05-23 16:55:51.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Item",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Qty",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_width": "300px"
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Rate",
+ "oldfieldname": "rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "oldfieldname": "uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:21:38.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales BOM Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 0a3ca99..9d43065 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -86,7 +86,7 @@
},
warehouse: function(doc, cdt, cdn) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
if(item.item_code && item.warehouse) {
return this.frm.call({
method: "erpnext.selling.utils.get_available_qty",
@@ -162,7 +162,7 @@
if (check) {
return $c('runserverobj', {
'method':'stop_sales_order',
- 'docs': frappe.model.compress(make_doclist(doc.doctype, doc.name))
+ 'docs': doc
}, function(r,rt) {
cur_frm.refresh();
});
@@ -177,7 +177,7 @@
if (check) {
return $c('runserverobj', {
'method':'unstop_sales_order',
- 'docs': frappe.model.compress(make_doclist(doc.doctype, doc.name))
+ 'docs': doc
}, function(r,rt) {
cur_frm.refresh();
});
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index fd915de..25eda9a 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -13,7 +13,7 @@
from erpnext.controllers.selling_controller import SellingController
-class DocType(SellingController):
+class SalesOrder(SellingController):
def __init__(self, doc, doclist=None):
self.doc = doc
if not doclist: doclist = []
@@ -48,7 +48,7 @@
def validate_for_items(self):
check_list, flag = [], 0
chk_dupl_itm = []
- for d in getlist(self.doclist, 'sales_order_details'):
+ for d in self.get('sales_order_details'):
e = [d.item_code, d.description, d.warehouse, d.prevdoc_docname or '']
f = [d.item_code, d.description]
@@ -75,7 +75,7 @@
d.projected_qty = tot_avail_qty and flt(tot_avail_qty[0][0]) or 0
def validate_sales_mntc_quotation(self):
- for d in getlist(self.doclist, 'sales_order_details'):
+ for d in self.get('sales_order_details'):
if d.prevdoc_docname:
res = frappe.db.sql("select name from `tabQuotation` where name=%s and order_type = %s", (d.prevdoc_docname, self.doc.order_type))
if not res:
diff --git a/erpnext/selling/doctype/sales_order/sales_order.txt b/erpnext/selling/doctype/sales_order/sales_order.txt
index 01c2817..102abc0 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.txt
+++ b/erpnext/selling/doctype/sales_order/sales_order.txt
@@ -1,942 +1,932 @@
-[
- {
- "creation": "2013-06-18 12:39:59",
- "docstatus": 0,
- "modified": "2014-01-28 18:47:42",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "document_type": "Transaction",
- "icon": "icon-file-text",
- "is_submittable": 1,
- "issingle": 0,
- "module": "Selling",
- "name": "__common__",
- "read_only_onload": 1,
- "search_fields": "status,transaction_date,customer,customer_name, territory,order_type,company"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Sales Order",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Sales Order",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1
- },
- {
- "doctype": "DocType",
- "name": "Sales Order"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_section",
- "fieldtype": "Section Break",
- "label": "Customer",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "in_filter": 0,
- "oldfieldtype": "Column Break",
- "search_index": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "PI/2011/\nSO\nSO/10-11/\nSO1112",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Customer",
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Name",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Address",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_mobile",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Mobile No",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_email",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Contact Email",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "default": "Sales",
- "doctype": "DocField",
- "fieldname": "order_type",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Order Type",
- "oldfieldname": "order_type",
- "oldfieldtype": "Select",
- "options": "\nSales\nMaintenance",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "width": "150px"
- },
- {
- "description": "Select the relevant company name if you have multiple companies.",
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "default": "Today",
- "doctype": "DocField",
- "fieldname": "transaction_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Sales Order Date",
- "no_copy": 1,
- "oldfieldname": "transaction_date",
- "oldfieldtype": "Date",
- "print_hide": 0,
- "reqd": 1,
- "search_index": 1,
- "width": "160px"
- },
- {
- "depends_on": "eval:doc.order_type == 'Sales'",
- "doctype": "DocField",
- "fieldname": "delivery_date",
- "fieldtype": "Date",
- "hidden": 0,
- "in_filter": 1,
- "label": "Delivery Date",
- "oldfieldname": "delivery_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "reqd": 0,
- "search_index": 1,
- "width": "160px"
- },
- {
- "description": "Customer's Purchase Order Number",
- "doctype": "DocField",
- "fieldname": "po_no",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "PO No",
- "oldfieldname": "po_no",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "reqd": 0,
- "width": "100px"
- },
- {
- "depends_on": "eval:doc.po_no",
- "description": "Customer's Purchase Order Date",
- "doctype": "DocField",
- "fieldname": "po_date",
- "fieldtype": "Date",
- "hidden": 0,
- "label": "PO Date",
- "oldfieldname": "po_date",
- "oldfieldtype": "Date",
- "print_hide": 0,
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "shipping_address_name",
- "fieldtype": "Link",
- "hidden": 1,
- "in_filter": 1,
- "label": "Shipping Address",
- "options": "Address",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "shipping_address",
- "fieldtype": "Small Text",
- "hidden": 1,
- "in_filter": 0,
- "label": "Shipping Address",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sec_break45",
- "fieldtype": "Section Break",
- "label": "Currency and Price List",
- "options": "icon-tag"
- },
- {
- "doctype": "DocField",
- "fieldname": "currency",
- "fieldtype": "Link",
- "label": "Currency",
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "print_hide": 1,
- "reqd": 1,
- "width": "100px"
- },
- {
- "description": "Rate at which customer's currency is converted to company's base currency",
- "doctype": "DocField",
- "fieldname": "conversion_rate",
- "fieldtype": "Float",
- "label": "Exchange Rate",
- "oldfieldname": "conversion_rate",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "selling_price_list",
- "fieldtype": "Link",
- "label": "Price List",
- "oldfieldname": "price_list_name",
- "oldfieldtype": "Select",
- "options": "Price List",
- "print_hide": 1,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_currency",
- "fieldtype": "Link",
- "label": "Price List Currency",
- "options": "Currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "description": "Rate at which Price list currency is converted to company's base currency",
- "doctype": "DocField",
- "fieldname": "plc_conversion_rate",
- "fieldtype": "Float",
- "label": "Price List Exchange Rate",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "items",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart"
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "sales_order_details",
- "fieldtype": "Table",
- "label": "Sales Order Items",
- "oldfieldname": "sales_order_details",
- "oldfieldtype": "Table",
- "options": "Sales Order Item",
- "print_hide": 0,
- "reqd": 1
- },
- {
- "description": "Display all the individual items delivered with the main items",
- "doctype": "DocField",
- "fieldname": "packing_list",
- "fieldtype": "Section Break",
- "hidden": 0,
- "label": "Packing List",
- "oldfieldtype": "Section Break",
- "options": "icon-suitcase",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "packing_details",
- "fieldtype": "Table",
- "label": "Packing Details",
- "oldfieldname": "packing_details",
- "oldfieldtype": "Table",
- "options": "Packed Item",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_31",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total_export",
- "fieldtype": "Currency",
- "label": "Net Total",
- "options": "currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_33",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "label": "Net Total (Company Currency)",
- "oldfieldname": "net_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "taxes",
- "fieldtype": "Section Break",
- "label": "Taxes and Charges",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "print_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "taxes_and_charges",
- "fieldtype": "Link",
- "label": "Taxes and Charges",
- "oldfieldname": "charge",
- "oldfieldtype": "Link",
- "options": "Sales Taxes and Charges Master",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_38",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "shipping_rule",
- "fieldtype": "Link",
- "label": "Shipping Rule",
- "oldfieldtype": "Button",
- "options": "Shipping Rule",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_40",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges",
- "fieldtype": "Table",
- "label": "Sales Taxes and Charges",
- "oldfieldname": "other_charges",
- "oldfieldtype": "Table",
- "options": "Sales Taxes and Charges"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_calculation",
- "fieldtype": "HTML",
- "label": "Taxes and Charges Calculation",
- "oldfieldtype": "HTML",
- "print_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_43",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_total_export",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Total",
- "options": "currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_46",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_total",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Total (Company Currency)",
- "oldfieldname": "other_charges_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "discount_amount",
- "fieldtype": "Currency",
- "label": "Discount Amount",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "label": "Totals",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total_export",
- "fieldtype": "Currency",
- "label": "Grand Total",
- "oldfieldname": "grand_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1,
- "reqd": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "rounded_total_export",
- "fieldtype": "Currency",
- "label": "Rounded Total",
- "oldfieldname": "rounded_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "in_words_export",
- "fieldtype": "Data",
- "label": "In Words",
- "oldfieldname": "in_words_export",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "read_only": 1,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 1,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total",
- "fieldtype": "Currency",
- "label": "Grand Total (Company Currency)",
- "oldfieldname": "grand_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "rounded_total",
- "fieldtype": "Currency",
- "label": "Rounded Total (Company Currency)",
- "oldfieldname": "rounded_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1,
- "width": "150px"
- },
- {
- "description": "In Words will be visible once you save the Sales Order.",
- "doctype": "DocField",
- "fieldname": "in_words",
- "fieldtype": "Data",
- "label": "In Words (Company Currency)",
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "icon-legal",
- "print_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "tc_name",
- "fieldtype": "Link",
- "label": "Terms",
- "oldfieldname": "tc_name",
- "oldfieldtype": "Link",
- "options": "Terms and Conditions",
- "print_hide": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "terms",
- "fieldtype": "Text Editor",
- "label": "Terms and Conditions Details",
- "oldfieldname": "terms",
- "oldfieldtype": "Text Editor",
- "print_hide": 0
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_info",
- "fieldtype": "Section Break",
- "label": "Contact Info",
- "options": "icon-bullhorn"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break45",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Territory",
- "options": "Territory",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Customer Group",
- "options": "Customer Group",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break46",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Customer Address",
- "options": "Address",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Contact Person",
- "options": "Contact",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "print_hide": 1
- },
- {
- "description": "Track this Sales Order against any Project",
- "doctype": "DocField",
- "fieldname": "project_name",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Project Name",
- "oldfieldname": "project_name",
- "oldfieldtype": "Link",
- "options": "Project",
- "search_index": 1
- },
- {
- "depends_on": "eval:doc.source == 'Campaign'",
- "doctype": "DocField",
- "fieldname": "campaign",
- "fieldtype": "Link",
- "label": "Campaign",
- "oldfieldname": "campaign",
- "oldfieldtype": "Link",
- "options": "Campaign",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "source",
- "fieldtype": "Select",
- "label": "Source",
- "oldfieldname": "source",
- "oldfieldtype": "Select",
- "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break4",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 1,
- "width": "50%"
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "letter_head",
- "fieldtype": "Select",
- "label": "Letter Head",
- "oldfieldname": "letter_head",
- "oldfieldtype": "Select",
- "options": "link:Letter Head",
- "print_hide": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "label": "Print Heading",
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_78",
- "fieldtype": "Section Break",
- "oldfieldtype": "Column Break",
- "print_hide": 1,
- "width": "50%"
- },
- {
- "default": "Draft",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nDraft\nSubmitted\nStopped\nCancelled",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1,
- "search_index": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "delivery_status",
- "fieldtype": "Select",
- "hidden": 1,
- "label": "Delivery Status",
- "no_copy": 1,
- "options": "Delivered\nNot Delivered\nPartly Delivered\nClosed\nNot Applicable",
- "print_hide": 1
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "description": "% of materials delivered against this Sales Order",
- "doctype": "DocField",
- "fieldname": "per_delivered",
- "fieldtype": "Percent",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "% Delivered",
- "no_copy": 1,
- "oldfieldname": "per_delivered",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_81",
- "fieldtype": "Column Break"
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "description": "% of materials billed against this Sales Order",
- "doctype": "DocField",
- "fieldname": "per_billed",
- "fieldtype": "Percent",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "% Amount Billed",
- "no_copy": 1,
- "oldfieldname": "per_billed",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "billing_status",
- "fieldtype": "Select",
- "hidden": 1,
- "label": "Billing Status",
- "no_copy": 1,
- "options": "Billed\nNot Billed\nPartly Billed\nClosed",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_team_section_break",
- "fieldtype": "Section Break",
- "label": "Sales Team",
- "oldfieldtype": "Section Break",
- "options": "icon-group",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_partner",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Sales Partner",
- "oldfieldname": "sales_partner",
- "oldfieldtype": "Link",
- "options": "Sales Partner",
- "print_hide": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break7",
- "fieldtype": "Column Break",
- "print_hide": 1,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "commission_rate",
- "fieldtype": "Float",
- "label": "Commission Rate",
- "oldfieldname": "commission_rate",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_commission",
- "fieldtype": "Currency",
- "label": "Total Commission",
- "oldfieldname": "total_commission",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break1",
- "fieldtype": "Section Break",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_team",
- "fieldtype": "Table",
- "label": "Sales Team1",
- "oldfieldname": "sales_team",
- "oldfieldtype": "Table",
- "options": "Sales Team",
- "print_hide": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "report": 1,
- "role": "Sales User",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "report": 1,
- "role": "Maintenance User",
- "submit": 1,
- "write": 1
- },
- {
- "cancel": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Accounts User"
- },
- {
- "cancel": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Customer"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-06-18 12:39:59.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "fieldname": "customer_section",
+ "fieldtype": "Section Break",
+ "label": "Customer",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "in_filter": 0,
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "search_index": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "PI/2011/\nSO\nSO/10-11/\nSO1112",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Customer",
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Address",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_mobile",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Mobile No",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_email",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Contact Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "default": "Sales",
+ "fieldname": "order_type",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Order Type",
+ "oldfieldname": "order_type",
+ "oldfieldtype": "Select",
+ "options": "\nSales\nMaintenance",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "description": "Select the relevant company name if you have multiple companies.",
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "default": "Today",
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Sales Order Date",
+ "no_copy": 1,
+ "oldfieldname": "transaction_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "160px"
+ },
+ {
+ "depends_on": "eval:doc.order_type == 'Sales'",
+ "fieldname": "delivery_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Delivery Date",
+ "oldfieldname": "delivery_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 0,
+ "search_index": 1,
+ "width": "160px"
+ },
+ {
+ "description": "Customer's Purchase Order Number",
+ "fieldname": "po_no",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "PO No",
+ "oldfieldname": "po_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "depends_on": "eval:doc.po_no",
+ "description": "Customer's Purchase Order Date",
+ "fieldname": "po_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "label": "PO Date",
+ "oldfieldname": "po_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "shipping_address_name",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Shipping Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "shipping_address",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "in_filter": 0,
+ "label": "Shipping Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "sec_break45",
+ "fieldtype": "Section Break",
+ "label": "Currency and Price List",
+ "options": "icon-tag",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "label": "Currency",
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "description": "Rate at which customer's currency is converted to company's base currency",
+ "fieldname": "conversion_rate",
+ "fieldtype": "Float",
+ "label": "Exchange Rate",
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "selling_price_list",
+ "fieldtype": "Link",
+ "label": "Price List",
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Select",
+ "options": "Price List",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "price_list_currency",
+ "fieldtype": "Link",
+ "label": "Price List Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "description": "Rate at which Price list currency is converted to company's base currency",
+ "fieldname": "plc_conversion_rate",
+ "fieldtype": "Float",
+ "label": "Price List Exchange Rate",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "items",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "sales_order_details",
+ "fieldtype": "Table",
+ "label": "Sales Order Items",
+ "oldfieldname": "sales_order_details",
+ "oldfieldtype": "Table",
+ "options": "Sales Order Item",
+ "permlevel": 0,
+ "print_hide": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Display all the individual items delivered with the main items",
+ "fieldname": "packing_list",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "label": "Packing List",
+ "oldfieldtype": "Section Break",
+ "options": "icon-suitcase",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "packing_details",
+ "fieldtype": "Table",
+ "label": "Packing Details",
+ "oldfieldname": "packing_details",
+ "oldfieldtype": "Table",
+ "options": "Packed Item",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "section_break_31",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total_export",
+ "fieldtype": "Currency",
+ "label": "Net Total",
+ "options": "currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_33",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "label": "Net Total (Company Currency)",
+ "oldfieldname": "net_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "taxes",
+ "fieldtype": "Section Break",
+ "label": "Taxes and Charges",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 0
+ },
+ {
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "label": "Taxes and Charges",
+ "oldfieldname": "charge",
+ "oldfieldtype": "Link",
+ "options": "Sales Taxes and Charges Master",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "column_break_38",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "shipping_rule",
+ "fieldtype": "Link",
+ "label": "Shipping Rule",
+ "oldfieldtype": "Button",
+ "options": "Shipping Rule",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "section_break_40",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges",
+ "fieldtype": "Table",
+ "label": "Sales Taxes and Charges",
+ "oldfieldname": "other_charges",
+ "oldfieldtype": "Table",
+ "options": "Sales Taxes and Charges",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_calculation",
+ "fieldtype": "HTML",
+ "label": "Taxes and Charges Calculation",
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
+ "print_hide": 0
+ },
+ {
+ "fieldname": "section_break_43",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_total_export",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Total",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_46",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_total",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Total (Company Currency)",
+ "oldfieldname": "other_charges_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "discount_amount",
+ "fieldtype": "Currency",
+ "label": "Discount Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "label": "Totals",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "grand_total_export",
+ "fieldtype": "Currency",
+ "label": "Grand Total",
+ "oldfieldname": "grand_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "rounded_total_export",
+ "fieldtype": "Currency",
+ "label": "Rounded Total",
+ "oldfieldname": "rounded_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "in_words_export",
+ "fieldtype": "Data",
+ "label": "In Words",
+ "oldfieldname": "in_words_export",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "width": "50%"
+ },
+ {
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "label": "Grand Total (Company Currency)",
+ "oldfieldname": "grand_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "rounded_total",
+ "fieldtype": "Currency",
+ "label": "Rounded Total (Company Currency)",
+ "oldfieldname": "rounded_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "description": "In Words will be visible once you save the Sales Order.",
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "label": "In Words (Company Currency)",
+ "oldfieldname": "in_words",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "label": "Terms and Conditions",
+ "oldfieldtype": "Section Break",
+ "options": "icon-legal",
+ "permlevel": 0,
+ "print_hide": 0
+ },
+ {
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "label": "Terms",
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "print_hide": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "label": "Terms and Conditions Details",
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0,
+ "print_hide": 0
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_info",
+ "fieldtype": "Section Break",
+ "label": "Contact Info",
+ "options": "icon-bullhorn",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "col_break45",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Customer Group",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "col_break46",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Customer Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Contact Person",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "description": "Track this Sales Order against any Project",
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Project Name",
+ "oldfieldname": "project_name",
+ "oldfieldtype": "Link",
+ "options": "Project",
+ "permlevel": 0,
+ "search_index": 1
+ },
+ {
+ "depends_on": "eval:doc.source == 'Campaign'",
+ "fieldname": "campaign",
+ "fieldtype": "Link",
+ "label": "Campaign",
+ "oldfieldname": "campaign",
+ "oldfieldtype": "Link",
+ "options": "Campaign",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "source",
+ "fieldtype": "Select",
+ "label": "Source",
+ "oldfieldname": "source",
+ "oldfieldtype": "Select",
+ "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "width": "50%"
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "letter_head",
+ "fieldtype": "Select",
+ "label": "Letter Head",
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "link:Letter Head",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "label": "Print Heading",
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "section_break_78",
+ "fieldtype": "Section Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "width": "50%"
+ },
+ {
+ "default": "Draft",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nDraft\nSubmitted\nStopped\nCancelled",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "delivery_status",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "label": "Delivery Status",
+ "no_copy": 1,
+ "options": "Delivered\nNot Delivered\nPartly Delivered\nClosed\nNot Applicable",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "description": "% of materials delivered against this Sales Order",
+ "fieldname": "per_delivered",
+ "fieldtype": "Percent",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "% Delivered",
+ "no_copy": 1,
+ "oldfieldname": "per_delivered",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "column_break_81",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "description": "% of materials billed against this Sales Order",
+ "fieldname": "per_billed",
+ "fieldtype": "Percent",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "% Amount Billed",
+ "no_copy": 1,
+ "oldfieldname": "per_billed",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "billing_status",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "label": "Billing Status",
+ "no_copy": 1,
+ "options": "Billed\nNot Billed\nPartly Billed\nClosed",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "sales_team_section_break",
+ "fieldtype": "Section Break",
+ "label": "Sales Team",
+ "oldfieldtype": "Section Break",
+ "options": "icon-group",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "sales_partner",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Sales Partner",
+ "oldfieldname": "sales_partner",
+ "oldfieldtype": "Link",
+ "options": "Sales Partner",
+ "permlevel": 0,
+ "print_hide": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "column_break7",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "width": "50%"
+ },
+ {
+ "fieldname": "commission_rate",
+ "fieldtype": "Float",
+ "label": "Commission Rate",
+ "oldfieldname": "commission_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "total_commission",
+ "fieldtype": "Currency",
+ "label": "Total Commission",
+ "oldfieldname": "total_commission",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "section_break1",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "sales_team",
+ "fieldtype": "Table",
+ "label": "Sales Team1",
+ "oldfieldname": "sales_team",
+ "oldfieldtype": "Table",
+ "options": "Sales Team",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "is_submittable": 1,
+ "issingle": 0,
+ "modified": "2014-01-28 18:47:42.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales Order",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "Accounts User"
+ },
+ {
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "Customer"
+ }
+ ],
+ "read_only_onload": 1,
+ "search_fields": "status,transaction_date,customer,customer_name, territory,order_type,company"
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py
index e325aeb..869350c 100644
--- a/erpnext/selling/doctype/sales_order/test_sales_order.py
+++ b/erpnext/selling/doctype/sales_order/test_sales_order.py
@@ -80,7 +80,7 @@
_insert_purchase_receipt(so.doclist[1].item_code)
- dn = frappe.bean(frappe.copy_doclist(dn_test_records[0]))
+ dn = frappe.bean(frappe.copy_doc(dn_test_records[0]))
dn.doclist[1].item_code = so.doclist[1].item_code
dn.doclist[1].against_sales_order = so.doc.name
dn.doclist[1].prevdoc_detail_docname = so.doclist[1].name
@@ -199,7 +199,7 @@
# change item in test so record
- test_record = frappe.copy_doclist(test_records[0])
+ test_record = frappe.copy_doc(test_records[0])
test_record[1]["item_code"] = "_Test Sales BOM Item"
# reset bin
@@ -248,7 +248,7 @@
from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records
# change item in test so record
- test_record = frappe.copy_doclist(test_records[0])
+ test_record = frappe.copy_doc(test_records[0])
test_record[1]["item_code"] = "_Test Sales BOM Item"
# reset bin
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.py b/erpnext/selling/doctype/sales_order_item/sales_order_item.py
index 26c87f1..ef2ad09 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.py
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SalesOrderItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.txt b/erpnext/selling/doctype/sales_order_item/sales_order_item.txt
index 7e471e4..9d0ae0e 100644
--- a/erpnext/selling/doctype/sales_order_item/sales_order_item.txt
+++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.txt
@@ -1,460 +1,447 @@
-[
- {
- "creation": "2013-03-07 11:42:58",
- "docstatus": 0,
- "modified": "2014-02-28 11:20:05",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "SOD/.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Selling",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Sales Order Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Sales Order Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "print_width": "150px",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_item_code",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Customer's Item Code",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_list_view": 0,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150",
- "read_only": 0,
- "reqd": 1,
- "width": "150"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "print_width": "300px",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "quantity_and_rate",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Quantity and Rate"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Quantity",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate",
- "oldfieldname": "ref_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 1,
- "print_width": "70px",
- "read_only": 1,
- "reqd": 0,
- "width": "70px"
- },
- {
- "doctype": "DocField",
- "fieldname": "discount_percentage",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Discount(%)",
- "oldfieldname": "adj_rate",
- "oldfieldtype": "Float",
- "print_hide": 1,
- "print_width": "70px",
- "read_only": 0,
- "width": "70px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "hidden": 0,
- "in_list_view": 0,
- "label": "UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "print_width": "70px",
- "read_only": 1,
- "reqd": 0,
- "width": "70px"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate (Company Currency)",
- "oldfieldname": "base_ref_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_simple1",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Rate",
- "oldfieldname": "export_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_width": "100px",
- "read_only": 0,
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Amount",
- "no_copy": 0,
- "oldfieldname": "export_amount",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Basic Rate (Company Currency)",
- "oldfieldname": "basic_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_amount",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Amount (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_price",
- "fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse_and_reference",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Warehouse and Reference"
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Reserved Warehouse",
- "no_copy": 0,
- "oldfieldname": "reserved_warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 0,
- "reqd": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_docname",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Quotation",
- "no_copy": 1,
- "oldfieldname": "prevdoc_docname",
- "oldfieldtype": "Link",
- "options": "Quotation",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Link",
- "hidden": 1,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Brand Name",
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 1,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Item Group",
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "page_break",
- "fieldtype": "Check",
- "in_list_view": 0,
- "label": "Page Break",
- "oldfieldname": "page_break",
- "oldfieldtype": "Check",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break4",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "projected_qty",
- "fieldtype": "Float",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Projected Qty",
- "no_copy": 1,
- "oldfieldname": "projected_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "70px",
- "read_only": 1,
- "width": "70px"
- },
- {
- "doctype": "DocField",
- "fieldname": "actual_qty",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Actual Qty",
- "no_copy": 1,
- "print_hide": 1,
- "print_width": "70px",
- "read_only": 1,
- "width": "70px"
- },
- {
- "doctype": "DocField",
- "fieldname": "delivered_qty",
- "fieldtype": "Float",
- "hidden": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Delivered Qty",
- "no_copy": 1,
- "oldfieldname": "delivered_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "search_index": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "billed_amt",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Billed Amt",
- "no_copy": 1,
- "options": "currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "description": "For Production",
- "doctype": "DocField",
- "fieldname": "planned_qty",
- "fieldtype": "Float",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Planned Quantity",
- "no_copy": 1,
- "oldfieldname": "planned_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "50px",
- "read_only": 1,
- "report_hide": 1,
- "width": "50px"
- },
- {
- "description": "For Production",
- "doctype": "DocField",
- "fieldname": "produced_qty",
- "fieldtype": "Float",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Produced Quantity",
- "oldfieldname": "produced_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "50px",
- "read_only": 1,
- "report_hide": 1,
- "width": "50px"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_tax_rate",
- "fieldtype": "Small Text",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Item Tax Rate",
- "oldfieldname": "item_tax_rate",
- "oldfieldtype": "Small Text",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "transaction_date",
- "fieldtype": "Date",
- "hidden": 1,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Sales Order Date",
- "oldfieldname": "transaction_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 1,
- "search_index": 0
- }
-]
\ No newline at end of file
+{
+ "autoname": "SOD/.#####",
+ "creation": "2013-03-07 11:42:58.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "customer_item_code",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Customer's Item Code",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_list_view": 0,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "150"
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Quantity and Rate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Quantity",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate",
+ "oldfieldname": "ref_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "70px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "70px"
+ },
+ {
+ "fieldname": "discount_percentage",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Discount(%)",
+ "oldfieldname": "adj_rate",
+ "oldfieldtype": "Float",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "70px",
+ "read_only": 0,
+ "width": "70px"
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_list_view": 0,
+ "label": "UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_width": "70px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "70px"
+ },
+ {
+ "fieldname": "base_price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate (Company Currency)",
+ "oldfieldname": "base_ref_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "section_break_simple1",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Rate",
+ "oldfieldname": "export_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "no_copy": 0,
+ "oldfieldname": "export_amount",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "base_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Basic Rate (Company Currency)",
+ "oldfieldname": "basic_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "base_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Amount (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "warehouse_and_reference",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Warehouse and Reference",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Reserved Warehouse",
+ "no_copy": 0,
+ "oldfieldname": "reserved_warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 0,
+ "reqd": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "prevdoc_docname",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Quotation",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_docname",
+ "oldfieldtype": "Link",
+ "options": "Quotation",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Brand Name",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Item Group",
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "in_list_view": 0,
+ "label": "Page Break",
+ "oldfieldname": "page_break",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "projected_qty",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Projected Qty",
+ "no_copy": 1,
+ "oldfieldname": "projected_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "70px",
+ "read_only": 1,
+ "width": "70px"
+ },
+ {
+ "fieldname": "actual_qty",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Actual Qty",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "70px",
+ "read_only": 1,
+ "width": "70px"
+ },
+ {
+ "fieldname": "delivered_qty",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Delivered Qty",
+ "no_copy": 1,
+ "oldfieldname": "delivered_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "search_index": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "billed_amt",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Billed Amt",
+ "no_copy": 1,
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "description": "For Production",
+ "fieldname": "planned_qty",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Planned Quantity",
+ "no_copy": 1,
+ "oldfieldname": "planned_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "50px",
+ "read_only": 1,
+ "report_hide": 1,
+ "width": "50px"
+ },
+ {
+ "description": "For Production",
+ "fieldname": "produced_qty",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Produced Quantity",
+ "oldfieldname": "produced_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "50px",
+ "read_only": 1,
+ "report_hide": 1,
+ "width": "50px"
+ },
+ {
+ "fieldname": "item_tax_rate",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Item Tax Rate",
+ "oldfieldname": "item_tax_rate",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "hidden": 1,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Sales Order Date",
+ "oldfieldname": "transaction_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1,
+ "search_index": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-28 11:20:05.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales Order Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_team/sales_team.py b/erpnext/selling/doctype/sales_team/sales_team.py
index 26c87f1..01d38d2 100644
--- a/erpnext/selling/doctype/sales_team/sales_team.py
+++ b/erpnext/selling/doctype/sales_team/sales_team.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SalesTeam(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_team/sales_team.txt b/erpnext/selling/doctype/sales_team/sales_team.txt
index d012cb4..dda6046 100644
--- a/erpnext/selling/doctype/sales_team/sales_team.txt
+++ b/erpnext/selling/doctype/sales_team/sales_team.txt
@@ -1,120 +1,107 @@
-[
- {
- "creation": "2013-04-19 13:30:51",
- "docstatus": 0,
- "modified": "2013-12-31 19:00:14",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Selling",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Sales Team",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Sales Team"
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_person",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Sales Person",
- "oldfieldname": "sales_person",
- "oldfieldtype": "Link",
- "options": "Sales Person",
- "print_width": "200px",
- "reqd": 1,
- "search_index": 1,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_designation",
- "fieldtype": "Data",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Designation",
- "oldfieldname": "sales_designation",
- "oldfieldtype": "Data",
- "print_width": "100px",
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_no",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 1,
- "label": "Contact No.",
- "oldfieldname": "contact_no",
- "oldfieldtype": "Data",
- "print_width": "100px",
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "allocated_percentage",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Contribution (%)",
- "oldfieldname": "allocated_percentage",
- "oldfieldtype": "Currency",
- "print_width": "100px",
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "allocated_amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Contribution to Net Total",
- "oldfieldname": "allocated_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_width": "120px",
- "read_only": 1,
- "reqd": 0,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "incentives",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Incentives",
- "oldfieldname": "incentives",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "parenttype",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Parenttype",
- "oldfieldname": "parenttype",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "search_index": 1
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-19 13:30:51.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "sales_person",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Sales Person",
+ "oldfieldname": "sales_person",
+ "oldfieldtype": "Link",
+ "options": "Sales Person",
+ "permlevel": 0,
+ "print_width": "200px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "sales_designation",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Designation",
+ "oldfieldname": "sales_designation",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_width": "100px",
+ "width": "100px"
+ },
+ {
+ "fieldname": "contact_no",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 1,
+ "label": "Contact No.",
+ "oldfieldname": "contact_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_width": "100px",
+ "width": "100px"
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "allocated_percentage",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Contribution (%)",
+ "oldfieldname": "allocated_percentage",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "100px",
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "allocated_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Contribution to Net Total",
+ "oldfieldname": "allocated_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_width": "120px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "120px"
+ },
+ {
+ "fieldname": "incentives",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Incentives",
+ "oldfieldname": "incentives",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "parenttype",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Parenttype",
+ "oldfieldname": "parenttype",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "search_index": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-31 19:00:14.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales Team",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.py b/erpnext/selling/doctype/selling_settings/selling_settings.py
index 5b44c7b..6823fa1 100644
--- a/erpnext/selling/doctype/selling_settings/selling_settings.py
+++ b/erpnext/selling/doctype/selling_settings/selling_settings.py
@@ -6,9 +6,9 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class SellingSettings(Document):
def validate(self):
for key in ["cust_master_name", "customer_group", "territory", "maintain_same_sales_rate",
diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.txt b/erpnext/selling/doctype/selling_settings/selling_settings.txt
index 24d5c28..ade8449 100644
--- a/erpnext/selling/doctype/selling_settings/selling_settings.txt
+++ b/erpnext/selling/doctype/selling_settings/selling_settings.txt
@@ -1,109 +1,90 @@
-[
- {
- "creation": "2013-06-25 10:25:16",
- "docstatus": 0,
- "modified": "2014-02-19 18:35:36",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "description": "Settings for Selling Module",
- "doctype": "DocType",
- "document_type": "Other",
- "icon": "icon-cog",
- "issingle": 1,
- "module": "Selling",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Selling Settings",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Selling Settings",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "role": "System Manager",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Selling Settings"
- },
- {
- "default": "Customer Name",
- "doctype": "DocField",
- "fieldname": "cust_master_name",
- "fieldtype": "Select",
- "label": "Customer Naming By",
- "options": "Customer Name\nNaming Series"
- },
- {
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "label": "Default Customer Group",
- "options": "Customer Group"
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "label": "Default Territory",
- "options": "Territory"
- },
- {
- "doctype": "DocField",
- "fieldname": "selling_price_list",
- "fieldtype": "Link",
- "label": "Default Price List",
- "options": "Price List"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_5",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "so_required",
- "fieldtype": "Select",
- "label": "Sales Order Required",
- "options": "No\nYes"
- },
- {
- "doctype": "DocField",
- "fieldname": "dn_required",
- "fieldtype": "Select",
- "label": "Delivery Note Required",
- "options": "No\nYes"
- },
- {
- "doctype": "DocField",
- "fieldname": "maintain_same_sales_rate",
- "fieldtype": "Check",
- "label": "Maintain Same Rate Throughout Sales Cycle"
- },
- {
- "doctype": "DocField",
- "fieldname": "editable_price_list_rate",
- "fieldtype": "Check",
- "label": "Allow user to edit Price List Rate in transactions"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-25 10:25:16.000000",
+ "description": "Settings for Selling Module",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "fields": [
+ {
+ "default": "Customer Name",
+ "fieldname": "cust_master_name",
+ "fieldtype": "Select",
+ "label": "Customer Naming By",
+ "options": "Customer Name\nNaming Series",
+ "permlevel": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "label": "Default Customer Group",
+ "options": "Customer Group",
+ "permlevel": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "label": "Default Territory",
+ "options": "Territory",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "selling_price_list",
+ "fieldtype": "Link",
+ "label": "Default Price List",
+ "options": "Price List",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break_5",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "so_required",
+ "fieldtype": "Select",
+ "label": "Sales Order Required",
+ "options": "No\nYes",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "dn_required",
+ "fieldtype": "Select",
+ "label": "Delivery Note Required",
+ "options": "No\nYes",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "maintain_same_sales_rate",
+ "fieldtype": "Check",
+ "label": "Maintain Same Rate Throughout Sales Cycle",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "editable_price_list_rate",
+ "fieldtype": "Check",
+ "label": "Allow user to edit Price List Rate in transactions",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-cog",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2014-02-19 18:35:36.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Selling Settings",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "System Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sms_center/sms_center.py b/erpnext/selling/doctype/sms_center/sms_center.py
index 7da6f32..9aeb5ee 100644
--- a/erpnext/selling/doctype/sms_center/sms_center.py
+++ b/erpnext/selling/doctype/sms_center/sms_center.py
@@ -8,10 +8,9 @@
from frappe.model.code import get_obj
from frappe import msgprint, _
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class SmsCenter(Document):
def create_receiver_list(self):
rec, where_clause = '', ''
diff --git a/erpnext/selling/doctype/sms_center/sms_center.txt b/erpnext/selling/doctype/sms_center/sms_center.txt
index efa7a45..56143c4 100644
--- a/erpnext/selling/doctype/sms_center/sms_center.txt
+++ b/erpnext/selling/doctype/sms_center/sms_center.txt
@@ -1,148 +1,129 @@
-[
- {
- "creation": "2013-01-10 16:34:22",
- "docstatus": 0,
- "modified": "2014-01-30 15:29:04",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 0,
- "allow_copy": 1,
- "doctype": "DocType",
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "icon-mobile-phone",
- "in_create": 0,
- "issingle": 1,
- "module": "Selling",
- "name": "__common__",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "SMS Center",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "doctype": "DocPerm",
- "export": 0,
- "import": 0,
- "name": "__common__",
- "parent": "SMS Center",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "report": 0,
- "role": "System Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "SMS Center"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "send_to",
- "fieldtype": "Select",
- "label": "Send To",
- "options": "\nAll Contact\nAll Customer Contact\nAll Supplier Contact\nAll Sales Partner Contact\nAll Lead (Open)\nAll Employee (Active)\nAll Sales Person"
- },
- {
- "depends_on": "eval:doc.send_to=='All Customer Contact'",
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "label": "Customer",
- "options": "Customer"
- },
- {
- "depends_on": "eval:doc.send_to=='All Supplier Contact'",
- "doctype": "DocField",
- "fieldname": "supplier",
- "fieldtype": "Link",
- "label": "Supplier",
- "options": "Supplier"
- },
- {
- "depends_on": "eval:doc.send_to=='All Employee (Active)'",
- "doctype": "DocField",
- "fieldname": "department",
- "fieldtype": "Select",
- "label": "Department",
- "options": "link:Department"
- },
- {
- "depends_on": "eval:doc.send_to=='All Employee (Active)'",
- "doctype": "DocField",
- "fieldname": "branch",
- "fieldtype": "Select",
- "label": "Branch",
- "options": "link:Branch"
- },
- {
- "doctype": "DocField",
- "fieldname": "create_receiver_list",
- "fieldtype": "Button",
- "label": "Create Receiver List",
- "options": "create_receiver_list"
- },
- {
- "doctype": "DocField",
- "fieldname": "receiver_list",
- "fieldtype": "Code",
- "label": "Receiver List"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break9",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "description": "Messages greater than 160 characters will be split into multiple messages",
- "doctype": "DocField",
- "fieldname": "message",
- "fieldtype": "Text",
- "label": "Message",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_words",
- "fieldtype": "Int",
- "label": "Total Words",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_messages",
- "fieldtype": "Int",
- "label": "Total Message(s)",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "send_sms",
- "fieldtype": "Button",
- "label": "Send SMS",
- "options": "send_sms"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 0,
+ "allow_copy": 1,
+ "creation": "2013-01-10 16:34:22.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "send_to",
+ "fieldtype": "Select",
+ "label": "Send To",
+ "options": "\nAll Contact\nAll Customer Contact\nAll Supplier Contact\nAll Sales Partner Contact\nAll Lead (Open)\nAll Employee (Active)\nAll Sales Person",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.send_to=='All Customer Contact'",
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "label": "Customer",
+ "options": "Customer",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.send_to=='All Supplier Contact'",
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "label": "Supplier",
+ "options": "Supplier",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.send_to=='All Employee (Active)'",
+ "fieldname": "department",
+ "fieldtype": "Select",
+ "label": "Department",
+ "options": "link:Department",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.send_to=='All Employee (Active)'",
+ "fieldname": "branch",
+ "fieldtype": "Select",
+ "label": "Branch",
+ "options": "link:Branch",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "create_receiver_list",
+ "fieldtype": "Button",
+ "label": "Create Receiver List",
+ "options": "create_receiver_list",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "receiver_list",
+ "fieldtype": "Code",
+ "label": "Receiver List",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break9",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "description": "Messages greater than 160 characters will be split into multiple messages",
+ "fieldname": "message",
+ "fieldtype": "Text",
+ "label": "Message",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "total_words",
+ "fieldtype": "Int",
+ "label": "Total Words",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "total_messages",
+ "fieldtype": "Int",
+ "label": "Total Message(s)",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "send_sms",
+ "fieldtype": "Button",
+ "label": "Send SMS",
+ "options": "send_sms",
+ "permlevel": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "icon-mobile-phone",
+ "idx": 1,
+ "in_create": 0,
+ "issingle": 1,
+ "modified": "2014-01-30 15:29:04.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "SMS Center",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "export": 0,
+ "import": 0,
+ "permlevel": 0,
+ "read": 1,
+ "report": 0,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 1
+}
\ No newline at end of file
diff --git a/erpnext/selling/page/sales_analytics/sales_analytics.txt b/erpnext/selling/page/sales_analytics/sales_analytics.txt
index 8753be6..12bc487 100644
--- a/erpnext/selling/page/sales_analytics/sales_analytics.txt
+++ b/erpnext/selling/page/sales_analytics/sales_analytics.txt
@@ -1,41 +1,26 @@
-[
- {
- "creation": "2012-09-21 20:15:12",
- "docstatus": 0,
- "modified": "2013-07-11 14:43:59",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-bar-chart",
- "module": "Selling",
- "name": "__common__",
- "page_name": "sales-analytics",
- "standard": "Yes",
- "title": "Sales Analytics"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "sales-analytics",
- "parentfield": "roles",
- "parenttype": "Page"
- },
- {
- "doctype": "Page",
- "name": "sales-analytics"
- },
- {
- "doctype": "Page Role",
- "role": "Analytics"
- },
- {
- "doctype": "Page Role",
- "role": "Sales Manager"
- },
- {
- "doctype": "Page Role",
- "role": "Maintenance Manager"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-09-21 20:15:12.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-bar-chart",
+ "idx": 1,
+ "modified": "2013-07-11 14:43:59.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "sales-analytics",
+ "owner": "Administrator",
+ "page_name": "sales-analytics",
+ "roles": [
+ {
+ "role": "Analytics"
+ },
+ {
+ "role": "Sales Manager"
+ },
+ {
+ "role": "Maintenance Manager"
+ }
+ ],
+ "standard": "Yes",
+ "title": "Sales Analytics"
+}
\ No newline at end of file
diff --git a/erpnext/selling/page/sales_browser/sales_browser.py b/erpnext/selling/page/sales_browser/sales_browser.py
index e53515c..42839f3 100644
--- a/erpnext/selling/page/sales_browser/sales_browser.py
+++ b/erpnext/selling/page/sales_browser/sales_browser.py
@@ -21,8 +21,7 @@
@frappe.whitelist()
def add_node():
- # from frappe.model.doc import Document
- ctype = frappe.form_dict.get('ctype')
+ # ctype = frappe.form_dict.get('ctype')
parent_field = 'parent_' + ctype.lower().replace(' ', '_')
name_field = ctype.lower().replace(' ', '_') + '_name'
diff --git a/erpnext/selling/page/sales_browser/sales_browser.txt b/erpnext/selling/page/sales_browser/sales_browser.txt
index 5a047e2..ace9203 100644
--- a/erpnext/selling/page/sales_browser/sales_browser.txt
+++ b/erpnext/selling/page/sales_browser/sales_browser.txt
@@ -1,56 +1,37 @@
-[
- {
- "creation": "2012-06-14 15:07:26",
- "docstatus": 0,
- "modified": "2013-07-11 14:43:56",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-sitemap",
- "module": "Selling",
- "name": "__common__",
- "page_name": "Sales Browser",
- "standard": "Yes"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "Sales Browser",
- "parentfield": "roles",
- "parenttype": "Page"
- },
- {
- "doctype": "Page",
- "name": "Sales Browser"
- },
- {
- "doctype": "Page Role",
- "role": "Sales Master Manager"
- },
- {
- "doctype": "Page Role",
- "role": "Material Master Manager"
- },
- {
- "doctype": "Page Role",
- "role": "Accounts Manager"
- },
- {
- "doctype": "Page Role",
- "role": "Sales Master Manager"
- },
- {
- "doctype": "Page Role",
- "role": "Purchase Manager"
- },
- {
- "doctype": "Page Role",
- "role": "Purchase Master Manager"
- },
- {
- "doctype": "Page Role",
- "role": "Material Manager"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-06-14 15:07:26.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-sitemap",
+ "idx": 1,
+ "modified": "2013-07-11 14:43:56.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales Browser",
+ "owner": "Administrator",
+ "page_name": "Sales Browser",
+ "roles": [
+ {
+ "role": "Sales Master Manager"
+ },
+ {
+ "role": "Material Master Manager"
+ },
+ {
+ "role": "Accounts Manager"
+ },
+ {
+ "role": "Sales Master Manager"
+ },
+ {
+ "role": "Purchase Manager"
+ },
+ {
+ "role": "Purchase Master Manager"
+ },
+ {
+ "role": "Material Manager"
+ }
+ ],
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/selling/page/sales_funnel/sales_funnel.txt b/erpnext/selling/page/sales_funnel/sales_funnel.txt
index b841f20..3a50968 100644
--- a/erpnext/selling/page/sales_funnel/sales_funnel.txt
+++ b/erpnext/selling/page/sales_funnel/sales_funnel.txt
@@ -1,33 +1,20 @@
-[
- {
- "creation": "2013-10-04 13:17:18",
- "docstatus": 0,
- "modified": "2013-10-04 13:17:18",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-filter",
- "module": "Selling",
- "name": "__common__",
- "page_name": "sales-funnel",
- "standard": "Yes",
- "title": "Sales Funnel"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "sales-funnel",
- "parentfield": "roles",
- "parenttype": "Page",
- "role": "Sales Manager"
- },
- {
- "doctype": "Page",
- "name": "sales-funnel"
- },
- {
- "doctype": "Page Role"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-10-04 13:17:18.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-filter",
+ "idx": 1,
+ "modified": "2013-10-04 13:17:18.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "sales-funnel",
+ "owner": "Administrator",
+ "page_name": "sales-funnel",
+ "roles": [
+ {
+ "role": "Sales Manager"
+ }
+ ],
+ "standard": "Yes",
+ "title": "Sales Funnel"
+}
\ No newline at end of file
diff --git a/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt b/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt
index 6655caa..29b47c8 100644
--- a/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt
+++ b/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-21 13:40:05",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Selling",
- "name": "__common__",
- "ref_doctype": "Sales BOM",
- "report_name": "Available Stock for Packing Items",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Available Stock for Packing Items"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-21 13:40:05.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Available Stock for Packing Items",
+ "owner": "Administrator",
+ "ref_doctype": "Sales BOM",
+ "report_name": "Available Stock for Packing Items",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt
index 98ef3a9..b04e5da 100644
--- a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt
+++ b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-11-28 14:58:06",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Selling",
- "name": "__common__",
- "ref_doctype": "Customer",
- "report_name": "Customer Acquisition and Loyalty",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Customer Acquisition and Loyalty"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-11-28 14:58:06.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Customer Acquisition and Loyalty",
+ "owner": "Administrator",
+ "ref_doctype": "Customer",
+ "report_name": "Customer Acquisition and Loyalty",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt b/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt
index fbe5b77..9fe5291 100644
--- a/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt
+++ b/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2012-10-04 18:45:27",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Selling",
- "name": "__common__",
- "query": "SELECT\n\t`tabCustomer`.name as customer_id,\n\t`tabCustomer`.customer_name,\n\t`tabCustomer`.customer_group,\n\t`tabAddress`.address_line1,\n\t`tabAddress`.address_line2,\n\t`tabAddress`.city,\n\t`tabAddress`.state,\n\t`tabAddress`.pincode,\n\t`tabAddress`.country,\n\t`tabAddress`.is_primary_address, \n\t`tabContact`.first_name,\n\t`tabContact`.last_name,\n\t`tabContact`.phone,\n\t`tabContact`.mobile_no,\n\t`tabContact`.email_id,\n\t`tabContact`.is_primary_contact\nFROM\n\t`tabCustomer`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.customer=`tabCustomer`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.customer=`tabCustomer`.name\n\t)\nWHERE\n\t`tabCustomer`.docstatus<2\nORDER BY\n\t`tabCustomer`.name asc",
- "ref_doctype": "Customer",
- "report_name": "Customer Addresses And Contacts",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Customer Addresses And Contacts"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-10-04 18:45:27.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Customer Addresses And Contacts",
+ "owner": "Administrator",
+ "query": "SELECT\n\t`tabCustomer`.name as customer_id,\n\t`tabCustomer`.customer_name,\n\t`tabCustomer`.customer_group,\n\t`tabAddress`.address_line1,\n\t`tabAddress`.address_line2,\n\t`tabAddress`.city,\n\t`tabAddress`.state,\n\t`tabAddress`.pincode,\n\t`tabAddress`.country,\n\t`tabAddress`.is_primary_address, \n\t`tabContact`.first_name,\n\t`tabContact`.last_name,\n\t`tabContact`.phone,\n\t`tabContact`.mobile_no,\n\t`tabContact`.email_id,\n\t`tabContact`.is_primary_contact\nFROM\n\t`tabCustomer`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.customer=`tabCustomer`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.customer=`tabCustomer`.name\n\t)\nWHERE\n\t`tabCustomer`.docstatus<2\nORDER BY\n\t`tabCustomer`.name asc",
+ "ref_doctype": "Customer",
+ "report_name": "Customer Addresses And Contacts",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt b/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt
index 54ea37e..04b662e 100644
--- a/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt
+++ b/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-07 12:27:07",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Selling",
- "name": "__common__",
- "ref_doctype": "Sales Order",
- "report_name": "Customers Not Buying Since Long Time ",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Customers Not Buying Since Long Time"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-07 12:27:07.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Customers Not Buying Since Long Time",
+ "owner": "Administrator",
+ "ref_doctype": "Sales Order",
+ "report_name": "Customers Not Buying Since Long Time ",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt
index d03ca92..27bd153 100644
--- a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt
+++ b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt
@@ -1,25 +1,18 @@
-[
- {
- "creation": "2013-05-23 17:42:24",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "disabled": 0,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Selling",
- "name": "__common__",
- "query": "select\n so_item.item_code as \"Item Code:Link/Item:120\",\n\tso_item.item_name as \"Item Name::120\",\n\tso_item.description as \"Description::150\",\n\tso_item.qty as \"Qty:Float:100\",\n\tso_item.stock_uom as \"UOM:Link/UOM:80\",\n\tso_item.base_rate as \"Rate:Currency:120\",\n\tso_item.base_amount as \"Amount:Currency:120\",\n\tso.name as \"Sales Order:Link/Sales Order:120\",\n\tso.transaction_date as \"Transaction Date:Date:140\",\n\tso.customer as \"Customer:Link/Customer:130\",\n\tso.territory as \"Territory:Link/Territory:130\",\n so.project_name as \"Project:Link/Project:130\",\n\tifnull(so_item.delivered_qty, 0) as \"Delivered Qty:Float:120\",\n\tifnull(so_item.billed_amt, 0) as \"Billed Amount:Currency:120\"\nfrom\n\t`tabSales Order` so, `tabSales Order Item` so_item\nwhere\n\tso.name = so_item.parent\n\tand so.docstatus = 1\norder by so.name desc",
- "ref_doctype": "Sales Order",
- "report_name": "Item-wise Sales History",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Item-wise Sales History"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-05-23 17:42:24.000000",
+ "disabled": 0,
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Item-wise Sales History",
+ "owner": "Administrator",
+ "query": "select\n so_item.item_code as \"Item Code:Link/Item:120\",\n\tso_item.item_name as \"Item Name::120\",\n\tso_item.description as \"Description::150\",\n\tso_item.qty as \"Qty:Float:100\",\n\tso_item.stock_uom as \"UOM:Link/UOM:80\",\n\tso_item.base_rate as \"Rate:Currency:120\",\n\tso_item.base_amount as \"Amount:Currency:120\",\n\tso.name as \"Sales Order:Link/Sales Order:120\",\n\tso.transaction_date as \"Transaction Date:Date:140\",\n\tso.customer as \"Customer:Link/Customer:130\",\n\tso.territory as \"Territory:Link/Territory:130\",\n so.project_name as \"Project:Link/Project:130\",\n\tifnull(so_item.delivered_qty, 0) as \"Delivered Qty:Float:120\",\n\tifnull(so_item.billed_amt, 0) as \"Billed Amount:Currency:120\"\nfrom\n\t`tabSales Order` so, `tabSales Order Item` so_item\nwhere\n\tso.name = so_item.parent\n\tand so.docstatus = 1\norder by so.name desc",
+ "ref_doctype": "Sales Order",
+ "report_name": "Item-wise Sales History",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/selling/report/lead_details/lead_details.txt b/erpnext/selling/report/lead_details/lead_details.txt
index 8c9f170..20c964b 100644
--- a/erpnext/selling/report/lead_details/lead_details.txt
+++ b/erpnext/selling/report/lead_details/lead_details.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-10-22 11:58:16",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Selling",
- "name": "__common__",
- "query": "SELECT\n `tabLead`.name as \"Lead Id:Link/Lead:120\",\n `tabLead`.lead_name as \"Lead Name::120\",\n\t`tabLead`.company_name as \"Company Name::120\",\n\t`tabLead`.status as \"Status::120\",\n\tconcat_ws(', ', \n\t\ttrim(',' from `tabAddress`.address_line1), \n\t\ttrim(',' from tabAddress.address_line2), \n\t\ttabAddress.state, tabAddress.pincode, tabAddress.country\n\t) as 'Address::180',\n\t`tabLead`.phone as \"Phone::100\",\n\t`tabLead`.mobile_no as \"Mobile No::100\",\n\t`tabLead`.email_id as \"Email Id::120\",\n\t`tabLead`.lead_owner as \"Lead Owner::120\",\n\t`tabLead`.source as \"Source::120\",\n\t`tabLead`.territory as \"Territory::120\",\n `tabLead`.owner as \"Owner:Link/User:120\"\nFROM\n\t`tabLead`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.lead=`tabLead`.name\n\t)\nWHERE\n\t`tabLead`.docstatus<2\nORDER BY\n\t`tabLead`.name asc",
- "ref_doctype": "Lead",
- "report_name": "Lead Details",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Lead Details"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-10-22 11:58:16.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Lead Details",
+ "owner": "Administrator",
+ "query": "SELECT\n `tabLead`.name as \"Lead Id:Link/Lead:120\",\n `tabLead`.lead_name as \"Lead Name::120\",\n\t`tabLead`.company_name as \"Company Name::120\",\n\t`tabLead`.status as \"Status::120\",\n\tconcat_ws(', ', \n\t\ttrim(',' from `tabAddress`.address_line1), \n\t\ttrim(',' from tabAddress.address_line2), \n\t\ttabAddress.state, tabAddress.pincode, tabAddress.country\n\t) as 'Address::180',\n\t`tabLead`.phone as \"Phone::100\",\n\t`tabLead`.mobile_no as \"Mobile No::100\",\n\t`tabLead`.email_id as \"Email Id::120\",\n\t`tabLead`.lead_owner as \"Lead Owner::120\",\n\t`tabLead`.source as \"Source::120\",\n\t`tabLead`.territory as \"Territory::120\",\n `tabLead`.owner as \"Owner:Link/User:120\"\nFROM\n\t`tabLead`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.lead=`tabLead`.name\n\t)\nWHERE\n\t`tabLead`.docstatus<2\nORDER BY\n\t`tabLead`.name asc",
+ "ref_doctype": "Lead",
+ "report_name": "Lead Details",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt b/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt
index 07b524b..b3282b9 100644
--- a/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt
+++ b/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-06-21 16:46:45",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Selling",
- "name": "__common__",
- "query": "select \n so_item.item_code as \"Item Code:Link/Item:120\",\n so_item.item_name as \"Item Name::120\",\n so_item.description as \"Description::120\",\n so.`name` as \"S.O. No.:Link/Sales Order:120\",\n so.`transaction_date` as \"Date:Date:120\",\n mr.name as \"Material Request:Link/Material Request:120\",\n so.customer as \"Customer:Link/Customer:120\",\n so.territory as \"Terretory:Link/Territory:120\",\n sum(so_item.qty) as \"SO Qty:Float:100 \",\n sum(mr_item.qty) as \"Requested Qty:Float:100\"\nfrom\n `tabSales Order` so, `tabSales Order Item` so_item, \n `tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n so_item.`parent` = so.`name` and mr_item.sales_order_no = so.name\n and mr_item.parent = mr.name \n and so.docstatus = 1 and so.status != \"Stopped\" \n and mr.docstatus = 1 and mr.status != \"Stopped\"\ngroup by so.name, so_item.item_code\norder by so.name desc, so_item.item_code asc",
- "ref_doctype": "Sales Order",
- "report_name": "Pending SO Items For Purchase Request",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Pending SO Items For Purchase Request"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-21 16:46:45.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Pending SO Items For Purchase Request",
+ "owner": "Administrator",
+ "query": "select \n so_item.item_code as \"Item Code:Link/Item:120\",\n so_item.item_name as \"Item Name::120\",\n so_item.description as \"Description::120\",\n so.`name` as \"S.O. No.:Link/Sales Order:120\",\n so.`transaction_date` as \"Date:Date:120\",\n mr.name as \"Material Request:Link/Material Request:120\",\n so.customer as \"Customer:Link/Customer:120\",\n so.territory as \"Terretory:Link/Territory:120\",\n sum(so_item.qty) as \"SO Qty:Float:100 \",\n sum(mr_item.qty) as \"Requested Qty:Float:100\"\nfrom\n `tabSales Order` so, `tabSales Order Item` so_item, \n `tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n so_item.`parent` = so.`name` and mr_item.sales_order_no = so.name\n and mr_item.parent = mr.name \n and so.docstatus = 1 and so.status != \"Stopped\" \n and mr.docstatus = 1 and mr.status != \"Stopped\"\ngroup by so.name, so_item.item_code\norder by so.name desc, so_item.item_code asc",
+ "ref_doctype": "Sales Order",
+ "report_name": "Pending SO Items For Purchase Request",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/selling/report/quotation_trends/quotation_trends.txt b/erpnext/selling/report/quotation_trends/quotation_trends.txt
index 5db150f..6be53ac 100644
--- a/erpnext/selling/report/quotation_trends/quotation_trends.txt
+++ b/erpnext/selling/report/quotation_trends/quotation_trends.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-06-07 16:01:16",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 0,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Selling",
- "name": "__common__",
- "ref_doctype": "Quotation",
- "report_name": "Quotation Trends",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Quotation Trends"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 0,
+ "creation": "2013-06-07 16:01:16.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Quotation Trends",
+ "owner": "Administrator",
+ "ref_doctype": "Quotation",
+ "report_name": "Quotation Trends",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/selling/report/sales_order_trends/sales_order_trends.txt b/erpnext/selling/report/sales_order_trends/sales_order_trends.txt
index 6ac7595..cb08af1 100644
--- a/erpnext/selling/report/sales_order_trends/sales_order_trends.txt
+++ b/erpnext/selling/report/sales_order_trends/sales_order_trends.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-13 18:43:30",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Selling",
- "name": "__common__",
- "ref_doctype": "Sales Order",
- "report_name": "Sales Order Trends",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Sales Order Trends"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-13 18:43:30.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales Order Trends",
+ "owner": "Administrator",
+ "ref_doctype": "Sales Order",
+ "report_name": "Sales Order Trends",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt
index 56674e1..6c45ba9 100644
--- a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt
+++ b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-21 12:14:15",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Selling",
- "name": "__common__",
- "ref_doctype": "Sales Order",
- "report_name": "Sales Person Target Variance Item Group-Wise",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Sales Person Target Variance Item Group-Wise"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-21 12:14:15.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales Person Target Variance Item Group-Wise",
+ "owner": "Administrator",
+ "ref_doctype": "Sales Order",
+ "report_name": "Sales Person Target Variance Item Group-Wise",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt
index b1334c6..4ecba96 100644
--- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt
+++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-05-03 11:31:05",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Selling",
- "name": "__common__",
- "ref_doctype": "Sales Order",
- "report_name": "Sales Person-wise Transaction Summary",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Sales Person-wise Transaction Summary"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-05-03 11:31:05.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales Person-wise Transaction Summary",
+ "owner": "Administrator",
+ "ref_doctype": "Sales Order",
+ "report_name": "Sales Person-wise Transaction Summary",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt
index 5bce007..b03bb02 100644
--- a/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt
+++ b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-21 12:15:00",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Selling",
- "name": "__common__",
- "ref_doctype": "Sales Order",
- "report_name": "Territory Target Variance Item Group-Wise",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Territory Target Variance Item Group-Wise"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-21 12:15:00.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Territory Target Variance Item Group-Wise",
+ "owner": "Administrator",
+ "ref_doctype": "Sales Order",
+ "report_name": "Territory Target Variance Item Group-Wise",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 1dbbbfe..ce2a798 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -70,7 +70,7 @@
if(this.frm.fields_dict[this.fname].grid.get_field('batch_no')) {
this.frm.set_query("batch_no", this.fname, function(doc, cdt, cdn) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
if(!item.item_code) {
frappe.throw(frappe._("Please enter Item Code to get batch no"));
} else {
@@ -98,7 +98,7 @@
this.frm.toggle_display("customer_name",
(this.frm.doc.customer_name && this.frm.doc.customer_name!==this.frm.doc.customer));
if(this.frm.fields_dict.packing_details) {
- var packing_list_exists = this.frm.get_doclist({parentfield: "packing_details"}).length;
+ var packing_list_exists = (this.frm.doc.packing_details || []).length;
this.frm.toggle_display("packing_list", packing_list_exists ? true : false);
}
},
@@ -128,7 +128,7 @@
},
price_list_rate: function(doc, cdt, cdn) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
frappe.model.round_floats_in(item, ["price_list_rate", "discount_percentage"]);
item.rate = flt(item.price_list_rate * (1 - item.discount_percentage / 100.0),
@@ -138,7 +138,7 @@
},
discount_percentage: function(doc, cdt, cdn) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
if(!item.price_list_rate) {
item.discount_percentage = 0.0;
} else {
@@ -147,7 +147,7 @@
},
rate: function(doc, cdt, cdn) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
frappe.model.round_floats_in(item, ["rate", "price_list_rate"]);
if(item.price_list_rate) {
@@ -188,7 +188,7 @@
},
allocated_percentage: function(doc, cdt, cdn) {
- var sales_person = frappe.model.get_doc(cdt, cdn);
+ var sales_person = frappe.get_doc(cdt, cdn);
if(sales_person.allocated_percentage) {
sales_person.allocated_percentage = flt(sales_person.allocated_percentage,
@@ -203,7 +203,7 @@
},
warehouse: function(doc, cdt, cdn) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
if(item.item_code && item.warehouse) {
return this.frm.call({
method: "erpnext.selling.utils.get_available_qty",
@@ -434,8 +434,7 @@
calculate_contribution: function() {
var me = this;
- $.each(frappe.model.get_doclist(this.frm.doc.doctype, this.frm.doc.name,
- {parentfield: "sales_team"}), function(i, sales_person) {
+ $.each(this.frm.doc.doctype.sales_team || [], function(i, sales_person) {
frappe.model.round_floats_in(sales_person);
if(sales_person.allocated_percentage) {
sales_person.allocated_amount = flt(
@@ -545,8 +544,8 @@
// toggle columns
var item_grid = this.frm.fields_dict[this.fname].grid;
var show = (this.frm.doc.currency != company_currency) ||
- (frappe.model.get_doclist(cur_frm.doctype, cur_frm.docname,
- {parentfield: "other_charges", included_in_print_rate: 1}).length);
+ (cur_frm.doc.other_charges.filter(
+ function(d) { return d.included_in_print_rate===1}).length);
$.each(["base_rate", "base_price_list_rate", "base_amount"], function(i, fname) {
if(frappe.meta.get_docfield(item_grid.doctype, fname))
@@ -566,7 +565,7 @@
// Help for Sales BOM items
var set_sales_bom_help = function(doc) {
if(!cur_frm.fields_dict.packing_list) return;
- if (getchildren('Packed Item', doc.name, 'packing_details').length) {
+ if ((doc.packing_details || []).length) {
$(cur_frm.fields_dict.packing_list.row.wrapper).toggle(true);
if (inList(['Delivery Note', 'Sales Invoice'], doc.doctype)) {
diff --git a/erpnext/setup/doctype/applicable_territory/applicable_territory.py b/erpnext/setup/doctype/applicable_territory/applicable_territory.py
index cb42e2e..25478d6 100644
--- a/erpnext/setup/doctype/applicable_territory/applicable_territory.py
+++ b/erpnext/setup/doctype/applicable_territory/applicable_territory.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ApplicableTerritory(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/setup/doctype/applicable_territory/applicable_territory.txt b/erpnext/setup/doctype/applicable_territory/applicable_territory.txt
index 3a5b0f3..cc41933 100644
--- a/erpnext/setup/doctype/applicable_territory/applicable_territory.txt
+++ b/erpnext/setup/doctype/applicable_territory/applicable_territory.txt
@@ -1,37 +1,24 @@
-[
- {
- "creation": "2013-06-20 12:48:38",
- "docstatus": 0,
- "modified": "2013-12-20 19:22:53",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Setup",
- "name": "__common__"
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Territory",
- "name": "__common__",
- "options": "Territory",
- "parent": "Applicable Territory",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "reqd": 1
- },
- {
- "doctype": "DocType",
- "name": "Applicable Territory"
- },
- {
- "doctype": "DocField"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-20 12:48:38.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:22:53.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Applicable Territory",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/authorization_control/authorization_control.py b/erpnext/setup/doctype/authorization_control/authorization_control.py
index b37686a..9b8980c 100644
--- a/erpnext/setup/doctype/authorization_control/authorization_control.py
+++ b/erpnext/setup/doctype/authorization_control/authorization_control.py
@@ -12,9 +12,7 @@
from erpnext.utilities.transaction_base import TransactionBase
-class DocType(TransactionBase):
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+class AuthorizationControl(TransactionBase):
# Get Names of all Approving Users and Roles
diff --git a/erpnext/setup/doctype/authorization_control/authorization_control.txt b/erpnext/setup/doctype/authorization_control/authorization_control.txt
index c5628d2..da35634 100644
--- a/erpnext/setup/doctype/authorization_control/authorization_control.txt
+++ b/erpnext/setup/doctype/authorization_control/authorization_control.txt
@@ -1,19 +1,12 @@
-[
- {
- "creation": "2012-03-27 14:36:18",
- "docstatus": 0,
- "modified": "2013-12-20 19:22:54",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "issingle": 1,
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocType",
- "name": "Authorization Control"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-03-27 14:36:18.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-12-20 19:22:54.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Authorization Control",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.py b/erpnext/setup/doctype/authorization_rule/authorization_rule.py
index 71f5caf..5255e4c 100644
--- a/erpnext/setup/doctype/authorization_rule/authorization_rule.py
+++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.py
@@ -7,9 +7,9 @@
from frappe.utils import cint, cstr, flt, has_common
from frappe import msgprint
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class AuthorizationRule(Document):
def check_duplicate_entry(self):
diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.txt b/erpnext/setup/doctype/authorization_rule/authorization_rule.txt
index bd852d0..23c0600 100644
--- a/erpnext/setup/doctype/authorization_rule/authorization_rule.txt
+++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.txt
@@ -1,166 +1,147 @@
-[
- {
- "creation": "2013-01-10 16:34:22",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:25",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "AR.####",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-shield",
- "module": "Setup",
- "name": "__common__",
- "search_fields": "transaction,based_on,system_user,system_role,approving_user,approving_role"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Authorization Rule",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Authorization Rule",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Authorization Rule"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "transaction",
- "fieldtype": "Select",
- "label": "Transaction",
- "oldfieldname": "transaction",
- "oldfieldtype": "Select",
- "options": "\nDelivery Note\nPurchase Invoice\nPurchase Order\nPurchase Receipt\nQuotation\nSales Invoice\nSales Order\nAppraisal",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "based_on",
- "fieldtype": "Select",
- "label": "Based On",
- "oldfieldname": "based_on",
- "oldfieldtype": "Select",
- "options": "\nGrand Total\nAverage Discount\nCustomerwise Discount\nItemwise Discount\nNot Applicable",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "master_name",
- "fieldtype": "Link",
- "label": "Customer / Item Name",
- "oldfieldname": "master_name",
- "oldfieldtype": "Link",
- "options": "[Select]"
- },
- {
- "doctype": "DocField",
- "fieldname": "system_role",
- "fieldtype": "Link",
- "label": "Applicable To (Role)",
- "oldfieldname": "system_role",
- "oldfieldtype": "Link",
- "options": "Role"
- },
- {
- "doctype": "DocField",
- "fieldname": "system_user",
- "fieldtype": "Link",
- "label": "Applicable To (User)",
- "oldfieldname": "system_user",
- "oldfieldtype": "Link",
- "options": "User"
- },
- {
- "description": "This will be used for setting rule in HR module",
- "doctype": "DocField",
- "fieldname": "to_emp",
- "fieldtype": "Link",
- "label": "Applicable To (Employee)",
- "oldfieldname": "to_emp",
- "oldfieldtype": "Link",
- "options": "Employee",
- "search_index": 0
- },
- {
- "description": "This will be used for setting rule in HR module",
- "doctype": "DocField",
- "fieldname": "to_designation",
- "fieldtype": "Link",
- "label": "Applicable To (Designation)",
- "oldfieldname": "to_designation",
- "oldfieldtype": "Link",
- "options": "Designation",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "approving_role",
- "fieldtype": "Link",
- "label": "Approving Role",
- "oldfieldname": "approving_role",
- "oldfieldtype": "Link",
- "options": "Role"
- },
- {
- "doctype": "DocField",
- "fieldname": "approving_user",
- "fieldtype": "Link",
- "label": "Approving User",
- "oldfieldname": "approving_user",
- "oldfieldtype": "Link",
- "options": "User"
- },
- {
- "doctype": "DocField",
- "fieldname": "value",
- "fieldtype": "Float",
- "label": "Above Value",
- "oldfieldname": "value",
- "oldfieldtype": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "AR.####",
+ "creation": "2013-01-10 16:34:22.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "transaction",
+ "fieldtype": "Select",
+ "label": "Transaction",
+ "oldfieldname": "transaction",
+ "oldfieldtype": "Select",
+ "options": "\nDelivery Note\nPurchase Invoice\nPurchase Order\nPurchase Receipt\nQuotation\nSales Invoice\nSales Order\nAppraisal",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "based_on",
+ "fieldtype": "Select",
+ "label": "Based On",
+ "oldfieldname": "based_on",
+ "oldfieldtype": "Select",
+ "options": "\nGrand Total\nAverage Discount\nCustomerwise Discount\nItemwise Discount\nNot Applicable",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "master_name",
+ "fieldtype": "Link",
+ "label": "Customer / Item Name",
+ "oldfieldname": "master_name",
+ "oldfieldtype": "Link",
+ "options": "[Select]",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "system_role",
+ "fieldtype": "Link",
+ "label": "Applicable To (Role)",
+ "oldfieldname": "system_role",
+ "oldfieldtype": "Link",
+ "options": "Role",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "system_user",
+ "fieldtype": "Link",
+ "label": "Applicable To (User)",
+ "oldfieldname": "system_user",
+ "oldfieldtype": "Link",
+ "options": "User",
+ "permlevel": 0
+ },
+ {
+ "description": "This will be used for setting rule in HR module",
+ "fieldname": "to_emp",
+ "fieldtype": "Link",
+ "label": "Applicable To (Employee)",
+ "oldfieldname": "to_emp",
+ "oldfieldtype": "Link",
+ "options": "Employee",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "description": "This will be used for setting rule in HR module",
+ "fieldname": "to_designation",
+ "fieldtype": "Link",
+ "label": "Applicable To (Designation)",
+ "oldfieldname": "to_designation",
+ "oldfieldtype": "Link",
+ "options": "Designation",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "approving_role",
+ "fieldtype": "Link",
+ "label": "Approving Role",
+ "oldfieldname": "approving_role",
+ "oldfieldtype": "Link",
+ "options": "Role",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "approving_user",
+ "fieldtype": "Link",
+ "label": "Approving User",
+ "oldfieldname": "approving_user",
+ "oldfieldtype": "Link",
+ "options": "User",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "value",
+ "fieldtype": "Float",
+ "label": "Above Value",
+ "oldfieldname": "value",
+ "oldfieldtype": "Currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-shield",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:25.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Authorization Rule",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "search_fields": "transaction,based_on,system_user,system_role,approving_user,approving_role"
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/backup_manager/backup_manager.py b/erpnext/setup/doctype/backup_manager/backup_manager.py
index c397800..8f7e891 100644
--- a/erpnext/setup/doctype/backup_manager/backup_manager.py
+++ b/erpnext/setup/doctype/backup_manager/backup_manager.py
@@ -7,9 +7,9 @@
import frappe
from frappe import _
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class BackupManager(Document):
def take_backups_daily():
take_backups_if("Daily")
diff --git a/erpnext/setup/doctype/backup_manager/backup_manager.txt b/erpnext/setup/doctype/backup_manager/backup_manager.txt
index 259bf37..a82ab65 100644
--- a/erpnext/setup/doctype/backup_manager/backup_manager.txt
+++ b/erpnext/setup/doctype/backup_manager/backup_manager.txt
@@ -1,178 +1,159 @@
-[
- {
- "creation": "2013-04-30 12:58:38",
- "docstatus": 0,
- "modified": "2013-12-20 19:22:55",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "description": "System for managing Backups",
- "doctype": "DocType",
- "document_type": "System",
- "icon": "icon-cloud-upload",
- "issingle": 1,
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Backup Manager",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Backup Manager",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "role": "System Manager",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Backup Manager"
- },
- {
- "doctype": "DocField",
- "fieldname": "setup",
- "fieldtype": "Section Break",
- "label": "Setup"
- },
- {
- "description": "Email ids separated by commas.",
- "doctype": "DocField",
- "fieldname": "send_notifications_to",
- "fieldtype": "Data",
- "label": "Send Notifications To",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "backup_right_now",
- "fieldtype": "Button",
- "hidden": 1,
- "label": "Backup Right Now",
- "read_only": 1
- },
- {
- "description": "Note: Backups and files are not deleted from Dropbox, you will have to delete them manually.",
- "doctype": "DocField",
- "fieldname": "sync_with_dropbox",
- "fieldtype": "Section Break",
- "label": "Sync with Dropbox"
- },
- {
- "doctype": "DocField",
- "fieldname": "upload_backups_to_dropbox",
- "fieldtype": "Select",
- "label": "Upload Backups to Dropbox",
- "options": "Never\nWeekly\nDaily"
- },
- {
- "doctype": "DocField",
- "fieldname": "dropbox_access_key",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Dropbox Access Key",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "dropbox_access_secret",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Dropbox Access Secret",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "dropbox_access_allowed",
- "fieldtype": "Check",
- "hidden": 1,
- "label": "Dropbox Access Allowed",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "allow_dropbox_access",
- "fieldtype": "Button",
- "label": "Allow Dropbox Access"
- },
- {
- "description": "Note: Backups and files are not deleted from Google Drive, you will have to delete them manually.",
- "doctype": "DocField",
- "fieldname": "sync_with_gdrive",
- "fieldtype": "Section Break",
- "hidden": 1,
- "label": "Sync with Google Drive"
- },
- {
- "doctype": "DocField",
- "fieldname": "upload_backups_to_gdrive",
- "fieldtype": "Select",
- "label": "Upload Backups to Google Drive",
- "options": "Never\nDaily\nWeekly"
- },
- {
- "doctype": "DocField",
- "fieldname": "allow_gdrive_access",
- "fieldtype": "Button",
- "label": "Allow Google Drive Access"
- },
- {
- "doctype": "DocField",
- "fieldname": "verification_code",
- "fieldtype": "Data",
- "label": "Enter Verification Code"
- },
- {
- "doctype": "DocField",
- "fieldname": "validate_gdrive",
- "fieldtype": "Button",
- "label": "Validate"
- },
- {
- "doctype": "DocField",
- "fieldname": "gdrive_access_allowed",
- "fieldtype": "Check",
- "hidden": 1,
- "label": "Google Drive Access Allowed",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "gdrive_credentials",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Credentials",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "database_folder_id",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Database Folder ID",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "files_folder_id",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Files Folder ID",
- "read_only": 1
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-30 12:58:38.000000",
+ "description": "System for managing Backups",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "System",
+ "fields": [
+ {
+ "fieldname": "setup",
+ "fieldtype": "Section Break",
+ "label": "Setup",
+ "permlevel": 0
+ },
+ {
+ "description": "Email ids separated by commas.",
+ "fieldname": "send_notifications_to",
+ "fieldtype": "Data",
+ "label": "Send Notifications To",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "backup_right_now",
+ "fieldtype": "Button",
+ "hidden": 1,
+ "label": "Backup Right Now",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "description": "Note: Backups and files are not deleted from Dropbox, you will have to delete them manually.",
+ "fieldname": "sync_with_dropbox",
+ "fieldtype": "Section Break",
+ "label": "Sync with Dropbox",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "upload_backups_to_dropbox",
+ "fieldtype": "Select",
+ "label": "Upload Backups to Dropbox",
+ "options": "Never\nWeekly\nDaily",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "dropbox_access_key",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Dropbox Access Key",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "dropbox_access_secret",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Dropbox Access Secret",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "dropbox_access_allowed",
+ "fieldtype": "Check",
+ "hidden": 1,
+ "label": "Dropbox Access Allowed",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "allow_dropbox_access",
+ "fieldtype": "Button",
+ "label": "Allow Dropbox Access",
+ "permlevel": 0
+ },
+ {
+ "description": "Note: Backups and files are not deleted from Google Drive, you will have to delete them manually.",
+ "fieldname": "sync_with_gdrive",
+ "fieldtype": "Section Break",
+ "hidden": 1,
+ "label": "Sync with Google Drive",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "upload_backups_to_gdrive",
+ "fieldtype": "Select",
+ "label": "Upload Backups to Google Drive",
+ "options": "Never\nDaily\nWeekly",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "allow_gdrive_access",
+ "fieldtype": "Button",
+ "label": "Allow Google Drive Access",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "verification_code",
+ "fieldtype": "Data",
+ "label": "Enter Verification Code",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "validate_gdrive",
+ "fieldtype": "Button",
+ "label": "Validate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "gdrive_access_allowed",
+ "fieldtype": "Check",
+ "hidden": 1,
+ "label": "Google Drive Access Allowed",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "gdrive_credentials",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Credentials",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "database_folder_id",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Database Folder ID",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "files_folder_id",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Files Folder ID",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-cloud-upload",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-12-20 19:22:55.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Backup Manager",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "System Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/brand/brand.py b/erpnext/setup/doctype/brand/brand.py
index d30eab6..5bdc243 100644
--- a/erpnext/setup/doctype/brand/brand.py
+++ b/erpnext/setup/doctype/brand/brand.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class Brand(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/setup/doctype/brand/brand.txt b/erpnext/setup/doctype/brand/brand.txt
index 3e67b9f..493eb5b 100644
--- a/erpnext/setup/doctype/brand/brand.txt
+++ b/erpnext/setup/doctype/brand/brand.txt
@@ -1,95 +1,93 @@
-[
- {
- "creation": "2013-02-22 01:27:54",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:brand",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-certificate",
- "in_dialog": 0,
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Brand",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Brand",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Brand"
- },
- {
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Data",
- "label": "Brand Name",
- "oldfieldname": "brand",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "width": "300px"
- },
- {
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Material Master Manager",
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Material User",
- "submit": 0,
- "write": 0
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales User"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Purchase User"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Accounts User"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:brand",
+ "creation": "2013-02-22 01:27:54.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "brand",
+ "fieldtype": "Data",
+ "label": "Brand Name",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "300px"
+ }
+ ],
+ "icon": "icon-certificate",
+ "idx": 1,
+ "in_dialog": 0,
+ "modified": "2014-01-20 17:48:27.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Brand",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Master Manager",
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User"
+ },
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User"
+ },
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index 5162ffb..a7e884e 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -9,9 +9,10 @@
import frappe.defaults
-class DocType:
- def __init__(self,d,dl):
- self.doc, self.doclist = d,dl
+from frappe.model.document import Document
+
+class Company(Document):
+
def onload(self):
self.doc.fields["__transactions_exist"] = self.check_if_transactions_exist()
@@ -85,15 +86,13 @@
website_settings.doc.home_page = webpage.doc.name
website_settings.doc.brand_html = self.doc.name
website_settings.doc.copyright = self.doc.name
- website_settings.doclist.append({
+ website_settings.append("top_bar_items", {
"doctype": "Top Bar Item",
- "parentfield": "top_bar_items",
"label":"Contact",
"url": "contact"
})
- website_settings.doclist.append({
+ website_settings.append("top_bar_items", {
"doctype": "Top Bar Item",
- "parentfield": "top_bar_items",
"label":"Blog",
"url": "blog"
})
diff --git a/erpnext/setup/doctype/company/company.txt b/erpnext/setup/doctype/company/company.txt
index 3aca525..555d0f1 100644
--- a/erpnext/setup/doctype/company/company.txt
+++ b/erpnext/setup/doctype/company/company.txt
@@ -1,393 +1,377 @@
-[
- {
- "creation": "2013-04-10 08:35:39",
- "docstatus": 0,
- "modified": "2014-03-05 14:54:29",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:company_name",
- "description": "Legal Entity / Subsidiary with a separate Chart of Accounts belonging to the Organization.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-building",
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Company",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Company",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1
- },
- {
- "doctype": "DocType",
- "name": "Company"
- },
- {
- "doctype": "DocField",
- "fieldname": "details",
- "fieldtype": "Section Break",
- "label": "Company Details",
- "oldfieldtype": "Section Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "company_name",
- "fieldtype": "Data",
- "label": "Company",
- "no_copy": 0,
- "oldfieldname": "company_name",
- "oldfieldtype": "Data",
- "read_only": 0,
- "reqd": 1
- },
- {
- "description": "Please Enter Abbreviation or Short Name properly as it will be added as Suffix to all Account Heads.",
- "doctype": "DocField",
- "fieldname": "abbr",
- "fieldtype": "Data",
- "label": "Abbr",
- "no_copy": 0,
- "oldfieldname": "abbr",
- "oldfieldtype": "Data",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cb0",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "domain",
- "fieldtype": "Select",
- "label": "Domain",
- "options": "Distribution\nManufacturing\nRetail\nServices",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "charts_section",
- "fieldtype": "Section Break",
- "label": "Chart of Accounts"
- },
- {
- "doctype": "DocField",
- "fieldname": "country",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Country",
- "options": "Country",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "chart_of_accounts",
- "fieldtype": "Link",
- "label": "Chart of Accounts",
- "options": "Chart of Accounts"
- },
- {
- "doctype": "DocField",
- "fieldname": "default_settings",
- "fieldtype": "Section Break",
- "label": "Default Settings",
- "oldfieldtype": "Section Break",
- "read_only": 0
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "default_bank_account",
- "fieldtype": "Link",
- "label": "Default Bank Account",
- "no_copy": 1,
- "oldfieldname": "default_bank_account",
- "oldfieldtype": "Link",
- "options": "Account",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "default_cash_account",
- "fieldtype": "Link",
- "label": "Default Cash Account",
- "no_copy": 1,
- "options": "Account",
- "read_only": 0
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "receivables_group",
- "fieldtype": "Link",
- "label": "Receivables Group",
- "no_copy": 1,
- "oldfieldname": "receivables_group",
- "oldfieldtype": "Link",
- "options": "Account",
- "read_only": 0
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "payables_group",
- "fieldtype": "Link",
- "label": "Payables Group",
- "no_copy": 1,
- "oldfieldname": "payables_group",
- "oldfieldtype": "Link",
- "options": "Account",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "default_expense_account",
- "fieldtype": "Link",
- "label": "Default Expense Account",
- "no_copy": 1,
- "options": "Account"
- },
- {
- "doctype": "DocField",
- "fieldname": "default_income_account",
- "fieldtype": "Link",
- "label": "Default Income Account",
- "no_copy": 1,
- "options": "Account"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "default_currency",
- "fieldtype": "Link",
- "label": "Default Currency",
- "options": "Currency",
- "read_only": 0,
- "reqd": 1
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "label": "Cost Center",
- "no_copy": 1,
- "options": "Cost Center"
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "credit_days",
- "fieldtype": "Int",
- "label": "Credit Days",
- "oldfieldname": "credit_days",
- "oldfieldtype": "Int",
- "read_only": 0
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "credit_limit",
- "fieldtype": "Currency",
- "label": "Credit Limit",
- "oldfieldname": "credit_limit",
- "oldfieldtype": "Currency",
- "options": "default_currency",
- "read_only": 0
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "yearly_bgt_flag",
- "fieldtype": "Select",
- "label": "If Yearly Budget Exceeded",
- "oldfieldname": "yearly_bgt_flag",
- "oldfieldtype": "Select",
- "options": "\nWarn\nIgnore\nStop",
- "read_only": 0
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "monthly_bgt_flag",
- "fieldtype": "Select",
- "label": "If Monthly Budget Exceeded",
- "oldfieldname": "monthly_bgt_flag",
- "oldfieldtype": "Select",
- "options": "\nWarn\nIgnore\nStop",
- "read_only": 0
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "auto_accounting_for_stock_settings",
- "fieldtype": "Section Break",
- "label": "Auto Accounting For Stock Settings",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_received_but_not_billed",
- "fieldtype": "Link",
- "label": "Stock Received But Not Billed",
- "no_copy": 1,
- "options": "Account",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_adjustment_account",
- "fieldtype": "Link",
- "label": "Stock Adjustment Account",
- "no_copy": 1,
- "options": "Account",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "expenses_included_in_valuation",
- "fieldtype": "Link",
- "label": "Expenses Included In Valuation",
- "no_copy": 1,
- "options": "Account",
- "read_only": 0
- },
- {
- "description": "For reference only.",
- "doctype": "DocField",
- "fieldname": "company_info",
- "fieldtype": "Section Break",
- "label": "Company Info",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "address",
- "fieldtype": "Small Text",
- "label": "Address",
- "oldfieldname": "address",
- "oldfieldtype": "Small Text",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "phone_no",
- "fieldtype": "Data",
- "label": "Phone No",
- "oldfieldname": "phone_no",
- "oldfieldtype": "Data",
- "options": "Phone",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "fax",
- "fieldtype": "Data",
- "label": "Fax",
- "oldfieldname": "fax",
- "oldfieldtype": "Data",
- "options": "Phone",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "email",
- "fieldtype": "Data",
- "label": "Email",
- "oldfieldname": "email",
- "oldfieldtype": "Data",
- "options": "Email",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "website",
- "fieldtype": "Data",
- "label": "Website",
- "oldfieldname": "website",
- "oldfieldtype": "Data",
- "read_only": 0
- },
- {
- "description": "Company registration numbers for your reference. Example: VAT Registration Numbers etc.",
- "doctype": "DocField",
- "fieldname": "registration_info",
- "fieldtype": "Section Break",
- "label": "Registration Info",
- "oldfieldtype": "Section Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "description": "Company registration numbers for your reference. Tax numbers etc.",
- "doctype": "DocField",
- "fieldname": "registration_details",
- "fieldtype": "Code",
- "label": "Registration Details",
- "oldfieldname": "registration_details",
- "oldfieldtype": "Code",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "no_copy": 1,
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "report": 1,
- "role": "System Manager",
- "submit": 0,
- "write": 1
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "All"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:company_name",
+ "creation": "2013-04-10 08:35:39.000000",
+ "description": "Legal Entity / Subsidiary with a separate Chart of Accounts belonging to the Organization.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "details",
+ "fieldtype": "Section Break",
+ "label": "Company Details",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "company_name",
+ "fieldtype": "Data",
+ "label": "Company",
+ "no_copy": 0,
+ "oldfieldname": "company_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Please Enter Abbreviation or Short Name properly as it will be added as Suffix to all Account Heads.",
+ "fieldname": "abbr",
+ "fieldtype": "Data",
+ "label": "Abbr",
+ "no_copy": 0,
+ "oldfieldname": "abbr",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "cb0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "domain",
+ "fieldtype": "Select",
+ "label": "Domain",
+ "options": "Distribution\nManufacturing\nRetail\nServices",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "charts_section",
+ "fieldtype": "Section Break",
+ "label": "Chart of Accounts",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "country",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Country",
+ "options": "Country",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "chart_of_accounts",
+ "fieldtype": "Link",
+ "label": "Chart of Accounts",
+ "options": "Chart of Accounts",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "default_settings",
+ "fieldtype": "Section Break",
+ "label": "Default Settings",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "default_bank_account",
+ "fieldtype": "Link",
+ "label": "Default Bank Account",
+ "no_copy": 1,
+ "oldfieldname": "default_bank_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "default_cash_account",
+ "fieldtype": "Link",
+ "label": "Default Cash Account",
+ "no_copy": 1,
+ "options": "Account",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "receivables_group",
+ "fieldtype": "Link",
+ "label": "Receivables Group",
+ "no_copy": 1,
+ "oldfieldname": "receivables_group",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "payables_group",
+ "fieldtype": "Link",
+ "label": "Payables Group",
+ "no_copy": 1,
+ "oldfieldname": "payables_group",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "default_expense_account",
+ "fieldtype": "Link",
+ "label": "Default Expense Account",
+ "no_copy": 1,
+ "options": "Account",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "default_income_account",
+ "fieldtype": "Link",
+ "label": "Default Income Account",
+ "no_copy": 1,
+ "options": "Account",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "default_currency",
+ "fieldtype": "Link",
+ "label": "Default Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "label": "Cost Center",
+ "no_copy": 1,
+ "options": "Cost Center",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "credit_days",
+ "fieldtype": "Int",
+ "label": "Credit Days",
+ "oldfieldname": "credit_days",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "credit_limit",
+ "fieldtype": "Currency",
+ "label": "Credit Limit",
+ "oldfieldname": "credit_limit",
+ "oldfieldtype": "Currency",
+ "options": "default_currency",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "yearly_bgt_flag",
+ "fieldtype": "Select",
+ "label": "If Yearly Budget Exceeded",
+ "oldfieldname": "yearly_bgt_flag",
+ "oldfieldtype": "Select",
+ "options": "\nWarn\nIgnore\nStop",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "monthly_bgt_flag",
+ "fieldtype": "Select",
+ "label": "If Monthly Budget Exceeded",
+ "oldfieldname": "monthly_bgt_flag",
+ "oldfieldtype": "Select",
+ "options": "\nWarn\nIgnore\nStop",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "auto_accounting_for_stock_settings",
+ "fieldtype": "Section Break",
+ "label": "Auto Accounting For Stock Settings",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "stock_received_but_not_billed",
+ "fieldtype": "Link",
+ "label": "Stock Received But Not Billed",
+ "no_copy": 1,
+ "options": "Account",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "stock_adjustment_account",
+ "fieldtype": "Link",
+ "label": "Stock Adjustment Account",
+ "no_copy": 1,
+ "options": "Account",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "expenses_included_in_valuation",
+ "fieldtype": "Link",
+ "label": "Expenses Included In Valuation",
+ "no_copy": 1,
+ "options": "Account",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "For reference only.",
+ "fieldname": "company_info",
+ "fieldtype": "Section Break",
+ "label": "Company Info",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "address",
+ "fieldtype": "Small Text",
+ "label": "Address",
+ "oldfieldname": "address",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "phone_no",
+ "fieldtype": "Data",
+ "label": "Phone No",
+ "oldfieldname": "phone_no",
+ "oldfieldtype": "Data",
+ "options": "Phone",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "fax",
+ "fieldtype": "Data",
+ "label": "Fax",
+ "oldfieldname": "fax",
+ "oldfieldtype": "Data",
+ "options": "Phone",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "email",
+ "fieldtype": "Data",
+ "label": "Email",
+ "oldfieldname": "email",
+ "oldfieldtype": "Data",
+ "options": "Email",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "website",
+ "fieldtype": "Data",
+ "label": "Website",
+ "oldfieldname": "website",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "Company registration numbers for your reference. Example: VAT Registration Numbers etc.",
+ "fieldname": "registration_info",
+ "fieldtype": "Section Break",
+ "label": "Registration Info",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "description": "Company registration numbers for your reference. Tax numbers etc.",
+ "fieldname": "registration_details",
+ "fieldtype": "Code",
+ "label": "Registration Details",
+ "oldfieldname": "registration_details",
+ "oldfieldtype": "Code",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "no_copy": 1,
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-building",
+ "idx": 1,
+ "modified": "2014-03-05 14:54:29.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Company",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "All"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/contact_control/contact_control.js b/erpnext/setup/doctype/contact_control/contact_control.js
index f28e3a0..743bedd 100755
--- a/erpnext/setup/doctype/contact_control/contact_control.js
+++ b/erpnext/setup/doctype/contact_control/contact_control.js
@@ -2,7 +2,7 @@
// License: GNU General Public License v3. See license.txt
cur_frm.cscript.get_states=function(doc, dt, dn) {
- return $c('runserverobj', args={'method': 'check_state', 'docs':frappe.model.compress(make_doclist(doc.doctype, doc.name))},
+ return $c('runserverobj', args={'method': 'check_state', 'docs':doc},
function(r, rt) {
if(r.message)
set_field_options('state', r.message);
diff --git a/erpnext/setup/doctype/contact_control/contact_control.py b/erpnext/setup/doctype/contact_control/contact_control.py
index 35bd61c..96e9551 100644
--- a/erpnext/setup/doctype/contact_control/contact_control.py
+++ b/erpnext/setup/doctype/contact_control/contact_control.py
@@ -4,7 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self,doc,doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class ContactControl(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/setup/doctype/contact_control/contact_control.txt b/erpnext/setup/doctype/contact_control/contact_control.txt
index a5a0d01..560aed5 100644
--- a/erpnext/setup/doctype/contact_control/contact_control.txt
+++ b/erpnext/setup/doctype/contact_control/contact_control.txt
@@ -1,63 +1,48 @@
-[
- {
- "creation": "2012-03-27 14:36:19",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:02",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "in_create": 1,
- "issingle": 1,
- "module": "Setup",
- "name": "__common__",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldtype": "Text",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Contact Control",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Contact Control",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "role": "System Manager",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Contact Control"
- },
- {
- "doctype": "DocField",
- "fieldname": "header",
- "label": "Header"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_intro",
- "label": "Customer Intro"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_intro",
- "label": "Supplier Intro"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-03-27 14:36:19.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "header",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Header",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "customer_intro",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Customer Intro",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "supplier_intro",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Supplier Intro",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "in_create": 1,
+ "issingle": 1,
+ "modified": "2013-12-20 19:23:02.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Contact Control",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "System Manager",
+ "write": 1
+ }
+ ],
+ "read_only": 1
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/country/country.py b/erpnext/setup/doctype/country/country.py
index d30eab6..5e16f51 100644
--- a/erpnext/setup/doctype/country/country.py
+++ b/erpnext/setup/doctype/country/country.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class Country(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/setup/doctype/country/country.txt b/erpnext/setup/doctype/country/country.txt
index 57d2025..487a160 100644
--- a/erpnext/setup/doctype/country/country.txt
+++ b/erpnext/setup/doctype/country/country.txt
@@ -1,105 +1,102 @@
-[
- {
- "creation": "2013-01-19 10:23:30",
- "docstatus": 0,
- "modified": "2014-03-05 14:36:16",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:country_name",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-globe",
- "in_create": 0,
- "module": "Setup",
- "name": "__common__",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Country",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Country",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Country"
- },
- {
- "doctype": "DocField",
- "fieldname": "country_name",
- "fieldtype": "Data",
- "label": "Country Name",
- "oldfieldname": "country_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "date_format",
- "fieldtype": "Data",
- "label": "Date Format"
- },
- {
- "doctype": "DocField",
- "fieldname": "time_zones",
- "fieldtype": "Text",
- "label": "Time Zones"
- },
- {
- "doctype": "DocField",
- "fieldname": "code",
- "fieldtype": "Data",
- "label": "Code"
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "doctype": "DocPerm",
- "role": "Sales Master Manager",
- "submit": 0,
- "write": 1
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "role": "Purchase Master Manager",
- "submit": 0,
- "write": 1
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "role": "HR User",
- "submit": 0,
- "write": 1
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "role": "HR Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocPerm",
- "role": "All"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:country_name",
+ "creation": "2013-01-19 10:23:30.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "country_name",
+ "fieldtype": "Data",
+ "label": "Country Name",
+ "oldfieldname": "country_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "date_format",
+ "fieldtype": "Data",
+ "label": "Date Format",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "time_zones",
+ "fieldtype": "Text",
+ "label": "Time Zones",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "code",
+ "fieldtype": "Data",
+ "label": "Code",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-globe",
+ "idx": 1,
+ "in_create": 0,
+ "modified": "2014-03-05 14:36:16.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Country",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "All"
+ }
+ ],
+ "read_only": 0
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/currency/currency.py b/erpnext/setup/doctype/currency/currency.py
index 2f6a62a..5541065 100644
--- a/erpnext/setup/doctype/currency/currency.py
+++ b/erpnext/setup/doctype/currency/currency.py
@@ -5,9 +5,9 @@
import frappe
from frappe import throw, _
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class Currency(Document):
def validate_conversion_rate(currency, conversion_rate, conversion_rate_label, company):
"""common validation for currency and price list currency"""
diff --git a/erpnext/setup/doctype/currency/currency.txt b/erpnext/setup/doctype/currency/currency.txt
index 6bd2b1c..6c66bca 100644
--- a/erpnext/setup/doctype/currency/currency.txt
+++ b/erpnext/setup/doctype/currency/currency.txt
@@ -1,126 +1,119 @@
-[
- {
- "creation": "2013-01-28 10:06:02",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:31",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "field:currency_name",
- "description": "**Currency** Master",
- "doctype": "DocType",
- "icon": "icon-bitcoin",
- "in_create": 0,
- "module": "Setup",
- "name": "__common__",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Currency",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Currency",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "currency_name",
- "fieldtype": "Data",
- "label": "Currency Name",
- "oldfieldname": "currency_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "enabled",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Enabled"
- },
- {
- "description": "Sub-currency. For e.g. \"Cent\"",
- "doctype": "DocField",
- "fieldname": "fraction",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Fraction"
- },
- {
- "description": "1 Currency = [?] Fraction\nFor e.g. 1 USD = 100 Cent",
- "doctype": "DocField",
- "fieldname": "fraction_units",
- "fieldtype": "Int",
- "in_list_view": 1,
- "label": "Fraction Units"
- },
- {
- "description": "A symbol for this currency. For e.g. $",
- "doctype": "DocField",
- "fieldname": "symbol",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Symbol"
- },
- {
- "description": "How should this currency be formatted? If not set, will use system defaults",
- "doctype": "DocField",
- "fieldname": "number_format",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Number Format",
- "options": "\n#,###.##\n#.###,##\n# ###.##\n#,###.###\n#,##,###.##\n#.###\n#,###"
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Accounts Manager",
- "submit": 0,
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales Master Manager",
- "submit": 0,
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Purchase Master Manager",
- "submit": 0,
- "write": 1
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "All"
- }
-]
\ No newline at end of file
+{
+ "autoname": "field:currency_name",
+ "creation": "2013-01-28 10:06:02.000000",
+ "description": "**Currency** Master",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "currency_name",
+ "fieldtype": "Data",
+ "label": "Currency Name",
+ "oldfieldname": "currency_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "enabled",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Enabled",
+ "permlevel": 0
+ },
+ {
+ "description": "Sub-currency. For e.g. \"Cent\"",
+ "fieldname": "fraction",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Fraction",
+ "permlevel": 0
+ },
+ {
+ "description": "1 Currency = [?] Fraction\nFor e.g. 1 USD = 100 Cent",
+ "fieldname": "fraction_units",
+ "fieldtype": "Int",
+ "in_list_view": 1,
+ "label": "Fraction Units",
+ "permlevel": 0
+ },
+ {
+ "description": "A symbol for this currency. For e.g. $",
+ "fieldname": "symbol",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Symbol",
+ "permlevel": 0
+ },
+ {
+ "description": "How should this currency be formatted? If not set, will use system defaults",
+ "fieldname": "number_format",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Number Format",
+ "options": "\n#,###.##\n#.###,##\n# ###.##\n#,###.###\n#,##,###.##\n#.###\n#,###",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-bitcoin",
+ "idx": 1,
+ "in_create": 0,
+ "modified": "2014-01-20 17:48:31.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Currency",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "All"
+ }
+ ],
+ "read_only": 0
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/currency_exchange/currency_exchange.py b/erpnext/setup/doctype/currency_exchange/currency_exchange.py
index 93f4419..a0624de 100644
--- a/erpnext/setup/doctype/currency_exchange/currency_exchange.py
+++ b/erpnext/setup/doctype/currency_exchange/currency_exchange.py
@@ -8,9 +8,7 @@
from frappe import _, msgprint
from frappe.model.controller import DocListController
-class DocType(DocListController):
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+class CurrencyExchange(DocListController):
def autoname(self):
self.doc.name = self.doc.from_currency + "-" + self.doc.to_currency
diff --git a/erpnext/setup/doctype/currency_exchange/currency_exchange.txt b/erpnext/setup/doctype/currency_exchange/currency_exchange.txt
index adaf125..7556968 100644
--- a/erpnext/setup/doctype/currency_exchange/currency_exchange.txt
+++ b/erpnext/setup/doctype/currency_exchange/currency_exchange.txt
@@ -1,86 +1,81 @@
-[
- {
- "creation": "2013-06-20 15:40:29",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:31",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "description": "Specify Exchange Rate to convert one currency into another",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-exchange",
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Currency Exchange",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "reqd": 1
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Currency Exchange",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Currency Exchange"
- },
- {
- "doctype": "DocField",
- "fieldname": "from_currency",
- "fieldtype": "Link",
- "label": "From Currency",
- "options": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "to_currency",
- "fieldtype": "Link",
- "label": "To Currency",
- "options": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "exchange_rate",
- "fieldtype": "Float",
- "label": "Exchange Rate"
- },
- {
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Accounts Manager",
- "write": 1
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Accounts User"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales User"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Purchase User"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "creation": "2013-06-20 15:40:29.000000",
+ "description": "Specify Exchange Rate to convert one currency into another",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "from_currency",
+ "fieldtype": "Link",
+ "label": "From Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "to_currency",
+ "fieldtype": "Link",
+ "label": "To Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "exchange_rate",
+ "fieldtype": "Float",
+ "label": "Exchange Rate",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "icon": "icon-exchange",
+ "idx": 1,
+ "modified": "2014-01-20 17:48:31.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Currency Exchange",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "write": 1
+ },
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User"
+ },
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User"
+ },
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/customer_group/customer_group.py b/erpnext/setup/doctype/customer_group/customer_group.py
index 547f19f..214e20c 100644
--- a/erpnext/setup/doctype/customer_group/customer_group.py
+++ b/erpnext/setup/doctype/customer_group/customer_group.py
@@ -7,10 +7,7 @@
from frappe.utils.nestedset import DocTypeNestedSet
-class DocType(DocTypeNestedSet):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class CustomerGroup(DocTypeNestedSet):
self.nsm_parent_field = 'parent_customer_group';
def validate(self):
diff --git a/erpnext/setup/doctype/customer_group/customer_group.txt b/erpnext/setup/doctype/customer_group/customer_group.txt
index 59f52c6..e5ade41 100644
--- a/erpnext/setup/doctype/customer_group/customer_group.txt
+++ b/erpnext/setup/doctype/customer_group/customer_group.txt
@@ -1,165 +1,160 @@
-[
- {
- "creation": "2013-01-10 16:34:23",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:33",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:customer_group_name",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-sitemap",
- "in_create": 1,
- "module": "Setup",
- "name": "__common__",
- "read_only": 1,
- "search_fields": "name,parent_customer_group"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Customer Group",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Customer Group",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Customer Group"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_group_name",
- "fieldtype": "Data",
- "label": "Customer Group Name",
- "no_copy": 1,
- "oldfieldname": "customer_group_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "parent_customer_group",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Parent Customer Group",
- "oldfieldname": "parent_customer_group",
- "oldfieldtype": "Link",
- "options": "Customer Group",
- "reqd": 0
- },
- {
- "description": "Only leaf nodes are allowed in transaction",
- "doctype": "DocField",
- "fieldname": "is_group",
- "fieldtype": "Select",
- "label": "Has Child Node",
- "oldfieldname": "is_group",
- "oldfieldtype": "Select",
- "options": "\nYes\nNo",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cb0",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "default_price_list",
- "fieldtype": "Link",
- "label": "Default Price List",
- "options": "Price List"
- },
- {
- "doctype": "DocField",
- "fieldname": "lft",
- "fieldtype": "Int",
- "hidden": 1,
- "label": "lft",
- "no_copy": 1,
- "oldfieldname": "lft",
- "oldfieldtype": "Int",
- "print_hide": 1,
- "report_hide": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rgt",
- "fieldtype": "Int",
- "hidden": 1,
- "label": "rgt",
- "no_copy": 1,
- "oldfieldname": "rgt",
- "oldfieldtype": "Int",
- "print_hide": 1,
- "report_hide": 1,
- "search_index": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "old_parent",
- "fieldtype": "Link",
- "hidden": 1,
- "ignore_restrictions": 1,
- "label": "old_parent",
- "no_copy": 1,
- "oldfieldname": "old_parent",
- "oldfieldtype": "Data",
- "options": "Customer Group",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales Manager",
- "write": 0
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales User",
- "write": 0
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales Master Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:customer_group_name",
+ "creation": "2013-01-10 16:34:23.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "customer_group_name",
+ "fieldtype": "Data",
+ "label": "Customer Group Name",
+ "no_copy": 1,
+ "oldfieldname": "customer_group_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "parent_customer_group",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Parent Customer Group",
+ "oldfieldname": "parent_customer_group",
+ "oldfieldtype": "Link",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "description": "Only leaf nodes are allowed in transaction",
+ "fieldname": "is_group",
+ "fieldtype": "Select",
+ "label": "Has Child Node",
+ "oldfieldname": "is_group",
+ "oldfieldtype": "Select",
+ "options": "\nYes\nNo",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "cb0",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "default_price_list",
+ "fieldtype": "Link",
+ "label": "Default Price List",
+ "options": "Price List",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "lft",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "label": "lft",
+ "no_copy": 1,
+ "oldfieldname": "lft",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "rgt",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "label": "rgt",
+ "no_copy": 1,
+ "oldfieldname": "rgt",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1,
+ "search_index": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "old_parent",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_restrictions": 1,
+ "label": "old_parent",
+ "no_copy": 1,
+ "oldfieldname": "old_parent",
+ "oldfieldtype": "Data",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ }
+ ],
+ "icon": "icon-sitemap",
+ "idx": 1,
+ "in_create": 1,
+ "modified": "2014-01-20 17:48:33.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Customer Group",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 1,
+ "search_fields": "name,parent_customer_group"
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/email_digest/email_digest.js b/erpnext/setup/doctype/email_digest/email_digest.js
index 875061b..51f6231 100644
--- a/erpnext/setup/doctype/email_digest/email_digest.js
+++ b/erpnext/setup/doctype/email_digest/email_digest.js
@@ -9,7 +9,7 @@
cur_frm.add_custom_button(frappe._('View Now'), function() {
doc = locals[dt][dn];
if(doc.__unsaved != 1) {
- return $c_obj(make_doclist(dt, dn), 'get_digest_msg', '', function(r, rt) {
+ return $c_obj(doc, 'get_digest_msg', '', function(r, rt) {
if(r.exc) {
msgprint(err_msg);
console.log(r.exc);
@@ -32,7 +32,7 @@
cur_frm.add_custom_button(frappe._('Send Now'), function() {
doc = locals[dt][dn];
if(doc.__unsaved != 1) {
- return $c_obj(make_doclist(dt, dn), 'send', '', function(r, rt) {
+ return $c_obj(doc, 'send', '', function(r, rt) {
if(r.exc) {
msgprint(err_msg);
console.log(r.exc);
@@ -49,7 +49,7 @@
cur_frm.cscript.addremove_recipients = function(doc, dt, dn) {
// Get user list
- return $c_obj(make_doclist(dt, dn), 'get_users', '', function(r, rt) {
+ return $c_obj(doc, 'get_users', '', function(r, rt) {
if(r.exc) {
msgprint(r.exc);
} else {
diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py
index c46c43e..1344686 100644
--- a/erpnext/setup/doctype/email_digest/email_digest.py
+++ b/erpnext/setup/doctype/email_digest/email_digest.py
@@ -45,9 +45,9 @@
</span></p>"""
from frappe.model.controller import DocListController
-class DocType(DocListController):
- def __init__(self, doc, doclist=[]):
- self.doc, self.doclist = doc, doclist
+class EmailDigest(DocListController):
+ def __init__(self, arg1, arg2=None):
+ super(EmailDigest, self).__init__(arg1, arg2)
self.from_date, self.to_date = self.get_from_to_date()
self.future_from_date, self.future_to_date = self.get_future_from_to_date()
self.currency = frappe.db.get_value("Company", self.doc.company,
diff --git a/erpnext/setup/doctype/email_digest/email_digest.txt b/erpnext/setup/doctype/email_digest/email_digest.txt
index 6660c25..0ffc60d 100644
--- a/erpnext/setup/doctype/email_digest/email_digest.txt
+++ b/erpnext/setup/doctype/email_digest/email_digest.txt
@@ -1,368 +1,352 @@
-[
- {
- "creation": "2013-02-21 14:15:31",
- "docstatus": 0,
- "modified": "2014-03-19 11:39:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "Prompt",
- "description": "Send regular summary reports via Email.",
- "doctype": "DocType",
- "document_type": "System",
- "icon": "icon-envelope",
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Email Digest",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Email Digest",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "read": 1,
- "role": "System Manager",
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Email Digest"
- },
- {
- "doctype": "DocField",
- "fieldname": "settings",
- "fieldtype": "Section Break",
- "label": "Email Digest Settings"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "enabled",
- "fieldtype": "Check",
- "label": "Enabled"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "label": "For Company",
- "options": "link:Company",
- "reqd": 1
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "frequency",
- "fieldtype": "Select",
- "label": "How frequently?",
- "options": "Daily\nWeekly\nMonthly",
- "reqd": 1
- },
- {
- "depends_on": "eval:doc.enabled",
- "doctype": "DocField",
- "fieldname": "next_send",
- "fieldtype": "Data",
- "label": "Next email will be sent on:",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break"
- },
- {
- "description": "Note: Email will not be sent to disabled users",
- "doctype": "DocField",
- "fieldname": "recipient_list",
- "fieldtype": "Text",
- "label": "Recipients",
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "addremove_recipients",
- "fieldtype": "Button",
- "label": "Add/Remove Recipients"
- },
- {
- "doctype": "DocField",
- "fieldname": "accounts",
- "fieldtype": "Section Break",
- "label": "Accounts"
- },
- {
- "doctype": "DocField",
- "fieldname": "accounts_module",
- "fieldtype": "Column Break",
- "label": "Income / Expense"
- },
- {
- "doctype": "DocField",
- "fieldname": "income_year_to_date",
- "fieldtype": "Check",
- "label": "Income Year to Date"
- },
- {
- "description": "Balances of Accounts of type \"Bank\" or \"Cash\"",
- "doctype": "DocField",
- "fieldname": "bank_balance",
- "fieldtype": "Check",
- "label": "Bank/Cash Balance"
- },
- {
- "description": "Income booked for the digest period",
- "doctype": "DocField",
- "fieldname": "income",
- "fieldtype": "Check",
- "label": "Income Booked"
- },
- {
- "description": "Expenses booked for the digest period",
- "doctype": "DocField",
- "fieldname": "expenses_booked",
- "fieldtype": "Check",
- "label": "Expenses Booked"
- },
- {
- "description": "Receivable / Payable account will be identified based on the field Master Type",
- "doctype": "DocField",
- "fieldname": "column_break_16",
- "fieldtype": "Column Break",
- "label": "Receivables / Payables"
- },
- {
- "description": "Payments received during the digest period",
- "doctype": "DocField",
- "fieldname": "collections",
- "fieldtype": "Check",
- "label": "Payments Received"
- },
- {
- "description": "Payments made during the digest period",
- "doctype": "DocField",
- "fieldname": "payments",
- "fieldtype": "Check",
- "label": "Payments Made"
- },
- {
- "description": "Total amount of invoices sent to the customer during the digest period",
- "doctype": "DocField",
- "fieldname": "invoiced_amount",
- "fieldtype": "Check",
- "label": "Receivables"
- },
- {
- "description": "Total amount of invoices received from suppliers during the digest period",
- "doctype": "DocField",
- "fieldname": "payables",
- "fieldtype": "Check",
- "label": "Payables"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_20",
- "fieldtype": "Section Break",
- "label": "Buying & Selling"
- },
- {
- "doctype": "DocField",
- "fieldname": "buying_module",
- "fieldtype": "Column Break",
- "label": "Buying"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_purchase_requests",
- "fieldtype": "Check",
- "label": "New Material Requests"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_supplier_quotations",
- "fieldtype": "Check",
- "label": "New Supplier Quotations"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_purchase_orders",
- "fieldtype": "Check",
- "label": "New Purchase Orders"
- },
- {
- "doctype": "DocField",
- "fieldname": "selling_module",
- "fieldtype": "Column Break",
- "label": "Selling"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_leads",
- "fieldtype": "Check",
- "label": "New Leads"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_enquiries",
- "fieldtype": "Check",
- "label": "New Enquiries"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_quotations",
- "fieldtype": "Check",
- "label": "New Quotations"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_sales_orders",
- "fieldtype": "Check",
- "label": "New Sales Orders"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_34",
- "fieldtype": "Section Break",
- "label": "Inventory & Support"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_module",
- "fieldtype": "Column Break",
- "label": "Stock"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_delivery_notes",
- "fieldtype": "Check",
- "label": "New Delivery Notes"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_purchase_receipts",
- "fieldtype": "Check",
- "label": "New Purchase Receipts"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_stock_entries",
- "fieldtype": "Check",
- "label": "New Stock Entries"
- },
- {
- "doctype": "DocField",
- "fieldname": "support_module",
- "fieldtype": "Column Break",
- "label": "Support"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_support_tickets",
- "fieldtype": "Check",
- "label": "New Support Tickets"
- },
- {
- "doctype": "DocField",
- "fieldname": "open_tickets",
- "fieldtype": "Check",
- "label": "Open Tickets"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_communications",
- "fieldtype": "Check",
- "label": "New Communications"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_40",
- "fieldtype": "Section Break",
- "label": "Projects & System"
- },
- {
- "doctype": "DocField",
- "fieldname": "projects_module",
- "fieldtype": "Column Break",
- "label": "Projects"
- },
- {
- "doctype": "DocField",
- "fieldname": "new_projects",
- "fieldtype": "Check",
- "label": "New Projects"
- },
- {
- "doctype": "DocField",
- "fieldname": "core_module",
- "fieldtype": "Column Break",
- "label": "System"
- },
- {
- "doctype": "DocField",
- "fieldname": "scheduler_errors",
- "fieldtype": "Check",
- "label": "Scheduler Failed Events"
- },
- {
- "doctype": "DocField",
- "fieldname": "user_specific",
- "fieldtype": "Section Break",
- "label": "User Specific"
- },
- {
- "doctype": "DocField",
- "fieldname": "general",
- "fieldtype": "Column Break",
- "label": "General"
- },
- {
- "doctype": "DocField",
- "fieldname": "calendar_events",
- "fieldtype": "Check",
- "label": "Calendar Events"
- },
- {
- "doctype": "DocField",
- "fieldname": "todo_list",
- "fieldtype": "Check",
- "label": "To Do List"
- },
- {
- "doctype": "DocField",
- "fieldname": "stub",
- "fieldtype": "Column Break",
- "label": "Stub"
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "report": 1,
- "write": 1
- },
- {
- "amend": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "permlevel": 1
- }
-]
\ No newline at end of file
+{
+ "autoname": "Prompt",
+ "creation": "2013-02-21 14:15:31.000000",
+ "description": "Send regular summary reports via Email.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "System",
+ "fields": [
+ {
+ "fieldname": "settings",
+ "fieldtype": "Section Break",
+ "label": "Email Digest Settings",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "enabled",
+ "fieldtype": "Check",
+ "label": "Enabled",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "label": "For Company",
+ "options": "link:Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "frequency",
+ "fieldtype": "Select",
+ "label": "How frequently?",
+ "options": "Daily\nWeekly\nMonthly",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:doc.enabled",
+ "fieldname": "next_send",
+ "fieldtype": "Data",
+ "label": "Next email will be sent on:",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "Note: Email will not be sent to disabled users",
+ "fieldname": "recipient_list",
+ "fieldtype": "Text",
+ "label": "Recipients",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "addremove_recipients",
+ "fieldtype": "Button",
+ "label": "Add/Remove Recipients",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "accounts",
+ "fieldtype": "Section Break",
+ "label": "Accounts",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "accounts_module",
+ "fieldtype": "Column Break",
+ "label": "Income / Expense",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "income_year_to_date",
+ "fieldtype": "Check",
+ "label": "Income Year to Date",
+ "permlevel": 0
+ },
+ {
+ "description": "Balances of Accounts of type \"Bank\" or \"Cash\"",
+ "fieldname": "bank_balance",
+ "fieldtype": "Check",
+ "label": "Bank/Cash Balance",
+ "permlevel": 0
+ },
+ {
+ "description": "Income booked for the digest period",
+ "fieldname": "income",
+ "fieldtype": "Check",
+ "label": "Income Booked",
+ "permlevel": 0
+ },
+ {
+ "description": "Expenses booked for the digest period",
+ "fieldname": "expenses_booked",
+ "fieldtype": "Check",
+ "label": "Expenses Booked",
+ "permlevel": 0
+ },
+ {
+ "description": "Receivable / Payable account will be identified based on the field Master Type",
+ "fieldname": "column_break_16",
+ "fieldtype": "Column Break",
+ "label": "Receivables / Payables",
+ "permlevel": 0
+ },
+ {
+ "description": "Payments received during the digest period",
+ "fieldname": "collections",
+ "fieldtype": "Check",
+ "label": "Payments Received",
+ "permlevel": 0
+ },
+ {
+ "description": "Payments made during the digest period",
+ "fieldname": "payments",
+ "fieldtype": "Check",
+ "label": "Payments Made",
+ "permlevel": 0
+ },
+ {
+ "description": "Total amount of invoices sent to the customer during the digest period",
+ "fieldname": "invoiced_amount",
+ "fieldtype": "Check",
+ "label": "Receivables",
+ "permlevel": 0
+ },
+ {
+ "description": "Total amount of invoices received from suppliers during the digest period",
+ "fieldname": "payables",
+ "fieldtype": "Check",
+ "label": "Payables",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "section_break_20",
+ "fieldtype": "Section Break",
+ "label": "Buying & Selling",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "buying_module",
+ "fieldtype": "Column Break",
+ "label": "Buying",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_purchase_requests",
+ "fieldtype": "Check",
+ "label": "New Material Requests",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_supplier_quotations",
+ "fieldtype": "Check",
+ "label": "New Supplier Quotations",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_purchase_orders",
+ "fieldtype": "Check",
+ "label": "New Purchase Orders",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "selling_module",
+ "fieldtype": "Column Break",
+ "label": "Selling",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_leads",
+ "fieldtype": "Check",
+ "label": "New Leads",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_enquiries",
+ "fieldtype": "Check",
+ "label": "New Enquiries",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_quotations",
+ "fieldtype": "Check",
+ "label": "New Quotations",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_sales_orders",
+ "fieldtype": "Check",
+ "label": "New Sales Orders",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "section_break_34",
+ "fieldtype": "Section Break",
+ "label": "Inventory & Support",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "stock_module",
+ "fieldtype": "Column Break",
+ "label": "Stock",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_delivery_notes",
+ "fieldtype": "Check",
+ "label": "New Delivery Notes",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_purchase_receipts",
+ "fieldtype": "Check",
+ "label": "New Purchase Receipts",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_stock_entries",
+ "fieldtype": "Check",
+ "label": "New Stock Entries",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "support_module",
+ "fieldtype": "Column Break",
+ "label": "Support",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_support_tickets",
+ "fieldtype": "Check",
+ "label": "New Support Tickets",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "open_tickets",
+ "fieldtype": "Check",
+ "label": "Open Tickets",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_communications",
+ "fieldtype": "Check",
+ "label": "New Communications",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "section_break_40",
+ "fieldtype": "Section Break",
+ "label": "Projects & System",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "projects_module",
+ "fieldtype": "Column Break",
+ "label": "Projects",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "new_projects",
+ "fieldtype": "Check",
+ "label": "New Projects",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "core_module",
+ "fieldtype": "Column Break",
+ "label": "System",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "scheduler_errors",
+ "fieldtype": "Check",
+ "label": "Scheduler Failed Events",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "user_specific",
+ "fieldtype": "Section Break",
+ "label": "User Specific",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "general",
+ "fieldtype": "Column Break",
+ "label": "General",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "calendar_events",
+ "fieldtype": "Check",
+ "label": "Calendar Events",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "todo_list",
+ "fieldtype": "Check",
+ "label": "To Do List",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "stub",
+ "fieldtype": "Column Break",
+ "label": "Stub",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-envelope",
+ "idx": 1,
+ "modified": "2014-03-19 11:39:27.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Email Digest",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "permlevel": 1,
+ "read": 1,
+ "role": "System Manager",
+ "submit": 0
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/features_setup/features_setup.py b/erpnext/setup/doctype/features_setup/features_setup.py
index 0c9d6e4..825163d 100644
--- a/erpnext/setup/doctype/features_setup/features_setup.py
+++ b/erpnext/setup/doctype/features_setup/features_setup.py
@@ -2,9 +2,9 @@
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class FeaturesSetup(Document):
def validate(self):
"""
diff --git a/erpnext/setup/doctype/features_setup/features_setup.txt b/erpnext/setup/doctype/features_setup/features_setup.txt
index dd2df02..8122da0 100644
--- a/erpnext/setup/doctype/features_setup/features_setup.txt
+++ b/erpnext/setup/doctype/features_setup/features_setup.txt
@@ -1,253 +1,241 @@
-[
- {
- "creation": "2012-12-20 12:50:49",
- "docstatus": 0,
- "modified": "2013-12-24 11:40:19",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "icon": "icon-glass",
- "issingle": 1,
- "module": "Setup",
- "name": "__common__",
- "name_case": "Title Case"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Features Setup",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Features Setup",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 0,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Features Setup"
- },
- {
- "doctype": "DocField",
- "fieldname": "materials",
- "fieldtype": "Section Break",
- "label": "Materials"
- },
- {
- "description": "To track item in sales and purchase documents based on their serial nos. This is can also used to track warranty details of the product.",
- "doctype": "DocField",
- "fieldname": "fs_item_serial_nos",
- "fieldtype": "Check",
- "label": "Item Serial Nos"
- },
- {
- "description": "To track items in sales and purchase documents with batch nos<br><b>Preferred Industry: Chemicals etc</b>",
- "doctype": "DocField",
- "fieldname": "fs_item_batch_nos",
- "fieldtype": "Check",
- "label": "Item Batch Nos"
- },
- {
- "description": "To track brand name in the following documents<br>\nDelivery Note, Enuiry, Material Request, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Sales Invoice, Sales BOM, Sales Order, Serial No",
- "doctype": "DocField",
- "fieldname": "fs_brands",
- "fieldtype": "Check",
- "label": "Brands"
- },
- {
- "description": "To track items using barcode. You will be able to enter items in Delivery Note and Sales Invoice by scanning barcode of item.",
- "doctype": "DocField",
- "fieldname": "fs_item_barcode",
- "fieldtype": "Check",
- "label": "Item Barcode"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break"
- },
- {
- "description": "1. To maintain the customer wise item code and to make them searchable based on their code use this option",
- "doctype": "DocField",
- "fieldname": "fs_item_advanced",
- "fieldtype": "Check",
- "label": "Item Advanced"
- },
- {
- "description": "If Sale BOM is defined, the actual BOM of the Pack is displayed as table.\nAvailable in Delivery Note and Sales Order",
- "doctype": "DocField",
- "fieldname": "fs_packing_details",
- "fieldtype": "Check",
- "label": "Packing Details"
- },
- {
- "description": "To get Item Group in details table",
- "doctype": "DocField",
- "fieldname": "fs_item_group_in_details",
- "fieldtype": "Check",
- "label": "Item Groups in Details"
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_and_purchase",
- "fieldtype": "Section Break",
- "label": "Sales and Purchase"
- },
- {
- "description": "All export related fields like currency, conversion rate, export total, export grand total etc are available in <br>\nDelivery Note, POS, Quotation, Sales Invoice, Sales Order etc.",
- "doctype": "DocField",
- "fieldname": "fs_exports",
- "fieldtype": "Check",
- "label": "Exports"
- },
- {
- "description": "All import related fields like currency, conversion rate, import total, import grand total etc are available in <br>\nPurchase Receipt, Supplier Quotation, Purchase Invoice, Purchase Order etc.",
- "doctype": "DocField",
- "fieldname": "fs_imports",
- "fieldtype": "Check",
- "label": "Imports"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break"
- },
- {
- "description": "Field available in Delivery Note, Quotation, Sales Invoice, Sales Order",
- "doctype": "DocField",
- "fieldname": "fs_discounts",
- "fieldtype": "Check",
- "label": "Sales Discounts"
- },
- {
- "description": "Discount Fields will be available in Purchase Order, Purchase Receipt, Purchase Invoice",
- "doctype": "DocField",
- "fieldname": "fs_purchase_discounts",
- "fieldtype": "Check",
- "label": "Purchase Discounts"
- },
- {
- "description": "To track any installation or commissioning related work after sales",
- "doctype": "DocField",
- "fieldname": "fs_after_sales_installations",
- "fieldtype": "Check",
- "label": "After Sale Installations"
- },
- {
- "description": "Available in \nBOM, Delivery Note, Purchase Invoice, Production Order, Purchase Order, Purchase Receipt, Sales Invoice, Sales Order, Stock Entry, Timesheet",
- "doctype": "DocField",
- "fieldname": "fs_projects",
- "fieldtype": "Check",
- "label": "Projects"
- },
- {
- "description": "If you have Sales Team and Sale Partners (Channel Partners) they can be tagged and maintain their contribution in the sales activity",
- "doctype": "DocField",
- "fieldname": "fs_sales_extras",
- "fieldtype": "Check",
- "label": "Sales Extras"
- },
- {
- "doctype": "DocField",
- "fieldname": "accounts",
- "fieldtype": "Section Break",
- "label": "Accounts"
- },
- {
- "description": "Check if you need automatic recurring invoices. After submitting any sales invoice, Recurring section will be visible.",
- "doctype": "DocField",
- "fieldname": "fs_recurring_invoice",
- "fieldtype": "Check",
- "label": "Recurring Invoice"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break"
- },
- {
- "description": "To enable <b>Point of Sale</b> features",
- "doctype": "DocField",
- "fieldname": "fs_pos",
- "fieldtype": "Check",
- "label": "Point of Sale"
- },
- {
- "description": "To enable <b>Point of Sale</b> view",
- "doctype": "DocField",
- "fieldname": "fs_pos_view",
- "fieldtype": "Check",
- "label": "POS View"
- },
- {
- "doctype": "DocField",
- "fieldname": "production",
- "fieldtype": "Section Break",
- "label": "Manufacturing"
- },
- {
- "description": "If you involve in manufacturing activity<br>\nEnables item <b>Is Manufactured</b>",
- "doctype": "DocField",
- "fieldname": "fs_manufacturing",
- "fieldtype": "Check",
- "label": "Manufacturing"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break"
- },
- {
- "description": "If you follow Quality Inspection<br>\nEnables item QA Required and QA No in Purchase Receipt",
- "doctype": "DocField",
- "fieldname": "fs_quality",
- "fieldtype": "Check",
- "label": "Quality"
- },
- {
- "doctype": "DocField",
- "fieldname": "miscelleneous",
- "fieldtype": "Section Break",
- "label": "Miscelleneous"
- },
- {
- "description": "If you have long print formats, this feature can be used to split the page to be printed on multiple pages with all headers and footers on each page",
- "doctype": "DocField",
- "fieldname": "fs_page_break",
- "fieldtype": "Check",
- "label": "Page Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break4",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "fs_more_info",
- "fieldtype": "Check",
- "label": "More Info"
- },
- {
- "doctype": "DocPerm",
- "role": "System Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Administrator"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-12-20 12:50:49.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "materials",
+ "fieldtype": "Section Break",
+ "label": "Materials",
+ "permlevel": 0
+ },
+ {
+ "description": "To track item in sales and purchase documents based on their serial nos. This is can also used to track warranty details of the product.",
+ "fieldname": "fs_item_serial_nos",
+ "fieldtype": "Check",
+ "label": "Item Serial Nos",
+ "permlevel": 0
+ },
+ {
+ "description": "To track items in sales and purchase documents with batch nos<br><b>Preferred Industry: Chemicals etc</b>",
+ "fieldname": "fs_item_batch_nos",
+ "fieldtype": "Check",
+ "label": "Item Batch Nos",
+ "permlevel": 0
+ },
+ {
+ "description": "To track brand name in the following documents<br>\nDelivery Note, Enuiry, Material Request, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Sales Invoice, Sales BOM, Sales Order, Serial No",
+ "fieldname": "fs_brands",
+ "fieldtype": "Check",
+ "label": "Brands",
+ "permlevel": 0
+ },
+ {
+ "description": "To track items using barcode. You will be able to enter items in Delivery Note and Sales Invoice by scanning barcode of item.",
+ "fieldname": "fs_item_barcode",
+ "fieldtype": "Check",
+ "label": "Item Barcode",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "1. To maintain the customer wise item code and to make them searchable based on their code use this option",
+ "fieldname": "fs_item_advanced",
+ "fieldtype": "Check",
+ "label": "Item Advanced",
+ "permlevel": 0
+ },
+ {
+ "description": "If Sale BOM is defined, the actual BOM of the Pack is displayed as table.\nAvailable in Delivery Note and Sales Order",
+ "fieldname": "fs_packing_details",
+ "fieldtype": "Check",
+ "label": "Packing Details",
+ "permlevel": 0
+ },
+ {
+ "description": "To get Item Group in details table",
+ "fieldname": "fs_item_group_in_details",
+ "fieldtype": "Check",
+ "label": "Item Groups in Details",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sales_and_purchase",
+ "fieldtype": "Section Break",
+ "label": "Sales and Purchase",
+ "permlevel": 0
+ },
+ {
+ "description": "All export related fields like currency, conversion rate, export total, export grand total etc are available in <br>\nDelivery Note, POS, Quotation, Sales Invoice, Sales Order etc.",
+ "fieldname": "fs_exports",
+ "fieldtype": "Check",
+ "label": "Exports",
+ "permlevel": 0
+ },
+ {
+ "description": "All import related fields like currency, conversion rate, import total, import grand total etc are available in <br>\nPurchase Receipt, Supplier Quotation, Purchase Invoice, Purchase Order etc.",
+ "fieldname": "fs_imports",
+ "fieldtype": "Check",
+ "label": "Imports",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "Field available in Delivery Note, Quotation, Sales Invoice, Sales Order",
+ "fieldname": "fs_discounts",
+ "fieldtype": "Check",
+ "label": "Sales Discounts",
+ "permlevel": 0
+ },
+ {
+ "description": "Discount Fields will be available in Purchase Order, Purchase Receipt, Purchase Invoice",
+ "fieldname": "fs_purchase_discounts",
+ "fieldtype": "Check",
+ "label": "Purchase Discounts",
+ "permlevel": 0
+ },
+ {
+ "description": "To track any installation or commissioning related work after sales",
+ "fieldname": "fs_after_sales_installations",
+ "fieldtype": "Check",
+ "label": "After Sale Installations",
+ "permlevel": 0
+ },
+ {
+ "description": "Available in \nBOM, Delivery Note, Purchase Invoice, Production Order, Purchase Order, Purchase Receipt, Sales Invoice, Sales Order, Stock Entry, Timesheet",
+ "fieldname": "fs_projects",
+ "fieldtype": "Check",
+ "label": "Projects",
+ "permlevel": 0
+ },
+ {
+ "description": "If you have Sales Team and Sale Partners (Channel Partners) they can be tagged and maintain their contribution in the sales activity",
+ "fieldname": "fs_sales_extras",
+ "fieldtype": "Check",
+ "label": "Sales Extras",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "accounts",
+ "fieldtype": "Section Break",
+ "label": "Accounts",
+ "permlevel": 0
+ },
+ {
+ "description": "Check if you need automatic recurring invoices. After submitting any sales invoice, Recurring section will be visible.",
+ "fieldname": "fs_recurring_invoice",
+ "fieldtype": "Check",
+ "label": "Recurring Invoice",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "To enable <b>Point of Sale</b> features",
+ "fieldname": "fs_pos",
+ "fieldtype": "Check",
+ "label": "Point of Sale",
+ "permlevel": 0
+ },
+ {
+ "description": "To enable <b>Point of Sale</b> view",
+ "fieldname": "fs_pos_view",
+ "fieldtype": "Check",
+ "label": "POS View",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "production",
+ "fieldtype": "Section Break",
+ "label": "Manufacturing",
+ "permlevel": 0
+ },
+ {
+ "description": "If you involve in manufacturing activity<br>\nEnables item <b>Is Manufactured</b>",
+ "fieldname": "fs_manufacturing",
+ "fieldtype": "Check",
+ "label": "Manufacturing",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "If you follow Quality Inspection<br>\nEnables item QA Required and QA No in Purchase Receipt",
+ "fieldname": "fs_quality",
+ "fieldtype": "Check",
+ "label": "Quality",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "miscelleneous",
+ "fieldtype": "Section Break",
+ "label": "Miscelleneous",
+ "permlevel": 0
+ },
+ {
+ "description": "If you have long print formats, this feature can be used to split the page to be printed on multiple pages with all headers and footers on each page",
+ "fieldname": "fs_page_break",
+ "fieldtype": "Check",
+ "label": "Page Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "fs_more_info",
+ "fieldtype": "Check",
+ "label": "More Info",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-glass",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-12-24 11:40:19.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Features Setup",
+ "name_case": "Title Case",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Administrator",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.js b/erpnext/setup/doctype/global_defaults/global_defaults.js
index 4b378b3..85d718a 100644
--- a/erpnext/setup/doctype/global_defaults/global_defaults.js
+++ b/erpnext/setup/doctype/global_defaults/global_defaults.js
@@ -18,7 +18,7 @@
},
validate: function(doc, cdt, cdn) {
- return $c_obj(make_doclist(cdt, cdn), 'get_defaults', '', function(r, rt){
+ return $c_obj(doc, 'get_defaults', '', function(r, rt){
sys_defaults = r.message;
});
},
diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.py b/erpnext/setup/doctype/global_defaults/global_defaults.py
index d61ff8a..bfe3265 100644
--- a/erpnext/setup/doctype/global_defaults/global_defaults.py
+++ b/erpnext/setup/doctype/global_defaults/global_defaults.py
@@ -22,9 +22,9 @@
'disable_rounded_total': 'disable_rounded_total',
}
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class GlobalDefaults(Document):
def on_update(self):
"""update defaults"""
diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.txt b/erpnext/setup/doctype/global_defaults/global_defaults.txt
index 31ba0df..5a5f21e 100644
--- a/erpnext/setup/doctype/global_defaults/global_defaults.txt
+++ b/erpnext/setup/doctype/global_defaults/global_defaults.txt
@@ -1,193 +1,174 @@
-[
- {
- "creation": "2013-05-02 17:53:24",
- "docstatus": 0,
- "modified": "2014-02-19 19:11:58",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_copy": 1,
- "doctype": "DocType",
- "hide_toolbar": 0,
- "icon": "icon-cog",
- "in_create": 1,
- "issingle": 1,
- "module": "Setup",
- "name": "__common__",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Global Defaults",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Global Defaults",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "report": 0,
- "role": "System Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Global Defaults"
- },
- {
- "doctype": "DocField",
- "fieldname": "date_and_number_settings",
- "fieldtype": "Section Break",
- "label": "Date and Number Settings"
- },
- {
- "default": "dd-mm-yyyy",
- "doctype": "DocField",
- "fieldname": "date_format",
- "fieldtype": "Select",
- "label": "Date Format",
- "options": "yyyy-mm-dd\ndd-mm-yyyy\ndd/mm/yyyy\nmm/dd/yyyy\nmm-dd-yyyy",
- "read_only": 0
- },
- {
- "description": "This is the default number format. For currencies, please set the number format in the currency master.",
- "doctype": "DocField",
- "fieldname": "number_format",
- "fieldtype": "Select",
- "label": "Number Format",
- "options": "\n#,###.##\n#.###,##\n# ###.##\n#,###.###\n#,##,###.##\n#.###\n#,###",
- "read_only": 0
- },
- {
- "default": "3",
- "description": "Precision for Float fields (quantities, discounts, percentages etc). Floats will be rounded up to specified decimals. Default = 3",
- "doctype": "DocField",
- "fieldname": "float_precision",
- "fieldtype": "Select",
- "label": "Float Precision",
- "options": "\n2\n3\n4\n5\n6",
- "read_only": 0
- },
- {
- "description": "If disable, 'Rounded Total' field will not be visible in any transaction",
- "doctype": "DocField",
- "fieldname": "disable_rounded_total",
- "fieldtype": "Check",
- "label": "Disable Rounded Total",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "currency_settings",
- "fieldtype": "Section Break",
- "label": "Currency Settings"
- },
- {
- "default": "INR",
- "doctype": "DocField",
- "fieldname": "default_currency",
- "fieldtype": "Link",
- "label": "Default Currency",
- "options": "Currency",
- "read_only": 0,
- "reqd": 1
- },
- {
- "description": "Do not show any symbol like $ etc next to currencies.",
- "doctype": "DocField",
- "fieldname": "hide_currency_symbol",
- "fieldtype": "Select",
- "label": "Hide Currency Symbol",
- "options": "\nNo\nYes",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Section Break",
- "label": "Company Settings",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "default_company",
- "fieldtype": "Link",
- "label": "Default Company",
- "options": "Company",
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "current_fiscal_year",
- "fieldtype": "Link",
- "label": "Current Fiscal Year",
- "options": "Fiscal Year",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "system",
- "fieldtype": "Section Break",
- "label": "System Settings",
- "read_only": 0
- },
- {
- "description": "Session Expiry in Hours e.g. 06:00",
- "doctype": "DocField",
- "fieldname": "session_expiry",
- "fieldtype": "Data",
- "label": "Session Expiry",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "country",
- "fieldtype": "Select",
- "label": "Country",
- "options": "link:Country"
- },
- {
- "doctype": "DocField",
- "fieldname": "sms_sender_name",
- "fieldtype": "Data",
- "label": "SMS Sender Name",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_3",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "description": "For Server Side Print Formats",
- "doctype": "DocField",
- "fieldname": "print_style",
- "fieldtype": "Select",
- "label": "Print Format Style",
- "options": "Standard\nClassic\nModern\nSpartan",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "time_zone",
- "fieldtype": "Select",
- "label": "Time Zone"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_copy": 1,
+ "creation": "2013-05-02 17:53:24.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "date_and_number_settings",
+ "fieldtype": "Section Break",
+ "label": "Date and Number Settings",
+ "permlevel": 0
+ },
+ {
+ "default": "dd-mm-yyyy",
+ "fieldname": "date_format",
+ "fieldtype": "Select",
+ "label": "Date Format",
+ "options": "yyyy-mm-dd\ndd-mm-yyyy\ndd/mm/yyyy\nmm/dd/yyyy\nmm-dd-yyyy",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "This is the default number format. For currencies, please set the number format in the currency master.",
+ "fieldname": "number_format",
+ "fieldtype": "Select",
+ "label": "Number Format",
+ "options": "\n#,###.##\n#.###,##\n# ###.##\n#,###.###\n#,##,###.##\n#.###\n#,###",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "default": "3",
+ "description": "Precision for Float fields (quantities, discounts, percentages etc). Floats will be rounded up to specified decimals. Default = 3",
+ "fieldname": "float_precision",
+ "fieldtype": "Select",
+ "label": "Float Precision",
+ "options": "\n2\n3\n4\n5\n6",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "If disable, 'Rounded Total' field will not be visible in any transaction",
+ "fieldname": "disable_rounded_total",
+ "fieldtype": "Check",
+ "label": "Disable Rounded Total",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "currency_settings",
+ "fieldtype": "Section Break",
+ "label": "Currency Settings",
+ "permlevel": 0
+ },
+ {
+ "default": "INR",
+ "fieldname": "default_currency",
+ "fieldtype": "Link",
+ "label": "Default Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Do not show any symbol like $ etc next to currencies.",
+ "fieldname": "hide_currency_symbol",
+ "fieldtype": "Select",
+ "label": "Hide Currency Symbol",
+ "options": "\nNo\nYes",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Section Break",
+ "label": "Company Settings",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "default_company",
+ "fieldtype": "Link",
+ "label": "Default Company",
+ "options": "Company",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "current_fiscal_year",
+ "fieldtype": "Link",
+ "label": "Current Fiscal Year",
+ "options": "Fiscal Year",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "system",
+ "fieldtype": "Section Break",
+ "label": "System Settings",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "Session Expiry in Hours e.g. 06:00",
+ "fieldname": "session_expiry",
+ "fieldtype": "Data",
+ "label": "Session Expiry",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "country",
+ "fieldtype": "Select",
+ "label": "Country",
+ "options": "link:Country",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sms_sender_name",
+ "fieldtype": "Data",
+ "label": "SMS Sender Name",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "For Server Side Print Formats",
+ "fieldname": "print_style",
+ "fieldtype": "Select",
+ "label": "Print Format Style",
+ "options": "Standard\nClassic\nModern\nSpartan",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "time_zone",
+ "fieldtype": "Select",
+ "label": "Time Zone",
+ "permlevel": 0
+ }
+ ],
+ "hide_toolbar": 0,
+ "icon": "icon-cog",
+ "idx": 1,
+ "in_create": 1,
+ "issingle": 1,
+ "modified": "2014-02-19 19:11:58.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Global Defaults",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "permlevel": 0,
+ "read": 1,
+ "report": 0,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 1
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py
index aa1002e..455d752 100644
--- a/erpnext/setup/doctype/item_group/item_group.py
+++ b/erpnext/setup/doctype/item_group/item_group.py
@@ -6,10 +6,7 @@
from frappe.utils.nestedset import DocTypeNestedSet
-class DocType(DocTypeNestedSet):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class ItemGroup(DocTypeNestedSet):
self.nsm_parent_field = 'parent_item_group'
def validate(self):
diff --git a/erpnext/setup/doctype/item_group/item_group.txt b/erpnext/setup/doctype/item_group/item_group.txt
index 8bd9e7f..592673e 100644
--- a/erpnext/setup/doctype/item_group/item_group.txt
+++ b/erpnext/setup/doctype/item_group/item_group.txt
@@ -1,228 +1,239 @@
-[
- {
- "creation": "2013-03-28 10:35:29",
- "docstatus": 0,
- "modified": "2014-02-20 18:29:57",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:item_group_name",
- "description": "Item Classification",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-sitemap",
- "in_create": 1,
- "issingle": 0,
- "max_attachments": 3,
- "module": "Setup",
- "name": "__common__",
- "search_fields": "parent_item_group"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Item Group",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Item Group",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Item Group"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_group_name",
- "fieldtype": "Data",
- "label": "Item Group Name",
- "no_copy": 0,
- "oldfieldname": "item_group_name",
- "oldfieldtype": "Data",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "page_name",
- "fieldtype": "Data",
- "label": "Page Name",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cb0",
- "fieldtype": "Column Break"
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "parent_item_group",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Parent Item Group",
- "no_copy": 0,
- "oldfieldname": "parent_item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "reqd": 0,
- "search_index": 0
- },
- {
- "description": "Only leaf nodes are allowed in transaction",
- "doctype": "DocField",
- "fieldname": "is_group",
- "fieldtype": "Select",
- "label": "Has Child Node",
- "no_copy": 0,
- "oldfieldname": "is_group",
- "oldfieldtype": "Select",
- "options": "\nYes\nNo",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sb9",
- "fieldtype": "Section Break",
- "label": "Website Settings"
- },
- {
- "description": "Check this if you want to show in website",
- "doctype": "DocField",
- "fieldname": "show_in_website",
- "fieldtype": "Check",
- "label": "Show in Website",
- "no_copy": 0,
- "search_index": 0
- },
- {
- "depends_on": "show_in_website",
- "doctype": "DocField",
- "fieldname": "parent_website_route",
- "fieldtype": "Link",
- "label": "Parent Website Page",
- "options": "Website Route"
- },
- {
- "depends_on": "show_in_website",
- "description": "Show this slideshow at the top of the page",
- "doctype": "DocField",
- "fieldname": "slideshow",
- "fieldtype": "Link",
- "label": "Slideshow",
- "options": "Website Slideshow"
- },
- {
- "depends_on": "show_in_website",
- "description": "HTML / Banner that will show on the top of product list.",
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text Editor",
- "label": "Description"
- },
- {
- "depends_on": "show_in_website",
- "doctype": "DocField",
- "fieldname": "item_website_specifications",
- "fieldtype": "Table",
- "label": "Item Website Specifications",
- "options": "Item Website Specification"
- },
- {
- "doctype": "DocField",
- "fieldname": "lft",
- "fieldtype": "Int",
- "hidden": 1,
- "in_filter": 1,
- "label": "lft",
- "no_copy": 1,
- "oldfieldname": "lft",
- "oldfieldtype": "Int",
- "print_hide": 1,
- "report_hide": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rgt",
- "fieldtype": "Int",
- "hidden": 1,
- "in_filter": 1,
- "label": "rgt",
- "no_copy": 1,
- "oldfieldname": "rgt",
- "oldfieldtype": "Int",
- "print_hide": 1,
- "report_hide": 0,
- "search_index": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "old_parent",
- "fieldtype": "Link",
- "hidden": 1,
- "ignore_restrictions": 1,
- "label": "old_parent",
- "no_copy": 1,
- "oldfieldname": "old_parent",
- "oldfieldtype": "Data",
- "options": "Item Group",
- "print_hide": 1,
- "report_hide": 1,
- "search_index": 0
- },
- {
- "amend": 0,
- "create": 0,
- "doctype": "DocPerm",
- "role": "Material Manager",
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "create": 0,
- "doctype": "DocPerm",
- "role": "Material User",
- "submit": 0,
- "write": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "role": "Material Master Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocPerm",
- "role": "Sales User"
- },
- {
- "doctype": "DocPerm",
- "role": "Purchase User"
- },
- {
- "doctype": "DocPerm",
- "role": "Accounts User"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:item_group_name",
+ "creation": "2013-03-28 10:35:29.000000",
+ "description": "Item Classification",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "item_group_name",
+ "fieldtype": "Data",
+ "label": "Item Group Name",
+ "no_copy": 0,
+ "oldfieldname": "item_group_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "page_name",
+ "fieldtype": "Data",
+ "label": "Page Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "cb0",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "parent_item_group",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Parent Item Group",
+ "no_copy": 0,
+ "oldfieldname": "parent_item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "description": "Only leaf nodes are allowed in transaction",
+ "fieldname": "is_group",
+ "fieldtype": "Select",
+ "label": "Has Child Node",
+ "no_copy": 0,
+ "oldfieldname": "is_group",
+ "oldfieldtype": "Select",
+ "options": "\nYes\nNo",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "sb9",
+ "fieldtype": "Section Break",
+ "label": "Website Settings",
+ "permlevel": 0
+ },
+ {
+ "description": "Check this if you want to show in website",
+ "fieldname": "show_in_website",
+ "fieldtype": "Check",
+ "label": "Show in Website",
+ "no_copy": 0,
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "depends_on": "show_in_website",
+ "fieldname": "parent_website_route",
+ "fieldtype": "Link",
+ "label": "Parent Website Page",
+ "options": "Website Route",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "show_in_website",
+ "description": "Show this slideshow at the top of the page",
+ "fieldname": "slideshow",
+ "fieldtype": "Link",
+ "label": "Slideshow",
+ "options": "Website Slideshow",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "show_in_website",
+ "description": "HTML / Banner that will show on the top of product list.",
+ "fieldname": "description",
+ "fieldtype": "Text Editor",
+ "label": "Description",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "show_in_website",
+ "fieldname": "item_website_specifications",
+ "fieldtype": "Table",
+ "label": "Item Website Specifications",
+ "options": "Item Website Specification",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "lft",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "lft",
+ "no_copy": 1,
+ "oldfieldname": "lft",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "rgt",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "rgt",
+ "no_copy": 1,
+ "oldfieldname": "rgt",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 0,
+ "search_index": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "old_parent",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_restrictions": 1,
+ "label": "old_parent",
+ "no_copy": 1,
+ "oldfieldname": "old_parent",
+ "oldfieldtype": "Data",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1,
+ "search_index": 0
+ }
+ ],
+ "icon": "icon-sitemap",
+ "idx": 1,
+ "in_create": 1,
+ "issingle": 0,
+ "max_attachments": 3,
+ "modified": "2014-02-20 18:29:57.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Item Group",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Manager",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User"
+ },
+ {
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User"
+ },
+ {
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User"
+ }
+ ],
+ "search_fields": "parent_item_group"
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py
index 4d2d1ea..2c928aa 100644
--- a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py
+++ b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py
@@ -8,9 +8,9 @@
from frappe import _
from frappe.utils import cint
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class JobsEmailSettings(Document):
def validate(self):
if cint(self.doc.extract_emails) and not (self.doc.email_id and self.doc.host and \
diff --git a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt
index 24a4240..e6fec9d 100644
--- a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt
+++ b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt
@@ -1,92 +1,73 @@
-[
- {
- "creation": "2013-01-15 16:50:01",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:16",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "description": "Email settings for jobs email id \"jobs@example.com\"",
- "doctype": "DocType",
- "icon": "icon-cog",
- "issingle": 1,
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Jobs Email Settings",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Jobs Email Settings",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "role": "System Manager",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Jobs Email Settings"
- },
- {
- "description": "Settings to extract Job Applicants from a mailbox e.g. \"jobs@example.com\"",
- "doctype": "DocField",
- "fieldname": "pop3_mail_settings",
- "fieldtype": "Section Break",
- "label": "POP3 Mail Settings"
- },
- {
- "description": "Check to activate",
- "doctype": "DocField",
- "fieldname": "extract_emails",
- "fieldtype": "Check",
- "label": "Extract Emails"
- },
- {
- "description": "Email Id where a job applicant will email e.g. \"jobs@example.com\"",
- "doctype": "DocField",
- "fieldname": "email_id",
- "fieldtype": "Data",
- "label": "Email Id"
- },
- {
- "description": "POP3 server e.g. (pop.gmail.com)",
- "doctype": "DocField",
- "fieldname": "host",
- "fieldtype": "Data",
- "label": "Host"
- },
- {
- "doctype": "DocField",
- "fieldname": "use_ssl",
- "fieldtype": "Check",
- "label": "Use SSL"
- },
- {
- "doctype": "DocField",
- "fieldname": "username",
- "fieldtype": "Data",
- "label": "Username"
- },
- {
- "doctype": "DocField",
- "fieldname": "password",
- "fieldtype": "Password",
- "label": "Password"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-15 16:50:01.000000",
+ "description": "Email settings for jobs email id \"jobs@example.com\"",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "Settings to extract Job Applicants from a mailbox e.g. \"jobs@example.com\"",
+ "fieldname": "pop3_mail_settings",
+ "fieldtype": "Section Break",
+ "label": "POP3 Mail Settings",
+ "permlevel": 0
+ },
+ {
+ "description": "Check to activate",
+ "fieldname": "extract_emails",
+ "fieldtype": "Check",
+ "label": "Extract Emails",
+ "permlevel": 0
+ },
+ {
+ "description": "Email Id where a job applicant will email e.g. \"jobs@example.com\"",
+ "fieldname": "email_id",
+ "fieldtype": "Data",
+ "label": "Email Id",
+ "permlevel": 0
+ },
+ {
+ "description": "POP3 server e.g. (pop.gmail.com)",
+ "fieldname": "host",
+ "fieldtype": "Data",
+ "label": "Host",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "use_ssl",
+ "fieldtype": "Check",
+ "label": "Use SSL",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "username",
+ "fieldtype": "Data",
+ "label": "Username",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "password",
+ "fieldtype": "Password",
+ "label": "Password",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-cog",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-12-20 19:23:16.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Jobs Email Settings",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "System Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/naming_series/naming_series.js b/erpnext/setup/doctype/naming_series/naming_series.js
index 4f6a4c9..b9b94ca 100644
--- a/erpnext/setup/doctype/naming_series/naming_series.js
+++ b/erpnext/setup/doctype/naming_series/naming_series.js
@@ -29,7 +29,7 @@
}
if(doc.select_doc_for_series)
- return $c_obj(make_doclist(doc.doctype, doc.name),'get_options','',callback);
+ return $c_obj(doc,'get_options','',callback);
}
cur_frm.cscript.update = function() {
diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py
index 5b0c9e2..d1608fc 100644
--- a/erpnext/setup/doctype/naming_series/naming_series.py
+++ b/erpnext/setup/doctype/naming_series/naming_series.py
@@ -8,9 +8,9 @@
from frappe import msgprint, throw, _
import frappe.model.doctype
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class NamingSeries(Document):
def get_transactions(self, arg=None):
return {
@@ -56,26 +56,27 @@
default = options[0]
# update in property setter
- from frappe.model.doc import Document
- prop_dict = {'options': "\n".join(options), 'default': default}
+ prop_dict = {'options': "\n".join(options), 'default': default}
for prop in prop_dict:
ps_exists = frappe.db.sql("""SELECT name FROM `tabProperty Setter`
WHERE doc_type = %s AND field_name = 'naming_series'
AND property = %s""", (doctype, prop))
if ps_exists:
- ps = Document('Property Setter', ps_exists[0][0])
+ ps = frappe.get_doc('Property Setter', ps_exists[0][0])
ps.value = prop_dict[prop]
ps.save()
else:
- ps = Document('Property Setter', fielddata = {
+ ps = frappe.get_doc({
+ 'doctype': 'Property Setter',
'doctype_or_field': 'DocField',
'doc_type': doctype,
'field_name': 'naming_series',
'property': prop,
'value': prop_dict[prop],
'property_type': 'Select',
+ '__islocal': 1
})
- ps.save(1)
+ ps.save()
self.doc.set_options = "\n".join(options)
diff --git a/erpnext/setup/doctype/naming_series/naming_series.txt b/erpnext/setup/doctype/naming_series/naming_series.txt
index dd28eac..95faa48 100644
--- a/erpnext/setup/doctype/naming_series/naming_series.txt
+++ b/erpnext/setup/doctype/naming_series/naming_series.txt
@@ -1,117 +1,98 @@
-[
- {
- "creation": "2013-01-25 11:35:08",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:21",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "description": "Set prefix for numbering series on your transactions",
- "doctype": "DocType",
- "hide_heading": 0,
- "hide_toolbar": 1,
- "icon": "icon-sort-by-order",
- "issingle": 1,
- "module": "Setup",
- "name": "__common__",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Naming Series",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Naming Series",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 0,
- "role": "System Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Naming Series"
- },
- {
- "description": "Set prefix for numbering series on your transactions",
- "doctype": "DocField",
- "fieldname": "setup_series",
- "fieldtype": "Section Break",
- "label": "Setup Series"
- },
- {
- "doctype": "DocField",
- "fieldname": "select_doc_for_series",
- "fieldtype": "Select",
- "label": "Select Transaction"
- },
- {
- "doctype": "DocField",
- "fieldname": "help_html",
- "fieldtype": "HTML",
- "label": "Help HTML",
- "options": "<div class=\"well\">\nEdit list of Series in the box below. Rules:\n<ul>\n<li>Each Series Prefix on a new line.</li>\n<li>Allowed special characters are \"/\" and \"-\"</li>\n<li>Optionally, set the number of digits in the series using dot (.) followed by hashes (#). For example, \".####\" means that the series will have four digits. Default is five digits.</li>\n</ul>\nExamples:<br>\nINV-<br>\nINV-10-<br>\nINVK-<br>\nINV-.####<br>\n</div>"
- },
- {
- "doctype": "DocField",
- "fieldname": "set_options",
- "fieldtype": "Text",
- "label": "Series List for this Transaction"
- },
- {
- "description": "Check this if you want to force the user to select a series before saving. There will be no default if you check this.",
- "doctype": "DocField",
- "fieldname": "user_must_always_select",
- "fieldtype": "Check",
- "label": "User must always select"
- },
- {
- "doctype": "DocField",
- "fieldname": "update",
- "fieldtype": "Button",
- "label": "Update"
- },
- {
- "description": "Change the starting / current sequence number of an existing series.",
- "doctype": "DocField",
- "fieldname": "update_series",
- "fieldtype": "Section Break",
- "label": "Update Series"
- },
- {
- "doctype": "DocField",
- "fieldname": "prefix",
- "fieldtype": "Select",
- "label": "Prefix"
- },
- {
- "description": "This is the number of the last created transaction with this prefix",
- "doctype": "DocField",
- "fieldname": "current_value",
- "fieldtype": "Int",
- "label": "Current Value"
- },
- {
- "doctype": "DocField",
- "fieldname": "update_series_start",
- "fieldtype": "Button",
- "label": "Update Series Number",
- "options": "update_series_start"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-25 11:35:08.000000",
+ "description": "Set prefix for numbering series on your transactions",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "Set prefix for numbering series on your transactions",
+ "fieldname": "setup_series",
+ "fieldtype": "Section Break",
+ "label": "Setup Series",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "select_doc_for_series",
+ "fieldtype": "Select",
+ "label": "Select Transaction",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "help_html",
+ "fieldtype": "HTML",
+ "label": "Help HTML",
+ "options": "<div class=\"well\">\nEdit list of Series in the box below. Rules:\n<ul>\n<li>Each Series Prefix on a new line.</li>\n<li>Allowed special characters are \"/\" and \"-\"</li>\n<li>Optionally, set the number of digits in the series using dot (.) followed by hashes (#). For example, \".####\" means that the series will have four digits. Default is five digits.</li>\n</ul>\nExamples:<br>\nINV-<br>\nINV-10-<br>\nINVK-<br>\nINV-.####<br>\n</div>",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "set_options",
+ "fieldtype": "Text",
+ "label": "Series List for this Transaction",
+ "permlevel": 0
+ },
+ {
+ "description": "Check this if you want to force the user to select a series before saving. There will be no default if you check this.",
+ "fieldname": "user_must_always_select",
+ "fieldtype": "Check",
+ "label": "User must always select",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "update",
+ "fieldtype": "Button",
+ "label": "Update",
+ "permlevel": 0
+ },
+ {
+ "description": "Change the starting / current sequence number of an existing series.",
+ "fieldname": "update_series",
+ "fieldtype": "Section Break",
+ "label": "Update Series",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "prefix",
+ "fieldtype": "Select",
+ "label": "Prefix",
+ "permlevel": 0
+ },
+ {
+ "description": "This is the number of the last created transaction with this prefix",
+ "fieldname": "current_value",
+ "fieldtype": "Int",
+ "label": "Current Value",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "update_series_start",
+ "fieldtype": "Button",
+ "label": "Update Series Number",
+ "options": "update_series_start",
+ "permlevel": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 1,
+ "icon": "icon-sort-by-order",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-12-20 19:23:21.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Naming Series",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 1
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/notification_control/notification_control.js b/erpnext/setup/doctype/notification_control/notification_control.js
index 9d26496..19660b8 100644
--- a/erpnext/setup/doctype/notification_control/notification_control.js
+++ b/erpnext/setup/doctype/notification_control/notification_control.js
@@ -8,6 +8,6 @@
doc.custom_message = r.message;
refresh_field('custom_message');
}
- return $c_obj(make_doclist(cdt, cdn),'get_message',doc.select_transaction, callback)
+ return $c_obj(doc,'get_message',doc.select_transaction, callback)
}
}
diff --git a/erpnext/setup/doctype/notification_control/notification_control.py b/erpnext/setup/doctype/notification_control/notification_control.py
index c513746..21bdcce 100644
--- a/erpnext/setup/doctype/notification_control/notification_control.py
+++ b/erpnext/setup/doctype/notification_control/notification_control.py
@@ -7,9 +7,10 @@
from frappe import msgprint
-class DocType:
- def __init__(self,d,dl):
- self.doc, self.doclist = d,dl
+from frappe.model.document import Document
+
+class NotificationControl(Document):
+
def get_message(self, arg):
fn = arg.lower().replace(' ', '_') + '_message'
diff --git a/erpnext/setup/doctype/notification_control/notification_control.txt b/erpnext/setup/doctype/notification_control/notification_control.txt
index 81e08a5..e6a6a7f 100644
--- a/erpnext/setup/doctype/notification_control/notification_control.txt
+++ b/erpnext/setup/doctype/notification_control/notification_control.txt
@@ -1,218 +1,200 @@
-[
- {
- "creation": "2012-07-12 23:29:45",
- "docstatus": 0,
- "modified": "2013-07-10 19:24:07",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_copy": 1,
- "allow_email": 1,
- "allow_print": 1,
- "description": "Send automatic emails to Contacts on Submitting transactions.",
- "doctype": "DocType",
- "icon": "icon-envelope",
- "issingle": 1,
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Notification Control",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Notification Control",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1
- },
- {
- "doctype": "DocType",
- "name": "Notification Control"
- },
- {
- "description": "When any of the checked transactions are \"Submitted\", an email pop-up automatically opened to send an email to the associated \"Contact\" in that transaction, with the transaction as an attachment. The user may or may not send the email.",
- "doctype": "DocField",
- "fieldname": "send_autonotification_for",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Prompt for Email on Submission of"
- },
- {
- "doctype": "DocField",
- "fieldname": "sales",
- "fieldtype": "Column Break",
- "in_list_view": 0,
- "label": "Sales",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "quotation",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Quotation"
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_order",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Sales Order"
- },
- {
- "doctype": "DocField",
- "fieldname": "delivery_note",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Delivery Note"
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_invoice",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Sales Invoice"
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase",
- "fieldtype": "Column Break",
- "in_list_view": 0,
- "label": "Purchase",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_order",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Purchase Order"
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_receipt",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Purchase Receipt"
- },
- {
- "doctype": "DocField",
- "fieldname": "expense_claim",
- "fieldtype": "Check",
- "label": "Expense Claim"
- },
- {
- "description": "Customize the introductory text that goes as a part of that email. Each transaction has a separate introductory text.",
- "doctype": "DocField",
- "fieldname": "customize_the_notification",
- "fieldtype": "Section Break",
- "label": "Customize the Notification"
- },
- {
- "doctype": "DocField",
- "fieldname": "select_transaction",
- "fieldtype": "Select",
- "label": "Select Transaction",
- "options": "\nQuotation\nSales Order\nDelivery Note\nSales Invoice\nPurchase Order\nPurchase Receipt\nExpense Claim\nExpense Claim Approved\nExpense Claim Rejected"
- },
- {
- "doctype": "DocField",
- "fieldname": "custom_message",
- "fieldtype": "Text Editor",
- "label": "Custom Message"
- },
- {
- "doctype": "DocField",
- "fieldname": "update",
- "fieldtype": "Button",
- "label": "Update",
- "options": "set_message"
- },
- {
- "doctype": "DocField",
- "fieldname": "quotation_message",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Quotation Message",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_order_message",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Sales Order Message",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "delivery_note_message",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Delivery Note Message",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_invoice_message",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Sales Invoice Message",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_order_message",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Purchase Order Message",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_receipt_message",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Purchase Receipt Message",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "expense_claim_approved_message",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Expense Claim Approved Message",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "expense_claim_rejected_message",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Expense Claim Rejected Message",
- "print_hide": 1
- },
- {
- "create": 0,
- "doctype": "DocPerm",
- "role": "Guest",
- "write": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "role": "System Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_copy": 1,
+ "allow_email": 1,
+ "allow_print": 1,
+ "creation": "2012-07-12 23:29:45.000000",
+ "description": "Send automatic emails to Contacts on Submitting transactions.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "When any of the checked transactions are \"Submitted\", an email pop-up automatically opened to send an email to the associated \"Contact\" in that transaction, with the transaction as an attachment. The user may or may not send the email.",
+ "fieldname": "send_autonotification_for",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Prompt for Email on Submission of",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sales",
+ "fieldtype": "Column Break",
+ "in_list_view": 0,
+ "label": "Sales",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "quotation",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Quotation",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sales_order",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Sales Order",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "delivery_note",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Delivery Note",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sales_invoice",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Sales Invoice",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "purchase",
+ "fieldtype": "Column Break",
+ "in_list_view": 0,
+ "label": "Purchase",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "purchase_order",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Purchase Order",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "purchase_receipt",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Purchase Receipt",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "expense_claim",
+ "fieldtype": "Check",
+ "label": "Expense Claim",
+ "permlevel": 0
+ },
+ {
+ "description": "Customize the introductory text that goes as a part of that email. Each transaction has a separate introductory text.",
+ "fieldname": "customize_the_notification",
+ "fieldtype": "Section Break",
+ "label": "Customize the Notification",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "select_transaction",
+ "fieldtype": "Select",
+ "label": "Select Transaction",
+ "options": "\nQuotation\nSales Order\nDelivery Note\nSales Invoice\nPurchase Order\nPurchase Receipt\nExpense Claim\nExpense Claim Approved\nExpense Claim Rejected",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "custom_message",
+ "fieldtype": "Text Editor",
+ "label": "Custom Message",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "update",
+ "fieldtype": "Button",
+ "label": "Update",
+ "options": "set_message",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "quotation_message",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Quotation Message",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "sales_order_message",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Sales Order Message",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "delivery_note_message",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Delivery Note Message",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "sales_invoice_message",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Sales Invoice Message",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "purchase_order_message",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Purchase Order Message",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "purchase_receipt_message",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Purchase Receipt Message",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "expense_claim_approved_message",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Expense Claim Approved Message",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "expense_claim_rejected_message",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Expense Claim Rejected Message",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "icon": "icon-envelope",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-07-10 19:24:07.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Notification Control",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 0,
+ "permlevel": 0,
+ "read": 1,
+ "role": "Guest",
+ "write": 0
+ },
+ {
+ "create": 1,
+ "permlevel": 0,
+ "read": 1,
+ "role": "System Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/print_heading/print_heading.py b/erpnext/setup/doctype/print_heading/print_heading.py
index 263c31e..eb6d978 100644
--- a/erpnext/setup/doctype/print_heading/print_heading.py
+++ b/erpnext/setup/doctype/print_heading/print_heading.py
@@ -4,12 +4,7 @@
from __future__ import unicode_literals
import frappe
-from frappe.model import db_exists
-from frappe.model.bean import copy_doclist
+from frappe.model.document import Document
-
-
-
-class DocType:
- def __init__(self,doc,doclist=[]):
- self.doc, self.doclist = doc,doclist
\ No newline at end of file
+class PrintHeading(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/setup/doctype/print_heading/print_heading.txt b/erpnext/setup/doctype/print_heading/print_heading.txt
index d566f8d..fc558f2 100644
--- a/erpnext/setup/doctype/print_heading/print_heading.txt
+++ b/erpnext/setup/doctype/print_heading/print_heading.txt
@@ -1,80 +1,61 @@
-[
- {
- "creation": "2013-01-10 16:34:24",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:01",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:print_heading",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-font",
- "module": "Setup",
- "name": "__common__",
- "search_fields": "print_heading"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Print Heading",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Print Heading",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "All",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Print Heading"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "print_heading",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Print Heading",
- "oldfieldname": "print_heading",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "width": "300px"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:print_heading",
+ "creation": "2013-01-10 16:34:24.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "print_heading",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Print Heading",
+ "oldfieldname": "print_heading",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "width": "300px"
+ }
+ ],
+ "icon": "icon-font",
+ "idx": 1,
+ "modified": "2014-01-20 17:49:01.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Print Heading",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "All",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "search_fields": "print_heading"
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py
index d30eab6..ea9f927 100644
--- a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py
+++ b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class QuotationLostReason(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt
index 00e9c6e..0d58279 100644
--- a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt
+++ b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt
@@ -1,70 +1,51 @@
-[
- {
- "creation": "2013-01-10 16:34:24",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:17",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:order_lost_reason",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-flag",
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Quotation Lost Reason",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Quotation Lost Reason",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Sales Master Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Quotation Lost Reason"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "order_lost_reason",
- "fieldtype": "Data",
- "label": "Quotation Lost Reason",
- "oldfieldname": "order_lost_reason",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:order_lost_reason",
+ "creation": "2013-01-10 16:34:24.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "order_lost_reason",
+ "fieldtype": "Data",
+ "label": "Quotation Lost Reason",
+ "oldfieldname": "order_lost_reason",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "icon": "icon-flag",
+ "idx": 1,
+ "modified": "2014-01-20 17:49:17.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Quotation Lost Reason",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.py b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.py
index 4d2d1ea..01e9be4 100644
--- a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.py
+++ b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.py
@@ -8,9 +8,9 @@
from frappe import _
from frappe.utils import cint
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class SalesEmailSettings(Document):
def validate(self):
if cint(self.doc.extract_emails) and not (self.doc.email_id and self.doc.host and \
diff --git a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt
index f5f8a97..c19f2e2 100644
--- a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt
+++ b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt
@@ -1,92 +1,73 @@
-[
- {
- "creation": "2013-01-16 10:25:26",
- "docstatus": 0,
- "modified": "2013-12-20 19:21:38",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "description": "Email settings to extract Leads from sales email id e.g. \"sales@example.com\"",
- "doctype": "DocType",
- "icon": "icon-cog",
- "issingle": 1,
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Sales Email Settings",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Sales Email Settings",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "role": "System Manager",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Sales Email Settings"
- },
- {
- "description": "Email settings to extract Leads from sales email id e.g. \"sales@example.com\"",
- "doctype": "DocField",
- "fieldname": "pop3_mail_settings",
- "fieldtype": "Section Break",
- "label": "POP3 Mail Settings"
- },
- {
- "description": "Check to activate",
- "doctype": "DocField",
- "fieldname": "extract_emails",
- "fieldtype": "Check",
- "label": "Extract Emails"
- },
- {
- "description": "Email Id where a job applicant will email e.g. \"jobs@example.com\"",
- "doctype": "DocField",
- "fieldname": "email_id",
- "fieldtype": "Data",
- "label": "Email Id"
- },
- {
- "description": "POP3 server e.g. (pop.gmail.com)",
- "doctype": "DocField",
- "fieldname": "host",
- "fieldtype": "Data",
- "label": "Host"
- },
- {
- "doctype": "DocField",
- "fieldname": "use_ssl",
- "fieldtype": "Check",
- "label": "Use SSL"
- },
- {
- "doctype": "DocField",
- "fieldname": "username",
- "fieldtype": "Data",
- "label": "Username"
- },
- {
- "doctype": "DocField",
- "fieldname": "password",
- "fieldtype": "Password",
- "label": "Password"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-16 10:25:26.000000",
+ "description": "Email settings to extract Leads from sales email id e.g. \"sales@example.com\"",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "Email settings to extract Leads from sales email id e.g. \"sales@example.com\"",
+ "fieldname": "pop3_mail_settings",
+ "fieldtype": "Section Break",
+ "label": "POP3 Mail Settings",
+ "permlevel": 0
+ },
+ {
+ "description": "Check to activate",
+ "fieldname": "extract_emails",
+ "fieldtype": "Check",
+ "label": "Extract Emails",
+ "permlevel": 0
+ },
+ {
+ "description": "Email Id where a job applicant will email e.g. \"jobs@example.com\"",
+ "fieldname": "email_id",
+ "fieldtype": "Data",
+ "label": "Email Id",
+ "permlevel": 0
+ },
+ {
+ "description": "POP3 server e.g. (pop.gmail.com)",
+ "fieldname": "host",
+ "fieldtype": "Data",
+ "label": "Host",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "use_ssl",
+ "fieldtype": "Check",
+ "label": "Use SSL",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "username",
+ "fieldtype": "Data",
+ "label": "Username",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "password",
+ "fieldtype": "Password",
+ "label": "Password",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-cog",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-12-20 19:21:38.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Sales Email Settings",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "System Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.py b/erpnext/setup/doctype/sales_partner/sales_partner.py
index eefabf6..5e3e569 100644
--- a/erpnext/setup/doctype/sales_partner/sales_partner.py
+++ b/erpnext/setup/doctype/sales_partner/sales_partner.py
@@ -4,12 +4,9 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, cstr, filter_strip_join
+from frappe.model.document import Document
-class DocType():
- def __init__(self, doc, doclist=None):
- self.doc = doc
- self.doclist = doclist
-
+class SalesPartner(Document):
def validate(self):
if self.doc.partner_website and not self.doc.partner_website.startswith("http"):
self.doc.partner_website = "http://" + self.doc.partner_website
diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.txt b/erpnext/setup/doctype/sales_partner/sales_partner.txt
index 25ae9a0..7bc0edd 100644
--- a/erpnext/setup/doctype/sales_partner/sales_partner.txt
+++ b/erpnext/setup/doctype/sales_partner/sales_partner.txt
@@ -1,250 +1,247 @@
-[
- {
- "creation": "2013-04-12 15:34:06",
- "docstatus": 0,
- "modified": "2014-02-20 18:30:32",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:partner_name",
- "description": "A third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-user",
- "in_create": 0,
- "module": "Setup",
- "name": "__common__",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Sales Partner",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Sales Partner",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Sales Partner"
- },
- {
- "doctype": "DocField",
- "fieldname": "partner_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Sales Partner Name",
- "oldfieldname": "partner_name",
- "oldfieldtype": "Data",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "partner_type",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Partner Type",
- "oldfieldname": "partner_type",
- "oldfieldtype": "Select",
- "options": "\nChannel Partner\nDistributor\nDealer\nAgent\nRetailer\nImplementation Partner\nReseller",
- "search_index": 0
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "label": "Territory",
- "options": "Territory",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "commission_rate",
- "fieldtype": "Float",
- "label": "Commission Rate",
- "oldfieldname": "commission_rate",
- "oldfieldtype": "Currency",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_contacts",
- "fieldtype": "Section Break",
- "label": "Address & Contacts"
- },
- {
- "depends_on": "eval:doc.__islocal",
- "doctype": "DocField",
- "fieldname": "address_desc",
- "fieldtype": "HTML",
- "label": "Address Desc",
- "options": "<em>Addresses will appear only when you save the customer</em>"
- },
- {
- "doctype": "DocField",
- "fieldname": "address_html",
- "fieldtype": "HTML",
- "label": "Address HTML",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break"
- },
- {
- "depends_on": "eval:doc.__islocal",
- "doctype": "DocField",
- "fieldname": "contact_desc",
- "fieldtype": "HTML",
- "label": "Contact Desc",
- "options": "<em>Contact Details will appear only when you save the customer</em>"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_html",
- "fieldtype": "HTML",
- "label": "Contact HTML",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "partner_target_details_section_break",
- "fieldtype": "Section Break",
- "label": "Sales Partner Target",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "partner_target_details",
- "fieldtype": "Table",
- "label": "Partner Target Detail",
- "oldfieldname": "partner_target_details",
- "oldfieldtype": "Table",
- "options": "Target Detail",
- "reqd": 0
- },
- {
- "description": "Select Budget Distribution to unevenly distribute targets across months.",
- "doctype": "DocField",
- "fieldname": "distribution_id",
- "fieldtype": "Link",
- "label": "Target Distribution",
- "oldfieldname": "distribution_id",
- "oldfieldtype": "Link",
- "options": "Budget Distribution"
- },
- {
- "doctype": "DocField",
- "fieldname": "website",
- "fieldtype": "Section Break",
- "label": "Website"
- },
- {
- "doctype": "DocField",
- "fieldname": "show_in_website",
- "fieldtype": "Check",
- "label": "Show In Website"
- },
- {
- "depends_on": "eval:cint(doc.show_in_website)",
- "doctype": "DocField",
- "fieldname": "section_break_17",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "logo",
- "fieldtype": "Select",
- "label": "Logo",
- "options": "attach_files:"
- },
- {
- "doctype": "DocField",
- "fieldname": "partner_website",
- "fieldtype": "Data",
- "label": "Partner's Website"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_20",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "page_name",
- "fieldtype": "Data",
- "label": "Page Name",
- "read_only": 1
- },
- {
- "depends_on": "eval:cint(doc.show_in_website)",
- "doctype": "DocField",
- "fieldname": "section_break_22",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "introduction",
- "fieldtype": "Text",
- "label": "Introduction"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text Editor",
- "label": "Description"
- },
- {
- "doctype": "DocField",
- "fieldname": "parent_website_route",
- "fieldtype": "Link",
- "label": "Parent Website Route",
- "options": "Website Route"
- },
- {
- "create": 0,
- "doctype": "DocPerm",
- "role": "Sales Manager",
- "write": 0
- },
- {
- "create": 0,
- "doctype": "DocPerm",
- "role": "Sales User",
- "write": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "role": "Sales Master Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:partner_name",
+ "creation": "2013-04-12 15:34:06.000000",
+ "description": "A third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "partner_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Sales Partner Name",
+ "oldfieldname": "partner_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "partner_type",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Partner Type",
+ "oldfieldname": "partner_type",
+ "oldfieldtype": "Select",
+ "options": "\nChannel Partner\nDistributor\nDealer\nAgent\nRetailer\nImplementation Partner\nReseller",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "commission_rate",
+ "fieldtype": "Float",
+ "label": "Commission Rate",
+ "oldfieldname": "commission_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "address_contacts",
+ "fieldtype": "Section Break",
+ "label": "Address & Contacts",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.__islocal",
+ "fieldname": "address_desc",
+ "fieldtype": "HTML",
+ "label": "Address Desc",
+ "options": "<em>Addresses will appear only when you save the customer</em>",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "address_html",
+ "fieldtype": "HTML",
+ "label": "Address HTML",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.__islocal",
+ "fieldname": "contact_desc",
+ "fieldtype": "HTML",
+ "label": "Contact Desc",
+ "options": "<em>Contact Details will appear only when you save the customer</em>",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "contact_html",
+ "fieldtype": "HTML",
+ "label": "Contact HTML",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "partner_target_details_section_break",
+ "fieldtype": "Section Break",
+ "label": "Sales Partner Target",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "partner_target_details",
+ "fieldtype": "Table",
+ "label": "Partner Target Detail",
+ "oldfieldname": "partner_target_details",
+ "oldfieldtype": "Table",
+ "options": "Target Detail",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "description": "Select Budget Distribution to unevenly distribute targets across months.",
+ "fieldname": "distribution_id",
+ "fieldtype": "Link",
+ "label": "Target Distribution",
+ "oldfieldname": "distribution_id",
+ "oldfieldtype": "Link",
+ "options": "Budget Distribution",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "website",
+ "fieldtype": "Section Break",
+ "label": "Website",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "show_in_website",
+ "fieldtype": "Check",
+ "label": "Show In Website",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:cint(doc.show_in_website)",
+ "fieldname": "section_break_17",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "logo",
+ "fieldtype": "Select",
+ "label": "Logo",
+ "options": "attach_files:",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "partner_website",
+ "fieldtype": "Data",
+ "label": "Partner's Website",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break_20",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "page_name",
+ "fieldtype": "Data",
+ "label": "Page Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:cint(doc.show_in_website)",
+ "fieldname": "section_break_22",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "introduction",
+ "fieldtype": "Text",
+ "label": "Introduction",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text Editor",
+ "label": "Description",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "parent_website_route",
+ "fieldtype": "Link",
+ "label": "Parent Website Route",
+ "options": "Website Route",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-user",
+ "idx": 1,
+ "in_create": 0,
+ "modified": "2014-02-20 18:30:32.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Sales Partner",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 0
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/sales_person/sales_person.py b/erpnext/setup/doctype/sales_person/sales_person.py
index 58ddd13..b128d2c 100644
--- a/erpnext/setup/doctype/sales_person/sales_person.py
+++ b/erpnext/setup/doctype/sales_person/sales_person.py
@@ -7,14 +7,11 @@
from frappe.utils import flt
from frappe.utils.nestedset import DocTypeNestedSet
-class DocType(DocTypeNestedSet):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class SalesPerson(DocTypeNestedSet):
self.nsm_parent_field = 'parent_sales_person';
def validate(self):
- for d in getlist(self.doclist, 'target_details'):
+ for d in self.get('target_details'):
if not flt(d.target_qty) and not flt(d.target_amount):
frappe.throw(_("Either target qty or target amount is mandatory."))
diff --git a/erpnext/setup/doctype/sales_person/sales_person.txt b/erpnext/setup/doctype/sales_person/sales_person.txt
index 724dc4c..55b32a2 100644
--- a/erpnext/setup/doctype/sales_person/sales_person.txt
+++ b/erpnext/setup/doctype/sales_person/sales_person.txt
@@ -1,198 +1,193 @@
-[
- {
- "creation": "2013-01-10 16:34:24",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:25",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:sales_person_name",
- "description": "All Sales Transactions can be tagged against multiple **Sales Persons** so that you can set and monitor targets.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-user",
- "in_create": 1,
- "module": "Setup",
- "name": "__common__",
- "search_fields": "name,parent_sales_person"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Sales Person",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Sales Person",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Sales Person"
- },
- {
- "doctype": "DocField",
- "fieldname": "name_and_employee_id",
- "fieldtype": "Section Break",
- "label": "Name and Employee ID",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_person_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Sales Person Name",
- "oldfieldname": "sales_person_name",
- "oldfieldtype": "Data",
- "reqd": 1,
- "search_index": 0
- },
- {
- "description": "Select company name first.",
- "doctype": "DocField",
- "fieldname": "parent_sales_person",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Parent Sales Person",
- "oldfieldname": "parent_sales_person",
- "oldfieldtype": "Link",
- "options": "Sales Person",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "is_group",
- "fieldtype": "Select",
- "label": "Has Child Node",
- "oldfieldname": "is_group",
- "oldfieldtype": "Select",
- "options": "\nYes\nNo",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cb0",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "employee",
- "fieldtype": "Link",
- "label": "Employee",
- "options": "Employee",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "lft",
- "fieldtype": "Int",
- "hidden": 1,
- "in_filter": 1,
- "label": "lft",
- "no_copy": 1,
- "oldfieldname": "lft",
- "oldfieldtype": "Int",
- "print_hide": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rgt",
- "fieldtype": "Int",
- "hidden": 1,
- "in_filter": 1,
- "label": "rgt",
- "no_copy": 1,
- "oldfieldname": "rgt",
- "oldfieldtype": "Int",
- "print_hide": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "old_parent",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "old_parent",
- "no_copy": 1,
- "oldfieldname": "old_parent",
- "oldfieldtype": "Data",
- "print_hide": 1
- },
- {
- "description": "Set targets Item Group-wise for this Sales Person.",
- "doctype": "DocField",
- "fieldname": "target_details_section_break",
- "fieldtype": "Section Break",
- "label": "Sales Person Targets",
- "oldfieldtype": "Section Break",
- "options": "icon-bullseye"
- },
- {
- "doctype": "DocField",
- "fieldname": "target_details",
- "fieldtype": "Table",
- "label": "Target Details1",
- "oldfieldname": "target_details",
- "oldfieldtype": "Table",
- "options": "Target Detail"
- },
- {
- "description": "Select Budget Distribution to unevenly distribute targets across months.",
- "doctype": "DocField",
- "fieldname": "distribution_id",
- "fieldtype": "Link",
- "label": "Target Distribution",
- "oldfieldname": "distribution_id",
- "oldfieldtype": "Link",
- "options": "Budget Distribution",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "communications",
- "fieldtype": "Table",
- "hidden": 1,
- "label": "Communications",
- "options": "Communication",
- "print_hide": 1
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales Manager",
- "write": 0
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales User",
- "write": 0
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales Master Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:sales_person_name",
+ "creation": "2013-01-10 16:34:24.000000",
+ "description": "All Sales Transactions can be tagged against multiple **Sales Persons** so that you can set and monitor targets.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "name_and_employee_id",
+ "fieldtype": "Section Break",
+ "label": "Name and Employee ID",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sales_person_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Sales Person Name",
+ "oldfieldname": "sales_person_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "description": "Select company name first.",
+ "fieldname": "parent_sales_person",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Parent Sales Person",
+ "oldfieldname": "parent_sales_person",
+ "oldfieldtype": "Link",
+ "options": "Sales Person",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "is_group",
+ "fieldtype": "Select",
+ "label": "Has Child Node",
+ "oldfieldname": "is_group",
+ "oldfieldtype": "Select",
+ "options": "\nYes\nNo",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "cb0",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "employee",
+ "fieldtype": "Link",
+ "label": "Employee",
+ "options": "Employee",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "lft",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "lft",
+ "no_copy": 1,
+ "oldfieldname": "lft",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "rgt",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "rgt",
+ "no_copy": 1,
+ "oldfieldname": "rgt",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "old_parent",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "old_parent",
+ "no_copy": 1,
+ "oldfieldname": "old_parent",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "description": "Set targets Item Group-wise for this Sales Person.",
+ "fieldname": "target_details_section_break",
+ "fieldtype": "Section Break",
+ "label": "Sales Person Targets",
+ "oldfieldtype": "Section Break",
+ "options": "icon-bullseye",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "target_details",
+ "fieldtype": "Table",
+ "label": "Target Details1",
+ "oldfieldname": "target_details",
+ "oldfieldtype": "Table",
+ "options": "Target Detail",
+ "permlevel": 0
+ },
+ {
+ "description": "Select Budget Distribution to unevenly distribute targets across months.",
+ "fieldname": "distribution_id",
+ "fieldtype": "Link",
+ "label": "Target Distribution",
+ "oldfieldname": "distribution_id",
+ "oldfieldtype": "Link",
+ "options": "Budget Distribution",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "icon": "icon-user",
+ "idx": 1,
+ "in_create": 1,
+ "modified": "2014-01-20 17:49:25.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Sales Person",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "search_fields": "name,parent_sales_person"
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/sms_parameter/sms_parameter.py b/erpnext/setup/doctype/sms_parameter/sms_parameter.py
index 26c87f1..4c54a4f 100644
--- a/erpnext/setup/doctype/sms_parameter/sms_parameter.py
+++ b/erpnext/setup/doctype/sms_parameter/sms_parameter.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SmsParameter(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/setup/doctype/sms_parameter/sms_parameter.txt b/erpnext/setup/doctype/sms_parameter/sms_parameter.txt
index c4ebb8f..cfa3d98 100755
--- a/erpnext/setup/doctype/sms_parameter/sms_parameter.txt
+++ b/erpnext/setup/doctype/sms_parameter/sms_parameter.txt
@@ -1,42 +1,34 @@
-[
- {
- "creation": "2013-02-22 01:27:58",
- "docstatus": 0,
- "modified": "2013-12-20 19:21:47",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "fieldtype": "Data",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "SMS Parameter",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "print_width": "150px",
- "reqd": 1,
- "width": "150px"
- },
- {
- "doctype": "DocType",
- "name": "SMS Parameter"
- },
- {
- "doctype": "DocField",
- "fieldname": "parameter",
- "label": "Parameter"
- },
- {
- "doctype": "DocField",
- "fieldname": "value",
- "label": "Value"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:58.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "parameter",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Parameter",
+ "permlevel": 0,
+ "print_width": "150px",
+ "reqd": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "value",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Value",
+ "permlevel": 0,
+ "print_width": "150px",
+ "reqd": 1,
+ "width": "150px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:21:47.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "SMS Parameter",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/sms_settings/sms_settings.py b/erpnext/setup/doctype/sms_settings/sms_settings.py
index 26c87f1..9361d3b 100644
--- a/erpnext/setup/doctype/sms_settings/sms_settings.py
+++ b/erpnext/setup/doctype/sms_settings/sms_settings.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SmsSettings(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/setup/doctype/sms_settings/sms_settings.txt b/erpnext/setup/doctype/sms_settings/sms_settings.txt
index 20c0a62..a966ddb 100755
--- a/erpnext/setup/doctype/sms_settings/sms_settings.txt
+++ b/erpnext/setup/doctype/sms_settings/sms_settings.txt
@@ -1,94 +1,75 @@
-[
- {
- "creation": "2013-01-10 16:34:24",
- "docstatus": 0,
- "modified": "2013-09-10 17:20:25",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_copy": 1,
- "allow_email": 1,
- "allow_print": 1,
- "doctype": "DocType",
- "icon": "icon-cog",
- "in_create": 0,
- "issingle": 1,
- "module": "Setup",
- "name": "__common__",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "SMS Settings",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "SMS Settings",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "report": 0,
- "role": "System Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "SMS Settings"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "description": "Eg. smsgateway.com/api/send_sms.cgi",
- "doctype": "DocField",
- "fieldname": "sms_gateway_url",
- "fieldtype": "Data",
- "label": "SMS Gateway URL",
- "reqd": 1
- },
- {
- "description": "Enter url parameter for message",
- "doctype": "DocField",
- "fieldname": "message_parameter",
- "fieldtype": "Data",
- "label": "Message Parameter",
- "reqd": 1
- },
- {
- "description": "Enter url parameter for receiver nos",
- "doctype": "DocField",
- "fieldname": "receiver_parameter",
- "fieldtype": "Data",
- "label": "Receiver Parameter",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "static_parameters",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "description": "Enter static url parameters here (Eg. sender=ERPNext, username=ERPNext, password=1234 etc.)",
- "doctype": "DocField",
- "fieldname": "static_parameter_details",
- "fieldtype": "Table",
- "label": "Static Parameters",
- "options": "SMS Parameter"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_copy": 1,
+ "allow_email": 1,
+ "allow_print": 1,
+ "creation": "2013-01-10 16:34:24.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "description": "Eg. smsgateway.com/api/send_sms.cgi",
+ "fieldname": "sms_gateway_url",
+ "fieldtype": "Data",
+ "label": "SMS Gateway URL",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Enter url parameter for message",
+ "fieldname": "message_parameter",
+ "fieldtype": "Data",
+ "label": "Message Parameter",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Enter url parameter for receiver nos",
+ "fieldname": "receiver_parameter",
+ "fieldtype": "Data",
+ "label": "Receiver Parameter",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "static_parameters",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "description": "Enter static url parameters here (Eg. sender=ERPNext, username=ERPNext, password=1234 etc.)",
+ "fieldname": "static_parameter_details",
+ "fieldtype": "Table",
+ "label": "Static Parameters",
+ "options": "SMS Parameter",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-cog",
+ "idx": 1,
+ "in_create": 0,
+ "issingle": 1,
+ "modified": "2013-09-10 17:20:25.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "SMS Settings",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "permlevel": 0,
+ "read": 1,
+ "report": 0,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 0
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/supplier_type/supplier_type.py b/erpnext/setup/doctype/supplier_type/supplier_type.py
index d30eab6..7036956 100644
--- a/erpnext/setup/doctype/supplier_type/supplier_type.py
+++ b/erpnext/setup/doctype/supplier_type/supplier_type.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class SupplierType(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/setup/doctype/supplier_type/supplier_type.txt b/erpnext/setup/doctype/supplier_type/supplier_type.txt
index 5154f15..03c8ece 100644
--- a/erpnext/setup/doctype/supplier_type/supplier_type.txt
+++ b/erpnext/setup/doctype/supplier_type/supplier_type.txt
@@ -1,85 +1,80 @@
-[
- {
- "creation": "2013-01-10 16:34:24",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:31",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:supplier_type",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-flag",
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Supplier Type",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Supplier Type",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Supplier Type"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_type",
- "fieldtype": "Data",
- "label": "Supplier Type",
- "oldfieldname": "supplier_type",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Purchase Manager",
- "write": 0
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Purchase User",
- "write": 0
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Purchase Master Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:supplier_type",
+ "creation": "2013-01-10 16:34:24.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "supplier_type",
+ "fieldtype": "Data",
+ "label": "Supplier Type",
+ "oldfieldname": "supplier_type",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "icon": "icon-flag",
+ "idx": 1,
+ "modified": "2014-01-20 17:49:31.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Supplier Type",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Manager",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Master Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/target_detail/target_detail.py b/erpnext/setup/doctype/target_detail/target_detail.py
index 26c87f1..2332560 100644
--- a/erpnext/setup/doctype/target_detail/target_detail.py
+++ b/erpnext/setup/doctype/target_detail/target_detail.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class TargetDetail(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/setup/doctype/target_detail/target_detail.txt b/erpnext/setup/doctype/target_detail/target_detail.txt
index 3ae395f..a3df0e5 100644
--- a/erpnext/setup/doctype/target_detail/target_detail.txt
+++ b/erpnext/setup/doctype/target_detail/target_detail.txt
@@ -1,72 +1,62 @@
-[
- {
- "creation": "2013-02-22 01:27:58",
- "docstatus": 0,
- "modified": "2013-12-20 19:21:51",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Target Detail",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Target Detail"
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Item Group",
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "target_qty",
- "fieldtype": "Float",
- "label": "Target Qty",
- "oldfieldname": "target_qty",
- "oldfieldtype": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "target_amount",
- "fieldtype": "Float",
- "in_filter": 1,
- "label": "Target Amount",
- "oldfieldname": "target_amount",
- "oldfieldtype": "Currency",
- "reqd": 0,
- "search_index": 1
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:27:58.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Group",
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "target_qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Target Qty",
+ "oldfieldname": "target_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "target_amount",
+ "fieldtype": "Float",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Target Amount",
+ "oldfieldname": "target_amount",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:21:51.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Target Detail",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py
index 26c87f1..73ac394 100644
--- a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py
+++ b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class TermsAndConditions(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt
index 1649379..b43790b 100644
--- a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt
+++ b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt
@@ -1,104 +1,103 @@
-[
- {
- "creation": "2013-01-10 16:34:24",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:33",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:title",
- "description": "Standard Terms and Conditions that can be added to Sales and Purchases.\n\nExamples:\n\n1. Validity of the offer.\n1. Payment Terms (In Advance, On Credit, part advance etc).\n1. What is extra (or payable by the Customer).\n1. Safety / usage warning.\n1. Warranty if any.\n1. Returns Policy.\n1. Terms of shipping, if applicable.\n1. Ways of addressing disputes, indemnity, liability, etc.\n1. Address and Contact of your Company.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-legal",
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Terms and Conditions",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Terms and Conditions",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Terms and Conditions"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "title",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Title",
- "oldfieldname": "title",
- "oldfieldtype": "Data",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "terms",
- "fieldtype": "Text Editor",
- "label": "Terms and Conditions",
- "oldfieldname": "terms",
- "oldfieldtype": "Text Editor"
- },
- {
- "amend": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales Master Manager",
- "write": 1
- },
- {
- "amend": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales User",
- "write": 0
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "System Manager",
- "write": 1
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Accounts User",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:title",
+ "creation": "2013-01-10 16:34:24.000000",
+ "description": "Standard Terms and Conditions that can be added to Sales and Purchases.\n\nExamples:\n\n1. Validity of the offer.\n1. Payment Terms (In Advance, On Credit, part advance etc).\n1. What is extra (or payable by the Customer).\n1. Safety / usage warning.\n1. Warranty if any.\n1. Returns Policy.\n1. Terms of shipping, if applicable.\n1. Ways of addressing disputes, indemnity, liability, etc.\n1. Address and Contact of your Company.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "title",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Title",
+ "oldfieldname": "title",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "label": "Terms and Conditions",
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-legal",
+ "idx": 1,
+ "modified": "2014-01-20 17:49:33.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Terms and Conditions",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/territory/territory.py b/erpnext/setup/doctype/territory/territory.py
index 5dfe458..67669d9 100644
--- a/erpnext/setup/doctype/territory/territory.py
+++ b/erpnext/setup/doctype/territory/territory.py
@@ -9,14 +9,11 @@
from frappe.utils.nestedset import DocTypeNestedSet
-class DocType(DocTypeNestedSet):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
- self.nsm_parent_field = 'parent_territory'
+class Territory(DocTypeNestedSet):
+ nsm_parent_field = 'parent_territory'
def validate(self):
- for d in getlist(self.doclist, 'target_details'):
+ for d in self.get('target_details'):
if not flt(d.target_qty) and not flt(d.target_amount):
msgprint("Either target qty or target amount is mandatory.")
raise Exception
diff --git a/erpnext/setup/doctype/territory/territory.txt b/erpnext/setup/doctype/territory/territory.txt
index 3eb766d..e3456e9 100644
--- a/erpnext/setup/doctype/territory/territory.txt
+++ b/erpnext/setup/doctype/territory/territory.txt
@@ -1,201 +1,196 @@
-[
- {
- "creation": "2013-01-10 16:34:24",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:33",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:territory_name",
- "description": "Classification of Customers by region",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-map-marker",
- "in_create": 1,
- "module": "Setup",
- "name": "__common__",
- "name_case": "Title Case",
- "read_only": 1,
- "search_fields": "name,parent_territory,territory_manager"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Territory",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Territory",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Territory"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "territory_name",
- "fieldtype": "Data",
- "label": "Territory Name",
- "no_copy": 1,
- "oldfieldname": "territory_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "parent_territory",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Parent Territory",
- "oldfieldname": "parent_territory",
- "oldfieldtype": "Link",
- "options": "Territory",
- "reqd": 0
- },
- {
- "description": "Only leaf nodes are allowed in transaction",
- "doctype": "DocField",
- "fieldname": "is_group",
- "fieldtype": "Select",
- "label": "Has Child Node",
- "oldfieldname": "is_group",
- "oldfieldtype": "Select",
- "options": "\nYes\nNo",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cb0",
- "fieldtype": "Column Break"
- },
- {
- "description": "For reference",
- "doctype": "DocField",
- "fieldname": "territory_manager",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Territory Manager",
- "oldfieldname": "territory_manager",
- "oldfieldtype": "Link",
- "options": "Sales Person",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "lft",
- "fieldtype": "Int",
- "hidden": 1,
- "in_filter": 1,
- "label": "lft",
- "no_copy": 1,
- "oldfieldname": "lft",
- "oldfieldtype": "Int",
- "print_hide": 1,
- "report_hide": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rgt",
- "fieldtype": "Int",
- "hidden": 1,
- "in_filter": 1,
- "label": "rgt",
- "no_copy": 1,
- "oldfieldname": "rgt",
- "oldfieldtype": "Int",
- "print_hide": 1,
- "report_hide": 0,
- "search_index": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "old_parent",
- "fieldtype": "Link",
- "hidden": 1,
- "ignore_restrictions": 1,
- "label": "old_parent",
- "no_copy": 1,
- "oldfieldname": "old_parent",
- "oldfieldtype": "Data",
- "options": "Territory",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "description": "Set Item Group-wise budgets on this Territory. You can also include seasonality by setting the Distribution.",
- "doctype": "DocField",
- "fieldname": "target_details_section_break",
- "fieldtype": "Section Break",
- "label": "Territory Targets",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "target_details",
- "fieldtype": "Table",
- "label": "Target Details",
- "oldfieldname": "target_details",
- "oldfieldtype": "Table",
- "options": "Target Detail"
- },
- {
- "description": "Select Budget Distribution to unevenly distribute targets across months.",
- "doctype": "DocField",
- "fieldname": "distribution_id",
- "fieldtype": "Link",
- "label": "Target Distribution",
- "oldfieldname": "distribution_id",
- "oldfieldtype": "Link",
- "options": "Budget Distribution"
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales Manager",
- "write": 0
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales User",
- "write": 0
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales Master Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:territory_name",
+ "creation": "2013-01-10 16:34:24.000000",
+ "description": "Classification of Customers by region",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "territory_name",
+ "fieldtype": "Data",
+ "label": "Territory Name",
+ "no_copy": 1,
+ "oldfieldname": "territory_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "parent_territory",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Parent Territory",
+ "oldfieldname": "parent_territory",
+ "oldfieldtype": "Link",
+ "options": "Territory",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "description": "Only leaf nodes are allowed in transaction",
+ "fieldname": "is_group",
+ "fieldtype": "Select",
+ "label": "Has Child Node",
+ "oldfieldname": "is_group",
+ "oldfieldtype": "Select",
+ "options": "\nYes\nNo",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "cb0",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "For reference",
+ "fieldname": "territory_manager",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Territory Manager",
+ "oldfieldname": "territory_manager",
+ "oldfieldtype": "Link",
+ "options": "Sales Person",
+ "permlevel": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "lft",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "lft",
+ "no_copy": 1,
+ "oldfieldname": "lft",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "rgt",
+ "fieldtype": "Int",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "rgt",
+ "no_copy": 1,
+ "oldfieldname": "rgt",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 0,
+ "search_index": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "old_parent",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_restrictions": 1,
+ "label": "old_parent",
+ "no_copy": 1,
+ "oldfieldname": "old_parent",
+ "oldfieldtype": "Data",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ },
+ {
+ "description": "Set Item Group-wise budgets on this Territory. You can also include seasonality by setting the Distribution.",
+ "fieldname": "target_details_section_break",
+ "fieldtype": "Section Break",
+ "label": "Territory Targets",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "target_details",
+ "fieldtype": "Table",
+ "label": "Target Details",
+ "oldfieldname": "target_details",
+ "oldfieldtype": "Table",
+ "options": "Target Detail",
+ "permlevel": 0
+ },
+ {
+ "description": "Select Budget Distribution to unevenly distribute targets across months.",
+ "fieldname": "distribution_id",
+ "fieldtype": "Link",
+ "label": "Target Distribution",
+ "oldfieldname": "distribution_id",
+ "oldfieldtype": "Link",
+ "options": "Budget Distribution",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-map-marker",
+ "idx": 1,
+ "in_create": 1,
+ "modified": "2014-01-20 17:49:33.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Territory",
+ "name_case": "Title Case",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 1,
+ "search_fields": "name,parent_territory,territory_manager"
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/uom/uom.py b/erpnext/setup/doctype/uom/uom.py
index d30eab6..2d076f6 100644
--- a/erpnext/setup/doctype/uom/uom.py
+++ b/erpnext/setup/doctype/uom/uom.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class Uom(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/setup/doctype/uom/uom.txt b/erpnext/setup/doctype/uom/uom.txt
index edff5b1..42e31eb 100644
--- a/erpnext/setup/doctype/uom/uom.txt
+++ b/erpnext/setup/doctype/uom/uom.txt
@@ -1,82 +1,77 @@
-[
- {
- "creation": "2013-01-10 16:34:24",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:34",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "field:uom_name",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-compass",
- "module": "Setup",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "UOM",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "UOM",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "UOM"
- },
- {
- "doctype": "DocField",
- "fieldname": "uom_name",
- "fieldtype": "Data",
- "label": "UOM Name",
- "oldfieldname": "uom_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "description": "Check this to disallow fractions. (for Nos)",
- "doctype": "DocField",
- "fieldname": "must_be_whole_number",
- "fieldtype": "Check",
- "label": "Must be Whole Number"
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Material Master Manager",
- "write": 1
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Material Manager",
- "write": 0
- },
- {
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Material User",
- "write": 0
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "field:uom_name",
+ "creation": "2013-01-10 16:34:24.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "uom_name",
+ "fieldtype": "Data",
+ "label": "UOM Name",
+ "oldfieldname": "uom_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Check this to disallow fractions. (for Nos)",
+ "fieldname": "must_be_whole_number",
+ "fieldtype": "Check",
+ "label": "Must be Whole Number",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-compass",
+ "idx": 1,
+ "modified": "2014-01-20 17:49:34.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "UOM",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Manager",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 0,
+ "write": 0
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/setup/doctype/website_item_group/website_item_group.py b/erpnext/setup/doctype/website_item_group/website_item_group.py
index cb42e2e..4665cab 100644
--- a/erpnext/setup/doctype/website_item_group/website_item_group.py
+++ b/erpnext/setup/doctype/website_item_group/website_item_group.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class WebsiteItemGroup(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/setup/doctype/website_item_group/website_item_group.txt b/erpnext/setup/doctype/website_item_group/website_item_group.txt
index ff731a1..2f68e0a 100644
--- a/erpnext/setup/doctype/website_item_group/website_item_group.txt
+++ b/erpnext/setup/doctype/website_item_group/website_item_group.txt
@@ -1,39 +1,26 @@
-[
- {
- "creation": "2013-02-22 01:28:09",
- "docstatus": 0,
- "modified": "2014-02-28 13:00:07",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "description": "Cross Listing of Item in multiple groups",
- "doctype": "DocType",
- "document_type": "Other",
- "istable": 1,
- "module": "Setup",
- "name": "__common__"
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Item Group",
- "name": "__common__",
- "options": "Item Group",
- "parent": "Website Item Group",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "reqd": 1
- },
- {
- "doctype": "DocType",
- "name": "Website Item Group"
- },
- {
- "doctype": "DocField"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:28:09.000000",
+ "description": "Cross Listing of Item in multiple groups",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "fields": [
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Item Group",
+ "options": "Item Group",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-28 13:00:07.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "Website Item Group",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py
index eba79d8..b03eeae 100644
--- a/erpnext/setup/page/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/page/setup_wizard/setup_wizard.py
@@ -334,16 +334,14 @@
fileurl = save_file(filename, content, "Letter Head", "Standard", decode=True).file_name
frappe.db.set_value("Letter Head", "Standard", "content", "<img src='%s' style='max-width: 100%%;'>" % fileurl)
-
-
def add_all_roles_to(name):
- user = frappe.doc("User", name)
+ user = frappe.get_doc("User", name)
for role in frappe.db.sql("""select name from tabRole"""):
if role[0] not in ["Administrator", "Guest", "All", "Customer", "Supplier", "Partner"]:
- d = user.addchild("user_roles", "UserRole")
+ d = user.append("user_roles")
d.role = role[0]
- d.insert()
-
+ user.save()
+
def create_territories():
"""create two default territories, one for home country and one named Rest of the World"""
from frappe.utils.nestedset import get_root_of
diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.txt b/erpnext/setup/page/setup_wizard/setup_wizard.txt
index 996fd1a..e90c87c 100644
--- a/erpnext/setup/page/setup_wizard/setup_wizard.txt
+++ b/erpnext/setup/page/setup_wizard/setup_wizard.txt
@@ -1,32 +1,19 @@
-[
- {
- "creation": "2013-10-04 13:49:33",
- "docstatus": 0,
- "modified": "2013-10-04 13:49:33",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "module": "Setup",
- "name": "__common__",
- "page_name": "setup-wizard",
- "standard": "Yes",
- "title": "Setup Wizard"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "setup-wizard",
- "parentfield": "roles",
- "parenttype": "Page",
- "role": "System Manager"
- },
- {
- "doctype": "Page",
- "name": "setup-wizard"
- },
- {
- "doctype": "Page Role"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-10-04 13:49:33.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "idx": 1,
+ "modified": "2013-10-04 13:49:33.000000",
+ "modified_by": "Administrator",
+ "module": "Setup",
+ "name": "setup-wizard",
+ "owner": "Administrator",
+ "page_name": "setup-wizard",
+ "roles": [
+ {
+ "role": "System Manager"
+ }
+ ],
+ "standard": "Yes",
+ "title": "Setup Wizard"
+}
\ No newline at end of file
diff --git a/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt b/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt
index 3f29d61..c0a198f 100644
--- a/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt
+++ b/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-04-19 13:31:11",
- "docstatus": 0,
- "modified": "2014-02-11 17:36:51",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Delivery Note",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Georgia\", serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Georgia\", serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table thead {\n\t\tborder-bottom: 1px solid black;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px 0px;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Delivery Note',\n\t\t\t\tdoc.name,\n\t\t\t\t'delivery_note_details',\n\t\t\t\t'Delivery Note Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'base_rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tvar to_append = ''\n\t\t\t\t\t\tif(data_row.discount_percentage){\n\t\t\t\t\t\t\tto_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' +\n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\tdata_row.description = data_row.description + to_append;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(data_row.serial_no) {\n\t\t\t\t\t\t\tto_append = '<div style=\"padding-left: 15px;\"><i>Serial No.:' + \n\t\t\t\t\t\t\t\t((data_row.serial_no.indexOf('\\n')>-1)?'<br />':' ') + \n\t\t\t\t\t\t\t\tdata_row.serial_no + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\tdata_row.description = data_row.description + to_append;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td><script>'<h1>' + (doc.select_print_heading || 'Delivery Note') + '</h1>'</script></td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Delivery Note Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Sales Order No.</b></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<script>doc.sales_order_no</script><br />\n\t\t\t\t\t\t\t<i>(<script>date.str_to_user(doc.posting_date)</script>)</i>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
- "module": "Stock",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Delivery Note Classic"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-19 13:31:11.000000",
+ "doc_type": "Delivery Note",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Georgia\", serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Georgia\", serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table thead {\n\t\tborder-bottom: 1px solid black;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px 0px;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Delivery Note',\n\t\t\t\tdoc.name,\n\t\t\t\t'delivery_note_details',\n\t\t\t\t'Delivery Note Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'base_rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tvar to_append = ''\n\t\t\t\t\t\tif(data_row.discount_percentage){\n\t\t\t\t\t\t\tto_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' +\n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\tdata_row.description = data_row.description + to_append;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(data_row.serial_no) {\n\t\t\t\t\t\t\tto_append = '<div style=\"padding-left: 15px;\"><i>Serial No.:' + \n\t\t\t\t\t\t\t\t((data_row.serial_no.indexOf('\\n')>-1)?'<br />':' ') + \n\t\t\t\t\t\t\t\tdata_row.serial_no + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\tdata_row.description = data_row.description + to_append;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td><script>'<h1>' + (doc.select_print_heading || 'Delivery Note') + '</h1>'</script></td></tr>\n\t\t\t<tr><td><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Delivery Note Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Sales Order No.</b></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<script>doc.sales_order_no</script><br />\n\t\t\t\t\t\t\t<i>(<script>date.str_to_user(doc.posting_date)</script>)</i>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
+ "idx": 1,
+ "modified": "2014-02-11 17:36:51.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Delivery Note Classic",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt b/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt
index 2c66867..9a4999d 100644
--- a/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt
+++ b/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-04-19 13:31:11",
- "docstatus": 0,
- "modified": "2014-02-11 17:36:26",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Delivery Note",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n line-height: 150%;\n\t}\n\n\t.common {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t\tborder-style: none !important;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t\tborder-style: none !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h1 {\n\t\ttext-transform: uppercase;\n\t\tcolor: white;\n\t\tfont-size: 55px;\n\t\tfont-style: italic;\n\t}\n\n\ttable.header-table thead tr:nth-child(1) div {\n\t\theight: 24px;\n\t\tbackground-color: #696969;\n\t\tvertical-align: middle;\n\t\tpadding: 12px 0px 0px 0px;\n\t\twidth: 100%;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body table tr td {\n\t\tbackground-color: #DCDCDC !important;\n\t}\n\n\tdiv.page-body table tr:nth-child(1) td {\n\t\tbackground-color: #696969 !important;\n\t\tcolor: white !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table tfoot td {\n\t\tbackground-color: #696969;\n\t\theight: 10px;\n\t}\n\n\t.imp-details {\n\t\tbackground-color: #DCDCDC;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Delivery Note',\n\t\t\t\tdoc.name,\n\t\t\t\t'delivery_note_details',\n\t\t\t\t'Delivery Note Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'base_rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tvar to_append = ''\n\t\t\t\t\t\tif(data_row.discount_percentage){\n\t\t\t\t\t\t\tto_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' +\n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\tdata_row.description = data_row.description + to_append;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(data_row.serial_no) {\n\t\t\t\t\t\t\tto_append = '<div style=\"padding-left: 15px;\"><i>Serial No.:' + \n\t\t\t\t\t\t\t\t((data_row.serial_no.indexOf('\\n')>-1)?'<br />':' ') + \n\t\t\t\t\t\t\t\tdata_row.serial_no + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\tdata_row.description = data_row.description + to_append;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Delivery Note') + '</h1>'</script></div></td></tr>\n\t\t\t<tr><td colspan=2><div style=\"height:15px\"></div></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr class='imp-details'>\n\t\t\t\t\t\t<td><b>Delivery Note No.</b></td>\n\t\t\t\t\t\t<td><script>cur_frm.docname</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Delivery Note Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Sales Order No.</b></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<script>doc.sales_order_no</script><br />\n\t\t\t\t\t\t\t<i>(<script>date.str_to_user(doc.posting_date)</script>)</i>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold' class='imp-details'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr><td colspan=2><div></div></td><tr>\n\t\t</tfoot>\n\t</table>\n</div>",
- "module": "Stock",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Delivery Note Modern"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-19 13:31:11.000000",
+ "doc_type": "Delivery Note",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n line-height: 150%;\n\t}\n\n\t.common {\n\t\tfont-family: \"Helvetica\", \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 10px 0px;\n\t}\n\n\ttable {\n\t\tborder-collapse: collapse;\n\t\twidth: 100%;\n\t\tvertical-align: top;\n\t\tborder-style: none !important;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t\tborder-style: none !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h1 {\n\t\ttext-transform: uppercase;\n\t\tcolor: white;\n\t\tfont-size: 55px;\n\t\tfont-style: italic;\n\t}\n\n\ttable.header-table thead tr:nth-child(1) div {\n\t\theight: 24px;\n\t\tbackground-color: #696969;\n\t\tvertical-align: middle;\n\t\tpadding: 12px 0px 0px 0px;\n\t\twidth: 100%;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body table tr td {\n\t\tbackground-color: #DCDCDC !important;\n\t}\n\n\tdiv.page-body table tr:nth-child(1) td {\n\t\tbackground-color: #696969 !important;\n\t\tcolor: white !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n\n\ttable.footer-table tfoot td {\n\t\tbackground-color: #696969;\n\t\theight: 10px;\n\t}\n\n\t.imp-details {\n\t\tbackground-color: #DCDCDC;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Delivery Note',\n\t\t\t\tdoc.name,\n\t\t\t\t'delivery_note_details',\n\t\t\t\t'Delivery Note Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'base_rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tvar to_append = ''\n\t\t\t\t\t\tif(data_row.discount_percentage){\n\t\t\t\t\t\t\tto_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' +\n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\tdata_row.description = data_row.description + to_append;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(data_row.serial_no) {\n\t\t\t\t\t\t\tto_append = '<div style=\"padding-left: 15px;\"><i>Serial No.:' + \n\t\t\t\t\t\t\t\t((data_row.serial_no.indexOf('\\n')>-1)?'<br />':' ') + \n\t\t\t\t\t\t\t\tdata_row.serial_no + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\tdata_row.description = data_row.description + to_append;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><div><script>'<h1>' + (doc.select_print_heading || 'Delivery Note') + '</h1>'</script></div></td></tr>\n\t\t\t<tr><td colspan=2><div style=\"height:15px\"></div></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr class='imp-details'>\n\t\t\t\t\t\t<td><b>Delivery Note No.</b></td>\n\t\t\t\t\t\t<td><script>cur_frm.docname</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Delivery Note Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Sales Order No.</b></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<script>doc.sales_order_no</script><br />\n\t\t\t\t\t\t\t<i>(<script>date.str_to_user(doc.posting_date)</script>)</i>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold' class='imp-details'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\t<tr><td colspan=2><div></div></td><tr>\n\t\t</tfoot>\n\t</table>\n</div>",
+ "idx": 1,
+ "modified": "2014-02-11 17:36:26.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Delivery Note Modern",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt b/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt
index 1d33833..eb42034 100644
--- a/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt
+++ b/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt
@@ -1,20 +1,13 @@
-[
- {
- "owner": "Administrator",
- "docstatus": 0,
- "creation": "2011-08-23 16:49:40",
- "modified_by": "Administrator",
- "modified": "2011-10-19 14:12:11"
- },
- {
- "name": "__common__",
- "module": "Stock",
- "standard": "Yes",
- "html": "<html>\n<head>\n\n<script>\nfunction replaceAll(s,s1,s2){ return s.split(s1).join(s2);}\n\nfunction get_letter_head() {\n\t// add letter head\n\tvar cp = locals['Control Panel']['Control Panel'];\n\tif(doc.letter_head)\n\t\tvar lh= cstr(_p.letter_heads[doc.letter_head]);\n\telse if(cp.letter_head)\n\t\tvar lh= cp.letter_head;\n\telse \n\t\tvar lh= '';\n\t\t\n\treturn lh;\n}\n\n</script>\n<style>\n.cust_tbl { border-collapse:collapse; }\n.cust_tbl td { border:1px solid #848484; font-size: 13px}\n.large_font td {font-size: 13px}\n</style>\n</head>\n\n<body>\n<script>\nreplaceAll(doc.print_packing_slip,'[HEADER GOES HERE]',get_letter_head());\n</script>\n</body>\n</html>",
- "doctype": "Print Format"
- },
- {
- "name": "Delivery Note Packing List Wise",
- "doctype": "Print Format"
- }
-]
\ No newline at end of file
+{
+ "creation": "2011-08-23 16:49:40.000000",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<html>\n<head>\n\n<script>\nfunction replaceAll(s,s1,s2){ return s.split(s1).join(s2);}\n\nfunction get_letter_head() {\n\t// add letter head\n\tvar cp = locals['Control Panel']['Control Panel'];\n\tif(doc.letter_head)\n\t\tvar lh= cstr(_p.letter_heads[doc.letter_head]);\n\telse if(cp.letter_head)\n\t\tvar lh= cp.letter_head;\n\telse \n\t\tvar lh= '';\n\t\t\n\treturn lh;\n}\n\n</script>\n<style>\n.cust_tbl { border-collapse:collapse; }\n.cust_tbl td { border:1px solid #848484; font-size: 13px}\n.large_font td {font-size: 13px}\n</style>\n</head>\n\n<body>\n<script>\nreplaceAll(doc.print_packing_slip,'[HEADER GOES HERE]',get_letter_head());\n</script>\n</body>\n</html>",
+ "idx": 1,
+ "modified": "2011-10-19 14:12:11.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Delivery Note Packing List Wise",
+ "owner": "Administrator",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt b/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt
index 4b62d70..626dcda 100644
--- a/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt
+++ b/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-04-19 13:31:11",
- "docstatus": 0,
- "modified": "2014-02-11 17:37:14",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doc_type": "Delivery Note",
- "doctype": "Print Format",
- "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 0px;\n\t}\n\n\ttable {\n\t\twidth: 100% !important;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\n\ttable, td {\n\t\tborder-collapse: collapse !important;\n\t\tpadding: 0px;\n\t\tmargin: 0px !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px;\n\t}\n\n\ttable.header-table > thead,\n\ttable.header-table > tbody > tr > td,\n\ttable.footer-table > tbody > tr > td {\n\t\tborder: 1px solid black;\n\t\tpadding: 5px;\n\t}\n\n\ttable.footer-table > tbody,\n\ttable.header-table > thead {\n\t\tborder-bottom: 3px solid black;\n\t}\n\n\ttable.header-table > thead {\n\t\tborder-top: 3px solid black;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body td {\n\t\tbackground-color: white !important;\n\t\tborder: 1px solid black !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Delivery Note',\n\t\t\t\tdoc.name,\n\t\t\t\t'delivery_note_details',\n\t\t\t\t'Delivery Note Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'base_rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tvar to_append = ''\n\t\t\t\t\t\tif(data_row.discount_percentage){\n\t\t\t\t\t\t\tto_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' +\n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\tdata_row.description = data_row.description + to_append;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(data_row.serial_no) {\n\t\t\t\t\t\t\tto_append = '<div style=\"padding-left: 15px;\"><i>Serial No.:' + \n\t\t\t\t\t\t\t\t((data_row.serial_no.indexOf('\\n')>-1)?'<br />':' ') + \n\t\t\t\t\t\t\t\tdata_row.serial_no + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\tdata_row.description = data_row.description + to_append;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Delivery Note') + '</h1>'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Delivery Note Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Sales Order No.</b></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<script>doc.sales_order_no</script><br />\n\t\t\t\t\t\t\t<i>(<script>date.str_to_user(doc.posting_date)</script>)</i>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
- "module": "Stock",
- "name": "__common__",
- "print_format_type": "Client",
- "standard": "Yes"
- },
- {
- "doctype": "Print Format",
- "name": "Delivery Note Spartan"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-04-19 13:31:11.000000",
+ "doc_type": "Delivery Note",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "html": "<!--\n\tSample Print Format for ERPNext\n\tPlease use at your own discretion\n\tFor suggestions and contributions:\n\t\thttps://github.com/frappe/erpnext-print-templates\n\n\tFreely usable under MIT license\n-->\n\n<!-- Style Settings -->\n<style>\n\t/*\n\t\tcommon style for whole page\n\t\tThis should include:\n\t\t+ page size related settings\n\t\t+ font family settings\n\t\t+ line spacing settings\n\t*/\n\t@media screen {\n\t\tbody {\n\t\t\twidth: 8.3in;\n\t\t}\n\t}\n\n\thtml, body, div, span, td {\n\t\tfont-family: \"Arial\", sans-serif;\n\t\tfont-size: 12px;\n\t}\n\n\tbody {\n\t\tpadding: 10px;\n\t\tmargin: auto;\n\t\tfont-size: 12px;\n\t}\n\n\t.common {\n\t\tfont-family: \"Arial\", sans-serif !important;\n\t\tfont-size: 12px;\n\t\tpadding: 0px;\n\t}\n\n\ttable {\n\t\twidth: 100% !important;\n\t\tvertical-align: top;\n\t}\n\n\ttable td {\n\t\tpadding: 2px 0px;\n\t}\n\n\ttable, td {\n\t\tborder-collapse: collapse !important;\n\t\tpadding: 0px;\n\t\tmargin: 0px !important;\n\t}\n\t\n\ttable h1, h2, h3, h4, h5, h6 {\n\t\tpadding: 0px;\n\t\tmargin: 0px;\n\t}\n\n\ttable.header-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.header-table h3 {\n\t\tcolor: gray;\n\t}\n\n\ttable.header-table thead td {\n\t\tpadding: 5px;\n\t}\n\n\ttable.header-table > thead,\n\ttable.header-table > tbody > tr > td,\n\ttable.footer-table > tbody > tr > td {\n\t\tborder: 1px solid black;\n\t\tpadding: 5px;\n\t}\n\n\ttable.footer-table > tbody,\n\ttable.header-table > thead {\n\t\tborder-bottom: 3px solid black;\n\t}\n\n\ttable.header-table > thead {\n\t\tborder-top: 3px solid black;\n\t}\n\n\tdiv.page-body table td:nth-child(6),\n\tdiv.page-body table td:nth-child(7) {\n\t\ttext-align: right;\n\t}\n\n\tdiv.page-body td {\n\t\tbackground-color: white !important;\n\t\tborder: 1px solid black !important;\n\t}\n\n\ttable.footer-table td {\n\t\tvertical-align: top;\n\t}\n\n\ttable.footer-table td table td:nth-child(2),\n\ttable.footer-table td table td:nth-child(3) {\n\t\ttext-align: right;\n\t}\n</style>\n\n\n<!-- Javascript -->\n<script>\n\tsi_std = {\n\t\tprint_item_table: function() {\n\t\t\tvar table = print_table(\n\t\t\t\t'Delivery Note',\n\t\t\t\tdoc.name,\n\t\t\t\t'delivery_note_details',\n\t\t\t\t'Delivery Note Item',\n\t\t\t\t[// Here specify the table columns to be displayed\n\t\t\t\t\t'SR', 'item_code', 'item_name', 'description', 'qty', 'stock_uom',\n\t\t\t\t\t'base_rate', 'amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the labels of column headings\n\t\t\t\t\t'Sr', 'Item Code', 'Item Name', 'Description', 'Qty',\n\t\t\t\t\t'UoM', 'Basic Rate', 'Amount'\n\t\t\t\t],\n\t\t\t\t[// Here specify the column widths\n\t\t\t\t\t'3%', '10%', '15%', '32%', '5%',\n\t\t\t\t\t'5%', '15%', '15%'\n\t\t\t\t],\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\t{\n\t\t\t\t\t'description' : function(data_row) {\n\t\t\t\t\t\tvar to_append = ''\n\t\t\t\t\t\tif(data_row.discount_percentage){\n\t\t\t\t\t\t\tto_append = '<div style=\"padding-left: 15px;\"><i>Discount: ' + \n\t\t\t\t\t\t\t\tdata_row.discount_percentage + '% on ' +\n\t\t\t\t\t\t\t\tformat_currency(data_row.price_list_rate, doc.currency) + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\tdata_row.description = data_row.description + to_append;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(data_row.serial_no) {\n\t\t\t\t\t\t\tto_append = '<div style=\"padding-left: 15px;\"><i>Serial No.:' + \n\t\t\t\t\t\t\t\t((data_row.serial_no.indexOf('\\n')>-1)?'<br />':' ') + \n\t\t\t\t\t\t\t\tdata_row.serial_no + '</i></div>';\n\t\t\t\t\t\t\tif(data_row.description.indexOf(to_append)==-1) {\n\t\t\t\t\t\t\t\tdata_row.description = data_row.description + to_append;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\treturn data_row.description;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\t// This code takes care of page breaks\n\t\t\tif(table.appendChild) {\n\t\t\t\tout = table.innerHTML;\n\t\t\t} else {\n\t\t\t\tout = '';\n\t\t\t\tfor(var i=0; i < (table.length-1); i++) {\n\t\t\t\t\tout += table[i].innerHTML + \n\t\t\t\t\t\t'<div style = \"page-break-after: always;\" \\\n\t\t\t\t\t\tclass = \"page_break\"></div>\\\n\t\t\t\t\t\t<div class=\"page-settings\"></div>';\n\t\t\t\t}\n\t\t\t\tout += table[table.length-1].innerHTML;\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\n\n\t\tprint_other_charges: function(parent) {\n\t\t\tvar oc = getchildren('Sales Taxes and Charges', doc.name, 'other_charges');\n\t\t\tvar rows = '<table width=100%>\\n';\n\t\t\tfor(var i=0; i<oc.length; i++) {\n\t\t\t\tif(!oc[i].included_in_print_rate) {\n\t\t\t\t\trows +=\n\t\t\t\t\t\t'<tr>\\n' +\n\t\t\t\t\t\t\t'\\t<td>' + oc[i].description + '</td>\\n' +\n\t\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(oc[i].tax_amount/doc.conversion_rate, doc.currency) + '</td>\\n' +\n\t\t\t\t\t\t'</tr>\\n';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(doc.discount_amount) {\n\t\t\t\trows += '<tr>\\n' + \n\t\t\t\t\t\t'\\t<td>Discount Amount</td>\\n' + \n\t\t\t\t\t\t'\\t<td style=\"width: 38%; text-align: right;\">' + format_currency(doc.discount_amount, doc.currency) + '</td>\\n' + \n\t\t\t\t\t'</tr>\\n';\n\t\t\t}\n\n\t\t\treturn rows + '</table>\\n';\n\t\t}\n\t};\n</script>\n\n\n<!-- Page Layout Settings -->\n<div class='common page-header'>\n\t<!-- \n\t\tPage Header will contain\n\t\t\t+ table 1\n\t\t\t\t+ table 1a\n\t\t\t\t\t- Name\n\t\t\t\t\t- Address\n\t\t\t\t\t- Contact\n\t\t\t\t\t- Mobile No\n\t\t\t\t+ table 1b\n\t\t\t\t\t- Voucher Date\n\t\t\t\t\t- Due Date\n\t-->\n\t<table class='header-table' cellspacing=0>\n\t\t<thead>\n\t\t\t<tr><td colspan=2><script>'<h1>' + (doc.select_print_heading || 'Delivery Note') + '</h1>'</script></td></tr>\n\t\t\t<tr><td colspan=2><h3><script>cur_frm.docname</script></h3></td></tr>\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60%><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=22%><b>Name</b></td>\n\t\t\t\t\t\t<td><script>doc.customer_name</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Address</b></td>\n\t\t\t\t\t\t<td><script>replace_newlines(doc.address_display)</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t\t\t<td><script>doc.contact_display</script></td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody></table></td>\n\t\t\t\t<td><table width=100% cellspacing=0><tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td width=63%><b>Delivery Note Date</b></td>\n\t\t\t\t\t\t<td><script>date.str_to_user(doc.transaction_date)</script></td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td><b>Sales Order No.</b></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<script>doc.sales_order_no</script><br />\n\t\t\t\t\t\t\t<i>(<script>date.str_to_user(doc.posting_date)</script>)</i>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t<tr>\t\t\t\t\t\n\t\t\t\t</tbody></table></td>\n\t\t\t</tr>\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>\n<div class='common page-body'>\n\t<!-- \n\t\tPage Body will contain\n\t\t\t+ table 2\n\t\t\t\t- Sales Invoice Data\n\t-->\n\t<script>si_std.print_item_table()</script>\n</div>\n<div class='common page-footer'>\n\t<!-- \n\t\tPage Footer will contain\n\t\t\t+ table 3\n\t\t\t\t- Terms and Conditions\n\t\t\t\t- Total Rounded Amount Calculation\n\t\t\t\t- Total Rounded Amount in Words\n\t-->\n\t<table class='footer-table' width=100% cellspacing=0>\n\t\t<thead>\n\t\t\t\n\t\t</thead>\n\t\t<tbody>\n\t\t\t<tr>\n\t\t\t\t<td width=60% style='padding-right: 10px;'>\n\t\t\t\t\t<b>Terms, Conditions & Other Information:</b><br />\n\t\t\t\t\t<script>doc.terms</script>\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<table cellspacing=0 width=100%><tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Net Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.net_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr><td colspan=3><script>si_std.print_other_charges()</script></td></tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>Grand Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.grand_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr style='font-weight: bold'>\n\t\t\t\t\t\t\t<td>Rounded Total</td>\n\t\t\t\t\t\t\t<td style=\"width: 38%; text-align: right;\"><script>\n\t\t\t\t\t\t\t\tformat_currency(doc.rounded_total_export, doc.currency)\n\t\t\t\t\t\t\t</script></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody></table>\n\t\t\t\t\t<br /><b>In Words</b><br />\n\t\t\t\t\t<i><script>doc.in_words_export</script></i>\n\t\t\t\t</td>\n\t\t\t</tr>\t\t\n\t\t</tbody>\n\t\t<tfoot>\n\t\t\n\t\t</tfoot>\n\t</table>\n</div>",
+ "idx": 1,
+ "modified": "2014-02-11 17:37:14.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Delivery Note Spartan",
+ "owner": "Administrator",
+ "print_format_type": "Client",
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py
index 26c87f1..365cb38 100644
--- a/erpnext/stock/doctype/batch/batch.py
+++ b/erpnext/stock/doctype/batch/batch.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class Batch(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/batch/batch.txt b/erpnext/stock/doctype/batch/batch.txt
index c08573b..df9c8c5 100644
--- a/erpnext/stock/doctype/batch/batch.txt
+++ b/erpnext/stock/doctype/batch/batch.txt
@@ -1,109 +1,90 @@
-[
- {
- "creation": "2013-03-05 14:50:38",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:24",
- "modified_by": "Administrator",
- "owner": "harshada@webnotestech.com"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "autoname": "field:batch_id",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-archive",
- "max_attachments": 5,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Batch",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Batch",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Material Master Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Batch"
- },
- {
- "doctype": "DocField",
- "fieldname": "batch_id",
- "fieldtype": "Data",
- "label": "Batch ID",
- "no_copy": 1,
- "oldfieldname": "batch_id",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Item",
- "oldfieldname": "item",
- "oldfieldtype": "Link",
- "options": "Item",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "expiry_date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "label": "Expiry Date",
- "oldfieldname": "expiry_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "start_date",
- "fieldtype": "Date",
- "label": "Batch Started Date",
- "oldfieldname": "start_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "finished_date",
- "fieldtype": "Date",
- "label": "Batch Finished Date",
- "oldfieldname": "finished_date",
- "oldfieldtype": "Date"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "autoname": "field:batch_id",
+ "creation": "2013-03-05 14:50:38.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "batch_id",
+ "fieldtype": "Data",
+ "label": "Batch ID",
+ "no_copy": 1,
+ "oldfieldname": "batch_id",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "item",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Item",
+ "oldfieldname": "item",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "width": "300px"
+ },
+ {
+ "fieldname": "expiry_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Expiry Date",
+ "oldfieldname": "expiry_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "start_date",
+ "fieldtype": "Date",
+ "label": "Batch Started Date",
+ "oldfieldname": "start_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "finished_date",
+ "fieldtype": "Date",
+ "label": "Batch Finished Date",
+ "oldfieldname": "finished_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-archive",
+ "idx": 1,
+ "max_attachments": 5,
+ "modified": "2014-01-20 17:48:24.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Batch",
+ "owner": "harshada@webnotestech.com",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Master Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/bin/bin.py b/erpnext/stock/doctype/bin/bin.py
index 1b5e243..0587f47 100644
--- a/erpnext/stock/doctype/bin/bin.py
+++ b/erpnext/stock/doctype/bin/bin.py
@@ -9,10 +9,9 @@
import frappe.defaults
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class Bin(Document):
def validate(self):
if self.doc.fields.get("__islocal") or not self.doc.stock_uom:
diff --git a/erpnext/stock/doctype/bin/bin.txt b/erpnext/stock/doctype/bin/bin.txt
index 2775191..03fa4bf 100644
--- a/erpnext/stock/doctype/bin/bin.txt
+++ b/erpnext/stock/doctype/bin/bin.txt
@@ -1,202 +1,205 @@
-[
- {
- "creation": "2013-01-10 16:34:25",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:56",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "BIN/.#######",
- "doctype": "DocType",
- "hide_toolbar": 1,
- "in_create": 1,
- "module": "Stock",
- "name": "__common__",
- "read_only": 0,
- "search_fields": "item_code,warehouse"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Bin",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Bin",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Bin"
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Warehouse",
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "search_index": 1
- },
- {
- "default": "0.00",
- "doctype": "DocField",
- "fieldname": "reserved_qty",
- "fieldtype": "Float",
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Reserved Quantity",
- "oldfieldname": "reserved_qty",
- "oldfieldtype": "Currency",
- "search_index": 0
- },
- {
- "default": "0.00",
- "doctype": "DocField",
- "fieldname": "actual_qty",
- "fieldtype": "Float",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Actual Quantity",
- "oldfieldname": "actual_qty",
- "oldfieldtype": "Currency",
- "search_index": 0
- },
- {
- "default": "0.00",
- "doctype": "DocField",
- "fieldname": "ordered_qty",
- "fieldtype": "Float",
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Ordered Quantity",
- "oldfieldname": "ordered_qty",
- "oldfieldtype": "Currency",
- "search_index": 0
- },
- {
- "default": "0.00",
- "doctype": "DocField",
- "fieldname": "indented_qty",
- "fieldtype": "Float",
- "in_filter": 0,
- "label": "Quantity Requested for Purchase",
- "oldfieldname": "indented_qty",
- "oldfieldtype": "Currency",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "planned_qty",
- "fieldtype": "Float",
- "in_filter": 0,
- "label": "Planned Qty",
- "oldfieldname": "planned_qty",
- "oldfieldtype": "Currency",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "projected_qty",
- "fieldtype": "Float",
- "in_filter": 0,
- "label": "Projected Qty",
- "oldfieldname": "projected_qty",
- "oldfieldtype": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "ma_rate",
- "fieldtype": "Float",
- "hidden": 1,
- "in_filter": 0,
- "label": "Moving Average Rate",
- "oldfieldname": "ma_rate",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "report_hide": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "fcfs_rate",
- "fieldtype": "Float",
- "hidden": 1,
- "label": "FCFS Rate",
- "oldfieldname": "fcfs_rate",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "valuation_rate",
- "fieldtype": "Float",
- "label": "Valuation Rate",
- "oldfieldname": "valuation_rate",
- "oldfieldtype": "Currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_value",
- "fieldtype": "Float",
- "label": "Stock Value",
- "oldfieldname": "stock_value",
- "oldfieldtype": "Currency"
- },
- {
- "doctype": "DocPerm",
- "role": "Sales User"
- },
- {
- "doctype": "DocPerm",
- "role": "Purchase User"
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "doctype": "DocPerm",
- "role": "Material User",
- "write": 0
- }
-]
\ No newline at end of file
+{
+ "autoname": "BIN/.#######",
+ "creation": "2013-01-10 16:34:25.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Warehouse",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "default": "0.00",
+ "fieldname": "reserved_qty",
+ "fieldtype": "Float",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Reserved Quantity",
+ "oldfieldname": "reserved_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "default": "0.00",
+ "fieldname": "actual_qty",
+ "fieldtype": "Float",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Actual Quantity",
+ "oldfieldname": "actual_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "default": "0.00",
+ "fieldname": "ordered_qty",
+ "fieldtype": "Float",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Ordered Quantity",
+ "oldfieldname": "ordered_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "default": "0.00",
+ "fieldname": "indented_qty",
+ "fieldtype": "Float",
+ "in_filter": 0,
+ "label": "Quantity Requested for Purchase",
+ "oldfieldname": "indented_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "planned_qty",
+ "fieldtype": "Float",
+ "in_filter": 0,
+ "label": "Planned Qty",
+ "oldfieldname": "planned_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "projected_qty",
+ "fieldtype": "Float",
+ "in_filter": 0,
+ "label": "Projected Qty",
+ "oldfieldname": "projected_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "ma_rate",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "in_filter": 0,
+ "label": "Moving Average Rate",
+ "oldfieldname": "ma_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "fcfs_rate",
+ "fieldtype": "Float",
+ "hidden": 1,
+ "label": "FCFS Rate",
+ "oldfieldname": "fcfs_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "valuation_rate",
+ "fieldtype": "Float",
+ "label": "Valuation Rate",
+ "oldfieldname": "valuation_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "stock_value",
+ "fieldtype": "Float",
+ "label": "Stock Value",
+ "oldfieldname": "stock_value",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "hide_toolbar": 1,
+ "idx": 1,
+ "in_create": 1,
+ "modified": "2013-12-20 19:23:56.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Bin",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0
+ },
+ {
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User",
+ "submit": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 0,
+ "write": 0
+ }
+ ],
+ "read_only": 0,
+ "search_fields": "item_code,warehouse"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js
index 371c093..f94a118 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.js
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.js
@@ -20,8 +20,7 @@
if(!doc.__billing_complete && doc.docstatus==1) {
// show Make Invoice button only if Delivery Note is not created from Sales Invoice
var from_sales_invoice = false;
- from_sales_invoice = cur_frm.get_doclist({parentfield: "delivery_note_details"})
- .some(function(item) {
+ from_sales_invoice = cur_frm.doc.delivery_note_details.some(function(item) {
return item.against_sales_invoice ? true : false;
});
@@ -167,7 +166,7 @@
out ='';
- var cl = getchildren('Delivery Note Item',doc.name,'delivery_note_details');
+ var cl = doc.delivery_note_details || [];
// outer table
var out='<div><table class="noborder" style="width:100%"><tr><td style="width: 50%"></td><td>';
@@ -205,7 +204,7 @@
cur_frm.cscript.expense_account = function(doc, cdt, cdn){
var d = locals[cdt][cdn];
if(d.expense_account) {
- var cl = getchildren('Delivery Note Item', doc.name, cur_frm.cscript.fname, doc.doctype);
+ var cl = doc[cur_frm.cscript.fname] || [];
for(var i = 0; i < cl.length; i++){
if(!cl[i].expense_account) cl[i].expense_account = d.expense_account;
}
@@ -228,7 +227,7 @@
cur_frm.cscript.cost_center = function(doc, cdt, cdn){
var d = locals[cdt][cdn];
if(d.cost_center) {
- var cl = getchildren('Delivery Note Item', doc.name, cur_frm.cscript.fname, doc.doctype);
+ var cl = doc[cur_frm.cscript.fname] || [];
for(var i = 0; i < cl.length; i++){
if(!cl[i].cost_center) cl[i].cost_center = d.cost_center;
}
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py
index a7c4923..8d91e49 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.py
@@ -13,10 +13,7 @@
from erpnext.stock.utils import update_bin
from erpnext.controllers.selling_controller import SellingController
-class DocType(SellingController):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class DeliveryNote(SellingController):
self.tname = 'Delivery Note Item'
self.fname = 'delivery_note_details'
self.status_updater = [{
@@ -37,14 +34,14 @@
billed_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabSales Invoice Item`
where docstatus=1 and delivery_note=%s""", self.doc.name)
if billed_qty:
- total_qty = sum((item.qty for item in self.doclist.get({"parentfield": "delivery_note_details"})))
+ total_qty = sum((item.qty for item in self.get("delivery_note_details")))
self.doc.fields["__billing_complete"] = billed_qty[0][0] == total_qty
def get_portal_page(self):
return "shipment" if self.doc.docstatus==1 else None
def set_actual_qty(self):
- for d in getlist(self.doclist, 'delivery_note_details'):
+ for d in self.get('delivery_note_details'):
if d.item_code and d.warehouse:
actual_qty = frappe.db.sql("""select actual_qty from `tabBin`
where item_code = %s and warehouse = %s""", (d.item_code, d.warehouse))
@@ -53,7 +50,7 @@
def so_required(self):
"""check in manage account if sales order required or not"""
if frappe.db.get_value("Selling Settings", None, 'so_required') == 'Yes':
- for d in getlist(self.doclist,'delivery_note_details'):
+ for d in self.get('delivery_note_details'):
if not d.against_sales_order:
msgprint("Sales Order No. required against item %s"%d.item_code)
raise Exception
@@ -81,7 +78,7 @@
if not self.doc.installation_status: self.doc.installation_status = 'Not Installed'
def validate_with_previous_doc(self):
- items = self.doclist.get({"parentfield": "delivery_note_details"})
+ items = self.get("delivery_note_details")
for fn in (("Sales Order", "against_sales_order"), ("Sales Invoice", "against_sales_invoice")):
if items.get_distinct_values(fn[1]):
@@ -114,7 +111,7 @@
def validate_for_items(self):
check_list, chk_dupl_itm = [], []
- for d in getlist(self.doclist,'delivery_note_details'):
+ for d in self.get('delivery_note_details'):
e = [d.item_code, d.description, d.warehouse, d.against_sales_order or d.against_sales_invoice, d.batch_no or '']
f = [d.item_code, d.description, d.against_sales_order or d.against_sales_invoice]
@@ -140,11 +137,11 @@
def update_current_stock(self):
- for d in getlist(self.doclist, 'delivery_note_details'):
+ for d in self.get('delivery_note_details'):
bin = frappe.db.sql("select actual_qty from `tabBin` where item_code = %s and warehouse = %s", (d.item_code, d.warehouse), as_dict = 1)
d.actual_qty = bin and flt(bin[0]['actual_qty']) or 0
- for d in getlist(self.doclist, 'packing_details'):
+ for d in self.get('packing_details'):
bin = frappe.db.sql("select actual_qty, projected_qty from `tabBin` where item_code = %s and warehouse = %s", (d.item_code, d.warehouse), as_dict = 1)
d.actual_qty = bin and flt(bin[0]['actual_qty']) or 0
d.projected_qty = bin and flt(bin[0]['projected_qty']) or 0
@@ -268,7 +265,7 @@
def credit_limit(self):
"""check credit limit of items in DN Detail which are not fetched from sales order"""
amount, total = 0, 0
- for d in getlist(self.doclist, 'delivery_note_details'):
+ for d in self.get('delivery_note_details'):
if not (d.against_sales_order or d.against_sales_invoice):
amount += d.base_amount
if amount != 0:
@@ -299,7 +296,7 @@
si.set_doclist(si.doclist.get({"parentfield": ["!=", "entries"]}) +
si.doclist.get({"parentfield": "entries", "qty": [">", 0]}))
- if len(si.doclist.get({"parentfield": "entries"})) == 0:
+ if len(si.get("entries")) == 0:
frappe.msgprint(_("Hey! All these items have already been invoiced."),
raise_exception=True)
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.txt b/erpnext/stock/doctype/delivery_note/delivery_note.txt
index a20723d..2300f9a 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.txt
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.txt
@@ -1,1079 +1,1076 @@
-[
- {
- "creation": "2013-05-24 19:29:09",
- "docstatus": 0,
- "modified": "2014-01-28 18:51:42",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "document_type": "Transaction",
- "hide_toolbar": 0,
- "icon": "icon-truck",
- "in_create": 0,
- "is_submittable": 1,
- "module": "Stock",
- "name": "__common__",
- "read_only_onload": 1,
- "search_fields": "status,customer,customer_name, territory,grand_total"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Delivery Note",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Delivery Note",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Delivery Note"
- },
- {
- "doctype": "DocField",
- "fieldname": "delivery_to_section",
- "fieldtype": "Section Break",
- "label": "Delivery To",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_width": "50%",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "DN",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Customer",
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Customer Name",
- "read_only": 1
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Billing Address Name",
- "options": "Address",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Billing Address",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "shipping_address_name",
- "fieldtype": "Link",
- "label": "Shipping Address",
- "options": "Address",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "shipping_address",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Shipping Address",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_mobile",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Mobile No",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_email",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Contact Email",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "description": "Select the relevant company name if you have multiple companies",
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "default": "Today",
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Posting Date",
- "no_copy": 1,
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "print_hide": 0,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "po_no",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Customer's Purchase Order No",
- "no_copy": 0,
- "oldfieldname": "po_no",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "width": "100px"
- },
- {
- "depends_on": "eval:doc.po_no",
- "doctype": "DocField",
- "fieldname": "po_date",
- "fieldtype": "Date",
- "hidden": 0,
- "label": "Customer's Purchase Order Date",
- "no_copy": 0,
- "oldfieldname": "po_date",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "sec_break25",
- "fieldtype": "Section Break",
- "label": "Currency and Price List",
- "options": "icon-tag",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "currency",
- "fieldtype": "Link",
- "label": "Currency",
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "description": "Rate at which customer's currency is converted to company's base currency",
- "doctype": "DocField",
- "fieldname": "conversion_rate",
- "fieldtype": "Float",
- "label": "Exchange Rate",
- "no_copy": 0,
- "oldfieldname": "conversion_rate",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break23",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "selling_price_list",
- "fieldtype": "Link",
- "label": "Price List",
- "oldfieldname": "price_list_name",
- "oldfieldtype": "Select",
- "options": "Price List",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_currency",
- "fieldtype": "Link",
- "label": "Price List Currency",
- "options": "Currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "description": "Rate at which Price list currency is converted to company's base currency",
- "doctype": "DocField",
- "fieldname": "plc_conversion_rate",
- "fieldtype": "Float",
- "label": "Price List Exchange Rate",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "items",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart",
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "delivery_note_details",
- "fieldtype": "Table",
- "label": "Delivery Note Items",
- "no_copy": 0,
- "oldfieldname": "delivery_note_details",
- "oldfieldtype": "Table",
- "options": "Delivery Note Item",
- "print_hide": 0,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "packing_list",
- "fieldtype": "Section Break",
- "label": "Packing List",
- "oldfieldtype": "Section Break",
- "options": "icon-suitcase",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "packing_details",
- "fieldtype": "Table",
- "label": "Packing Details",
- "oldfieldname": "packing_details",
- "oldfieldtype": "Table",
- "options": "Packed Item",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_bom_help",
- "fieldtype": "HTML",
- "label": "Sales BOM Help",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_31",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total_export",
- "fieldtype": "Currency",
- "label": "Net Total",
- "options": "currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_33",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "label": "Net Total (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "net_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "reqd": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "taxes",
- "fieldtype": "Section Break",
- "label": "Taxes and Charges",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "read_only": 0
- },
- {
- "description": "If you have created a standard template in Sales Taxes and Charges Master, select one and click on the button below.",
- "doctype": "DocField",
- "fieldname": "taxes_and_charges",
- "fieldtype": "Link",
- "label": "Taxes and Charges",
- "oldfieldname": "charge",
- "oldfieldtype": "Link",
- "options": "Sales Taxes and Charges Master",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_39",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "shipping_rule",
- "fieldtype": "Link",
- "label": "Shipping Rule",
- "oldfieldtype": "Button",
- "options": "Shipping Rule",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_41",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges",
- "fieldtype": "Table",
- "label": "Sales Taxes and Charges",
- "no_copy": 0,
- "oldfieldname": "other_charges",
- "oldfieldtype": "Table",
- "options": "Sales Taxes and Charges",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_calculation",
- "fieldtype": "HTML",
- "label": "Taxes and Charges Calculation",
- "oldfieldtype": "HTML",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_44",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_total_export",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Total",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_47",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_total",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Total (Company Currency)",
- "oldfieldname": "other_charges_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "discount_amount",
- "fieldtype": "Currency",
- "label": "Discount Amount",
- "options": "Company:company:default_currency"
- },
- {
- "doctype": "DocField",
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "label": "Totals",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "print_hide": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total_export",
- "fieldtype": "Currency",
- "label": "Grand Total",
- "no_copy": 0,
- "oldfieldname": "grand_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "print_width": "150px",
- "read_only": 1,
- "reqd": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "rounded_total_export",
- "fieldtype": "Currency",
- "label": "Rounded Total",
- "no_copy": 0,
- "oldfieldname": "rounded_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "description": "In Words (Export) will be visible once you save the Delivery Note.",
- "doctype": "DocField",
- "fieldname": "in_words_export",
- "fieldtype": "Data",
- "label": "In Words",
- "no_copy": 0,
- "oldfieldname": "in_words_export",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total",
- "fieldtype": "Currency",
- "label": "Grand Total (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "grand_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "reqd": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "rounded_total",
- "fieldtype": "Currency",
- "label": "Rounded Total (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "rounded_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "description": "In Words will be visible once you save the Delivery Note.",
- "doctype": "DocField",
- "fieldname": "in_words",
- "fieldtype": "Data",
- "label": "In Words (Company Currency)",
- "no_copy": 0,
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "200px",
- "read_only": 1,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "icon-legal",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "tc_name",
- "fieldtype": "Link",
- "label": "Terms",
- "oldfieldname": "tc_name",
- "oldfieldtype": "Link",
- "options": "Terms and Conditions",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "terms",
- "fieldtype": "Text Editor",
- "label": "Terms and Conditions Details",
- "oldfieldname": "terms",
- "oldfieldtype": "Text Editor",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "transporter_info",
- "fieldtype": "Section Break",
- "label": "Transporter Info",
- "options": "icon-truck",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "transporter_name",
- "fieldtype": "Data",
- "label": "Transporter Name",
- "no_copy": 0,
- "oldfieldname": "transporter_name",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 0,
- "reqd": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break34",
- "fieldtype": "Column Break",
- "print_width": "50%",
- "read_only": 0,
- "width": "50%"
- },
- {
- "description": "Transporter lorry number",
- "doctype": "DocField",
- "fieldname": "lr_no",
- "fieldtype": "Data",
- "label": "Vehicle No",
- "no_copy": 0,
- "oldfieldname": "lr_no",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 0,
- "width": "100px"
- },
- {
- "default": "Today",
- "description": "Date on which lorry started from your warehouse",
- "doctype": "DocField",
- "fieldname": "lr_date",
- "fieldtype": "Date",
- "label": "Vehicle Dispatch Date",
- "no_copy": 0,
- "oldfieldname": "lr_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "width": "100px"
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_info",
- "fieldtype": "Section Break",
- "label": "Contact Info",
- "options": "icon-bullhorn",
- "read_only": 0
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Territory",
- "options": "Territory",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Customer Group",
- "options": "Customer Group",
- "print_hide": 1,
- "read_only": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break21",
- "fieldtype": "Column Break",
- "print_width": "50%",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Contact Person",
- "options": "Contact",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "description": "Track this Delivery Note against any Project",
- "doctype": "DocField",
- "fieldname": "project_name",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Project Name",
- "oldfieldname": "project_name",
- "oldfieldtype": "Link",
- "options": "Project",
- "read_only": 0,
- "search_index": 1
- },
- {
- "depends_on": "eval:doc.source == 'Campaign'",
- "doctype": "DocField",
- "fieldname": "campaign",
- "fieldtype": "Link",
- "label": "Campaign",
- "oldfieldname": "campaign",
- "oldfieldtype": "Link",
- "options": "Campaign",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "source",
- "fieldtype": "Select",
- "label": "Source",
- "oldfieldname": "source",
- "oldfieldtype": "Select",
- "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break5",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 1,
- "print_width": "50%",
- "read_only": 0,
- "width": "50%"
- },
- {
- "description": "Time at which items were delivered from warehouse",
- "doctype": "DocField",
- "fieldname": "posting_time",
- "fieldtype": "Time",
- "in_filter": 0,
- "label": "Posting Time",
- "oldfieldname": "posting_time",
- "oldfieldtype": "Time",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "search_index": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "letter_head",
- "fieldtype": "Select",
- "label": "Letter Head",
- "oldfieldname": "letter_head",
- "oldfieldtype": "Link",
- "options": "link:Letter Head",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "label": "Print Heading",
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "print_without_amount",
- "fieldtype": "Check",
- "label": "Print Without Amount",
- "oldfieldname": "print_without_amount",
- "oldfieldtype": "Check",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_83",
- "fieldtype": "Section Break"
- },
- {
- "default": "Draft",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nDraft\nSubmitted\nCancelled",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "description": "% of materials delivered against this Delivery Note",
- "doctype": "DocField",
- "fieldname": "per_installed",
- "fieldtype": "Percent",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "% Installed",
- "no_copy": 1,
- "oldfieldname": "per_installed",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "installation_status",
- "fieldtype": "Select",
- "hidden": 1,
- "label": "Installation Status",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_89",
- "fieldtype": "Column Break"
- },
- {
- "description": "Required only for sample item.",
- "doctype": "DocField",
- "fieldname": "to_warehouse",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "To Warehouse",
- "no_copy": 1,
- "oldfieldname": "to_warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "excise_page",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Excise Page Number",
- "oldfieldname": "excise_page",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "instructions",
- "fieldtype": "Text",
- "label": "Instructions",
- "oldfieldname": "instructions",
- "oldfieldtype": "Text",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_team_section_break",
- "fieldtype": "Section Break",
- "label": "Sales Team",
- "oldfieldtype": "Section Break",
- "options": "icon-group",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_partner",
- "fieldtype": "Link",
- "label": "Sales Partner",
- "no_copy": 0,
- "oldfieldname": "sales_partner",
- "oldfieldtype": "Link",
- "options": "Sales Partner",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break7",
- "fieldtype": "Column Break",
- "print_hide": 1,
- "print_width": "50%",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "commission_rate",
- "fieldtype": "Float",
- "label": "Commission Rate (%)",
- "no_copy": 0,
- "oldfieldname": "commission_rate",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_commission",
- "fieldtype": "Currency",
- "label": "Total Commission",
- "no_copy": 0,
- "oldfieldname": "total_commission",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break1",
- "fieldtype": "Section Break",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_team",
- "fieldtype": "Table",
- "label": "Sales Team1",
- "oldfieldname": "sales_team",
- "oldfieldtype": "Table",
- "options": "Sales Team",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Material User",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Material Manager",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales User",
- "submit": 1,
- "write": 1
- },
- {
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Accounts User",
- "submit": 0,
- "write": 0
- },
- {
- "cancel": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Customer"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-05-24 19:29:09.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "fieldname": "delivery_to_section",
+ "fieldtype": "Section Break",
+ "label": "Delivery To",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "DN",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Customer",
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Customer Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Billing Address Name",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Billing Address",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "shipping_address_name",
+ "fieldtype": "Link",
+ "label": "Shipping Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "shipping_address",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Shipping Address",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_mobile",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Mobile No",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_email",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Contact Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "description": "Select the relevant company name if you have multiple companies",
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "default": "Today",
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Posting Date",
+ "no_copy": 1,
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "po_no",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Customer's Purchase Order No",
+ "no_copy": 0,
+ "oldfieldname": "po_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "width": "100px"
+ },
+ {
+ "depends_on": "eval:doc.po_no",
+ "fieldname": "po_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "label": "Customer's Purchase Order Date",
+ "no_copy": 0,
+ "oldfieldname": "po_date",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "sec_break25",
+ "fieldtype": "Section Break",
+ "label": "Currency and Price List",
+ "options": "icon-tag",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "label": "Currency",
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Rate at which customer's currency is converted to company's base currency",
+ "fieldname": "conversion_rate",
+ "fieldtype": "Float",
+ "label": "Exchange Rate",
+ "no_copy": 0,
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "col_break23",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "selling_price_list",
+ "fieldtype": "Link",
+ "label": "Price List",
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Select",
+ "options": "Price List",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "price_list_currency",
+ "fieldtype": "Link",
+ "label": "Price List Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "description": "Rate at which Price list currency is converted to company's base currency",
+ "fieldname": "plc_conversion_rate",
+ "fieldtype": "Float",
+ "label": "Price List Exchange Rate",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "items",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "delivery_note_details",
+ "fieldtype": "Table",
+ "label": "Delivery Note Items",
+ "no_copy": 0,
+ "oldfieldname": "delivery_note_details",
+ "oldfieldtype": "Table",
+ "options": "Delivery Note Item",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "packing_list",
+ "fieldtype": "Section Break",
+ "label": "Packing List",
+ "oldfieldtype": "Section Break",
+ "options": "icon-suitcase",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "packing_details",
+ "fieldtype": "Table",
+ "label": "Packing Details",
+ "oldfieldname": "packing_details",
+ "oldfieldtype": "Table",
+ "options": "Packed Item",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "sales_bom_help",
+ "fieldtype": "HTML",
+ "label": "Sales BOM Help",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_31",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total_export",
+ "fieldtype": "Currency",
+ "label": "Net Total",
+ "options": "currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_33",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "label": "Net Total (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "net_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "taxes",
+ "fieldtype": "Section Break",
+ "label": "Taxes and Charges",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "If you have created a standard template in Sales Taxes and Charges Master, select one and click on the button below.",
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "label": "Taxes and Charges",
+ "oldfieldname": "charge",
+ "oldfieldtype": "Link",
+ "options": "Sales Taxes and Charges Master",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break_39",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "shipping_rule",
+ "fieldtype": "Link",
+ "label": "Shipping Rule",
+ "oldfieldtype": "Button",
+ "options": "Shipping Rule",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_41",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges",
+ "fieldtype": "Table",
+ "label": "Sales Taxes and Charges",
+ "no_copy": 0,
+ "oldfieldname": "other_charges",
+ "oldfieldtype": "Table",
+ "options": "Sales Taxes and Charges",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "other_charges_calculation",
+ "fieldtype": "HTML",
+ "label": "Taxes and Charges Calculation",
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_44",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_total_export",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Total",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_47",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_total",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Total (Company Currency)",
+ "oldfieldname": "other_charges_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "discount_amount",
+ "fieldtype": "Currency",
+ "label": "Discount Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "label": "Totals",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "grand_total_export",
+ "fieldtype": "Currency",
+ "label": "Grand Total",
+ "no_copy": 0,
+ "oldfieldname": "grand_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "rounded_total_export",
+ "fieldtype": "Currency",
+ "label": "Rounded Total",
+ "no_copy": 0,
+ "oldfieldname": "rounded_total_export",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "description": "In Words (Export) will be visible once you save the Delivery Note.",
+ "fieldname": "in_words_export",
+ "fieldtype": "Data",
+ "label": "In Words",
+ "no_copy": 0,
+ "oldfieldname": "in_words_export",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "label": "Grand Total (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "grand_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "rounded_total",
+ "fieldtype": "Currency",
+ "label": "Rounded Total (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "rounded_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "description": "In Words will be visible once you save the Delivery Note.",
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "label": "In Words (Company Currency)",
+ "no_copy": 0,
+ "oldfieldname": "in_words",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "200px",
+ "read_only": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "label": "Terms and Conditions",
+ "oldfieldtype": "Section Break",
+ "options": "icon-legal",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "label": "Terms",
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "label": "Terms and Conditions Details",
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "transporter_info",
+ "fieldtype": "Section Break",
+ "label": "Transporter Info",
+ "options": "icon-truck",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "transporter_name",
+ "fieldtype": "Data",
+ "label": "Transporter Name",
+ "no_copy": 0,
+ "oldfieldname": "transporter_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 0,
+ "reqd": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "col_break34",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "description": "Transporter lorry number",
+ "fieldname": "lr_no",
+ "fieldtype": "Data",
+ "label": "Vehicle No",
+ "no_copy": 0,
+ "oldfieldname": "lr_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "default": "Today",
+ "description": "Date on which lorry started from your warehouse",
+ "fieldname": "lr_date",
+ "fieldtype": "Date",
+ "label": "Vehicle Dispatch Date",
+ "no_copy": 0,
+ "oldfieldname": "lr_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "width": "100px"
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_info",
+ "fieldtype": "Section Break",
+ "label": "Contact Info",
+ "options": "icon-bullhorn",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Customer Group",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "col_break21",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Contact Person",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "description": "Track this Delivery Note against any Project",
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Project Name",
+ "oldfieldname": "project_name",
+ "oldfieldtype": "Link",
+ "options": "Project",
+ "permlevel": 0,
+ "read_only": 0,
+ "search_index": 1
+ },
+ {
+ "depends_on": "eval:doc.source == 'Campaign'",
+ "fieldname": "campaign",
+ "fieldtype": "Link",
+ "label": "Campaign",
+ "oldfieldname": "campaign",
+ "oldfieldtype": "Link",
+ "options": "Campaign",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "source",
+ "fieldtype": "Select",
+ "label": "Source",
+ "oldfieldname": "source",
+ "oldfieldtype": "Select",
+ "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break5",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "50%",
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "description": "Time at which items were delivered from warehouse",
+ "fieldname": "posting_time",
+ "fieldtype": "Time",
+ "in_filter": 0,
+ "label": "Posting Time",
+ "oldfieldname": "posting_time",
+ "oldfieldtype": "Time",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "letter_head",
+ "fieldtype": "Select",
+ "label": "Letter Head",
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Link",
+ "options": "link:Letter Head",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "label": "Print Heading",
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "print_without_amount",
+ "fieldtype": "Check",
+ "label": "Print Without Amount",
+ "oldfieldname": "print_without_amount",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_83",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "default": "Draft",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nDraft\nSubmitted\nCancelled",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "description": "% of materials delivered against this Delivery Note",
+ "fieldname": "per_installed",
+ "fieldtype": "Percent",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "% Installed",
+ "no_copy": 1,
+ "oldfieldname": "per_installed",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "installation_status",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "label": "Installation Status",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break_89",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "Required only for sample item.",
+ "fieldname": "to_warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "To Warehouse",
+ "no_copy": 1,
+ "oldfieldname": "to_warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "excise_page",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Excise Page Number",
+ "oldfieldname": "excise_page",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "instructions",
+ "fieldtype": "Text",
+ "label": "Instructions",
+ "oldfieldname": "instructions",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "sales_team_section_break",
+ "fieldtype": "Section Break",
+ "label": "Sales Team",
+ "oldfieldtype": "Section Break",
+ "options": "icon-group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "sales_partner",
+ "fieldtype": "Link",
+ "label": "Sales Partner",
+ "no_copy": 0,
+ "oldfieldname": "sales_partner",
+ "oldfieldtype": "Link",
+ "options": "Sales Partner",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "column_break7",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "50%",
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "commission_rate",
+ "fieldtype": "Float",
+ "label": "Commission Rate (%)",
+ "no_copy": 0,
+ "oldfieldname": "commission_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "total_commission",
+ "fieldtype": "Currency",
+ "label": "Total Commission",
+ "no_copy": 0,
+ "oldfieldname": "total_commission",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break1",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "sales_team",
+ "fieldtype": "Table",
+ "label": "Sales Team1",
+ "oldfieldname": "sales_team",
+ "oldfieldtype": "Table",
+ "options": "Sales Team",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ }
+ ],
+ "hide_toolbar": 0,
+ "icon": "icon-truck",
+ "idx": 1,
+ "in_create": 0,
+ "is_submittable": 1,
+ "modified": "2014-01-28 18:51:42.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Delivery Note",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Customer"
+ }
+ ],
+ "read_only_onload": 1,
+ "search_fields": "status,customer,customer_name, territory,grand_total"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py
index 26c87f1..3789cda 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class DeliveryNoteItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt
index f5f7712..e093def 100644
--- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt
+++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt
@@ -1,458 +1,445 @@
-[
- {
- "creation": "2013-04-22 13:15:44",
- "docstatus": 0,
- "modified": "2014-02-28 11:20:58",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "DND/.#######",
- "doctype": "DocType",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Delivery Note Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Delivery Note Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "barcode",
- "fieldtype": "Data",
- "in_list_view": 0,
- "label": "Barcode",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "print_width": "150px",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_list_view": 0,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 0,
- "reqd": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_item_code",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Customer's Item Code",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "print_width": "300px",
- "read_only": 0,
- "reqd": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "quantity_and_rate",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Quantity and Rate"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Quantity",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate",
- "no_copy": 0,
- "oldfieldname": "ref_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "discount_percentage",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Discount (%)",
- "oldfieldname": "adj_rate",
- "oldfieldtype": "Float",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "print_hide": 0,
- "print_width": "50px",
- "read_only": 1,
- "reqd": 1,
- "width": "50px"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate (Company Currency)",
- "oldfieldname": "base_ref_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_1",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Rate",
- "oldfieldname": "export_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "print_width": "150px",
- "read_only": 0,
- "reqd": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "export_amount",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Rate (Company Currency)",
- "oldfieldname": "basic_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "reqd": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_amount",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Amount (Company Currency)",
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_price",
- "fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse_and_reference",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Warehouse and Reference"
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Warehouse",
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no",
- "fieldtype": "Text",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Serial No",
- "no_copy": 1,
- "oldfieldname": "serial_no",
- "oldfieldtype": "Text",
- "print_hide": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "batch_no",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Batch No",
- "oldfieldname": "batch_no",
- "oldfieldtype": "Link",
- "options": "Batch",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 1,
- "label": "Item Group",
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Link",
- "hidden": 1,
- "label": "Brand Name",
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_tax_rate",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Item Tax Rate",
- "oldfieldname": "item_tax_rate",
- "oldfieldtype": "Small Text",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break4",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "actual_qty",
- "fieldtype": "Float",
- "label": "Available Qty at Warehouse",
- "no_copy": 1,
- "oldfieldname": "actual_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "expense_account",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Expense Account",
- "no_copy": 1,
- "options": "Account",
- "print_hide": 1,
- "read_only": 0,
- "width": "120px"
- },
- {
- "default": ":Company",
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Cost Center",
- "no_copy": 1,
- "options": "Cost Center",
- "print_hide": 1,
- "read_only": 0,
- "width": "120px"
- },
- {
- "doctype": "DocField",
- "fieldname": "against_sales_order",
- "fieldtype": "Link",
- "label": "Against Sales Order",
- "options": "Sales Order",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "against_sales_invoice",
- "fieldtype": "Link",
- "label": "Against Sales Invoice",
- "options": "Sales Invoice",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_detail_docname",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "label": "Against Document Detail No",
- "no_copy": 1,
- "oldfieldname": "prevdoc_detail_docname",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "search_index": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "installed_qty",
- "fieldtype": "Float",
- "label": "Installed Qty",
- "no_copy": 1,
- "oldfieldname": "installed_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "buying_amount",
- "fieldtype": "Currency",
- "hidden": 1,
- "label": "Buying Amount",
- "no_copy": 1,
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "page_break",
- "fieldtype": "Check",
- "label": "Page Break",
- "oldfieldname": "page_break",
- "oldfieldtype": "Check",
- "print_hide": 1,
- "read_only": 0
- }
-]
\ No newline at end of file
+{
+ "autoname": "DND/.#######",
+ "creation": "2013-04-22 13:15:44.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "barcode",
+ "fieldtype": "Data",
+ "in_list_view": 0,
+ "label": "Barcode",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_list_view": 0,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "customer_item_code",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Customer's Item Code",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Quantity and Rate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Quantity",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate",
+ "no_copy": 0,
+ "oldfieldname": "ref_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "discount_percentage",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Discount (%)",
+ "oldfieldname": "adj_rate",
+ "oldfieldtype": "Float",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "50px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "50px"
+ },
+ {
+ "fieldname": "base_price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate (Company Currency)",
+ "oldfieldname": "base_ref_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "section_break_1",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Rate",
+ "oldfieldname": "export_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "150px",
+ "read_only": 0,
+ "reqd": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "export_amount",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "base_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Rate (Company Currency)",
+ "oldfieldname": "basic_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "base_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Amount (Company Currency)",
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "warehouse_and_reference",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Warehouse and Reference",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Warehouse",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "serial_no",
+ "fieldtype": "Text",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Serial No",
+ "no_copy": 1,
+ "oldfieldname": "serial_no",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "batch_no",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Batch No",
+ "oldfieldname": "batch_no",
+ "oldfieldtype": "Link",
+ "options": "Batch",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "Item Group",
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "Brand Name",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "item_tax_rate",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Item Tax Rate",
+ "oldfieldname": "item_tax_rate",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "actual_qty",
+ "fieldtype": "Float",
+ "label": "Available Qty at Warehouse",
+ "no_copy": 1,
+ "oldfieldname": "actual_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "expense_account",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Expense Account",
+ "no_copy": 1,
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "width": "120px"
+ },
+ {
+ "default": ":Company",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Cost Center",
+ "no_copy": 1,
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "width": "120px"
+ },
+ {
+ "fieldname": "against_sales_order",
+ "fieldtype": "Link",
+ "label": "Against Sales Order",
+ "options": "Sales Order",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "against_sales_invoice",
+ "fieldtype": "Link",
+ "label": "Against Sales Invoice",
+ "options": "Sales Invoice",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "prevdoc_detail_docname",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Against Document Detail No",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_detail_docname",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "installed_qty",
+ "fieldtype": "Float",
+ "label": "Installed Qty",
+ "no_copy": 1,
+ "oldfieldname": "installed_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "buying_amount",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "label": "Buying Amount",
+ "no_copy": 1,
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "label": "Page Break",
+ "oldfieldname": "page_break",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-28 11:20:58.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Delivery Note Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js
index 3cae599..b797420 100644
--- a/erpnext/stock/doctype/item/item.js
+++ b/erpnext/stock/doctype/item/item.js
@@ -151,8 +151,7 @@
cur_frm.cscript.copy_from_item_group = function(doc) {
frappe.model.with_doc("Item Group", doc.item_group, function() {
- $.each(frappe.model.get("Item Website Specification", {parent:doc.item_group}),
- function(i, d) {
+ $.each((doc.item_website_specifications || []), function(i, d) {
var n = frappe.model.add_child(doc, "Item Website Specification",
"item_website_specifications");
n.label = d.label;
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 58d151a..2074925 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -5,7 +5,6 @@
import frappe
from frappe.utils import cstr, flt, getdate, now_datetime, formatdate
-from frappe.model.doc import addchild
from frappe.model.bean import getlist
from frappe import msgprint, _
@@ -13,13 +12,13 @@
class WarehouseNotSet(Exception): pass
-class DocType(DocListController):
+class Item(DocListController):
def onload(self):
self.doc.fields["__sle_exists"] = self.check_if_sle_exists()
def autoname(self):
if frappe.db.get_default("item_naming_by")=="Naming Series":
- from frappe.model.doc import make_autoname
+ from frappe.model.naming import make_autoname
self.doc.item_code = make_autoname(self.doc.naming_series+'.#####')
elif not self.doc.item_code:
msgprint(_("Item Code (item_code) is mandatory because Item naming is not sequential."), raise_exception=1)
@@ -58,13 +57,13 @@
raise_exception=WarehouseNotSet)
def add_default_uom_in_conversion_factor_table(self):
- uom_conv_list = [d.uom for d in self.doclist.get({"parentfield": "uom_conversion_details"})]
+ uom_conv_list = [d.uom for d in self.get("uom_conversion_details")]
if self.doc.stock_uom not in uom_conv_list:
- ch = addchild(self.doc, 'uom_conversion_details', 'UOM Conversion Detail', self.doclist)
+ ch = self.doc.append('uom_conversion_details', {})
ch.uom = self.doc.stock_uom
ch.conversion_factor = 1
- for d in self.doclist.get({"parentfield": "uom_conversion_details"}):
+ for d in self.get("uom_conversion_details"):
if d.conversion_factor == 1 and d.uom != self.doc.stock_uom:
self.doclist.remove(d)
@@ -95,7 +94,7 @@
def validate_conversion_factor(self):
check_list = []
- for d in getlist(self.doclist,'uom_conversion_details'):
+ for d in self.get('uom_conversion_details'):
if cstr(d.uom) in check_list:
msgprint(_("UOM %s has been entered more than once in Conversion Factor Table." %
cstr(d.uom)), raise_exception=1)
@@ -141,14 +140,14 @@
def fill_customer_code(self):
""" Append all the customer codes and insert into "customer_code" field of item table """
cust_code=[]
- for d in getlist(self.doclist,'item_customer_details'):
+ for d in self.get('item_customer_details'):
cust_code.append(d.ref_code)
self.doc.customer_code=','.join(cust_code)
def check_item_tax(self):
"""Check whether Tax Rate is not entered twice for same Tax Type"""
check_list=[]
- for d in getlist(self.doclist,'item_tax'):
+ for d in self.get('item_tax'):
if d.tax_type:
account_type = frappe.db.get_value("Account", d.tax_type, "account_type")
@@ -273,7 +272,7 @@
"in Item master") % {
"item_code": item_code,
"date": formatdate(end_of_life),
- "end_of_life_label": frappe.get_doctype("Item").get_label("end_of_life")
+ "end_of_life_label": frappe.get_meta("Item").get_label("end_of_life")
}
_msgprint(msg, verbose)
diff --git a/erpnext/stock/doctype/item/item.txt b/erpnext/stock/doctype/item/item.txt
index 229fa97..77c992a 100644
--- a/erpnext/stock/doctype/item/item.txt
+++ b/erpnext/stock/doctype/item/item.txt
@@ -1,892 +1,885 @@
-[
- {
- "creation": "2013-05-03 10:45:46",
- "docstatus": 0,
- "modified": "2014-03-13 15:54:09",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:item_code",
- "default_print_format": "Standard",
- "description": "A Product or a Service that is bought, sold or kept in stock.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-tag",
- "max_attachments": 1,
- "module": "Stock",
- "name": "__common__",
- "search_fields": "item_name,description,item_group,customer_code"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Item",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "name_and_description_section",
- "fieldtype": "Section Break",
- "label": "Name and Description",
- "no_copy": 0,
- "oldfieldtype": "Section Break",
- "options": "icon-flag",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "options": "\nITEM",
- "read_only": 0
- },
- {
- "description": "Item will be saved by this name in the data base.",
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Data",
- "in_filter": 0,
- "label": "Item Code",
- "no_copy": 1,
- "oldfieldname": "item_code",
- "oldfieldtype": "Data",
- "read_only": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Item Group",
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "read_only": 0,
- "reqd": 1
- },
- {
- "description": "Unit of measurement of this item (e.g. Kg, Unit, No, Pair).",
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Default Unit of Measure",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Brand",
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "barcode",
- "fieldtype": "Data",
- "label": "Barcode",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "image",
- "fieldtype": "Select",
- "label": "Image",
- "options": "attach_files:",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "image_view",
- "fieldtype": "Image",
- "in_list_view": 1,
- "label": "Image View",
- "options": "image",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "read_only": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "description_html",
- "fieldtype": "Small Text",
- "label": "Description HTML",
- "read_only": 0
- },
- {
- "description": "Generates HTML to include selected image in the description",
- "doctype": "DocField",
- "fieldname": "add_image",
- "fieldtype": "Button",
- "label": "Generate Description HTML",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "inventory",
- "fieldtype": "Section Break",
- "label": "Inventory",
- "oldfieldtype": "Section Break",
- "options": "icon-truck",
- "read_only": 0
- },
- {
- "default": "Yes",
- "description": "Select \"Yes\" if you are maintaining stock of this item in your Inventory.",
- "doctype": "DocField",
- "fieldname": "is_stock_item",
- "fieldtype": "Select",
- "label": "Is Stock Item",
- "oldfieldname": "is_stock_item",
- "oldfieldtype": "Select",
- "options": "Yes\nNo",
- "read_only": 0,
- "reqd": 1
- },
- {
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "description": "Mandatory if Stock Item is \"Yes\". Also the default warehouse where reserved quantity is set from Sales Order.",
- "doctype": "DocField",
- "fieldname": "default_warehouse",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Default Warehouse",
- "oldfieldname": "default_warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "description": "Percentage variation in quantity to be allowed while receiving or delivering this item.",
- "doctype": "DocField",
- "fieldname": "tolerance",
- "fieldtype": "Float",
- "label": "Allowance Percent",
- "oldfieldname": "tolerance",
- "oldfieldtype": "Currency",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "valuation_method",
- "fieldtype": "Select",
- "label": "Valuation Method",
- "options": "\nFIFO\nMoving Average",
- "read_only": 0
- },
- {
- "default": "0.00",
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "description": "You can enter the minimum quantity of this item to be ordered.",
- "doctype": "DocField",
- "fieldname": "min_order_qty",
- "fieldtype": "Float",
- "hidden": 0,
- "label": "Minimum Order Qty",
- "oldfieldname": "min_order_qty",
- "oldfieldtype": "Currency",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "default": "No",
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "description": "Select \"Yes\" if this item is used for some internal purpose in your company.",
- "doctype": "DocField",
- "fieldname": "is_asset_item",
- "fieldtype": "Select",
- "label": "Is Fixed Asset Item",
- "oldfieldname": "is_asset_item",
- "oldfieldtype": "Select",
- "options": "Yes\nNo",
- "read_only": 0,
- "reqd": 1
- },
- {
- "default": "No",
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "has_batch_no",
- "fieldtype": "Select",
- "label": "Has Batch No",
- "oldfieldname": "has_batch_no",
- "oldfieldtype": "Select",
- "options": "Yes\nNo",
- "read_only": 0,
- "reqd": 1
- },
- {
- "default": "No",
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "description": "Selecting \"Yes\" will give a unique identity to each entity of this item which can be viewed in the Serial No master.",
- "doctype": "DocField",
- "fieldname": "has_serial_no",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Has Serial No",
- "oldfieldname": "has_serial_no",
- "oldfieldtype": "Select",
- "options": "Yes\nNo",
- "read_only": 0,
- "reqd": 1
- },
- {
- "depends_on": "eval: doc.has_serial_no===\"Yes\"",
- "description": "Example: ABCD.#####\nIf series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.",
- "doctype": "DocField",
- "fieldname": "serial_no_series",
- "fieldtype": "Data",
- "label": "Serial Number Series"
- },
- {
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "warranty_period",
- "fieldtype": "Data",
- "label": "Warranty Period (in days)",
- "oldfieldname": "warranty_period",
- "oldfieldtype": "Data",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "end_of_life",
- "fieldtype": "Date",
- "label": "End of Life",
- "oldfieldname": "end_of_life",
- "oldfieldtype": "Date",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "description": "Net Weight of each Item",
- "doctype": "DocField",
- "fieldname": "net_weight",
- "fieldtype": "Float",
- "label": "Net Weight",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "weight_uom",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Weight UOM",
- "options": "UOM",
- "read_only": 0
- },
- {
- "description": "Auto-raise Material Request if quantity goes below re-order level in a warehouse",
- "doctype": "DocField",
- "fieldname": "reorder_section",
- "fieldtype": "Section Break",
- "label": "Re-order",
- "options": "icon-rss",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "re_order_level",
- "fieldtype": "Float",
- "label": "Re-Order Level",
- "oldfieldname": "re_order_level",
- "oldfieldtype": "Currency",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_stock_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "re_order_qty",
- "fieldtype": "Float",
- "label": "Re-Order Qty",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break_31",
- "fieldtype": "Section Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "item_reorder",
- "fieldtype": "Table",
- "label": "Warehouse-wise Item Reorder",
- "options": "Item Reorder",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_details",
- "fieldtype": "Section Break",
- "label": "Purchase Details",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart",
- "read_only": 0
- },
- {
- "default": "Yes",
- "description": "Selecting \"Yes\" will allow this item to appear in Purchase Order , Purchase Receipt.",
- "doctype": "DocField",
- "fieldname": "is_purchase_item",
- "fieldtype": "Select",
- "label": "Is Purchase Item",
- "oldfieldname": "is_purchase_item",
- "oldfieldtype": "Select",
- "options": "Yes\nNo",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "default_supplier",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Default Supplier",
- "options": "Supplier"
- },
- {
- "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
- "description": "Lead Time days is number of days by which this item is expected in your warehouse. This days is fetched in Material Request when you select this item.",
- "doctype": "DocField",
- "fieldname": "lead_time_days",
- "fieldtype": "Int",
- "label": "Lead Time Days",
- "no_copy": 1,
- "oldfieldname": "lead_time_days",
- "oldfieldtype": "Int",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
- "description": "Default Purchase Account in which cost of the item will be debited.",
- "doctype": "DocField",
- "fieldname": "expense_account",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Default Expense Account",
- "oldfieldname": "purchase_account",
- "oldfieldtype": "Link",
- "options": "Account",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
- "description": "Default Cost Center for tracking expense for this item.",
- "doctype": "DocField",
- "fieldname": "buying_cost_center",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Default Buying Cost Center",
- "oldfieldname": "cost_center",
- "oldfieldtype": "Link",
- "options": "Cost Center",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "last_purchase_rate",
- "fieldtype": "Float",
- "label": "Last Purchase Rate",
- "no_copy": 1,
- "oldfieldname": "last_purchase_rate",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "standard_rate",
- "fieldtype": "Float",
- "label": "Standard Rate",
- "oldfieldname": "standard_rate",
- "oldfieldtype": "Currency",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "uom_conversion_details",
- "fieldtype": "Table",
- "label": "UOM Conversion Details",
- "no_copy": 1,
- "oldfieldname": "uom_conversion_details",
- "oldfieldtype": "Table",
- "options": "UOM Conversion Detail",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "manufacturer",
- "fieldtype": "Data",
- "label": "Manufacturer",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "manufacturer_part_no",
- "fieldtype": "Data",
- "label": "Manufacturer Part Number",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "item_supplier_details",
- "fieldtype": "Table",
- "label": "Item Supplier Details",
- "options": "Item Supplier",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_details",
- "fieldtype": "Section Break",
- "label": "Sales Details",
- "oldfieldtype": "Section Break",
- "options": "icon-tag",
- "read_only": 0
- },
- {
- "default": "Yes",
- "description": "Selecting \"Yes\" will allow this item to figure in Sales Order, Delivery Note",
- "doctype": "DocField",
- "fieldname": "is_sales_item",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Is Sales Item",
- "oldfieldname": "is_sales_item",
- "oldfieldtype": "Select",
- "options": "Yes\nNo",
- "read_only": 0,
- "reqd": 1
- },
- {
- "default": "No",
- "depends_on": "eval:doc.is_sales_item==\"Yes\"",
- "description": "Select \"Yes\" if this item represents some work like training, designing, consulting etc.",
- "doctype": "DocField",
- "fieldname": "is_service_item",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Is Service Item",
- "oldfieldname": "is_service_item",
- "oldfieldtype": "Select",
- "options": "Yes\nNo",
- "read_only": 0,
- "reqd": 1
- },
- {
- "depends_on": "eval:doc.is_sales_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "max_discount",
- "fieldtype": "Float",
- "label": "Max Discount (%)",
- "oldfieldname": "max_discount",
- "oldfieldtype": "Currency",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_sales_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "income_account",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Default Income Account",
- "options": "Account",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_sales_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "selling_cost_center",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Default Selling Cost Center",
- "options": "Cost Center",
- "read_only": 0
- },
- {
- "depends_on": "eval:doc.is_sales_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "depends_on": "eval:doc.is_sales_item==\"Yes\"",
- "description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes",
- "doctype": "DocField",
- "fieldname": "item_customer_details",
- "fieldtype": "Table",
- "label": "Customer Codes",
- "options": "Item Customer Detail",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "item_tax_section_break",
- "fieldtype": "Section Break",
- "label": "Item Tax",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "item_tax",
- "fieldtype": "Table",
- "label": "Item Tax1",
- "oldfieldname": "item_tax",
- "oldfieldtype": "Table",
- "options": "Item Tax",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "inspection_criteria",
- "fieldtype": "Section Break",
- "label": "Inspection Criteria",
- "oldfieldtype": "Section Break",
- "options": "icon-search",
- "read_only": 0
- },
- {
- "default": "No",
- "doctype": "DocField",
- "fieldname": "inspection_required",
- "fieldtype": "Select",
- "label": "Inspection Required",
- "no_copy": 0,
- "oldfieldname": "inspection_required",
- "oldfieldtype": "Select",
- "options": "\nYes\nNo",
- "read_only": 0,
- "reqd": 1
- },
- {
- "depends_on": "eval:doc.inspection_required==\"Yes\"",
- "description": "Quality Inspection Parameters",
- "doctype": "DocField",
- "fieldname": "item_specification_details",
- "fieldtype": "Table",
- "label": "Item Quality Inspection Parameter",
- "oldfieldname": "item_specification_details",
- "oldfieldtype": "Table",
- "options": "Item Quality Inspection Parameter",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "manufacturing",
- "fieldtype": "Section Break",
- "label": "Manufacturing",
- "oldfieldtype": "Section Break",
- "options": "icon-cogs",
- "read_only": 0
- },
- {
- "default": "No",
- "description": "Selecting \"Yes\" will allow you to create Bill of Material showing raw material and operational costs incurred to manufacture this item.",
- "doctype": "DocField",
- "fieldname": "is_manufactured_item",
- "fieldtype": "Select",
- "label": "Allow Bill of Materials",
- "oldfieldname": "is_manufactured_item",
- "oldfieldtype": "Select",
- "options": "Yes\nNo",
- "read_only": 0,
- "reqd": 1
- },
- {
- "depends_on": "eval:doc.is_manufactured_item==\"Yes\"",
- "doctype": "DocField",
- "fieldname": "default_bom",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Default BOM",
- "no_copy": 1,
- "oldfieldname": "default_bom",
- "oldfieldtype": "Link",
- "options": "BOM",
- "read_only": 1
- },
- {
- "default": "No",
- "depends_on": "eval:doc.is_manufactured_item==\"Yes\"",
- "description": "Selecting \"Yes\" will allow you to make a Production Order for this item.",
- "doctype": "DocField",
- "fieldname": "is_pro_applicable",
- "fieldtype": "Select",
- "label": "Allow Production Order",
- "oldfieldname": "is_pro_applicable",
- "oldfieldtype": "Select",
- "options": "Yes\nNo",
- "read_only": 0,
- "reqd": 1
- },
- {
- "default": "No",
- "description": "Select \"Yes\" if you supply raw materials to your supplier to manufacture this item.",
- "doctype": "DocField",
- "fieldname": "is_sub_contracted_item",
- "fieldtype": "Select",
- "label": "Is Sub Contracted Item",
- "oldfieldname": "is_sub_contracted_item",
- "oldfieldtype": "Select",
- "options": "Yes\nNo",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_code",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "label": "Customer Code",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "website_section",
- "fieldtype": "Section Break",
- "label": "Website",
- "options": "icon-globe",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "show_in_website",
- "fieldtype": "Check",
- "label": "Show in Website",
- "read_only": 0
- },
- {
- "depends_on": "show_in_website",
- "description": "website page link",
- "doctype": "DocField",
- "fieldname": "page_name",
- "fieldtype": "Data",
- "label": "Page Name",
- "read_only": 1
- },
- {
- "depends_on": "show_in_website",
- "description": "Products will be sorted by weight-age in default searches. More the weight-age, higher the product will appear in the list.",
- "doctype": "DocField",
- "fieldname": "weightage",
- "fieldtype": "Int",
- "label": "Weightage",
- "read_only": 0,
- "search_index": 1
- },
- {
- "depends_on": "show_in_website",
- "description": "Show a slideshow at the top of the page",
- "doctype": "DocField",
- "fieldname": "slideshow",
- "fieldtype": "Link",
- "label": "Slideshow",
- "options": "Website Slideshow",
- "read_only": 0
- },
- {
- "depends_on": "show_in_website",
- "description": "Item Image (if not slideshow)",
- "doctype": "DocField",
- "fieldname": "website_image",
- "fieldtype": "Select",
- "label": "Image",
- "options": "attach_files:",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "cb72",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "depends_on": "show_in_website",
- "description": "Show \"In Stock\" or \"Not in Stock\" based on stock available in this warehouse.",
- "doctype": "DocField",
- "fieldname": "website_warehouse",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Website Warehouse",
- "options": "Warehouse",
- "read_only": 0
- },
- {
- "depends_on": "show_in_website",
- "description": "List this Item in multiple groups on the website.",
- "doctype": "DocField",
- "fieldname": "website_item_groups",
- "fieldtype": "Table",
- "label": "Website Item Groups",
- "options": "Website Item Group",
- "read_only": 0
- },
- {
- "depends_on": "show_in_website",
- "doctype": "DocField",
- "fieldname": "sb72",
- "fieldtype": "Section Break",
- "read_only": 0
- },
- {
- "depends_on": "show_in_website",
- "doctype": "DocField",
- "fieldname": "copy_from_item_group",
- "fieldtype": "Button",
- "label": "Copy From Item Group",
- "read_only": 0
- },
- {
- "depends_on": "show_in_website",
- "doctype": "DocField",
- "fieldname": "item_website_specifications",
- "fieldtype": "Table",
- "label": "Item Website Specifications",
- "options": "Item Website Specification",
- "read_only": 0
- },
- {
- "depends_on": "show_in_website",
- "doctype": "DocField",
- "fieldname": "web_long_description",
- "fieldtype": "Text Editor",
- "label": "Website Description",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "parent_website_route",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Parent Website Route",
- "options": "Website Route"
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "import": 1,
- "role": "Material Master Manager",
- "write": 1
- },
- {
- "amend": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Material Manager",
- "write": 0
- },
- {
- "amend": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Material User",
- "write": 0
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:item_code",
+ "creation": "2013-05-03 10:45:46.000000",
+ "default_print_format": "Standard",
+ "description": "A Product or a Service that is bought, sold or kept in stock.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "name_and_description_section",
+ "fieldtype": "Section Break",
+ "label": "Name and Description",
+ "no_copy": 0,
+ "oldfieldtype": "Section Break",
+ "options": "icon-flag",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "options": "\nITEM",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "Item will be saved by this name in the data base.",
+ "fieldname": "item_code",
+ "fieldtype": "Data",
+ "in_filter": 0,
+ "label": "Item Code",
+ "no_copy": 1,
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Item Group",
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Unit of measurement of this item (e.g. Kg, Unit, No, Pair).",
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Default Unit of Measure",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Brand",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "barcode",
+ "fieldtype": "Data",
+ "label": "Barcode",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "image",
+ "fieldtype": "Select",
+ "label": "Image",
+ "options": "attach_files:",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "image_view",
+ "fieldtype": "Image",
+ "in_list_view": 1,
+ "label": "Image View",
+ "options": "image",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "description_html",
+ "fieldtype": "Small Text",
+ "label": "Description HTML",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "Generates HTML to include selected image in the description",
+ "fieldname": "add_image",
+ "fieldtype": "Button",
+ "label": "Generate Description HTML",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "inventory",
+ "fieldtype": "Section Break",
+ "label": "Inventory",
+ "oldfieldtype": "Section Break",
+ "options": "icon-truck",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "default": "Yes",
+ "description": "Select \"Yes\" if you are maintaining stock of this item in your Inventory.",
+ "fieldname": "is_stock_item",
+ "fieldtype": "Select",
+ "label": "Is Stock Item",
+ "oldfieldname": "is_stock_item",
+ "oldfieldtype": "Select",
+ "options": "Yes\nNo",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "description": "Mandatory if Stock Item is \"Yes\". Also the default warehouse where reserved quantity is set from Sales Order.",
+ "fieldname": "default_warehouse",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Default Warehouse",
+ "oldfieldname": "default_warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "description": "Percentage variation in quantity to be allowed while receiving or delivering this item.",
+ "fieldname": "tolerance",
+ "fieldtype": "Float",
+ "label": "Allowance Percent",
+ "oldfieldname": "tolerance",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "fieldname": "valuation_method",
+ "fieldtype": "Select",
+ "label": "Valuation Method",
+ "options": "\nFIFO\nMoving Average",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "default": "0.00",
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "description": "You can enter the minimum quantity of this item to be ordered.",
+ "fieldname": "min_order_qty",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "label": "Minimum Order Qty",
+ "oldfieldname": "min_order_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "default": "No",
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "description": "Select \"Yes\" if this item is used for some internal purpose in your company.",
+ "fieldname": "is_asset_item",
+ "fieldtype": "Select",
+ "label": "Is Fixed Asset Item",
+ "oldfieldname": "is_asset_item",
+ "oldfieldtype": "Select",
+ "options": "Yes\nNo",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "default": "No",
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "fieldname": "has_batch_no",
+ "fieldtype": "Select",
+ "label": "Has Batch No",
+ "oldfieldname": "has_batch_no",
+ "oldfieldtype": "Select",
+ "options": "Yes\nNo",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "default": "No",
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "description": "Selecting \"Yes\" will give a unique identity to each entity of this item which can be viewed in the Serial No master.",
+ "fieldname": "has_serial_no",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Has Serial No",
+ "oldfieldname": "has_serial_no",
+ "oldfieldtype": "Select",
+ "options": "Yes\nNo",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval: doc.has_serial_no===\"Yes\"",
+ "description": "Example: ABCD.#####\nIf series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.",
+ "fieldname": "serial_no_series",
+ "fieldtype": "Data",
+ "label": "Serial Number Series",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "fieldname": "warranty_period",
+ "fieldtype": "Data",
+ "label": "Warranty Period (in days)",
+ "oldfieldname": "warranty_period",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "fieldname": "end_of_life",
+ "fieldtype": "Date",
+ "label": "End of Life",
+ "oldfieldname": "end_of_life",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "description": "Net Weight of each Item",
+ "fieldname": "net_weight",
+ "fieldtype": "Float",
+ "label": "Net Weight",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "fieldname": "weight_uom",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Weight UOM",
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "Auto-raise Material Request if quantity goes below re-order level in a warehouse",
+ "fieldname": "reorder_section",
+ "fieldtype": "Section Break",
+ "label": "Re-order",
+ "options": "icon-rss",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "fieldname": "re_order_level",
+ "fieldtype": "Float",
+ "label": "Re-Order Level",
+ "oldfieldname": "re_order_level",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_stock_item==\"Yes\"",
+ "fieldname": "re_order_qty",
+ "fieldtype": "Float",
+ "label": "Re-Order Qty",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "section_break_31",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "item_reorder",
+ "fieldtype": "Table",
+ "label": "Warehouse-wise Item Reorder",
+ "options": "Item Reorder",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "purchase_details",
+ "fieldtype": "Section Break",
+ "label": "Purchase Details",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "default": "Yes",
+ "description": "Selecting \"Yes\" will allow this item to appear in Purchase Order , Purchase Receipt.",
+ "fieldname": "is_purchase_item",
+ "fieldtype": "Select",
+ "label": "Is Purchase Item",
+ "oldfieldname": "is_purchase_item",
+ "oldfieldtype": "Select",
+ "options": "Yes\nNo",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "default_supplier",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Default Supplier",
+ "options": "Supplier",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
+ "description": "Lead Time days is number of days by which this item is expected in your warehouse. This days is fetched in Material Request when you select this item.",
+ "fieldname": "lead_time_days",
+ "fieldtype": "Int",
+ "label": "Lead Time Days",
+ "no_copy": 1,
+ "oldfieldname": "lead_time_days",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
+ "description": "Default Purchase Account in which cost of the item will be debited.",
+ "fieldname": "expense_account",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Default Expense Account",
+ "oldfieldname": "purchase_account",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
+ "description": "Default Cost Center for tracking expense for this item.",
+ "fieldname": "buying_cost_center",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Default Buying Cost Center",
+ "oldfieldname": "cost_center",
+ "oldfieldtype": "Link",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
+ "fieldname": "last_purchase_rate",
+ "fieldtype": "Float",
+ "label": "Last Purchase Rate",
+ "no_copy": 1,
+ "oldfieldname": "last_purchase_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
+ "fieldname": "standard_rate",
+ "fieldtype": "Float",
+ "label": "Standard Rate",
+ "oldfieldname": "standard_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
+ "fieldname": "uom_conversion_details",
+ "fieldtype": "Table",
+ "label": "UOM Conversion Details",
+ "no_copy": 1,
+ "oldfieldname": "uom_conversion_details",
+ "oldfieldtype": "Table",
+ "options": "UOM Conversion Detail",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
+ "fieldname": "manufacturer",
+ "fieldtype": "Data",
+ "label": "Manufacturer",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
+ "fieldname": "manufacturer_part_no",
+ "fieldtype": "Data",
+ "label": "Manufacturer Part Number",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_purchase_item==\"Yes\"",
+ "fieldname": "item_supplier_details",
+ "fieldtype": "Table",
+ "label": "Item Supplier Details",
+ "options": "Item Supplier",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "sales_details",
+ "fieldtype": "Section Break",
+ "label": "Sales Details",
+ "oldfieldtype": "Section Break",
+ "options": "icon-tag",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "default": "Yes",
+ "description": "Selecting \"Yes\" will allow this item to figure in Sales Order, Delivery Note",
+ "fieldname": "is_sales_item",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Is Sales Item",
+ "oldfieldname": "is_sales_item",
+ "oldfieldtype": "Select",
+ "options": "Yes\nNo",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "default": "No",
+ "depends_on": "eval:doc.is_sales_item==\"Yes\"",
+ "description": "Select \"Yes\" if this item represents some work like training, designing, consulting etc.",
+ "fieldname": "is_service_item",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Is Service Item",
+ "oldfieldname": "is_service_item",
+ "oldfieldtype": "Select",
+ "options": "Yes\nNo",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:doc.is_sales_item==\"Yes\"",
+ "fieldname": "max_discount",
+ "fieldtype": "Float",
+ "label": "Max Discount (%)",
+ "oldfieldname": "max_discount",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_sales_item==\"Yes\"",
+ "fieldname": "income_account",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Default Income Account",
+ "options": "Account",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_sales_item==\"Yes\"",
+ "fieldname": "selling_cost_center",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Default Selling Cost Center",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:doc.is_sales_item==\"Yes\"",
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "depends_on": "eval:doc.is_sales_item==\"Yes\"",
+ "description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes",
+ "fieldname": "item_customer_details",
+ "fieldtype": "Table",
+ "label": "Customer Codes",
+ "options": "Item Customer Detail",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "item_tax_section_break",
+ "fieldtype": "Section Break",
+ "label": "Item Tax",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "item_tax",
+ "fieldtype": "Table",
+ "label": "Item Tax1",
+ "oldfieldname": "item_tax",
+ "oldfieldtype": "Table",
+ "options": "Item Tax",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "inspection_criteria",
+ "fieldtype": "Section Break",
+ "label": "Inspection Criteria",
+ "oldfieldtype": "Section Break",
+ "options": "icon-search",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "default": "No",
+ "fieldname": "inspection_required",
+ "fieldtype": "Select",
+ "label": "Inspection Required",
+ "no_copy": 0,
+ "oldfieldname": "inspection_required",
+ "oldfieldtype": "Select",
+ "options": "\nYes\nNo",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:doc.inspection_required==\"Yes\"",
+ "description": "Quality Inspection Parameters",
+ "fieldname": "item_specification_details",
+ "fieldtype": "Table",
+ "label": "Item Quality Inspection Parameter",
+ "oldfieldname": "item_specification_details",
+ "oldfieldtype": "Table",
+ "options": "Item Quality Inspection Parameter",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "manufacturing",
+ "fieldtype": "Section Break",
+ "label": "Manufacturing",
+ "oldfieldtype": "Section Break",
+ "options": "icon-cogs",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "default": "No",
+ "description": "Selecting \"Yes\" will allow you to create Bill of Material showing raw material and operational costs incurred to manufacture this item.",
+ "fieldname": "is_manufactured_item",
+ "fieldtype": "Select",
+ "label": "Allow Bill of Materials",
+ "oldfieldname": "is_manufactured_item",
+ "oldfieldtype": "Select",
+ "options": "Yes\nNo",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:doc.is_manufactured_item==\"Yes\"",
+ "fieldname": "default_bom",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Default BOM",
+ "no_copy": 1,
+ "oldfieldname": "default_bom",
+ "oldfieldtype": "Link",
+ "options": "BOM",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "default": "No",
+ "depends_on": "eval:doc.is_manufactured_item==\"Yes\"",
+ "description": "Selecting \"Yes\" will allow you to make a Production Order for this item.",
+ "fieldname": "is_pro_applicable",
+ "fieldtype": "Select",
+ "label": "Allow Production Order",
+ "oldfieldname": "is_pro_applicable",
+ "oldfieldtype": "Select",
+ "options": "Yes\nNo",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "default": "No",
+ "description": "Select \"Yes\" if you supply raw materials to your supplier to manufacture this item.",
+ "fieldname": "is_sub_contracted_item",
+ "fieldtype": "Select",
+ "label": "Is Sub Contracted Item",
+ "oldfieldname": "is_sub_contracted_item",
+ "oldfieldtype": "Select",
+ "options": "Yes\nNo",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "customer_code",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Customer Code",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "website_section",
+ "fieldtype": "Section Break",
+ "label": "Website",
+ "options": "icon-globe",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "show_in_website",
+ "fieldtype": "Check",
+ "label": "Show in Website",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "show_in_website",
+ "description": "website page link",
+ "fieldname": "page_name",
+ "fieldtype": "Data",
+ "label": "Page Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "show_in_website",
+ "description": "Products will be sorted by weight-age in default searches. More the weight-age, higher the product will appear in the list.",
+ "fieldname": "weightage",
+ "fieldtype": "Int",
+ "label": "Weightage",
+ "permlevel": 0,
+ "read_only": 0,
+ "search_index": 1
+ },
+ {
+ "depends_on": "show_in_website",
+ "description": "Show a slideshow at the top of the page",
+ "fieldname": "slideshow",
+ "fieldtype": "Link",
+ "label": "Slideshow",
+ "options": "Website Slideshow",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "show_in_website",
+ "description": "Item Image (if not slideshow)",
+ "fieldname": "website_image",
+ "fieldtype": "Select",
+ "label": "Image",
+ "options": "attach_files:",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "cb72",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "show_in_website",
+ "description": "Show \"In Stock\" or \"Not in Stock\" based on stock available in this warehouse.",
+ "fieldname": "website_warehouse",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Website Warehouse",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "show_in_website",
+ "description": "List this Item in multiple groups on the website.",
+ "fieldname": "website_item_groups",
+ "fieldtype": "Table",
+ "label": "Website Item Groups",
+ "options": "Website Item Group",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "show_in_website",
+ "fieldname": "sb72",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "show_in_website",
+ "fieldname": "copy_from_item_group",
+ "fieldtype": "Button",
+ "label": "Copy From Item Group",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "show_in_website",
+ "fieldname": "item_website_specifications",
+ "fieldtype": "Table",
+ "label": "Item Website Specifications",
+ "options": "Item Website Specification",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "depends_on": "show_in_website",
+ "fieldname": "web_long_description",
+ "fieldtype": "Text Editor",
+ "label": "Website Description",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "parent_website_route",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Parent Website Route",
+ "options": "Website Route",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-tag",
+ "idx": 1,
+ "max_attachments": 1,
+ "modified": "2014-03-13 15:54:09.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "import": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Manager",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 0,
+ "write": 0
+ }
+ ],
+ "search_fields": "item_name,description,item_group,customer_code"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py
index 26c87f1..b0bd280c 100644
--- a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py
+++ b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ItemCustomerDetail(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt
index 9d9b6ca..42b917b 100644
--- a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt
+++ b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt
@@ -1,56 +1,47 @@
-[
- {
- "creation": "2013-03-08 15:37:16",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:16",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "ITEMCUST/.#####",
- "description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes",
- "doctype": "DocType",
- "in_create": 0,
- "istable": 1,
- "module": "Stock",
- "name": "__common__",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "in_filter": 1,
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Item Customer Detail",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocType",
- "name": "Item Customer Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Link",
- "label": "Customer Name",
- "oldfieldname": "price_list_name",
- "oldfieldtype": "Select",
- "options": "Customer",
- "print_width": "180px",
- "width": "180px"
- },
- {
- "doctype": "DocField",
- "fieldname": "ref_code",
- "fieldtype": "Data",
- "label": "Ref Code",
- "oldfieldname": "ref_rate",
- "oldfieldtype": "Currency",
- "print_width": "120px",
- "width": "120px"
- }
-]
\ No newline at end of file
+{
+ "autoname": "ITEMCUST/.#####",
+ "creation": "2013-03-08 15:37:16.000000",
+ "description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "customer_name",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Customer Name",
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Select",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_width": "180px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "180px"
+ },
+ {
+ "fieldname": "ref_code",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Ref Code",
+ "oldfieldname": "ref_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "120px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "120px"
+ }
+ ],
+ "idx": 1,
+ "in_create": 0,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:16.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item Customer Detail",
+ "owner": "Administrator",
+ "read_only": 0
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_price/item_price.py b/erpnext/stock/doctype/item_price/item_price.py
index 879fcae..3c3972b 100644
--- a/erpnext/stock/doctype/item_price/item_price.py
+++ b/erpnext/stock/doctype/item_price/item_price.py
@@ -7,9 +7,9 @@
class ItemPriceDuplicateItem(frappe.ValidationError): pass
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class ItemPrice(Document):
def validate(self):
self.validate_item()
diff --git a/erpnext/stock/doctype/item_price/item_price.txt b/erpnext/stock/doctype/item_price/item_price.txt
index 8b18876..6b50349 100644
--- a/erpnext/stock/doctype/item_price/item_price.txt
+++ b/erpnext/stock/doctype/item_price/item_price.txt
@@ -1,151 +1,140 @@
-[
- {
- "creation": "2013-05-02 16:29:48",
- "docstatus": 0,
- "modified": "2014-02-10 17:27:32",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "autoname": "RFD/.#####",
- "description": "Multiple Item prices.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-flag",
- "in_create": 0,
- "istable": 0,
- "module": "Stock",
- "name": "__common__",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Item Price",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Item Price",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Item Price"
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_details",
- "fieldtype": "Section Break",
- "label": "Price List",
- "options": "icon-tags"
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Price List",
- "options": "Price List",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "buying",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Buying",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "selling",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Selling",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_details",
- "fieldtype": "Section Break",
- "label": "Item",
- "options": "icon-tag"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "price_list_name",
- "oldfieldtype": "Select",
- "options": "Item",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_rate",
- "fieldtype": "Currency",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Rate",
- "oldfieldname": "ref_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_br_1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "label": "Item Name",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_description",
- "fieldtype": "Text",
- "label": "Item Description",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "currency",
- "fieldtype": "Link",
- "hidden": 1,
- "label": "Currency",
- "options": "Currency",
- "read_only": 1
- },
- {
- "doctype": "DocPerm",
- "role": "Sales Master Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Purchase Master Manager"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "RFD/.#####",
+ "creation": "2013-05-02 16:29:48.000000",
+ "description": "Multiple Item prices.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "price_list_details",
+ "fieldtype": "Section Break",
+ "label": "Price List",
+ "options": "icon-tags",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "price_list",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Price List",
+ "options": "Price List",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "buying",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Buying",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "selling",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Selling",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "item_details",
+ "fieldtype": "Section Break",
+ "label": "Item",
+ "options": "icon-tag",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Select",
+ "options": "Item",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "price_list_rate",
+ "fieldtype": "Currency",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Rate",
+ "oldfieldname": "ref_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "col_br_1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "label": "Item Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "item_description",
+ "fieldtype": "Text",
+ "label": "Item Description",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-flag",
+ "idx": 1,
+ "in_create": 0,
+ "istable": 0,
+ "modified": "2014-02-10 17:27:32.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item Price",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Master Manager",
+ "write": 1
+ }
+ ],
+ "read_only": 0
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py
index 26c87f1..b659bb0 100644
--- a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py
+++ b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ItemQualityInspectionParameter(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt
index 8ec87d7..f7c35f2 100644
--- a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt
+++ b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt
@@ -1,48 +1,38 @@
-[
- {
- "creation": "2013-02-22 01:28:01",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:16",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "IISD/.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "fieldtype": "Data",
- "in_list_view": 1,
- "name": "__common__",
- "oldfieldtype": "Data",
- "parent": "Item Quality Inspection Parameter",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Item Quality Inspection Parameter"
- },
- {
- "doctype": "DocField",
- "fieldname": "specification",
- "in_filter": 0,
- "label": "Parameter",
- "oldfieldname": "specification",
- "print_width": "200px",
- "reqd": 1,
- "search_index": 0,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "value",
- "label": "Acceptance Criteria",
- "oldfieldname": "value"
- }
-]
\ No newline at end of file
+{
+ "autoname": "IISD/.#####",
+ "creation": "2013-02-22 01:28:01.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "specification",
+ "fieldtype": "Data",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Parameter",
+ "oldfieldname": "specification",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_width": "200px",
+ "reqd": 1,
+ "search_index": 0,
+ "width": "200px"
+ },
+ {
+ "fieldname": "value",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Acceptance Criteria",
+ "oldfieldname": "value",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:16.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item Quality Inspection Parameter",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_reorder/item_reorder.py b/erpnext/stock/doctype/item_reorder/item_reorder.py
index 968a25b..7dcefb0 100644
--- a/erpnext/stock/doctype/item_reorder/item_reorder.py
+++ b/erpnext/stock/doctype/item_reorder/item_reorder.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ItemReorder(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_reorder/item_reorder.txt b/erpnext/stock/doctype/item_reorder/item_reorder.txt
index 74df09a..bc96b4a 100644
--- a/erpnext/stock/doctype/item_reorder/item_reorder.txt
+++ b/erpnext/stock/doctype/item_reorder/item_reorder.txt
@@ -1,60 +1,53 @@
-[
- {
- "creation": "2013-03-07 11:42:59",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:16",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "REORD-.#####",
- "doctype": "DocType",
- "in_create": 1,
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Item Reorder",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "read_only": 0
- },
- {
- "doctype": "DocType",
- "name": "Item Reorder"
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "label": "Warehouse",
- "options": "Warehouse",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse_reorder_level",
- "fieldtype": "Float",
- "label": "Re-order Level",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse_reorder_qty",
- "fieldtype": "Float",
- "label": "Re-order Qty"
- },
- {
- "doctype": "DocField",
- "fieldname": "material_request_type",
- "fieldtype": "Select",
- "label": "Material Request Type",
- "options": "Purchase\nTransfer",
- "reqd": 1
- }
-]
\ No newline at end of file
+{
+ "autoname": "REORD-.#####",
+ "creation": "2013-03-07 11:42:59.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Warehouse",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "warehouse_reorder_level",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Re-order Level",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "warehouse_reorder_qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Re-order Qty",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "material_request_type",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Material Request Type",
+ "options": "Purchase\nTransfer",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ }
+ ],
+ "idx": 1,
+ "in_create": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:16.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item Reorder",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_supplier/item_supplier.py b/erpnext/stock/doctype/item_supplier/item_supplier.py
index 26c87f1..68f4816 100644
--- a/erpnext/stock/doctype/item_supplier/item_supplier.py
+++ b/erpnext/stock/doctype/item_supplier/item_supplier.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ItemSupplier(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_supplier/item_supplier.txt b/erpnext/stock/doctype/item_supplier/item_supplier.txt
index 02e0bd7..e56f29e 100644
--- a/erpnext/stock/doctype/item_supplier/item_supplier.txt
+++ b/erpnext/stock/doctype/item_supplier/item_supplier.txt
@@ -1,43 +1,31 @@
-[
- {
- "creation": "2013-02-22 01:28:01",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:16",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Item Supplier",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Item Supplier"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier",
- "fieldtype": "Link",
- "label": "Supplier",
- "options": "Supplier"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_part_no",
- "fieldtype": "Data",
- "label": "Supplier Part Number",
- "print_width": "200px",
- "width": "200px"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:28:01.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Supplier",
+ "options": "Supplier",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "supplier_part_no",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Supplier Part Number",
+ "permlevel": 0,
+ "print_width": "200px",
+ "width": "200px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:16.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item Supplier",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_tax/item_tax.py b/erpnext/stock/doctype/item_tax/item_tax.py
index 26c87f1..96363e8 100644
--- a/erpnext/stock/doctype/item_tax/item_tax.py
+++ b/erpnext/stock/doctype/item_tax/item_tax.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ItemTax(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_tax/item_tax.txt b/erpnext/stock/doctype/item_tax/item_tax.txt
index 243ee1f..b2b9256 100644
--- a/erpnext/stock/doctype/item_tax/item_tax.txt
+++ b/erpnext/stock/doctype/item_tax/item_tax.txt
@@ -1,47 +1,35 @@
-[
- {
- "creation": "2013-02-22 01:28:01",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:16",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Item Tax",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Item Tax"
- },
- {
- "doctype": "DocField",
- "fieldname": "tax_type",
- "fieldtype": "Link",
- "label": "Tax",
- "oldfieldname": "tax_type",
- "oldfieldtype": "Link",
- "options": "Account",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "tax_rate",
- "fieldtype": "Float",
- "label": "Tax Rate",
- "oldfieldname": "tax_rate",
- "oldfieldtype": "Currency",
- "reqd": 0
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:28:01.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "tax_type",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Tax",
+ "oldfieldname": "tax_type",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "tax_rate",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Tax Rate",
+ "oldfieldname": "tax_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "reqd": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:16.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item Tax",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_website_specification/item_website_specification.py b/erpnext/stock/doctype/item_website_specification/item_website_specification.py
index 968a25b..ceb0727 100644
--- a/erpnext/stock/doctype/item_website_specification/item_website_specification.py
+++ b/erpnext/stock/doctype/item_website_specification/item_website_specification.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class ItemWebsiteSpecification(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/item_website_specification/item_website_specification.txt b/erpnext/stock/doctype/item_website_specification/item_website_specification.txt
index 164da81..1cf2189 100644
--- a/erpnext/stock/doctype/item_website_specification/item_website_specification.txt
+++ b/erpnext/stock/doctype/item_website_specification/item_website_specification.txt
@@ -1,45 +1,33 @@
-[
- {
- "creation": "2013-02-22 01:28:01",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:16",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "description": "Table for Item that will be shown in Web Site",
- "doctype": "DocType",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Item Website Specification",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Item Website Specification"
- },
- {
- "doctype": "DocField",
- "fieldname": "label",
- "fieldtype": "Data",
- "label": "Label",
- "print_width": "150px",
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "label": "Description",
- "print_width": "300px",
- "width": "300px"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:28:01.000000",
+ "description": "Table for Item that will be shown in Web Site",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "label",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Label",
+ "permlevel": 0,
+ "print_width": "150px",
+ "width": "150px"
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "permlevel": 0,
+ "print_width": "300px",
+ "width": "300px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:16.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item Website Specification",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py
index 26c87f1..4681361 100644
--- a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py
+++ b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class LandedCostItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt
index bf8af3a..f761eba 100644
--- a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt
+++ b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt
@@ -1,67 +1,57 @@
-[
- {
- "creation": "2013-02-22 01:28:02",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:18",
- "modified_by": "Administrator",
- "owner": "wasim@webnotestech.com"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Landed Cost Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "reqd": 1
- },
- {
- "doctype": "DocType",
- "name": "Landed Cost Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "account_head",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Account Head",
- "oldfieldname": "account_head",
- "oldfieldtype": "Link",
- "options": "Account",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "label": "Cost Center",
- "options": "Cost Center"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Data",
- "print_width": "300px",
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "currency"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:28:02.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "account_head",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Account Head",
+ "oldfieldname": "account_head",
+ "oldfieldtype": "Link",
+ "options": "Account",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "label": "Cost Center",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_width": "300px",
+ "reqd": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:18.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Landed Cost Item",
+ "owner": "wasim@webnotestech.com"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py
index 26c87f1..090f833 100644
--- a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py
+++ b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class LandedCostPurchaseReceipt(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt
index 8d02e3a..b50c148 100644
--- a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt
+++ b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt
@@ -1,39 +1,26 @@
-[
- {
- "creation": "2013-02-22 01:28:02",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:18",
- "modified_by": "Administrator",
- "owner": "wasim@webnotestech.com"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_receipt",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Purchase Receipt",
- "name": "__common__",
- "oldfieldname": "purchase_receipt_no",
- "oldfieldtype": "Link",
- "options": "Purchase Receipt",
- "parent": "Landed Cost Purchase Receipt",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "print_width": "220px",
- "width": "220px"
- },
- {
- "doctype": "DocType",
- "name": "Landed Cost Purchase Receipt"
- },
- {
- "doctype": "DocField"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:28:02.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "purchase_receipt",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Purchase Receipt",
+ "oldfieldname": "purchase_receipt_no",
+ "oldfieldtype": "Link",
+ "options": "Purchase Receipt",
+ "permlevel": 0,
+ "print_width": "220px",
+ "width": "220px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:18.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Landed Cost Purchase Receipt",
+ "owner": "wasim@webnotestech.com"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py
index c52c820..34cbe3e 100644
--- a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py
+++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py
@@ -4,13 +4,11 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import flt
-from frappe.model.doc import addchild
from frappe import msgprint, _
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class LandedCostWizard(Document):
def update_landed_cost(self):
"""
@@ -18,7 +16,7 @@
Recalculate valuation rate in all sle after pr posting date
"""
purchase_receipts = [row.purchase_receipt for row in
- self.doclist.get({"parentfield": "lc_pr_details"})]
+ self.get("lc_pr_details")]
self.validate_purchase_receipts(purchase_receipts)
self.cancel_pr(purchase_receipts)
@@ -37,10 +35,9 @@
for pr in purchase_receipts:
pr_bean = frappe.bean('Purchase Receipt', pr)
- pr_items = pr_bean.doclist.get({"parentfield": "purchase_tax_details"})
- idx = max([d.idx for d in pr_items]) if pr_items else 0
+ pr_items = pr_bean.get("purchase_tax_details")
- for lc in self.doclist.get({"parentfield": "landed_cost_details"}):
+ for lc in self.get("landed_cost_details"):
amt = flt(lc.amount) * flt(pr_bean.doc.net_total)/ flt(total_amt)
matched_row = pr_bean.doclist.get({
@@ -52,7 +49,7 @@
})
if not matched_row: # add if not exists
- ch = addchild(pr_bean.doc, 'other_charges', 'Purchase Taxes and Charges')
+ ch = pr_bean.append("other_charges")
ch.category = 'Valuation'
ch.add_deduct_tax = 'Add'
ch.charge_type = 'Actual'
@@ -62,9 +59,7 @@
ch.rate = amt
ch.tax_amount = amt
ch.docstatus = 1
- ch.idx = idx + 1
ch.save(1)
- idx += 1
else: # overwrite if exists
matched_row[0].rate = amt
matched_row[0].tax_amount = amt
diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt
index 587d0e3..59c9478 100644
--- a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt
+++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt
@@ -1,95 +1,83 @@
-[
- {
- "creation": "2013-01-22 16:50:39",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:18",
- "modified_by": "Administrator",
- "owner": "wasim@webnotestech.com"
- },
- {
- "doctype": "DocType",
- "icon": "icon-magic",
- "issingle": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Landed Cost Wizard",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Landed Cost Wizard",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 0,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Landed Cost Wizard"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "options": "Company",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "label": "Select Purchase Receipts",
- "options": "Simple"
- },
- {
- "doctype": "DocField",
- "fieldname": "lc_pr_details",
- "fieldtype": "Table",
- "label": "Landed Cost Purchase Receipts",
- "options": "Landed Cost Purchase Receipt"
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break1",
- "fieldtype": "Section Break",
- "label": "Add Taxes and Charges"
- },
- {
- "doctype": "DocField",
- "fieldname": "landed_cost_details",
- "fieldtype": "Table",
- "label": "Landed Cost Items",
- "options": "Landed Cost Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "update_landed_cost",
- "fieldtype": "Button",
- "label": "Update Landed Cost",
- "options": "update_landed_cost"
- },
- {
- "amend": 0,
- "cancel": 0,
- "doctype": "DocPerm",
- "role": "Purchase Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Purchase User"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-22 16:50:39.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "label": "Select Purchase Receipts",
+ "options": "Simple",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "lc_pr_details",
+ "fieldtype": "Table",
+ "label": "Landed Cost Purchase Receipts",
+ "options": "Landed Cost Purchase Receipt",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "section_break1",
+ "fieldtype": "Section Break",
+ "label": "Add Taxes and Charges",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "landed_cost_details",
+ "fieldtype": "Table",
+ "label": "Landed Cost Items",
+ "options": "Landed Cost Item",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "update_landed_cost",
+ "fieldtype": "Button",
+ "label": "Update Landed Cost",
+ "options": "update_landed_cost",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-magic",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2013-12-20 19:23:18.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Landed Cost Wizard",
+ "owner": "wasim@webnotestech.com",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Purchase Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Purchase User",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js
index c830775..081469b 100644
--- a/erpnext/stock/doctype/material_request/material_request.js
+++ b/erpnext/stock/doctype/material_request/material_request.js
@@ -80,7 +80,7 @@
schedule_date: function(doc, cdt, cdn) {
var val = locals[cdt][cdn].schedule_date;
if(val) {
- $.each(frappe.model.get("Material Request Item", { parent: cur_frm.doc.name }), function(i, d) {
+ $.each((doc.indent_details || []), function(i, d) {
if(!d.schedule_date) {
d.schedule_date = val;
}
@@ -172,7 +172,7 @@
var check = confirm(frappe._("Do you really want to STOP this Material Request?"));
if (check) {
- return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': frappe.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
+ return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': doc}, function(r,rt) {
cur_frm.refresh();
});
}
@@ -183,7 +183,7 @@
var check = confirm(frappe._("Do you really want to UNSTOP this Material Request?"));
if (check) {
- return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted','docs': frappe.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) {
+ return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted','docs': doc}, function(r,rt) {
cur_frm.refresh();
});
}
diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py
index 2fca85b..fda6849 100644
--- a/erpnext/stock/doctype/material_request/material_request.py
+++ b/erpnext/stock/doctype/material_request/material_request.py
@@ -13,19 +13,16 @@
from frappe import msgprint, _
from erpnext.controllers.buying_controller import BuyingController
-class DocType(BuyingController):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class MaterialRequest(BuyingController):
self.tname = 'Material Request Item'
self.fname = 'indent_details'
def check_if_already_pulled(self):
- pass#if self.[d.sales_order_no for d in getlist(self.doclist, 'indent_details')]
+ pass#if self.[d.sales_order_no for d in self.get('indent_details')]
def validate_qty_against_so(self):
so_items = {} # Format --> {'SO/00001': {'Item/001': 120, 'Item/002': 24}}
- for d in getlist(self.doclist, 'indent_details'):
+ for d in self.get('indent_details'):
if d.sales_order_no:
if not so_items.has_key(d.sales_order_no):
so_items[d.sales_order_no] = {d.item_code: flt(d.qty)}
@@ -53,7 +50,7 @@
% (actual_so_qty - already_indented, item, so_no))
def validate_schedule_date(self):
- for d in getlist(self.doclist, 'indent_details'):
+ for d in self.get('indent_details'):
if d.schedule_date < self.doc.transaction_date:
frappe.throw(_("Expected Date cannot be before Material Request Date"))
@@ -84,7 +81,7 @@
""" Update Quantity Requested for Purchase in Bin for Material Request of type 'Purchase'"""
from erpnext.stock.utils import update_bin
- for d in getlist(self.doclist, 'indent_details'):
+ for d in self.get('indent_details'):
if frappe.db.get_value("Item", d.item_code, "is_stock_item") == "Yes":
if not d.warehouse:
frappe.throw("Please Enter Warehouse for Item %s as it is stock item"
@@ -146,7 +143,7 @@
if self.doc.material_request_type != "Transfer":
return
- item_doclist = self.doclist.get({"parentfield": "indent_details"})
+ item_doclist = self.get("indent_details")
if not mr_items:
mr_items = [d.name for d in item_doclist]
@@ -174,13 +171,13 @@
if bean.doc.doctype == "Stock Entry":
material_request_map = {}
- for d in bean.doclist.get({"parentfield": "mtn_details"}):
+ for d in bean.get("mtn_details"):
if d.material_request:
material_request_map.setdefault(d.material_request, []).append(d.material_request_item)
for mr_name, mr_items in material_request_map.items():
mr_obj = frappe.get_obj("Material Request", mr_name, with_children=1)
- mr_doctype = frappe.get_doctype("Material Request")
+ mr_doctype = frappe.get_meta("Material Request")
if mr_obj.doc.status in ["Stopped", "Cancelled"]:
frappe.throw(_("Material Request") + ": %s, " % mr_obj.doc.name
diff --git a/erpnext/stock/doctype/material_request/material_request.txt b/erpnext/stock/doctype/material_request/material_request.txt
index cb02791..7db60dd 100644
--- a/erpnext/stock/doctype/material_request/material_request.txt
+++ b/erpnext/stock/doctype/material_request/material_request.txt
@@ -1,286 +1,297 @@
-[
- {
- "creation": "2013-03-07 14:48:38",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:57",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "icon": "icon-ticket",
- "is_submittable": 1,
- "module": "Stock",
- "name": "__common__",
- "read_only_onload": 1,
- "search_fields": "status,transaction_date"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Material Request",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Material Request",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Material Request"
- },
- {
- "doctype": "DocField",
- "fieldname": "type_section",
- "fieldtype": "Section Break",
- "label": "Basic Info",
- "options": "icon-pushpin"
- },
- {
- "doctype": "DocField",
- "fieldname": "material_request_type",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Type",
- "options": "Purchase\nTransfer",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "MREQ-\nIDT",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "description": "Select the relevant company name if you have multiple companies",
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "print_hide": 1,
- "print_width": "150px",
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "items",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart"
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "indent_details",
- "fieldtype": "Table",
- "label": "Material Request Items",
- "no_copy": 0,
- "oldfieldname": "indent_details",
- "oldfieldtype": "Table",
- "options": "Material Request Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "requested_by",
- "fieldtype": "Data",
- "label": "Requested For"
- },
- {
- "doctype": "DocField",
- "fieldname": "transaction_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Transaction Date",
- "no_copy": 1,
- "oldfieldname": "transaction_date",
- "oldfieldtype": "Date",
- "print_width": "100px",
- "reqd": 1,
- "search_index": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "print_width": "150px",
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nDraft\nSubmitted\nStopped\nCancelled",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "search_index": 1,
- "width": "100px"
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "letter_head",
- "fieldtype": "Select",
- "label": "Letter Head",
- "oldfieldname": "letter_head",
- "oldfieldtype": "Select",
- "options": "link:Letter Head",
- "print_hide": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "label": "Print Heading",
- "options": "Print Heading",
- "print_hide": 1
- },
- {
- "description": "% of materials ordered against this Material Request",
- "doctype": "DocField",
- "fieldname": "per_ordered",
- "fieldtype": "Percent",
- "in_list_view": 1,
- "label": "% Completed",
- "no_copy": 1,
- "oldfieldname": "per_ordered",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "icon-legal"
- },
- {
- "doctype": "DocField",
- "fieldname": "tc_name",
- "fieldtype": "Link",
- "label": "Terms",
- "oldfieldname": "tc_name",
- "oldfieldtype": "Link",
- "options": "Terms and Conditions",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "terms",
- "fieldtype": "Text Editor",
- "label": "Terms and Conditions Content",
- "oldfieldname": "terms",
- "oldfieldtype": "Text Editor"
- },
- {
- "doctype": "DocPerm",
- "role": "Purchase Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Material Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Material User"
- },
- {
- "doctype": "DocPerm",
- "role": "Purchase User"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-03-07 14:48:38.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "type_section",
+ "fieldtype": "Section Break",
+ "label": "Basic Info",
+ "options": "icon-pushpin",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "material_request_type",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Type",
+ "options": "Purchase\nTransfer",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break_2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "MREQ-\nIDT",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "description": "Select the relevant company name if you have multiple companies",
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "items",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "indent_details",
+ "fieldtype": "Table",
+ "label": "Material Request Items",
+ "no_copy": 0,
+ "oldfieldname": "indent_details",
+ "oldfieldtype": "Table",
+ "options": "Material Request Item",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "requested_by",
+ "fieldtype": "Data",
+ "label": "Requested For",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Transaction Date",
+ "no_copy": 1,
+ "oldfieldname": "transaction_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_width": "100px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nDraft\nSubmitted\nStopped\nCancelled",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "letter_head",
+ "fieldtype": "Select",
+ "label": "Letter Head",
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "link:Letter Head",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "label": "Print Heading",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "description": "% of materials ordered against this Material Request",
+ "fieldname": "per_ordered",
+ "fieldtype": "Percent",
+ "in_list_view": 1,
+ "label": "% Completed",
+ "no_copy": 1,
+ "oldfieldname": "per_ordered",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "label": "Terms and Conditions",
+ "oldfieldtype": "Section Break",
+ "options": "icon-legal",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "label": "Terms",
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "label": "Terms and Conditions Content",
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-ticket",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-20 17:48:57.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Material Request",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "read_only_onload": 1,
+ "search_fields": "status,transaction_date"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.py b/erpnext/stock/doctype/material_request_item/material_request_item.py
index 968a25b..30101f3 100644
--- a/erpnext/stock/doctype/material_request_item/material_request_item.py
+++ b/erpnext/stock/doctype/material_request_item/material_request_item.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class MaterialRequestItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.txt b/erpnext/stock/doctype/material_request_item/material_request_item.txt
index 56a4976..bff669f 100644
--- a/erpnext/stock/doctype/material_request_item/material_request_item.txt
+++ b/erpnext/stock/doctype/material_request_item/material_request_item.txt
@@ -1,253 +1,240 @@
-[
- {
- "creation": "2013-02-22 01:28:02",
- "docstatus": 0,
- "modified": "2014-02-03 11:35:26",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "MREQD-.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Material Request Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Material Request Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "print_width": "100px",
- "reqd": 1,
- "search_index": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "print_width": "100px",
- "reqd": 0,
- "search_index": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "print_width": "250px",
- "reqd": 1,
- "width": "250px"
- },
- {
- "doctype": "DocField",
- "fieldname": "quantity_and_warehouse",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Quantity and Warehouse"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Quantity",
- "no_copy": 0,
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "print_width": "80px",
- "reqd": 1,
- "width": "80px"
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "For Warehouse",
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_hide": 0,
- "print_width": "100px",
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "uom",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Stock UOM",
- "no_copy": 0,
- "oldfieldname": "uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "print_width": "70px",
- "read_only": 1,
- "reqd": 1,
- "width": "70px"
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "schedule_date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "label": "Required Date",
- "no_copy": 0,
- "oldfieldname": "schedule_date",
- "oldfieldtype": "Date",
- "print_hide": 0,
- "print_width": "100px",
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info"
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Item Group",
- "no_copy": 0,
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Link",
- "label": "Brand",
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "lead_time_date",
- "fieldtype": "Date",
- "in_list_view": 0,
- "label": "Lead Time Date",
- "no_copy": 1,
- "oldfieldname": "lead_time_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_order_no",
- "fieldtype": "Link",
- "label": "Sales Order No",
- "no_copy": 0,
- "options": "Sales Order",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "min_order_qty",
- "fieldtype": "Float",
- "label": "Min Order Qty",
- "no_copy": 1,
- "oldfieldname": "min_order_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "70px",
- "read_only": 1,
- "reqd": 0,
- "width": "70px"
- },
- {
- "doctype": "DocField",
- "fieldname": "projected_qty",
- "fieldtype": "Float",
- "label": "Projected Qty",
- "no_copy": 1,
- "oldfieldname": "projected_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "70px",
- "read_only": 1,
- "width": "70px"
- },
- {
- "doctype": "DocField",
- "fieldname": "ordered_qty",
- "fieldtype": "Float",
- "label": "Completed Qty",
- "no_copy": 1,
- "oldfieldname": "ordered_qty",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "page_break",
- "fieldtype": "Check",
- "label": "Page Break",
- "no_copy": 1,
- "oldfieldname": "page_break",
- "oldfieldtype": "Check",
- "print_hide": 1
- }
-]
\ No newline at end of file
+{
+ "autoname": "MREQD-.#####",
+ "creation": "2013-02-22 01:28:02.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "print_width": "100px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_width": "100px",
+ "reqd": 0,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_width": "250px",
+ "reqd": 1,
+ "width": "250px"
+ },
+ {
+ "fieldname": "quantity_and_warehouse",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Quantity and Warehouse",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Quantity",
+ "no_copy": 0,
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "80px",
+ "reqd": 1,
+ "width": "80px"
+ },
+ {
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "For Warehouse",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Stock UOM",
+ "no_copy": 0,
+ "oldfieldname": "uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_width": "70px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "70px"
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "schedule_date",
+ "fieldtype": "Date",
+ "in_list_view": 1,
+ "label": "Required Date",
+ "no_copy": 0,
+ "oldfieldname": "schedule_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "permlevel": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Item Group",
+ "no_copy": 0,
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "label": "Brand",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "lead_time_date",
+ "fieldtype": "Date",
+ "in_list_view": 0,
+ "label": "Lead Time Date",
+ "no_copy": 1,
+ "oldfieldname": "lead_time_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "sales_order_no",
+ "fieldtype": "Link",
+ "label": "Sales Order No",
+ "no_copy": 0,
+ "options": "Sales Order",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "min_order_qty",
+ "fieldtype": "Float",
+ "label": "Min Order Qty",
+ "no_copy": 1,
+ "oldfieldname": "min_order_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "70px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "70px"
+ },
+ {
+ "fieldname": "projected_qty",
+ "fieldtype": "Float",
+ "label": "Projected Qty",
+ "no_copy": 1,
+ "oldfieldname": "projected_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "70px",
+ "read_only": 1,
+ "width": "70px"
+ },
+ {
+ "fieldname": "ordered_qty",
+ "fieldtype": "Float",
+ "label": "Completed Qty",
+ "no_copy": 1,
+ "oldfieldname": "ordered_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "label": "Page Break",
+ "no_copy": 1,
+ "oldfieldname": "page_break",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-03 11:35:26.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Material Request Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py
index b01307d..b7a15b7 100644
--- a/erpnext/stock/doctype/packed_item/packed_item.py
+++ b/erpnext/stock/doctype/packed_item/packed_item.py
@@ -6,12 +6,11 @@
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr, flt
-from frappe.model.doc import addchild
from frappe.model.bean import getlist
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class PackedItem(Document):
def get_sales_bom_items(item_code):
return frappe.db.sql("""select t1.item_code, t1.qty, t1.uom
@@ -39,7 +38,7 @@
break
if not exists:
- pi = addchild(obj.doc, 'packing_details', 'Packed Item', obj.doclist)
+ pi = obj.doc.append('packing_details', {})
pi.parent_item = line.item_code
pi.item_code = packing_item_code
@@ -81,7 +80,7 @@
def cleanup_packing_list(obj, parent_items):
"""Remove all those child items which are no longer present in main item table"""
delete_list = []
- for d in obj.doclist.get({"parentfield": "packing_details"}):
+ for d in obj.get("packing_details"):
if [d.parent_item, d.parent_detail_docname] not in parent_items:
# mark for deletion from doclist
delete_list.append([d.parent_item, d.parent_detail_docname])
diff --git a/erpnext/stock/doctype/packed_item/packed_item.txt b/erpnext/stock/doctype/packed_item/packed_item.txt
index 45a1d4d..6558efb 100644
--- a/erpnext/stock/doctype/packed_item/packed_item.txt
+++ b/erpnext/stock/doctype/packed_item/packed_item.txt
@@ -1,170 +1,157 @@
-[
- {
- "creation": "2013-02-22 01:28:00",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:23",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Packed Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Packed Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "parent_item",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Parent Item",
- "oldfieldname": "parent_item",
- "oldfieldtype": "Link",
- "options": "Item",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "parent_detail_docname",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Parent Detail docname",
- "no_copy": 1,
- "oldfieldname": "parent_detail_docname",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "print_width": "300px",
- "read_only": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Warehouse",
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Qty",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no",
- "fieldtype": "Text",
- "label": "Serial No"
- },
- {
- "doctype": "DocField",
- "fieldname": "batch_no",
- "fieldtype": "Data",
- "label": "Batch No"
- },
- {
- "doctype": "DocField",
- "fieldname": "actual_qty",
- "fieldtype": "Float",
- "label": "Actual Qty",
- "no_copy": 1,
- "oldfieldname": "actual_qty",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "projected_qty",
- "fieldtype": "Float",
- "label": "Projected Qty",
- "no_copy": 1,
- "oldfieldname": "projected_qty",
- "oldfieldtype": "Currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "uom",
- "fieldtype": "Link",
- "label": "UOM",
- "oldfieldname": "uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "read_only": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_doctype",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Prevdoc DocType",
- "oldfieldname": "prevdoc_doctype",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "page_break",
- "fieldtype": "Check",
- "label": "Page Break",
- "oldfieldname": "page_break",
- "oldfieldtype": "Check",
- "read_only": 1
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:28:00.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "parent_item",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Parent Item",
+ "oldfieldname": "parent_item",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "parent_detail_docname",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Parent Detail docname",
+ "no_copy": 1,
+ "oldfieldname": "parent_detail_docname",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "read_only": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Warehouse",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Qty",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "serial_no",
+ "fieldtype": "Text",
+ "label": "Serial No",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "batch_no",
+ "fieldtype": "Data",
+ "label": "Batch No",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "actual_qty",
+ "fieldtype": "Float",
+ "label": "Actual Qty",
+ "no_copy": 1,
+ "oldfieldname": "actual_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "projected_qty",
+ "fieldtype": "Float",
+ "label": "Projected Qty",
+ "no_copy": 1,
+ "oldfieldname": "projected_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "label": "UOM",
+ "oldfieldname": "uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "prevdoc_doctype",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Prevdoc DocType",
+ "oldfieldname": "prevdoc_doctype",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "label": "Page Break",
+ "oldfieldname": "page_break",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:23.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Packed Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.js b/erpnext/stock/doctype/packing_slip/packing_slip.js
index f00fa77..ff1e1f0 100644
--- a/erpnext/stock/doctype/packing_slip/packing_slip.js
+++ b/erpnext/stock/doctype/packing_slip/packing_slip.js
@@ -59,7 +59,7 @@
cur_frm.cscript.validate_calculate_item_details = function(doc) {
doc = locals[doc.doctype][doc.name];
- var ps_detail = getchildren('Packing Slip Item', doc.name, 'item_details');
+ var ps_detail = doc.item_details || [];
cur_frm.cscript.validate_duplicate_items(doc, ps_detail);
cur_frm.cscript.calc_net_total_pkg(doc, ps_detail);
diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.py b/erpnext/stock/doctype/packing_slip/packing_slip.py
index b7b6473..99a6ee3 100644
--- a/erpnext/stock/doctype/packing_slip/packing_slip.py
+++ b/erpnext/stock/doctype/packing_slip/packing_slip.py
@@ -5,11 +5,10 @@
import frappe
from frappe.utils import flt, cint
from frappe import msgprint, _
-from frappe.model.doc import addchild
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class PackingSlip(Document):
def validate(self):
"""
@@ -36,7 +35,7 @@
msgprint(_("""Invalid Delivery Note. Delivery Note should exist and should be in draft state. Please rectify and try again."""), raise_exception=1)
def validate_items_mandatory(self):
- rows = [d.item_code for d in self.doclist.get({"parentfield": "item_details"})]
+ rows = [d.item_code for d in self.get("item_details")]
if not rows:
frappe.msgprint(_("No Items to Pack"), raise_exception=1)
@@ -87,7 +86,7 @@
* No. of Cases of this packing slip
"""
- rows = [d.item_code for d in self.doclist.get({"parentfield": "item_details"})]
+ rows = [d.item_code for d in self.get("item_details")]
condition = ""
if rows:
@@ -132,7 +131,7 @@
if not self.doc.from_case_no:
self.doc.from_case_no = self.get_recommended_case_no()
- for d in self.doclist.get({"parentfield": "item_details"}):
+ for d in self.get("item_details"):
res = frappe.db.get_value("Item", d.item_code,
["net_weight", "weight_uom"], as_dict=True)
@@ -151,12 +150,12 @@
return cint(recommended_case_no[0][0]) + 1
def get_items(self):
- self.doclist = self.doc.clear_table(self.doclist, "item_details", 1)
+ self.set("item_details", [])
dn_details = self.get_details_for_packing()[0]
for item in dn_details:
if flt(item.qty) > flt(item.packed_qty):
- ch = addchild(self.doc, 'item_details', 'Packing Slip Item', self.doclist)
+ ch = self.doc.append('item_details', {})
ch.item_code = item.item_code
ch.item_name = item.item_name
ch.stock_uom = item.stock_uom
diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.txt b/erpnext/stock/doctype/packing_slip/packing_slip.txt
index 2f8ccc3..634f11f 100644
--- a/erpnext/stock/doctype/packing_slip/packing_slip.txt
+++ b/erpnext/stock/doctype/packing_slip/packing_slip.txt
@@ -1,238 +1,259 @@
-[
- {
- "creation": "2013-04-11 15:32:24",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:59",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "PS.#######",
- "description": "Generate packing slips for packages to be delivered. Used to notify package number, package contents and its weight.",
- "doctype": "DocType",
- "document_type": "Transaction",
- "icon": "icon-suitcase",
- "is_submittable": 1,
- "module": "Stock",
- "name": "__common__",
- "read_only_onload": 1,
- "search_fields": "delivery_note"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Packing Slip",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Packing Slip",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Packing Slip"
- },
- {
- "doctype": "DocField",
- "fieldname": "packing_slip_details",
- "fieldtype": "Section Break",
- "label": "Packing Slip Items",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "description": "Indicates that the package is a part of this delivery",
- "doctype": "DocField",
- "fieldname": "delivery_note",
- "fieldtype": "Link",
- "label": "Delivery Note",
- "options": "Delivery Note",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 0,
- "options": "PS",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "description": "Identification of the package for the delivery (for print)",
- "doctype": "DocField",
- "fieldname": "from_case_no",
- "fieldtype": "Data",
- "label": "From Package No.",
- "no_copy": 1,
- "read_only": 0,
- "reqd": 1,
- "width": "50px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "description": "If more than one package of the same type (for print)",
- "doctype": "DocField",
- "fieldname": "to_case_no",
- "fieldtype": "Data",
- "label": "To Package No.",
- "no_copy": 1,
- "read_only": 0,
- "width": "50px"
- },
- {
- "doctype": "DocField",
- "fieldname": "package_item_details",
- "fieldtype": "Section Break",
- "label": "Package Item Details",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "get_items",
- "fieldtype": "Button",
- "label": "Get Items"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_details",
- "fieldtype": "Table",
- "label": "Items",
- "options": "Packing Slip Item",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "package_weight_details",
- "fieldtype": "Section Break",
- "label": "Package Weight Details",
- "read_only": 0
- },
- {
- "description": "The net weight of this package. (calculated automatically as sum of net weight of items)",
- "doctype": "DocField",
- "fieldname": "net_weight_pkg",
- "fieldtype": "Float",
- "label": "Net Weight",
- "no_copy": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "net_weight_uom",
- "fieldtype": "Link",
- "label": "Net Weight UOM",
- "no_copy": 1,
- "options": "UOM",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break4",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "description": "The gross weight of the package. Usually net weight + packaging material weight. (for print)",
- "doctype": "DocField",
- "fieldname": "gross_weight_pkg",
- "fieldtype": "Float",
- "label": "Gross Weight",
- "no_copy": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "gross_weight_uom",
- "fieldtype": "Link",
- "label": "Gross Weight UOM",
- "no_copy": 1,
- "options": "UOM",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "misc_details",
- "fieldtype": "Section Break",
- "label": "Misc Details",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "options": "Packing Slip",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocPerm",
- "role": "Material User"
- },
- {
- "doctype": "DocPerm",
- "role": "Sales User"
- },
- {
- "doctype": "DocPerm",
- "role": "Material Master Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Material Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Sales Manager"
- }
-]
\ No newline at end of file
+{
+ "autoname": "PS.#######",
+ "creation": "2013-04-11 15:32:24.000000",
+ "description": "Generate packing slips for packages to be delivered. Used to notify package number, package contents and its weight.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "fieldname": "packing_slip_details",
+ "fieldtype": "Section Break",
+ "label": "Packing Slip Items",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "Indicates that the package is a part of this delivery",
+ "fieldname": "delivery_note",
+ "fieldtype": "Link",
+ "label": "Delivery Note",
+ "options": "Delivery Note",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 0,
+ "options": "PS",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "Identification of the package for the delivery (for print)",
+ "fieldname": "from_case_no",
+ "fieldtype": "Data",
+ "label": "From Package No.",
+ "no_copy": 1,
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "width": "50px"
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "If more than one package of the same type (for print)",
+ "fieldname": "to_case_no",
+ "fieldtype": "Data",
+ "label": "To Package No.",
+ "no_copy": 1,
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50px"
+ },
+ {
+ "fieldname": "package_item_details",
+ "fieldtype": "Section Break",
+ "label": "Package Item Details",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "get_items",
+ "fieldtype": "Button",
+ "label": "Get Items",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "item_details",
+ "fieldtype": "Table",
+ "label": "Items",
+ "options": "Packing Slip Item",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "package_weight_details",
+ "fieldtype": "Section Break",
+ "label": "Package Weight Details",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "The net weight of this package. (calculated automatically as sum of net weight of items)",
+ "fieldname": "net_weight_pkg",
+ "fieldtype": "Float",
+ "label": "Net Weight",
+ "no_copy": 1,
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "net_weight_uom",
+ "fieldtype": "Link",
+ "label": "Net Weight UOM",
+ "no_copy": 1,
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "description": "The gross weight of the package. Usually net weight + packaging material weight. (for print)",
+ "fieldname": "gross_weight_pkg",
+ "fieldtype": "Float",
+ "label": "Gross Weight",
+ "no_copy": 1,
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "gross_weight_uom",
+ "fieldtype": "Link",
+ "label": "Gross Weight UOM",
+ "no_copy": 1,
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "misc_details",
+ "fieldtype": "Section Break",
+ "label": "Misc Details",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "options": "Packing Slip",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-suitcase",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-20 17:48:59.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Packing Slip",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Master Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "read_only_onload": 1,
+ "search_fields": "delivery_note"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py
index 968a25b..033e44b 100644
--- a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py
+++ b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class PackingSlipItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt
index 54e6991..9d5c1bb 100644
--- a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt
+++ b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt
@@ -1,110 +1,97 @@
-[
- {
- "creation": "2013-04-08 13:10:16",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:23",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "PSD/.#######",
- "doctype": "DocType",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Packing Slip Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Packing Slip Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Item Code",
- "options": "Item",
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Item Name",
- "print_width": "200px",
- "read_only": 1,
- "width": "200px"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Quantity",
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "UOM",
- "options": "UOM",
- "print_width": "100px",
- "read_only": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_weight",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Net Weight",
- "print_width": "100px",
- "read_only": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "weight_uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Weight UOM",
- "options": "UOM",
- "print_width": "100px",
- "read_only": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "page_break",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Page Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "dn_detail",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 1,
- "label": "DN Detail",
- "read_only": 0
- }
-]
\ No newline at end of file
+{
+ "autoname": "PSD/.#######",
+ "creation": "2013-04-08 13:10:16.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Item Code",
+ "options": "Item",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Item Name",
+ "permlevel": 0,
+ "print_width": "200px",
+ "read_only": 1,
+ "width": "200px"
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Quantity",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "net_weight",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Net Weight",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "weight_uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Weight UOM",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Page Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "dn_detail",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 1,
+ "label": "DN Detail",
+ "permlevel": 0,
+ "read_only": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:23.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Packing Slip Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/price_list/price_list.py b/erpnext/stock/doctype/price_list/price_list.py
index 37b9567..bf49a51 100644
--- a/erpnext/stock/doctype/price_list/price_list.py
+++ b/erpnext/stock/doctype/price_list/price_list.py
@@ -8,17 +8,16 @@
from frappe.model.controller import DocListController
import frappe.defaults
-class DocType(DocListController):
+class PriceList(DocListController):
def validate(self):
if not cint(self.doc.buying) and not cint(self.doc.selling):
throw(_("Price List must be applicable for Buying or Selling"))
- if not self.doclist.get({"parentfield": "valid_for_territories"}):
+ if not self.get("valid_for_territories"):
# if no territory, set default territory
if frappe.defaults.get_user_default("territory"):
- self.doclist.append({
+ self.append("valid_for_territories", {
"doctype": "Applicable Territory",
- "parentfield": "valid_for_territories",
"territory": frappe.defaults.get_user_default("territory")
})
else:
diff --git a/erpnext/stock/doctype/price_list/price_list.txt b/erpnext/stock/doctype/price_list/price_list.txt
index 253dce7..da69ff6 100644
--- a/erpnext/stock/doctype/price_list/price_list.txt
+++ b/erpnext/stock/doctype/price_list/price_list.txt
@@ -1,139 +1,126 @@
-[
- {
- "creation": "2013-01-25 11:35:09",
- "docstatus": 0,
- "modified": "2014-01-27 11:11:08",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 0,
- "allow_copy": 0,
- "allow_import": 1,
- "allow_email": 1,
- "allow_print": 1,
- "allow_rename": 1,
- "autoname": "field:price_list_name",
- "description": "Price List Master",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-tags",
- "max_attachments": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Price List",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Price List",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Price List"
- },
- {
- "default": "1",
- "doctype": "DocField",
- "fieldname": "enabled",
- "fieldtype": "Check",
- "label": "Enabled"
- },
- {
- "doctype": "DocField",
- "fieldname": "sb_1",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_name",
- "fieldtype": "Data",
- "label": "Price List Name",
- "oldfieldname": "price_list_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "currency",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Currency",
- "options": "Currency",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "buying",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Buying"
- },
- {
- "doctype": "DocField",
- "fieldname": "selling",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Selling",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_3",
- "fieldtype": "Column Break"
- },
- {
- "description": "Specify a list of Territories, for which, this Price List is valid",
- "doctype": "DocField",
- "fieldname": "valid_for_territories",
- "fieldtype": "Table",
- "label": "Valid for Territories",
- "options": "Applicable Territory",
- "reqd": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales User",
- "submit": 0,
- "write": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales Master Manager",
- "submit": 0,
- "write": 1
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Purchase User"
- },
- {
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Purchase Master Manager",
- "write": 1
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 0,
+ "allow_copy": 0,
+ "allow_email": 1,
+ "allow_import": 1,
+ "allow_print": 1,
+ "allow_rename": 1,
+ "autoname": "field:price_list_name",
+ "creation": "2013-01-25 11:35:09.000000",
+ "description": "Price List Master",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "default": "1",
+ "fieldname": "enabled",
+ "fieldtype": "Check",
+ "label": "Enabled",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sb_1",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "price_list_name",
+ "fieldtype": "Data",
+ "label": "Price List Name",
+ "oldfieldname": "price_list_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "buying",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Buying",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "selling",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Selling",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "Specify a list of Territories, for which, this Price List is valid",
+ "fieldname": "valid_for_territories",
+ "fieldtype": "Table",
+ "label": "Valid for Territories",
+ "options": "Applicable Territory",
+ "permlevel": 0,
+ "reqd": 1
+ }
+ ],
+ "icon": "icon-tags",
+ "idx": 1,
+ "max_attachments": 1,
+ "modified": "2014-01-27 11:11:08.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Price List",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "permlevel": 0,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "permlevel": 0,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "delete": 0,
+ "permlevel": 0,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User"
+ },
+ {
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "permlevel": 0,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Master Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
index f067d9c..88dff1a 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js
@@ -47,7 +47,7 @@
},
received_qty: function(doc, cdt, cdn) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
frappe.model.round_floats_in(item, ["qty", "received_qty"]);
item.qty = (item.qty < item.received_qty) ? item.qty : item.received_qty;
@@ -55,7 +55,7 @@
},
qty: function(doc, cdt, cdn) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
frappe.model.round_floats_in(item, ["qty", "received_qty"]);
if(!(item.received_qty || item.rejected_qty) && item.qty) {
@@ -74,7 +74,7 @@
},
rejected_qty: function(doc, cdt, cdn) {
- var item = frappe.model.get_doc(cdt, cdn);
+ var item = frappe.get_doc(cdt, cdn);
frappe.model.round_floats_in(item, ["received_qty", "rejected_qty"]);
if(item.rejected_qty > item.received_qty) {
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
index d1e86a8..bad59a6 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
@@ -12,10 +12,7 @@
from erpnext.stock.utils import update_bin
from erpnext.controllers.buying_controller import BuyingController
-class DocType(BuyingController):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class PurchaseReceipt(BuyingController):
self.tname = 'Purchase Receipt Item'
self.fname = 'purchase_receipt_details'
self.count = 0
@@ -35,7 +32,7 @@
billed_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabPurchase Invoice Item`
where purchase_receipt=%s""", self.doc.name)
if billed_qty:
- total_qty = sum((item.qty for item in self.doclist.get({"parentfield": "purchase_receipt_details"})))
+ total_qty = sum((item.qty for item in self.get("purchase_receipt_details")))
self.doc.fields["__billing_complete"] = billed_qty[0][0] == total_qty
def validate(self):
@@ -68,7 +65,7 @@
self.update_valuation_rate("purchase_receipt_details")
def validate_rejected_warehouse(self):
- for d in self.doclist.get({"parentfield": "purchase_receipt_details"}):
+ for d in self.get("purchase_receipt_details"):
if flt(d.rejected_qty) and not d.rejected_warehouse:
d.rejected_warehouse = self.doc.rejected_warehouse
if not d.rejected_warehouse:
@@ -76,7 +73,7 @@
# validate accepted and rejected qty
def validate_accepted_rejected_qty(self):
- for d in getlist(self.doclist, "purchase_receipt_details"):
+ for d in self.get("purchase_receipt_details"):
if not flt(d.received_qty) and flt(d.qty):
d.received_qty = flt(d.qty) - flt(d.rejected_qty)
@@ -129,7 +126,7 @@
def po_required(self):
if frappe.db.get_value("Buying Settings", None, "po_required") == 'Yes':
- for d in getlist(self.doclist,'purchase_receipt_details'):
+ for d in self.get('purchase_receipt_details'):
if not d.prevdoc_docname:
msgprint("Purchse Order No. required against item %s"%d.item_code)
raise Exception
@@ -138,7 +135,7 @@
sl_entries = []
stock_items = self.get_stock_items()
- for d in getlist(self.doclist, 'purchase_receipt_details'):
+ for d in self.get('purchase_receipt_details'):
if d.item_code in stock_items and d.warehouse:
pr_qty = flt(d.qty) * flt(d.conversion_factor)
@@ -162,7 +159,7 @@
def update_ordered_qty(self):
stock_items = self.get_stock_items()
- for d in self.doclist.get({"parentfield": "purchase_receipt_details"}):
+ for d in self.get("purchase_receipt_details"):
if d.item_code in stock_items and d.warehouse \
and cstr(d.prevdoc_doctype) == 'Purchase Order':
@@ -198,7 +195,7 @@
return po_qty, po_warehouse
def bk_flush_supp_wh(self, sl_entries):
- for d in getlist(self.doclist, 'pr_raw_material_details'):
+ for d in self.get('pr_raw_material_details'):
# negative quantity is passed as raw material qty has to be decreased
# when PR is submitted and it has to be increased when PR is cancelled
sl_entries.append(self.get_sl_entries(d, {
@@ -209,7 +206,7 @@
}))
def validate_inspection(self):
- for d in getlist(self.doclist, 'purchase_receipt_details'): #Enter inspection date for all items that require inspection
+ for d in self.get('purchase_receipt_details'): #Enter inspection date for all items that require inspection
ins_reqd = frappe.db.sql("select inspection_required from `tabItem` where name = %s",
(d.item_code,), as_dict = 1)
ins_reqd = ins_reqd and ins_reqd[0]['inspection_required'] or 'No'
@@ -219,7 +216,7 @@
# Check for Stopped status
def check_for_stopped_status(self, pc_obj):
check_list =[]
- for d in getlist(self.doclist, 'purchase_receipt_details'):
+ for d in self.get('purchase_receipt_details'):
if d.fields.has_key('prevdoc_docname') and d.prevdoc_docname and d.prevdoc_docname not in check_list:
check_list.append(d.prevdoc_docname)
pc_obj.check_for_stopped_status( d.prevdoc_doctype, d.prevdoc_docname)
@@ -282,7 +279,7 @@
self.make_cancel_gl_entries()
def get_current_stock(self):
- for d in getlist(self.doclist, 'pr_raw_material_details'):
+ for d in self.get('pr_raw_material_details'):
if self.doc.supplier_warehouse:
bin = frappe.db.sql("select actual_qty from `tabBin` where item_code = %s and warehouse = %s", (d.rm_item_code, self.doc.supplier_warehouse), as_dict = 1)
d.current_stock = bin and flt(bin[0]['actual_qty']) or 0
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt
index 5b83710..0d9e9e1 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt
@@ -1,853 +1,846 @@
-[
- {
- "creation": "2013-05-21 16:16:39",
- "docstatus": 0,
- "modified": "2014-02-17 12:01:00",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "document_type": "Transaction",
- "icon": "icon-truck",
- "is_submittable": 1,
- "module": "Stock",
- "name": "__common__",
- "read_only_onload": 1,
- "search_fields": "status, posting_date, supplier"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Purchase Receipt",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Purchase Receipt",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Purchase Receipt"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_section",
- "fieldtype": "Section Break",
- "label": "Supplier",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "\nGRN",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "supplier",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Supplier",
- "oldfieldname": "supplier",
- "oldfieldtype": "Link",
- "options": "Supplier",
- "print_hide": 1,
- "print_width": "150px",
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "depends_on": "supplier",
- "doctype": "DocField",
- "fieldname": "supplier_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_list_view": 1,
- "label": "Supplier Name",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Address",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_mobile",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Mobile No",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_email",
- "fieldtype": "Text",
- "hidden": 1,
- "label": "Contact Email",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Posting Date",
- "no_copy": 1,
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "print_width": "100px",
- "reqd": 1,
- "search_index": 1,
- "width": "100px"
- },
- {
- "description": "Time at which materials were received",
- "doctype": "DocField",
- "fieldname": "posting_time",
- "fieldtype": "Time",
- "in_filter": 0,
- "label": "Posting Time",
- "no_copy": 1,
- "oldfieldname": "posting_time",
- "oldfieldtype": "Time",
- "print_hide": 1,
- "print_width": "100px",
- "reqd": 1,
- "search_index": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "challan_no",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Supplier Shipment No",
- "no_copy": 1,
- "oldfieldname": "challan_no",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "print_width": "100px",
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "challan_date",
- "fieldtype": "Date",
- "hidden": 1,
- "label": "Supplier Shipment Date",
- "no_copy": 1,
- "oldfieldname": "challan_date",
- "oldfieldtype": "Date",
- "print_hide": 0,
- "print_width": "100px",
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "currency_price_list",
- "fieldtype": "Section Break",
- "label": "Currency and Price List",
- "options": "icon-tag"
- },
- {
- "doctype": "DocField",
- "fieldname": "currency",
- "fieldtype": "Link",
- "label": "Currency",
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "description": "Rate at which supplier's currency is converted to company's base currency",
- "doctype": "DocField",
- "fieldname": "conversion_rate",
- "fieldtype": "Float",
- "label": "Exchange Rate",
- "oldfieldname": "conversion_rate",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "buying_price_list",
- "fieldtype": "Link",
- "label": "Price List",
- "options": "Price List",
- "print_hide": 1
- },
- {
- "depends_on": "buying_price_list",
- "doctype": "DocField",
- "fieldname": "price_list_currency",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Price List Currency",
- "options": "Currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "depends_on": "buying_price_list",
- "doctype": "DocField",
- "fieldname": "plc_conversion_rate",
- "fieldtype": "Float",
- "label": "Price List Exchange Rate",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "items",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart"
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "purchase_receipt_details",
- "fieldtype": "Table",
- "label": "Purchase Receipt Items",
- "oldfieldname": "purchase_receipt_details",
- "oldfieldtype": "Table",
- "options": "Purchase Receipt Item",
- "print_hide": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "oldfieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total_import",
- "fieldtype": "Currency",
- "label": "Net Total",
- "oldfieldname": "net_total_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "get_current_stock",
- "fieldtype": "Button",
- "label": "Get Current Stock",
- "oldfieldtype": "Button",
- "options": "get_current_stock",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_27",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "label": "Net Total (Company Currency)",
- "oldfieldname": "net_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "reqd": 1,
- "width": "150px"
- },
- {
- "description": "Add / Edit Taxes and Charges",
- "doctype": "DocField",
- "fieldname": "taxes",
- "fieldtype": "Section Break",
- "label": "Taxes and Charges",
- "oldfieldtype": "Section Break",
- "options": "icon-money"
- },
- {
- "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.",
- "doctype": "DocField",
- "fieldname": "taxes_and_charges",
- "fieldtype": "Link",
- "label": "Taxes and Charges",
- "oldfieldname": "purchase_other_charges",
- "oldfieldtype": "Link",
- "options": "Purchase Taxes and Charges Master",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges",
- "fieldtype": "Table",
- "label": "Purchase Taxes and Charges",
- "oldfieldname": "purchase_tax_details",
- "oldfieldtype": "Table",
- "options": "Purchase Taxes and Charges"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_calculation",
- "fieldtype": "HTML",
- "label": "Taxes and Charges Calculation",
- "oldfieldtype": "HTML",
- "print_hide": 1
- },
- {
- "description": "Detailed Breakup of the totals",
- "doctype": "DocField",
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "label": "Totals",
- "oldfieldtype": "Section Break",
- "options": "icon-money"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_added_import",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Added",
- "oldfieldname": "other_charges_added_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_deducted_import",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Deducted",
- "oldfieldname": "other_charges_deducted_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total_import",
- "fieldtype": "Currency",
- "label": "Grand Total",
- "oldfieldname": "grand_total_import",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "in_words_import",
- "fieldtype": "Data",
- "label": "In Words",
- "oldfieldname": "in_words_import",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_added",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Added (Company Currency)",
- "oldfieldname": "other_charges_added",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "other_charges_deducted",
- "fieldtype": "Currency",
- "label": "Taxes and Charges Deducted (Company Currency)",
- "oldfieldname": "other_charges_deducted",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "total_tax",
- "fieldtype": "Currency",
- "label": "Total Tax (Company Currency)",
- "oldfieldname": "total_tax",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "grand_total",
- "fieldtype": "Currency",
- "label": "Grand Total (Company Currency)",
- "oldfieldname": "grand_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rounded_total",
- "fieldtype": "Currency",
- "label": "Rounded Total (Company Currency)",
- "oldfieldname": "rounded_total",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "description": "In Words will be visible once you save the Purchase Receipt.",
- "doctype": "DocField",
- "fieldname": "in_words",
- "fieldtype": "Data",
- "label": "In Words (Company Currency)",
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "terms_section_break",
- "fieldtype": "Section Break",
- "label": "Terms and Conditions",
- "oldfieldtype": "Section Break",
- "options": "icon-legal"
- },
- {
- "doctype": "DocField",
- "fieldname": "tc_name",
- "fieldtype": "Link",
- "label": "Terms",
- "oldfieldname": "tc_name",
- "oldfieldtype": "Link",
- "options": "Terms and Conditions",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "terms",
- "fieldtype": "Text Editor",
- "label": "Terms and Conditions1",
- "oldfieldname": "terms",
- "oldfieldtype": "Text Editor"
- },
- {
- "depends_on": "supplier",
- "doctype": "DocField",
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "label": "Contact Info",
- "options": "icon-bullhorn"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_address",
- "fieldtype": "Link",
- "label": "Supplier Address",
- "options": "Address",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_57",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "label": "Contact Person",
- "options": "Contact",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text"
- },
- {
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nDraft\nSubmitted\nCancelled",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "default": "No",
- "description": "Select \"Yes\" for sub - contracting items",
- "doctype": "DocField",
- "fieldname": "is_subcontracted",
- "fieldtype": "Select",
- "label": "Is Subcontracted",
- "oldfieldname": "is_subcontracted",
- "oldfieldtype": "Select",
- "options": "\nYes\nNo",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "options": "Purchase Receipt",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "range",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Range",
- "oldfieldname": "range",
- "oldfieldtype": "Data",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "bill_no",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Bill No",
- "oldfieldname": "bill_no",
- "oldfieldtype": "Data",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "bill_date",
- "fieldtype": "Date",
- "hidden": 1,
- "label": "Bill Date",
- "oldfieldname": "bill_date",
- "oldfieldtype": "Date",
- "print_hide": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "letter_head",
- "fieldtype": "Select",
- "label": "Letter Head",
- "options": "link:Letter Head",
- "print_hide": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "label": "Print Heading",
- "no_copy": 1,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "print_hide": 1,
- "report_hide": 1
- },
- {
- "description": "Select the relevant company name if you have multiple companies",
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Company",
- "no_copy": 0,
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "print_hide": 1,
- "print_width": "150px",
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "print_width": "150px",
- "reqd": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break4",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_hide": 1,
- "print_width": "50%",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "other_details",
- "fieldtype": "HTML",
- "hidden": 1,
- "label": "Other Details",
- "oldfieldtype": "HTML",
- "options": "<div class='columnHeading'>Other Details</div>",
- "print_hide": 1,
- "print_width": "30%",
- "reqd": 0,
- "width": "30%"
- },
- {
- "description": "Warehouse where you are maintaining stock of rejected items",
- "doctype": "DocField",
- "fieldname": "rejected_warehouse",
- "fieldtype": "Link",
- "label": "Rejected Warehouse",
- "no_copy": 1,
- "oldfieldname": "rejected_warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_hide": 1,
- "reqd": 0
- },
- {
- "description": "Supplier warehouse where you have issued raw materials for sub - contracting",
- "doctype": "DocField",
- "fieldname": "supplier_warehouse",
- "fieldtype": "Link",
- "label": "Supplier Warehouse",
- "no_copy": 1,
- "oldfieldname": "supplier_warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_hide": 1,
- "print_width": "50px",
- "width": "50px"
- },
- {
- "doctype": "DocField",
- "fieldname": "instructions",
- "fieldtype": "Small Text",
- "label": "Instructions",
- "oldfieldname": "instructions",
- "oldfieldtype": "Text"
- },
- {
- "doctype": "DocField",
- "fieldname": "remarks",
- "fieldtype": "Small Text",
- "label": "Remarks",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "transporter_info",
- "fieldtype": "Section Break",
- "label": "Transporter Info",
- "options": "icon-truck"
- },
- {
- "doctype": "DocField",
- "fieldname": "transporter_name",
- "fieldtype": "Data",
- "label": "Transporter Name",
- "oldfieldname": "transporter_name",
- "oldfieldtype": "Data"
- },
- {
- "description": "Transporter lorry number",
- "doctype": "DocField",
- "fieldname": "lr_no",
- "fieldtype": "Data",
- "label": "LR No",
- "no_copy": 1,
- "oldfieldname": "lr_no",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "print_width": "100px",
- "width": "100px"
- },
- {
- "description": "Date on which lorry started from supplier warehouse",
- "doctype": "DocField",
- "fieldname": "lr_date",
- "fieldtype": "Date",
- "label": "LR Date",
- "no_copy": 1,
- "oldfieldname": "lr_date",
- "oldfieldtype": "Date",
- "print_hide": 0,
- "print_width": "100px",
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break5",
- "fieldtype": "Column Break",
- "print_width": "50%",
- "width": "50%"
- },
- {
- "description": "Following table will show values if items are sub - contracted. These values will be fetched from the master of \"Bill of Materials\" of sub - contracted items.",
- "doctype": "DocField",
- "fieldname": "raw_material_details",
- "fieldtype": "Section Break",
- "label": "Raw Materials Supplied",
- "oldfieldtype": "Section Break",
- "options": "icon-table",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pr_raw_material_details",
- "fieldtype": "Table",
- "label": "Purchase Receipt Item Supplieds",
- "no_copy": 1,
- "oldfieldname": "pr_raw_material_details",
- "oldfieldtype": "Table",
- "options": "Purchase Receipt Item Supplied",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Material Manager",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Material User",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Purchase User",
- "submit": 1,
- "write": 1
- },
- {
- "cancel": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Supplier"
- }
-]
+{
+ "allow_attach": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-05-21 16:16:39.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "fieldname": "supplier_section",
+ "fieldtype": "Section Break",
+ "label": "Supplier",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "\nGRN",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Supplier",
+ "oldfieldname": "supplier",
+ "oldfieldtype": "Link",
+ "options": "Supplier",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "depends_on": "supplier",
+ "fieldname": "supplier_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_list_view": 1,
+ "label": "Supplier Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Address",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_mobile",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Mobile No",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_email",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "label": "Contact Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Posting Date",
+ "no_copy": 1,
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "description": "Time at which materials were received",
+ "fieldname": "posting_time",
+ "fieldtype": "Time",
+ "in_filter": 0,
+ "label": "Posting Time",
+ "no_copy": 1,
+ "oldfieldname": "posting_time",
+ "oldfieldtype": "Time",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "reqd": 1,
+ "search_index": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "challan_no",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Supplier Shipment No",
+ "no_copy": 1,
+ "oldfieldname": "challan_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "challan_date",
+ "fieldtype": "Date",
+ "hidden": 1,
+ "label": "Supplier Shipment Date",
+ "no_copy": 1,
+ "oldfieldname": "challan_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "currency_price_list",
+ "fieldtype": "Section Break",
+ "label": "Currency and Price List",
+ "options": "icon-tag",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "currency",
+ "fieldtype": "Link",
+ "label": "Currency",
+ "oldfieldname": "currency",
+ "oldfieldtype": "Select",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "description": "Rate at which supplier's currency is converted to company's base currency",
+ "fieldname": "conversion_rate",
+ "fieldtype": "Float",
+ "label": "Exchange Rate",
+ "oldfieldname": "conversion_rate",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "buying_price_list",
+ "fieldtype": "Link",
+ "label": "Price List",
+ "options": "Price List",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "depends_on": "buying_price_list",
+ "fieldname": "price_list_currency",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Price List Currency",
+ "options": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "depends_on": "buying_price_list",
+ "fieldname": "plc_conversion_rate",
+ "fieldtype": "Float",
+ "label": "Price List Exchange Rate",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "items",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "purchase_receipt_details",
+ "fieldtype": "Table",
+ "label": "Purchase Receipt Items",
+ "oldfieldname": "purchase_receipt_details",
+ "oldfieldtype": "Table",
+ "options": "Purchase Receipt Item",
+ "permlevel": 0,
+ "print_hide": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total_import",
+ "fieldtype": "Currency",
+ "label": "Net Total",
+ "oldfieldname": "net_total_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "get_current_stock",
+ "fieldtype": "Button",
+ "label": "Get Current Stock",
+ "oldfieldtype": "Button",
+ "options": "get_current_stock",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "column_break_27",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "label": "Net Total (Company Currency)",
+ "oldfieldname": "net_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "150px"
+ },
+ {
+ "description": "Add / Edit Taxes and Charges",
+ "fieldname": "taxes",
+ "fieldtype": "Section Break",
+ "label": "Taxes and Charges",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0
+ },
+ {
+ "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.",
+ "fieldname": "taxes_and_charges",
+ "fieldtype": "Link",
+ "label": "Taxes and Charges",
+ "oldfieldname": "purchase_other_charges",
+ "oldfieldtype": "Link",
+ "options": "Purchase Taxes and Charges Master",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "other_charges",
+ "fieldtype": "Table",
+ "label": "Purchase Taxes and Charges",
+ "oldfieldname": "purchase_tax_details",
+ "oldfieldtype": "Table",
+ "options": "Purchase Taxes and Charges",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_calculation",
+ "fieldtype": "HTML",
+ "label": "Taxes and Charges Calculation",
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "description": "Detailed Breakup of the totals",
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "label": "Totals",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "other_charges_added_import",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Added",
+ "oldfieldname": "other_charges_added_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "other_charges_deducted_import",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Deducted",
+ "oldfieldname": "other_charges_deducted_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "grand_total_import",
+ "fieldtype": "Currency",
+ "label": "Grand Total",
+ "oldfieldname": "grand_total_import",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "in_words_import",
+ "fieldtype": "Data",
+ "label": "In Words",
+ "oldfieldname": "in_words_import",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "other_charges_added",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Added (Company Currency)",
+ "oldfieldname": "other_charges_added",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "other_charges_deducted",
+ "fieldtype": "Currency",
+ "label": "Taxes and Charges Deducted (Company Currency)",
+ "oldfieldname": "other_charges_deducted",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "total_tax",
+ "fieldtype": "Currency",
+ "label": "Total Tax (Company Currency)",
+ "oldfieldname": "total_tax",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "grand_total",
+ "fieldtype": "Currency",
+ "label": "Grand Total (Company Currency)",
+ "oldfieldname": "grand_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "rounded_total",
+ "fieldtype": "Currency",
+ "label": "Rounded Total (Company Currency)",
+ "oldfieldname": "rounded_total",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "description": "In Words will be visible once you save the Purchase Receipt.",
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "label": "In Words (Company Currency)",
+ "oldfieldname": "in_words",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "terms_section_break",
+ "fieldtype": "Section Break",
+ "label": "Terms and Conditions",
+ "oldfieldtype": "Section Break",
+ "options": "icon-legal",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "tc_name",
+ "fieldtype": "Link",
+ "label": "Terms",
+ "oldfieldname": "tc_name",
+ "oldfieldtype": "Link",
+ "options": "Terms and Conditions",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "terms",
+ "fieldtype": "Text Editor",
+ "label": "Terms and Conditions1",
+ "oldfieldname": "terms",
+ "oldfieldtype": "Text Editor",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "supplier",
+ "fieldname": "contact_section",
+ "fieldtype": "Section Break",
+ "label": "Contact Info",
+ "options": "icon-bullhorn",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "supplier_address",
+ "fieldtype": "Link",
+ "label": "Supplier Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "column_break_57",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "label": "Contact Person",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nDraft\nSubmitted\nCancelled",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "default": "No",
+ "description": "Select \"Yes\" for sub - contracting items",
+ "fieldname": "is_subcontracted",
+ "fieldtype": "Select",
+ "label": "Is Subcontracted",
+ "oldfieldname": "is_subcontracted",
+ "oldfieldtype": "Select",
+ "options": "\nYes\nNo",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "options": "Purchase Receipt",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "range",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Range",
+ "oldfieldname": "range",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "bill_no",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Bill No",
+ "oldfieldname": "bill_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "bill_date",
+ "fieldtype": "Date",
+ "hidden": 1,
+ "label": "Bill Date",
+ "oldfieldname": "bill_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "letter_head",
+ "fieldtype": "Select",
+ "label": "Letter Head",
+ "options": "link:Letter Head",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "label": "Print Heading",
+ "no_copy": 1,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 1,
+ "report_hide": 1
+ },
+ {
+ "description": "Select the relevant company name if you have multiple companies",
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Company",
+ "no_copy": 0,
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "reqd": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "fieldname": "other_details",
+ "fieldtype": "HTML",
+ "hidden": 1,
+ "label": "Other Details",
+ "oldfieldtype": "HTML",
+ "options": "<div class='columnHeading'>Other Details</div>",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "30%",
+ "reqd": 0,
+ "width": "30%"
+ },
+ {
+ "description": "Warehouse where you are maintaining stock of rejected items",
+ "fieldname": "rejected_warehouse",
+ "fieldtype": "Link",
+ "label": "Rejected Warehouse",
+ "no_copy": 1,
+ "oldfieldname": "rejected_warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 0
+ },
+ {
+ "description": "Supplier warehouse where you have issued raw materials for sub - contracting",
+ "fieldname": "supplier_warehouse",
+ "fieldtype": "Link",
+ "label": "Supplier Warehouse",
+ "no_copy": 1,
+ "oldfieldname": "supplier_warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "50px",
+ "width": "50px"
+ },
+ {
+ "fieldname": "instructions",
+ "fieldtype": "Small Text",
+ "label": "Instructions",
+ "oldfieldname": "instructions",
+ "oldfieldtype": "Text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "remarks",
+ "fieldtype": "Small Text",
+ "label": "Remarks",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "transporter_info",
+ "fieldtype": "Section Break",
+ "label": "Transporter Info",
+ "options": "icon-truck",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "transporter_name",
+ "fieldtype": "Data",
+ "label": "Transporter Name",
+ "oldfieldname": "transporter_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "description": "Transporter lorry number",
+ "fieldname": "lr_no",
+ "fieldtype": "Data",
+ "label": "LR No",
+ "no_copy": 1,
+ "oldfieldname": "lr_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "width": "100px"
+ },
+ {
+ "description": "Date on which lorry started from supplier warehouse",
+ "fieldname": "lr_date",
+ "fieldtype": "Date",
+ "label": "LR Date",
+ "no_copy": 1,
+ "oldfieldname": "lr_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "width": "100px"
+ },
+ {
+ "fieldname": "column_break5",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "width": "50%"
+ },
+ {
+ "description": "Following table will show values if items are sub - contracted. These values will be fetched from the master of \"Bill of Materials\" of sub - contracted items.",
+ "fieldname": "raw_material_details",
+ "fieldtype": "Section Break",
+ "label": "Raw Materials Supplied",
+ "oldfieldtype": "Section Break",
+ "options": "icon-table",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "pr_raw_material_details",
+ "fieldtype": "Table",
+ "label": "Purchase Receipt Item Supplieds",
+ "no_copy": 1,
+ "oldfieldname": "pr_raw_material_details",
+ "oldfieldtype": "Table",
+ "options": "Purchase Receipt Item Supplied",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-truck",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-02-17 12:01:00.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Purchase Receipt",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Supplier"
+ }
+ ],
+ "read_only_onload": 1,
+ "search_fields": "status, posting_date, supplier"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
index 862bd84..2a2e821 100644
--- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
@@ -95,7 +95,7 @@
pr.insert()
self.assertEquals(pr.doclist[1].rm_supp_cost, 70000.0)
- self.assertEquals(len(pr.doclist.get({"parentfield": "pr_raw_material_details"})), 2)
+ self.assertEquals(len(pr.get("pr_raw_material_details")), 2)
def test_serial_no_supplier(self):
pr = frappe.bean(copy=test_records[0])
diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py
index 26c87f1..35fca0d 100644
--- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py
+++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class PurchaseReceiptItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
index cde7911..0c8100c 100755
--- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
+++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt
@@ -1,574 +1,561 @@
-[
- {
- "creation": "2013-05-24 19:29:10",
- "docstatus": 0,
- "modified": "2014-02-28 11:27:09",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "GRND/.#######",
- "doctype": "DocType",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Purchase Receipt Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Purchase Receipt Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "print_width": "300px",
- "read_only": 0,
- "reqd": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "received_and_accepted",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Received and Accepted"
- },
- {
- "doctype": "DocField",
- "fieldname": "received_qty",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Recd Quantity",
- "oldfieldname": "received_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Accepted Quantity",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "print_width": "100px",
- "read_only": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "rejected_qty",
- "fieldtype": "Float",
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Rejected Quantity",
- "oldfieldname": "rejected_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "search_index": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "UOM",
- "oldfieldname": "uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Stock UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Conversion Factor",
- "oldfieldname": "conversion_factor",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "rate_and_amount",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Rate and Amount"
- },
- {
- "doctype": "DocField",
- "fieldname": "price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate",
- "options": "currency",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "discount_percentage",
- "fieldtype": "Float",
- "in_list_view": 0,
- "label": "Discount %",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_price_list_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Price List Rate (Company Currency)",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sec_break1",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "rate",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Rate",
- "oldfieldname": "import_rate",
- "oldfieldtype": "Currency",
- "options": "currency",
- "print_hide": 0,
- "print_width": "100px",
- "read_only": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Amount",
- "oldfieldname": "import_amount",
- "oldfieldtype": "Currency",
- "options": "currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break4",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_rate",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Rate (Company Currency)",
- "oldfieldname": "purchase_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "base_amount",
- "fieldtype": "Currency",
- "in_list_view": 0,
- "label": "Amount (Company Currency)",
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_price",
- "fieldtype": "Link",
- "label": "Pricing Rule For Price",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "pricing_rule_for_discount",
- "fieldtype": "Link",
- "label": "Pricing Rule For Discount",
- "options": "Pricing Rule",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse_and_reference",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Warehouse and Reference"
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "hidden": 0,
- "in_list_view": 0,
- "label": "Accepted Warehouse",
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "rejected_warehouse",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Rejected Warehouse",
- "no_copy": 1,
- "oldfieldname": "rejected_warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 0,
- "width": "100px"
- },
- {
- "default": ":Company",
- "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "label": "Cost Center",
- "options": "Cost Center",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "project_name",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Project Name",
- "options": "Project",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "qa_no",
- "fieldtype": "Link",
- "label": "Quality Inspection",
- "no_copy": 1,
- "oldfieldname": "qa_no",
- "oldfieldtype": "Link",
- "options": "Quality Inspection",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "schedule_date",
- "fieldtype": "Date",
- "label": "Required By",
- "no_copy": 0,
- "oldfieldname": "schedule_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_qty",
- "fieldtype": "Float",
- "label": "Qty as per Stock UOM",
- "oldfieldname": "stock_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "print_width": "100px",
- "read_only": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_doctype",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Prevdoc Doctype",
- "no_copy": 1,
- "oldfieldname": "prevdoc_doctype",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_docname",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Purchase Order",
- "no_copy": 1,
- "oldfieldname": "prevdoc_docname",
- "oldfieldtype": "Link",
- "options": "Purchase Order",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "reqd": 0,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_detail_docname",
- "fieldtype": "Data",
- "hidden": 1,
- "in_filter": 1,
- "label": "Purchase Order Item No",
- "no_copy": 1,
- "oldfieldname": "prevdoc_detail_docname",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break5",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no",
- "fieldtype": "Text",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Serial No",
- "no_copy": 1,
- "oldfieldname": "serial_no",
- "oldfieldtype": "Text",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "rejected_serial_no",
- "fieldtype": "Text",
- "label": "Rejected Serial No",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "batch_no",
- "fieldtype": "Link",
- "label": "Batch No",
- "oldfieldname": "batch_no",
- "oldfieldtype": "Link",
- "options": "Batch",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Link",
- "hidden": 1,
- "label": "Brand",
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "hidden": 1,
- "in_filter": 1,
- "label": "Item Group",
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "print_hide": 1,
- "read_only": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "rm_supp_cost",
- "fieldtype": "Currency",
- "hidden": 1,
- "in_filter": 0,
- "label": "Raw Materials Supplied Cost",
- "no_copy": 1,
- "oldfieldname": "rm_supp_cost",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_tax_amount",
- "fieldtype": "Currency",
- "hidden": 1,
- "label": "Item Tax Amount",
- "no_copy": 1,
- "oldfieldname": "item_tax_amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "reqd": 0,
- "search_index": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "valuation_rate",
- "fieldtype": "Currency",
- "hidden": 1,
- "in_filter": 0,
- "label": "Valuation Rate",
- "no_copy": 1,
- "oldfieldname": "valuation_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_hide": 1,
- "print_width": "80px",
- "read_only": 1,
- "width": "80px"
- },
- {
- "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges",
- "doctype": "DocField",
- "fieldname": "item_tax_rate",
- "fieldtype": "Small Text",
- "hidden": 1,
- "in_filter": 0,
- "label": "Item Tax Rate",
- "oldfieldname": "item_tax_rate",
- "oldfieldtype": "Small Text",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 1
- },
- {
- "allow_on_submit": 1,
- "doctype": "DocField",
- "fieldname": "page_break",
- "fieldtype": "Check",
- "label": "Page Break",
- "oldfieldname": "page_break",
- "oldfieldtype": "Check",
- "print_hide": 1,
- "read_only": 0
- }
-]
\ No newline at end of file
+{
+ "autoname": "GRND/.#######",
+ "creation": "2013-05-24 19:29:10.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "received_and_accepted",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Received and Accepted",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "received_qty",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Recd Quantity",
+ "oldfieldname": "received_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Accepted Quantity",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "rejected_qty",
+ "fieldtype": "Float",
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Rejected Quantity",
+ "oldfieldname": "rejected_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "search_index": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "oldfieldname": "uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Stock UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Conversion Factor",
+ "oldfieldname": "conversion_factor",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "rate_and_amount",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Rate and Amount",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "discount_percentage",
+ "fieldtype": "Float",
+ "in_list_view": 0,
+ "label": "Discount %",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "base_price_list_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Price List Rate (Company Currency)",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "sec_break1",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "rate",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Rate",
+ "oldfieldname": "import_rate",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 0,
+ "print_width": "100px",
+ "read_only": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Amount",
+ "oldfieldname": "import_amount",
+ "oldfieldtype": "Currency",
+ "options": "currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "base_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Rate (Company Currency)",
+ "oldfieldname": "purchase_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "base_amount",
+ "fieldtype": "Currency",
+ "in_list_view": 0,
+ "label": "Amount (Company Currency)",
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "pricing_rule_for_price",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Price",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "pricing_rule_for_discount",
+ "fieldtype": "Link",
+ "label": "Pricing Rule For Discount",
+ "options": "Pricing Rule",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "warehouse_and_reference",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Warehouse and Reference",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_list_view": 0,
+ "label": "Accepted Warehouse",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "rejected_warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Rejected Warehouse",
+ "no_copy": 1,
+ "oldfieldname": "rejected_warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 0,
+ "width": "100px"
+ },
+ {
+ "default": ":Company",
+ "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "label": "Cost Center",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Project Name",
+ "options": "Project",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "qa_no",
+ "fieldtype": "Link",
+ "label": "Quality Inspection",
+ "no_copy": 1,
+ "oldfieldname": "qa_no",
+ "oldfieldtype": "Link",
+ "options": "Quality Inspection",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "schedule_date",
+ "fieldtype": "Date",
+ "label": "Required By",
+ "no_copy": 0,
+ "oldfieldname": "schedule_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "stock_qty",
+ "fieldtype": "Float",
+ "label": "Qty as per Stock UOM",
+ "oldfieldname": "stock_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "100px",
+ "read_only": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "prevdoc_doctype",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Prevdoc Doctype",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_doctype",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "prevdoc_docname",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Purchase Order",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_docname",
+ "oldfieldtype": "Link",
+ "options": "Purchase Order",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "prevdoc_detail_docname",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Purchase Order Item No",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_detail_docname",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "col_break5",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "serial_no",
+ "fieldtype": "Text",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Serial No",
+ "no_copy": 1,
+ "oldfieldname": "serial_no",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0
+ },
+ {
+ "fieldname": "rejected_serial_no",
+ "fieldtype": "Text",
+ "label": "Rejected Serial No",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "batch_no",
+ "fieldtype": "Link",
+ "label": "Batch No",
+ "oldfieldname": "batch_no",
+ "oldfieldtype": "Link",
+ "options": "Batch",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "Brand",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Item Group",
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "rm_supp_cost",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "in_filter": 0,
+ "label": "Raw Materials Supplied Cost",
+ "no_copy": 1,
+ "oldfieldname": "rm_supp_cost",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "item_tax_amount",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "label": "Item Tax Amount",
+ "no_copy": 1,
+ "oldfieldname": "item_tax_amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "valuation_rate",
+ "fieldtype": "Currency",
+ "hidden": 1,
+ "in_filter": 0,
+ "label": "Valuation Rate",
+ "no_copy": 1,
+ "oldfieldname": "valuation_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "80px",
+ "read_only": 1,
+ "width": "80px"
+ },
+ {
+ "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges",
+ "fieldname": "item_tax_rate",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "in_filter": 0,
+ "label": "Item Tax Rate",
+ "oldfieldname": "item_tax_rate",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "page_break",
+ "fieldtype": "Check",
+ "label": "Page Break",
+ "oldfieldname": "page_break",
+ "oldfieldtype": "Check",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-28 11:27:09.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Purchase Receipt Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py
index d52d48d..50b1d00 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.py
+++ b/erpnext/stock/doctype/serial_no/serial_no.py
@@ -20,7 +20,7 @@
class SerialNoNotExistsError(ValidationError): pass
class SerialNoDuplicateError(ValidationError): pass
-class DocType(StockController):
+class SerialNo(StockController):
def __init__(self, doc, doclist=None):
self.doc = doc
self.doclist = doclist or []
@@ -254,7 +254,7 @@
def update_serial_nos(sle, item_det):
if sle.is_cancelled == "No" and not sle.serial_no and sle.actual_qty > 0 and item_det.serial_no_series:
- from frappe.model.doc import make_autoname
+ from frappe.model.naming import make_autoname
serial_nos = []
for i in xrange(cint(sle.actual_qty)):
serial_nos.append(make_autoname(item_det.serial_no_series))
diff --git a/erpnext/stock/doctype/serial_no/serial_no.txt b/erpnext/stock/doctype/serial_no/serial_no.txt
index 3588493..7695578 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.txt
+++ b/erpnext/stock/doctype/serial_no/serial_no.txt
@@ -1,477 +1,470 @@
-[
- {
- "creation": "2013-05-16 10:59:15",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:26",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:serial_no",
- "description": "Distinct unit of an Item",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-barcode",
- "in_create": 0,
- "module": "Stock",
- "name": "__common__",
- "search_fields": "item_code,status"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Serial No",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Serial No",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Serial No"
- },
- {
- "doctype": "DocField",
- "fieldname": "details",
- "fieldtype": "Section Break",
- "label": "Details",
- "oldfieldtype": "Section Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "default": "In Store",
- "description": "Only Serial Nos with status \"Available\" can be delivered.",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nAvailable\nNot Available\nDelivered\nPurchase Returned\nSales Returned",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no",
- "fieldtype": "Data",
- "in_filter": 0,
- "label": "Serial No",
- "no_copy": 1,
- "oldfieldname": "serial_no",
- "oldfieldtype": "Data",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "read_only": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "description": "Warehouse can only be changed via Stock Entry / Delivery Note / Purchase Receipt",
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Warehouse",
- "no_copy": 1,
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "read_only": 1,
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Item Name",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "in_filter": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "read_only": 1,
- "search_index": 0,
- "width": "300px"
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "in_filter": 0,
- "label": "Item Group",
- "oldfieldname": "item_group",
- "oldfieldtype": "Link",
- "options": "Item Group",
- "read_only": 1,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "brand",
- "fieldtype": "Link",
- "in_filter": 0,
- "label": "Brand",
- "oldfieldname": "brand",
- "oldfieldtype": "Link",
- "options": "Brand",
- "read_only": 1,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_details",
- "fieldtype": "Section Break",
- "label": "Purchase / Manufacture Details",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break2",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_document_type",
- "fieldtype": "Select",
- "label": "Creation Document Type",
- "no_copy": 1,
- "options": "\nPurchase Receipt\nStock Entry",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_document_no",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Creation Document No",
- "no_copy": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Creation Date",
- "no_copy": 1,
- "oldfieldname": "purchase_date",
- "oldfieldtype": "Date",
- "read_only": 1,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_time",
- "fieldtype": "Time",
- "label": "Creation Time",
- "no_copy": 1,
- "read_only": 1,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "purchase_rate",
- "fieldtype": "Currency",
- "in_filter": 0,
- "label": "Incoming Rate",
- "no_copy": 1,
- "oldfieldname": "purchase_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break3",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Supplier",
- "no_copy": 1,
- "options": "Supplier",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Supplier Name",
- "no_copy": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "delivery_details",
- "fieldtype": "Section Break",
- "label": "Delivery Details",
- "oldfieldtype": "Column Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "delivery_document_type",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Delivery Document Type",
- "no_copy": 1,
- "options": "\nDelivery Note\nSales Invoice\nStock Entry",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "delivery_document_no",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Delivery Document No",
- "no_copy": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "delivery_date",
- "fieldtype": "Date",
- "label": "Delivery Date",
- "no_copy": 1,
- "oldfieldname": "delivery_date",
- "oldfieldtype": "Date",
- "read_only": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "delivery_time",
- "fieldtype": "Time",
- "label": "Delivery Time",
- "no_copy": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "is_cancelled",
- "fieldtype": "Select",
- "hidden": 1,
- "label": "Is Cancelled",
- "oldfieldname": "is_cancelled",
- "oldfieldtype": "Select",
- "options": "\nYes\nNo",
- "read_only": 0,
- "report_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break5",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Customer",
- "no_copy": 1,
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 1,
- "read_only": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Customer Name",
- "no_copy": 1,
- "oldfieldname": "customer_name",
- "oldfieldtype": "Data",
- "read_only": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "warranty_amc_details",
- "fieldtype": "Section Break",
- "label": "Warranty / AMC Details",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break6",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "maintenance_status",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Maintenance Status",
- "no_copy": 0,
- "oldfieldname": "maintenance_status",
- "oldfieldtype": "Select",
- "options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC",
- "read_only": 0,
- "search_index": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "warranty_period",
- "fieldtype": "Int",
- "label": "Warranty Period (Days)",
- "oldfieldname": "warranty_period",
- "oldfieldtype": "Int",
- "read_only": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break7",
- "fieldtype": "Column Break",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "warranty_expiry_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Warranty Expiry Date",
- "oldfieldname": "warranty_expiry_date",
- "oldfieldtype": "Date",
- "read_only": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "amc_expiry_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "AMC Expiry Date",
- "oldfieldname": "amc_expiry_date",
- "oldfieldtype": "Date",
- "read_only": 0,
- "search_index": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no_details",
- "fieldtype": "Text Editor",
- "label": "Serial No Details",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Company",
- "options": "link:Company",
- "read_only": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Material Master Manager",
- "write": 1
- },
- {
- "amend": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Material Manager",
- "write": 0
- },
- {
- "amend": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Material User",
- "write": 0
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:serial_no",
+ "creation": "2013-05-16 10:59:15.000000",
+ "description": "Distinct unit of an Item",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "details",
+ "fieldtype": "Section Break",
+ "label": "Details",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "default": "In Store",
+ "description": "Only Serial Nos with status \"Available\" can be delivered.",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nAvailable\nNot Available\nDelivered\nPurchase Returned\nSales Returned",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "serial_no",
+ "fieldtype": "Data",
+ "in_filter": 0,
+ "label": "Serial No",
+ "no_copy": 1,
+ "oldfieldname": "serial_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "description": "Warehouse can only be changed via Stock Entry / Delivery Note / Purchase Receipt",
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Warehouse",
+ "no_copy": 1,
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Item Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_filter": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0,
+ "width": "300px"
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "in_filter": 0,
+ "label": "Item Group",
+ "oldfieldname": "item_group",
+ "oldfieldtype": "Link",
+ "options": "Item Group",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "brand",
+ "fieldtype": "Link",
+ "in_filter": 0,
+ "label": "Brand",
+ "oldfieldname": "brand",
+ "oldfieldtype": "Link",
+ "options": "Brand",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "purchase_details",
+ "fieldtype": "Section Break",
+ "label": "Purchase / Manufacture Details",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "purchase_document_type",
+ "fieldtype": "Select",
+ "label": "Creation Document Type",
+ "no_copy": 1,
+ "options": "\nPurchase Receipt\nStock Entry",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "purchase_document_no",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Creation Document No",
+ "no_copy": 1,
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "purchase_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Creation Date",
+ "no_copy": 1,
+ "oldfieldname": "purchase_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "purchase_time",
+ "fieldtype": "Time",
+ "label": "Creation Time",
+ "no_copy": 1,
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0
+ },
+ {
+ "fieldname": "purchase_rate",
+ "fieldtype": "Currency",
+ "in_filter": 0,
+ "label": "Incoming Rate",
+ "no_copy": 1,
+ "oldfieldname": "purchase_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Supplier",
+ "no_copy": 1,
+ "options": "Supplier",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "supplier_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Supplier Name",
+ "no_copy": 1,
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "delivery_details",
+ "fieldtype": "Section Break",
+ "label": "Delivery Details",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "delivery_document_type",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Delivery Document Type",
+ "no_copy": 1,
+ "options": "\nDelivery Note\nSales Invoice\nStock Entry",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "delivery_document_no",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Delivery Document No",
+ "no_copy": 1,
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "delivery_date",
+ "fieldtype": "Date",
+ "label": "Delivery Date",
+ "no_copy": 1,
+ "oldfieldname": "delivery_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "delivery_time",
+ "fieldtype": "Time",
+ "label": "Delivery Time",
+ "no_copy": 1,
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "is_cancelled",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "label": "Is Cancelled",
+ "oldfieldname": "is_cancelled",
+ "oldfieldtype": "Select",
+ "options": "\nYes\nNo",
+ "permlevel": 0,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "fieldname": "column_break5",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Customer",
+ "no_copy": 1,
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Customer Name",
+ "no_copy": 1,
+ "oldfieldname": "customer_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "warranty_amc_details",
+ "fieldtype": "Section Break",
+ "label": "Warranty / AMC Details",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break6",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "maintenance_status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Maintenance Status",
+ "no_copy": 0,
+ "oldfieldname": "maintenance_status",
+ "oldfieldtype": "Select",
+ "options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC",
+ "permlevel": 0,
+ "read_only": 0,
+ "search_index": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "warranty_period",
+ "fieldtype": "Int",
+ "label": "Warranty Period (Days)",
+ "oldfieldname": "warranty_period",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "column_break7",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "warranty_expiry_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Warranty Expiry Date",
+ "oldfieldname": "warranty_expiry_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "amc_expiry_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "AMC Expiry Date",
+ "oldfieldname": "amc_expiry_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0,
+ "search_index": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "serial_no_details",
+ "fieldtype": "Text Editor",
+ "label": "Serial No Details",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Company",
+ "options": "link:Company",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 1
+ }
+ ],
+ "icon": "icon-barcode",
+ "idx": 1,
+ "in_create": 0,
+ "modified": "2014-01-20 17:49:26.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Serial No",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Manager",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 0,
+ "write": 0
+ }
+ ],
+ "search_fields": "item_code,status"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 535fcb7..6ee3922 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -105,9 +105,9 @@
},
callback: function(r) {
if (!r.exc) {
- for(d in getchildren('Stock Entry Detail', me.frm.doc.name, 'mtn_details')) {
+ $.each(doc.mtn_details || [], function(i, d) {
if(!d.expense_account) d.expense_account = r.message;
- }
+ });
}
}
});
@@ -225,7 +225,7 @@
},
mtn_details_add: function(doc, cdt, cdn) {
- var row = frappe.model.get_doc(cdt, cdn);
+ var row = frappe.get_doc(cdt, cdn);
this.frm.script_manager.copy_from_first_row("mtn_details", row,
["expense_account", "cost_center"]);
@@ -388,7 +388,7 @@
}
cur_frm.cscript.validate_items = function(doc) {
- cl = getchildren('Stock Entry Detail', doc.name, 'mtn_details');
+ cl = doc.mtn_details || [];
if (!cl.length) {
msgprint(frappe._("Item table can not be blank"));
validated = false;
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 3aeb507..785ad97 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -6,7 +6,6 @@
import frappe.defaults
from frappe.utils import cstr, cint, flt, comma_or, nowdate
-from frappe.model.doc import addchild
from frappe.model.bean import getlist
from frappe.model.code import get_obj
from frappe import msgprint, _
@@ -24,10 +23,7 @@
from erpnext.controllers.stock_controller import StockController
-class DocType(StockController):
- def __init__(self, doc, doclist=None):
- self.doc = doc
- self.doclist = doclist
+class StockEntry(StockController):
self.fname = 'mtn_details'
def validate(self):
@@ -77,7 +73,7 @@
def validate_item(self):
stock_items = self.get_stock_items()
- for item in self.doclist.get({"parentfield": "mtn_details"}):
+ for item in self.get("mtn_details"):
if item.item_code not in stock_items:
msgprint(_("""Only Stock Items are allowed for Stock Entry"""),
raise_exception=True)
@@ -93,14 +89,14 @@
if self.doc.purpose in source_mandatory and self.doc.purpose not in target_mandatory:
self.doc.to_warehouse = None
- for d in getlist(self.doclist, 'mtn_details'):
+ for d in self.get('mtn_details'):
d.t_warehouse = None
elif self.doc.purpose in target_mandatory and self.doc.purpose not in source_mandatory:
self.doc.from_warehouse = None
- for d in getlist(self.doclist, 'mtn_details'):
+ for d in self.get('mtn_details'):
d.s_warehouse = None
- for d in getlist(self.doclist, 'mtn_details'):
+ for d in self.get('mtn_details'):
if not d.s_warehouse and not d.t_warehouse:
d.s_warehouse = self.doc.from_warehouse
d.t_warehouse = self.doc.to_warehouse
@@ -176,11 +172,11 @@
+ self.doc.production_order + ":" + ", ".join(other_ste), DuplicateEntryForProductionOrderError)
def set_total_amount(self):
- self.doc.total_amount = sum([flt(item.amount) for item in self.doclist.get({"parentfield": "mtn_details"})])
+ self.doc.total_amount = sum([flt(item.amount) for item in self.get("mtn_details")])
def get_stock_and_rate(self):
"""get stock and incoming rate on posting date"""
- for d in getlist(self.doclist, 'mtn_details'):
+ for d in self.get('mtn_details'):
args = frappe._dict({
"item_code": d.item_code,
"warehouse": d.s_warehouse or d.t_warehouse,
@@ -225,12 +221,12 @@
return incoming_rate
def validate_incoming_rate(self):
- for d in getlist(self.doclist, 'mtn_details'):
+ for d in self.get('mtn_details'):
if d.t_warehouse:
self.validate_value("incoming_rate", ">", 0, d, raise_exception=IncorrectValuationRateError)
def validate_bom(self):
- for d in getlist(self.doclist, 'mtn_details'):
+ for d in self.get('mtn_details'):
if d.bom_no and not frappe.db.sql("""select name from `tabBOM`
where item = %s and name = %s and docstatus = 1 and is_active = 1""",
(d.item_code, d.bom_no)):
@@ -240,7 +236,7 @@
def validate_finished_goods(self):
"""validation: finished good quantity should be same as manufacturing quantity"""
- for d in getlist(self.doclist, 'mtn_details'):
+ for d in self.get('mtn_details'):
if d.bom_no and flt(d.transfer_qty) != flt(self.doc.fg_completed_qty):
msgprint(_("Row #") + " %s: " % d.idx
+ _("Quantity should be equal to Manufacturing Quantity. To fetch items again, click on 'Get Items' button or update the Quantity manually."), raise_exception=1)
@@ -275,7 +271,7 @@
stock_items = get_stock_items_for_return(ref.doclist, ref.parentfields)
already_returned_item_qty = self.get_already_returned_item_qty(ref.fieldname)
- for item in self.doclist.get({"parentfield": "mtn_details"}):
+ for item in self.get("mtn_details"):
# validate if item exists in the ref doclist and that it is a stock item
if item.item_code not in stock_items:
msgprint(_("Item") + ': "' + item.item_code + _("\" does not exist in ") +
@@ -303,7 +299,7 @@
def update_stock_ledger(self):
sl_entries = []
- for d in getlist(self.doclist, 'mtn_details'):
+ for d in self.get('mtn_details'):
if cstr(d.s_warehouse) and self.doc.docstatus == 1:
sl_entries.append(self.get_sl_entries(d, {
"warehouse": cstr(d.s_warehouse),
@@ -431,7 +427,7 @@
def get_items(self):
self.doclist = filter(lambda d: d.parentfield!="mtn_details", self.doclist)
- # self.doclist = self.doc.clear_table(self.doclist, 'mtn_details')
+ # self.set('mtn_details', [])
pro_obj = None
if self.doc.production_order:
@@ -566,8 +562,7 @@
["default_expense_account", "cost_center"])[0]
for d in item_dict:
- se_child = addchild(self.doc, 'mtn_details', 'Stock Entry Detail',
- self.doclist)
+ se_child = self.doc.append('mtn_details', {})
se_child.idx = idx
se_child.s_warehouse = item_dict[d].get("from_warehouse", self.doc.from_warehouse)
se_child.t_warehouse = item_dict[d].get("to_warehouse", self.doc.to_warehouse)
@@ -592,7 +587,7 @@
return idx
def validate_with_material_request(self):
- for item in self.doclist.get({"parentfield": "mtn_details"}):
+ for item in self.get("mtn_details"):
if item.material_request:
mreq_item = frappe.db.get_value("Material Request Item",
{"name": item.material_request_item, "parent": item.material_request},
@@ -801,7 +796,7 @@
# income account entries
children = []
- for se_item in se.doclist.get({"parentfield": "mtn_details"}):
+ for se_item in se.get("mtn_details"):
# find item in ref.doclist
ref_item = ref.doclist.getone({"item_code": se_item.item_code})
@@ -843,7 +838,7 @@
parent = {}
children = []
- for se_item in se.doclist.get({"parentfield": "mtn_details"}):
+ for se_item in se.get("mtn_details"):
for sales_invoice in invoices_against_delivery:
si = frappe.bean("Sales Invoice", sales_invoice)
@@ -900,7 +895,7 @@
parent = {}
children = []
- for se_item in se.doclist.get({"parentfield": "mtn_details"}):
+ for se_item in se.get("mtn_details"):
for purchase_invoice in invoice_against_receipt:
pi = frappe.bean("Purchase Invoice", purchase_invoice)
ref_item = pi.doclist.get({"item_code": se_item.item_code})
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.txt b/erpnext/stock/doctype/stock_entry/stock_entry.txt
index a8cf16b..f4a52de 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.txt
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.txt
@@ -1,638 +1,649 @@
-[
- {
- "creation": "2013-04-09 11:43:55",
- "docstatus": 0,
- "modified": "2014-02-26 10:59:19",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 0,
- "allow_copy": 0,
- "allow_import": 1,
- "allow_rename": 0,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "hide_heading": 0,
- "hide_toolbar": 0,
- "icon": "icon-file-text",
- "in_create": 0,
- "in_dialog": 0,
- "is_submittable": 1,
- "issingle": 0,
- "max_attachments": 0,
- "module": "Stock",
- "name": "__common__",
- "read_only": 0,
- "read_only_onload": 0,
- "search_fields": "transfer_date, from_warehouse, to_warehouse, purpose, remarks"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Stock Entry",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Stock Entry",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Stock Entry"
- },
- {
- "doctype": "DocField",
- "fieldname": "col1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_width": "50%",
- "read_only": 0,
- "width": "50%"
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "hidden": 0,
- "in_filter": 0,
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "\nSTE",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "allow_on_submit": 0,
- "default": "Material Issue",
- "doctype": "DocField",
- "fieldname": "purpose",
- "fieldtype": "Select",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Purpose",
- "no_copy": 0,
- "oldfieldname": "purpose",
- "oldfieldtype": "Select",
- "options": "Material Issue\nMaterial Receipt\nMaterial Transfer\nManufacture/Repack\nSubcontract\nSales Return\nPurchase Return",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval:doc.purpose==\"Sales Return\"",
- "doctype": "DocField",
- "fieldname": "delivery_note_no",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 0,
- "label": "Delivery Note No",
- "no_copy": 1,
- "oldfieldname": "delivery_note_no",
- "oldfieldtype": "Link",
- "options": "Delivery Note",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1
- },
- {
- "depends_on": "eval:doc.purpose==\"Sales Return\"",
- "doctype": "DocField",
- "fieldname": "sales_invoice_no",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Sales Invoice No",
- "no_copy": 1,
- "options": "Sales Invoice",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval:doc.purpose==\"Purchase Return\"",
- "doctype": "DocField",
- "fieldname": "purchase_receipt_no",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 0,
- "label": "Purchase Receipt No",
- "no_copy": 1,
- "oldfieldname": "purchase_receipt_no",
- "oldfieldtype": "Link",
- "options": "Purchase Receipt",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col2",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "print_width": "50%",
- "read_only": 0,
- "width": "50%"
- },
- {
- "allow_on_submit": 0,
- "default": "Today",
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Posting Date",
- "no_copy": 1,
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "posting_time",
- "fieldtype": "Time",
- "hidden": 0,
- "in_filter": 0,
- "label": "Posting Time",
- "no_copy": 1,
- "oldfieldname": "posting_time",
- "oldfieldtype": "Time",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "items_section",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "read_only": 0
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "from_warehouse",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Default Source Warehouse",
- "no_copy": 1,
- "oldfieldname": "from_warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "cb0",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "to_warehouse",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Default Target Warehouse",
- "no_copy": 1,
- "oldfieldname": "to_warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sb0",
- "fieldtype": "Section Break",
- "options": "Simple",
- "read_only": 0
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "mtn_details",
- "fieldtype": "Table",
- "hidden": 0,
- "in_filter": 0,
- "label": "MTN Details",
- "no_copy": 0,
- "oldfieldname": "mtn_details",
- "oldfieldtype": "Table",
- "options": "Stock Entry Detail",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "description": "Get valuation rate and available stock at source/target warehouse on mentioned posting date-time. If serialized item, please press this button after entering serial nos.",
- "doctype": "DocField",
- "fieldname": "get_stock_and_rate",
- "fieldtype": "Button",
- "label": "Get Stock and Rate",
- "oldfieldtype": "Button",
- "options": "get_stock_and_rate",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "depends_on": "eval:(doc.purpose!==\"Sales Return\" && doc.purpose!==\"Purchase Return\")",
- "doctype": "DocField",
- "fieldname": "sb1",
- "fieldtype": "Section Break",
- "label": "From Bill of Materials",
- "read_only": 0
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval:inList([\"Material Transfer\", \"Manufacture/Repack\"], doc.purpose)",
- "doctype": "DocField",
- "fieldname": "production_order",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Production Order",
- "no_copy": 0,
- "oldfieldname": "production_order",
- "oldfieldtype": "Link",
- "options": "Production Order",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 1
- },
- {
- "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)",
- "doctype": "DocField",
- "fieldname": "bom_no",
- "fieldtype": "Link",
- "label": "BOM No",
- "options": "BOM",
- "read_only": 0
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)",
- "description": "As per Stock UOM",
- "doctype": "DocField",
- "fieldname": "fg_completed_qty",
- "fieldtype": "Float",
- "hidden": 0,
- "in_filter": 0,
- "label": "Manufacturing Quantity",
- "no_copy": 0,
- "oldfieldname": "fg_completed_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "cb1",
- "fieldtype": "Column Break",
- "read_only": 0
- },
- {
- "default": "1",
- "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)",
- "description": "If checked, BOM for sub-assembly items will be considered for getting raw materials. Otherwise, all sub-assembly items will be treated as a raw material.",
- "doctype": "DocField",
- "fieldname": "use_multi_level_bom",
- "fieldtype": "Check",
- "label": "Use Multi-Level BOM",
- "read_only": 0
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)",
- "doctype": "DocField",
- "fieldname": "get_items",
- "fieldtype": "Button",
- "hidden": 0,
- "in_filter": 0,
- "label": "Get Items",
- "no_copy": 0,
- "oldfieldtype": "Button",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "depends_on": "eval:(doc.purpose==\"Sales Return\" || doc.purpose==\"Purchase Return\")",
- "doctype": "DocField",
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "label": "Contact Info",
- "read_only": 0
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval:doc.purpose==\"Purchase Return\"",
- "doctype": "DocField",
- "fieldname": "supplier",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 0,
- "label": "Supplier",
- "no_copy": 1,
- "oldfieldname": "supplier",
- "oldfieldtype": "Link",
- "options": "Supplier",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval:doc.purpose==\"Purchase Return\"",
- "doctype": "DocField",
- "fieldname": "supplier_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_filter": 0,
- "label": "Supplier Name",
- "no_copy": 1,
- "oldfieldname": "supplier_name",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval:doc.purpose==\"Purchase Return\"",
- "doctype": "DocField",
- "fieldname": "supplier_address",
- "fieldtype": "Small Text",
- "hidden": 0,
- "in_filter": 0,
- "label": "Supplier Address",
- "no_copy": 1,
- "oldfieldname": "supplier_address",
- "oldfieldtype": "Small Text",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval:doc.purpose==\"Sales Return\"",
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 0,
- "label": "Customer",
- "no_copy": 1,
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval:doc.purpose==\"Sales Return\"",
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "hidden": 0,
- "in_filter": 0,
- "label": "Customer Name",
- "no_copy": 1,
- "oldfieldname": "customer_name",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval:doc.purpose==\"Sales Return\"",
- "doctype": "DocField",
- "fieldname": "customer_address",
- "fieldtype": "Small Text",
- "hidden": 0,
- "in_filter": 0,
- "label": "Customer Address",
- "no_copy": 1,
- "oldfieldname": "customer_address",
- "oldfieldtype": "Small Text",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col4",
- "fieldtype": "Column Break",
- "print_width": "50%",
- "read_only": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "total_amount",
- "fieldtype": "Currency",
- "label": "Total Amount",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "project_name",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Project Name",
- "oldfieldname": "project_name",
- "oldfieldtype": "Link",
- "options": "Project",
- "read_only": 0
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "select_print_heading",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 0,
- "label": "Print Heading",
- "no_copy": 0,
- "oldfieldname": "select_print_heading",
- "oldfieldtype": "Link",
- "options": "Print Heading",
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 0,
- "label": "Fiscal Year",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col5",
- "fieldtype": "Column Break",
- "print_width": "50%",
- "read_only": 0,
- "width": "50%"
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "in_filter": 1,
- "label": "Company",
- "no_copy": 0,
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_restrictions": 1,
- "in_filter": 0,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Link",
- "options": "Stock Entry",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "remarks",
- "fieldtype": "Text",
- "hidden": 0,
- "in_filter": 0,
- "label": "Remarks",
- "no_copy": 1,
- "oldfieldname": "remarks",
- "oldfieldtype": "Text",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocPerm",
- "role": "Material User"
- },
- {
- "doctype": "DocPerm",
- "role": "Manufacturing User"
- },
- {
- "doctype": "DocPerm",
- "role": "Manufacturing Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Material Manager"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 0,
+ "allow_copy": 0,
+ "allow_import": 1,
+ "allow_rename": 0,
+ "autoname": "naming_series:",
+ "creation": "2013-04-09 11:43:55.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "col1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "\nSTE",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "default": "Material Issue",
+ "fieldname": "purpose",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Purpose",
+ "no_copy": 0,
+ "oldfieldname": "purpose",
+ "oldfieldtype": "Select",
+ "options": "Material Issue\nMaterial Receipt\nMaterial Transfer\nManufacture/Repack\nSubcontract\nSales Return\nPurchase Return",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:doc.purpose==\"Sales Return\"",
+ "fieldname": "delivery_note_no",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Delivery Note No",
+ "no_copy": 1,
+ "oldfieldname": "delivery_note_no",
+ "oldfieldtype": "Link",
+ "options": "Delivery Note",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "depends_on": "eval:doc.purpose==\"Sales Return\"",
+ "fieldname": "sales_invoice_no",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Sales Invoice No",
+ "no_copy": 1,
+ "options": "Sales Invoice",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:doc.purpose==\"Purchase Return\"",
+ "fieldname": "purchase_receipt_no",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Purchase Receipt No",
+ "no_copy": 1,
+ "oldfieldname": "purchase_receipt_no",
+ "oldfieldtype": "Link",
+ "options": "Purchase Receipt",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "col2",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "allow_on_submit": 0,
+ "default": "Today",
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Posting Date",
+ "no_copy": 1,
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "posting_time",
+ "fieldtype": "Time",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Posting Time",
+ "no_copy": 1,
+ "oldfieldname": "posting_time",
+ "oldfieldtype": "Time",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "items_section",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "from_warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Default Source Warehouse",
+ "no_copy": 1,
+ "oldfieldname": "from_warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "cb0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "to_warehouse",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Default Target Warehouse",
+ "no_copy": 1,
+ "oldfieldname": "to_warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "sb0",
+ "fieldtype": "Section Break",
+ "options": "Simple",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "mtn_details",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "MTN Details",
+ "no_copy": 0,
+ "oldfieldname": "mtn_details",
+ "oldfieldtype": "Table",
+ "options": "Stock Entry Detail",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "description": "Get valuation rate and available stock at source/target warehouse on mentioned posting date-time. If serialized item, please press this button after entering serial nos.",
+ "fieldname": "get_stock_and_rate",
+ "fieldtype": "Button",
+ "label": "Get Stock and Rate",
+ "oldfieldtype": "Button",
+ "options": "get_stock_and_rate",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "depends_on": "eval:(doc.purpose!==\"Sales Return\" && doc.purpose!==\"Purchase Return\")",
+ "fieldname": "sb1",
+ "fieldtype": "Section Break",
+ "label": "From Bill of Materials",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:inList([\"Material Transfer\", \"Manufacture/Repack\"], doc.purpose)",
+ "fieldname": "production_order",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Production Order",
+ "no_copy": 0,
+ "oldfieldname": "production_order",
+ "oldfieldtype": "Link",
+ "options": "Production Order",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)",
+ "fieldname": "bom_no",
+ "fieldtype": "Link",
+ "label": "BOM No",
+ "options": "BOM",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)",
+ "description": "As per Stock UOM",
+ "fieldname": "fg_completed_qty",
+ "fieldtype": "Float",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Manufacturing Quantity",
+ "no_copy": 0,
+ "oldfieldname": "fg_completed_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "cb1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "default": "1",
+ "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)",
+ "description": "If checked, BOM for sub-assembly items will be considered for getting raw materials. Otherwise, all sub-assembly items will be treated as a raw material.",
+ "fieldname": "use_multi_level_bom",
+ "fieldtype": "Check",
+ "label": "Use Multi-Level BOM",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)",
+ "fieldname": "get_items",
+ "fieldtype": "Button",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Get Items",
+ "no_copy": 0,
+ "oldfieldtype": "Button",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "depends_on": "eval:(doc.purpose==\"Sales Return\" || doc.purpose==\"Purchase Return\")",
+ "fieldname": "contact_section",
+ "fieldtype": "Section Break",
+ "label": "Contact Info",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:doc.purpose==\"Purchase Return\"",
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Supplier",
+ "no_copy": 1,
+ "oldfieldname": "supplier",
+ "oldfieldtype": "Link",
+ "options": "Supplier",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:doc.purpose==\"Purchase Return\"",
+ "fieldname": "supplier_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Supplier Name",
+ "no_copy": 1,
+ "oldfieldname": "supplier_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:doc.purpose==\"Purchase Return\"",
+ "fieldname": "supplier_address",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Supplier Address",
+ "no_copy": 1,
+ "oldfieldname": "supplier_address",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:doc.purpose==\"Sales Return\"",
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Customer",
+ "no_copy": 1,
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:doc.purpose==\"Sales Return\"",
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Customer Name",
+ "no_copy": 1,
+ "oldfieldname": "customer_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:doc.purpose==\"Sales Return\"",
+ "fieldname": "customer_address",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Customer Address",
+ "no_copy": 1,
+ "oldfieldname": "customer_address",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "col4",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "total_amount",
+ "fieldtype": "Currency",
+ "label": "Total Amount",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "project_name",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Project Name",
+ "oldfieldname": "project_name",
+ "oldfieldtype": "Link",
+ "options": "Project",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "select_print_heading",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Print Heading",
+ "no_copy": 0,
+ "oldfieldname": "select_print_heading",
+ "oldfieldtype": "Link",
+ "options": "Print Heading",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 0,
+ "label": "Fiscal Year",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "col5",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_width": "50%",
+ "read_only": 0,
+ "width": "50%"
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "label": "Company",
+ "no_copy": 0,
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_restrictions": 1,
+ "in_filter": 0,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Link",
+ "options": "Stock Entry",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "remarks",
+ "fieldtype": "Text",
+ "hidden": 0,
+ "in_filter": 0,
+ "label": "Remarks",
+ "no_copy": 1,
+ "oldfieldname": "remarks",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "icon": "icon-file-text",
+ "idx": 1,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 1,
+ "issingle": 0,
+ "max_attachments": 0,
+ "modified": "2014-02-26 10:59:19.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Stock Entry",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Manufacturing User",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Manufacturing Manager",
+ "submit": 1,
+ "write": 1
+ },
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Manager",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "search_fields": "transfer_date, from_warehouse, to_warehouse, purpose, remarks"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
index d14e896..dc27cc9 100644
--- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py
@@ -335,7 +335,7 @@
si = frappe.bean(si_doclist)
si.doc.posting_date = dn.doc.posting_date
si.doc.debit_to = "_Test Customer - _TC"
- for d in si.doclist.get({"parentfield": "entries"}):
+ for d in si.get("entries"):
d.income_account = "Sales - _TC"
d.cost_center = "_Test Cost Center - _TC"
si.insert()
@@ -433,7 +433,7 @@
si = frappe.bean(si_doclist)
si.doc.posting_date = dn.doc.posting_date
si.doc.debit_to = "_Test Customer - _TC"
- for d in si.doclist.get({"parentfield": "entries"}):
+ for d in si.get("entries"):
d.income_account = "Sales - _TC"
d.cost_center = "_Test Cost Center - _TC"
si.insert()
@@ -479,11 +479,11 @@
pi = frappe.bean(pi_doclist)
pi.doc.posting_date = pr.doc.posting_date
pi.doc.credit_to = "_Test Supplier - _TC"
- for d in pi.doclist.get({"parentfield": "entries"}):
+ for d in pi.get("entries"):
d.expense_account = "_Test Account Cost for Goods Sold - _TC"
d.cost_center = "_Test Cost Center - _TC"
- for d in pi.doclist.get({"parentfield": "other_charges"}):
+ for d in pi.get("other_charges"):
d.cost_center = "_Test Cost Center - _TC"
pi.run_method("calculate_taxes_and_totals")
@@ -582,10 +582,10 @@
pi = frappe.bean(pi_doclist)
pi.doc.posting_date = pr.doc.posting_date
pi.doc.credit_to = "_Test Supplier - _TC"
- for d in pi.doclist.get({"parentfield": "entries"}):
+ for d in pi.get("entries"):
d.expense_account = "_Test Account Cost for Goods Sold - _TC"
d.cost_center = "_Test Cost Center - _TC"
- for d in pi.doclist.get({"parentfield": "other_charges"}):
+ for d in pi.get("other_charges"):
d.cost_center = "_Test Cost Center - _TC"
pi.run_method("calculate_taxes_and_totals")
diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py
index 26c87f1..2570b68 100644
--- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py
+++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class StockEntryDetail(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt
index 3bc1695..0bdc9a8 100644
--- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt
+++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt
@@ -1,321 +1,308 @@
-[
- {
- "creation": "2013-03-29 18:22:12",
- "docstatus": 0,
- "modified": "2014-02-03 12:59:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "MTND/.######",
- "doctype": "DocType",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Stock Entry Detail",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Stock Entry Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "s_warehouse",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Source Warehouse",
- "no_copy": 1,
- "oldfieldname": "s_warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "t_warehouse",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Target Warehouse",
- "no_copy": 1,
- "oldfieldname": "t_warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sec_break1",
- "fieldtype": "Section Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "label": "Item Name",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break2",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Text",
- "print_width": "300px",
- "read_only": 0,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "quantity_and_rate",
- "fieldtype": "Section Break",
- "label": "Quantity and Rate"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Qty",
- "oldfieldname": "qty",
- "oldfieldtype": "Currency",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "uom",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "UOM",
- "oldfieldname": "uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "incoming_rate",
- "fieldtype": "Currency",
- "in_list_view": 1,
- "label": "Valuation Rate",
- "oldfieldname": "incoming_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "in_filter": 0,
- "label": "Stock UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Link",
- "options": "UOM",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "label": "Conversion Factor",
- "oldfieldname": "conversion_factor",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amount",
- "fieldtype": "Currency",
- "label": "Amount",
- "oldfieldname": "amount",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no_batch",
- "fieldtype": "Section Break",
- "label": "Serial No / Batch"
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no",
- "fieldtype": "Text",
- "label": "Serial No",
- "no_copy": 1,
- "oldfieldname": "serial_no",
- "oldfieldtype": "Text",
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break4",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "batch_no",
- "fieldtype": "Link",
- "label": "Batch No",
- "oldfieldname": "batch_no",
- "oldfieldtype": "Link",
- "options": "Batch",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "accounting",
- "fieldtype": "Section Break",
- "label": "Accounting"
- },
- {
- "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
- "doctype": "DocField",
- "fieldname": "expense_account",
- "fieldtype": "Link",
- "label": "Difference Account",
- "options": "Account",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break5",
- "fieldtype": "Column Break"
- },
- {
- "default": ":Company",
- "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Cost Center",
- "options": "Cost Center",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info"
- },
- {
- "doctype": "DocField",
- "fieldname": "actual_qty",
- "fieldtype": "Float",
- "in_filter": 1,
- "label": "Actual Qty (at source/target)",
- "no_copy": 1,
- "oldfieldname": "actual_qty",
- "oldfieldtype": "Read Only",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 0,
- "search_index": 1
- },
- {
- "description": "BOM No. for a Finished Good Item",
- "doctype": "DocField",
- "fieldname": "bom_no",
- "fieldtype": "Link",
- "hidden": 1,
- "label": "BOM No",
- "no_copy": 0,
- "options": "BOM",
- "print_hide": 1,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break6",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "transfer_qty",
- "fieldtype": "Float",
- "label": "Qty as per Stock UOM",
- "oldfieldname": "transfer_qty",
- "oldfieldtype": "Currency",
- "print_hide": 1,
- "read_only": 1,
- "reqd": 1
- },
- {
- "description": "Material Request used to make this Stock Entry",
- "doctype": "DocField",
- "fieldname": "material_request",
- "fieldtype": "Link",
- "hidden": 1,
- "label": "Material Request",
- "no_copy": 1,
- "options": "Material Request",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "material_request_item",
- "fieldtype": "Link",
- "hidden": 1,
- "label": "Material Request Item",
- "no_copy": 1,
- "options": "Material Request Item",
- "print_hide": 1,
- "read_only": 1
- }
-]
\ No newline at end of file
+{
+ "autoname": "MTND/.######",
+ "creation": "2013-03-29 18:22:12.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "s_warehouse",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Source Warehouse",
+ "no_copy": 1,
+ "oldfieldname": "s_warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "t_warehouse",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Target Warehouse",
+ "no_copy": 1,
+ "oldfieldname": "t_warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "sec_break1",
+ "fieldtype": "Section Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "label": "Item Name",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "col_break2",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "read_only": 0,
+ "width": "300px"
+ },
+ {
+ "fieldname": "quantity_and_rate",
+ "fieldtype": "Section Break",
+ "label": "Quantity and Rate",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "qty",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Qty",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "oldfieldname": "uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "incoming_rate",
+ "fieldtype": "Currency",
+ "in_list_view": 1,
+ "label": "Valuation Rate",
+ "oldfieldname": "incoming_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "in_filter": 0,
+ "label": "Stock UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "label": "Conversion Factor",
+ "oldfieldname": "conversion_factor",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "amount",
+ "fieldtype": "Currency",
+ "label": "Amount",
+ "oldfieldname": "amount",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "serial_no_batch",
+ "fieldtype": "Section Break",
+ "label": "Serial No / Batch",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "serial_no",
+ "fieldtype": "Text",
+ "label": "Serial No",
+ "no_copy": 1,
+ "oldfieldname": "serial_no",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "batch_no",
+ "fieldtype": "Link",
+ "label": "Batch No",
+ "oldfieldname": "batch_no",
+ "oldfieldtype": "Link",
+ "options": "Batch",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "accounting",
+ "fieldtype": "Section Break",
+ "label": "Accounting",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
+ "fieldname": "expense_account",
+ "fieldtype": "Link",
+ "label": "Difference Account",
+ "options": "Account",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "col_break5",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "default": ":Company",
+ "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "label": "Cost Center",
+ "options": "Cost Center",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "actual_qty",
+ "fieldtype": "Float",
+ "in_filter": 1,
+ "label": "Actual Qty (at source/target)",
+ "no_copy": 1,
+ "oldfieldname": "actual_qty",
+ "oldfieldtype": "Read Only",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "description": "BOM No. for a Finished Good Item",
+ "fieldname": "bom_no",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "BOM No",
+ "no_copy": 0,
+ "options": "BOM",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0
+ },
+ {
+ "fieldname": "col_break6",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "transfer_qty",
+ "fieldtype": "Float",
+ "label": "Qty as per Stock UOM",
+ "oldfieldname": "transfer_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "description": "Material Request used to make this Stock Entry",
+ "fieldname": "material_request",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "Material Request",
+ "no_copy": 1,
+ "options": "Material Request",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "material_request_item",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "Material Request Item",
+ "no_copy": 1,
+ "options": "Material Request Item",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2014-02-03 12:59:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Stock Entry Detail",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_ledger/stock_ledger.py b/erpnext/stock/doctype/stock_ledger/stock_ledger.py
index 664eadb..966e7ab 100644
--- a/erpnext/stock/doctype/stock_ledger/stock_ledger.py
+++ b/erpnext/stock/doctype/stock_ledger/stock_ledger.py
@@ -5,17 +5,15 @@
import frappe
from frappe.utils import add_days, cstr, flt, nowdate, cint, now
-from frappe.model.doc import Document
from frappe.model.bean import getlist
from frappe.model.code import get_obj
from frappe import session, msgprint
from erpnext.stock.utils import get_valid_serial_nos
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class StockLedger(Document):
def update_stock(self, values, is_amended = 'No'):
for v in values:
diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
index 9bb9911..dfc75d5 100644
--- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
+++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py
@@ -11,10 +11,7 @@
class StockFreezeError(frappe.ValidationError): pass
-class DocType(DocListController):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class StockLedgerEntry(DocListController):
def validate(self):
from erpnext.stock.utils import validate_warehouse_company
diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt
index 641a68c..2f7628f 100644
--- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt
+++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt
@@ -1,303 +1,287 @@
-[
- {
- "creation": "2013-01-29 19:25:42",
- "docstatus": 0,
- "modified": "2013-11-03 14:11:43",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_copy": 1,
- "allow_email": 1,
- "allow_print": 1,
- "autoname": "SLE/.########",
- "doctype": "DocType",
- "document_type": "Other",
- "hide_toolbar": 1,
- "icon": "icon-list",
- "in_create": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Stock Ledger Entry",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Stock Ledger Entry",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "report": 1,
- "submit": 0
- },
- {
- "doctype": "DocType",
- "name": "Stock Ledger Entry"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "search_index": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no",
- "fieldtype": "Text",
- "in_filter": 0,
- "label": "Serial No",
- "print_width": "100px",
- "read_only": 1,
- "search_index": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "batch_no",
- "fieldtype": "Data",
- "label": "Batch No",
- "oldfieldname": "batch_no",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Warehouse",
- "oldfieldname": "warehouse",
- "oldfieldtype": "Link",
- "options": "Warehouse",
- "print_width": "100px",
- "read_only": 1,
- "search_index": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Posting Date",
- "oldfieldname": "posting_date",
- "oldfieldtype": "Date",
- "print_width": "100px",
- "read_only": 1,
- "reqd": 0,
- "search_index": 1,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "posting_time",
- "fieldtype": "Time",
- "in_filter": 0,
- "label": "Posting Time",
- "oldfieldname": "posting_time",
- "oldfieldtype": "Time",
- "print_width": "100px",
- "read_only": 1,
- "search_index": 0,
- "width": "100px"
- },
- {
- "doctype": "DocField",
- "fieldname": "voucher_type",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Voucher Type",
- "oldfieldname": "voucher_type",
- "oldfieldtype": "Data",
- "print_width": "150px",
- "read_only": 1,
- "search_index": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "voucher_no",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Voucher No",
- "oldfieldname": "voucher_no",
- "oldfieldtype": "Data",
- "print_width": "150px",
- "read_only": 1,
- "search_index": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "voucher_detail_no",
- "fieldtype": "Data",
- "label": "Voucher Detail No",
- "oldfieldname": "voucher_detail_no",
- "oldfieldtype": "Data",
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "actual_qty",
- "fieldtype": "Float",
- "in_filter": 1,
- "label": "Actual Quantity",
- "oldfieldname": "actual_qty",
- "oldfieldtype": "Currency",
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "incoming_rate",
- "fieldtype": "Currency",
- "label": "Incoming Rate",
- "oldfieldname": "incoming_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "label": "Stock UOM",
- "oldfieldname": "stock_uom",
- "oldfieldtype": "Data",
- "options": "UOM",
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "qty_after_transaction",
- "fieldtype": "Float",
- "in_filter": 1,
- "label": "Actual Qty After Transaction",
- "oldfieldname": "bin_aqat",
- "oldfieldtype": "Currency",
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "valuation_rate",
- "fieldtype": "Currency",
- "label": "Valuation Rate",
- "oldfieldname": "valuation_rate",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "print_width": "150px",
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_value",
- "fieldtype": "Currency",
- "label": "Stock Value",
- "oldfieldname": "stock_value",
- "oldfieldtype": "Currency",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_value_difference",
- "fieldtype": "Currency",
- "label": "Stock Value Difference",
- "options": "Company:company:default_currency",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_queue",
- "fieldtype": "Text",
- "hidden": 1,
- "in_filter": 0,
- "label": "Stock Queue (FIFO)",
- "oldfieldname": "fcfs_stack",
- "oldfieldtype": "Text",
- "print_hide": 1,
- "read_only": 1,
- "report_hide": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "project",
- "fieldtype": "Link",
- "label": "Project",
- "options": "Project"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Data",
- "options": "link:Company",
- "print_width": "150px",
- "read_only": 1,
- "search_index": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Data",
- "print_width": "150px",
- "read_only": 1,
- "search_index": 0,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "is_cancelled",
- "fieldtype": "Select",
- "hidden": 1,
- "label": "Is Cancelled",
- "options": "\nNo\nYes",
- "report_hide": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "doctype": "DocPerm",
- "role": "Material User",
- "write": 0
- },
- {
- "doctype": "DocPerm",
- "role": "Accounts Manager"
- }
-]
\ No newline at end of file
+{
+ "allow_copy": 1,
+ "allow_email": 1,
+ "allow_print": 1,
+ "autoname": "SLE/.########",
+ "creation": "2013-01-29 19:25:42.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "serial_no",
+ "fieldtype": "Text",
+ "in_filter": 0,
+ "label": "Serial No",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 1,
+ "search_index": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "batch_no",
+ "fieldtype": "Data",
+ "label": "Batch No",
+ "oldfieldname": "batch_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "warehouse",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Warehouse",
+ "oldfieldname": "warehouse",
+ "oldfieldtype": "Link",
+ "options": "Warehouse",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 1,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Posting Date",
+ "oldfieldname": "posting_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 1,
+ "width": "100px"
+ },
+ {
+ "fieldname": "posting_time",
+ "fieldtype": "Time",
+ "in_filter": 0,
+ "label": "Posting Time",
+ "oldfieldname": "posting_time",
+ "oldfieldtype": "Time",
+ "permlevel": 0,
+ "print_width": "100px",
+ "read_only": 1,
+ "search_index": 0,
+ "width": "100px"
+ },
+ {
+ "fieldname": "voucher_type",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Voucher Type",
+ "oldfieldname": "voucher_type",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "voucher_no",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Voucher No",
+ "oldfieldname": "voucher_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "voucher_detail_no",
+ "fieldtype": "Data",
+ "label": "Voucher Detail No",
+ "oldfieldname": "voucher_detail_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "actual_qty",
+ "fieldtype": "Float",
+ "in_filter": 1,
+ "label": "Actual Quantity",
+ "oldfieldname": "actual_qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "incoming_rate",
+ "fieldtype": "Currency",
+ "label": "Incoming Rate",
+ "oldfieldname": "incoming_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "label": "Stock UOM",
+ "oldfieldname": "stock_uom",
+ "oldfieldtype": "Data",
+ "options": "UOM",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "qty_after_transaction",
+ "fieldtype": "Float",
+ "in_filter": 1,
+ "label": "Actual Qty After Transaction",
+ "oldfieldname": "bin_aqat",
+ "oldfieldtype": "Currency",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "valuation_rate",
+ "fieldtype": "Currency",
+ "label": "Valuation Rate",
+ "oldfieldname": "valuation_rate",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "stock_value",
+ "fieldtype": "Currency",
+ "label": "Stock Value",
+ "oldfieldname": "stock_value",
+ "oldfieldtype": "Currency",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "stock_value_difference",
+ "fieldtype": "Currency",
+ "label": "Stock Value Difference",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "stock_queue",
+ "fieldtype": "Text",
+ "hidden": 1,
+ "in_filter": 0,
+ "label": "Stock Queue (FIFO)",
+ "oldfieldname": "fcfs_stack",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "report_hide": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "project",
+ "fieldtype": "Link",
+ "label": "Project",
+ "options": "Project",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Data",
+ "options": "link:Company",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 0,
+ "width": "150px"
+ },
+ {
+ "fieldname": "is_cancelled",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "label": "Is Cancelled",
+ "options": "\nNo\nYes",
+ "permlevel": 0,
+ "report_hide": 1
+ }
+ ],
+ "hide_toolbar": 1,
+ "icon": "icon-list",
+ "idx": 1,
+ "in_create": 1,
+ "modified": "2013-11-03 14:11:43.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Stock Ledger Entry",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "permlevel": 0,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "permlevel": 0,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 0
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
index 7eef0a4..c4195c6 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -10,7 +10,7 @@
from erpnext.stock.stock_ledger import update_entries_after
from erpnext.controllers.stock_controller import StockController
-class DocType(StockController):
+class StockReconciliation(StockController):
def setup(self):
self.head_row = ["Item Code", "Warehouse", "Quantity", "Valuation Rate"]
self.entries = []
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt
index 90f5bc8..772830f 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt
@@ -1,162 +1,143 @@
-[
- {
- "creation": "2013-03-28 10:35:31",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:28",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 0,
- "allow_copy": 1,
- "autoname": "SR/.######",
- "description": "This tool helps you to update or fix the quantity and valuation of stock in the system. It is typically used to synchronise the system values and what actually exists in your warehouses.",
- "doctype": "DocType",
- "icon": "icon-upload-alt",
- "is_submittable": 1,
- "max_attachments": 1,
- "module": "Stock",
- "name": "__common__",
- "read_only_onload": 0,
- "search_fields": "posting_date"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Stock Reconciliation",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Stock Reconciliation",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "report": 1,
- "role": "Material Manager",
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Stock Reconciliation"
- },
- {
- "doctype": "DocField",
- "fieldname": "posting_date",
- "fieldtype": "Date",
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Posting Date",
- "oldfieldname": "reconciliation_date",
- "oldfieldtype": "Date",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "posting_time",
- "fieldtype": "Time",
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Posting Time",
- "oldfieldname": "reconciliation_time",
- "oldfieldtype": "Time",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "options": "Stock Reconciliation",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "label": "Fiscal Year",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "options": "Company",
- "reqd": 1
- },
- {
- "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
- "doctype": "DocField",
- "fieldname": "expense_account",
- "fieldtype": "Link",
- "label": "Difference Account",
- "options": "Account"
- },
- {
- "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
- "doctype": "DocField",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "label": "Cost Center",
- "options": "Cost Center"
- },
- {
- "doctype": "DocField",
- "fieldname": "col1",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "upload_html",
- "fieldtype": "HTML",
- "label": "Upload HTML",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "depends_on": "reconciliation_json",
- "doctype": "DocField",
- "fieldname": "sb2",
- "fieldtype": "Section Break",
- "label": "Reconciliation Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "reconciliation_html",
- "fieldtype": "HTML",
- "hidden": 0,
- "label": "Reconciliation HTML",
- "print_hide": 0,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "reconciliation_json",
- "fieldtype": "Long Text",
- "hidden": 1,
- "label": "Reconciliation JSON",
- "no_copy": 1,
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 0,
+ "allow_copy": 1,
+ "autoname": "SR/.######",
+ "creation": "2013-03-28 10:35:31.000000",
+ "description": "This tool helps you to update or fix the quantity and valuation of stock in the system. It is typically used to synchronise the system values and what actually exists in your warehouses.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "posting_date",
+ "fieldtype": "Date",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Posting Date",
+ "oldfieldname": "reconciliation_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "posting_time",
+ "fieldtype": "Time",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Posting Time",
+ "oldfieldname": "reconciliation_time",
+ "oldfieldtype": "Time",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "options": "Stock Reconciliation",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "label": "Fiscal Year",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
+ "fieldname": "expense_account",
+ "fieldtype": "Link",
+ "label": "Difference Account",
+ "options": "Account",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "label": "Cost Center",
+ "options": "Cost Center",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "col1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "upload_html",
+ "fieldtype": "HTML",
+ "label": "Upload HTML",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "depends_on": "reconciliation_json",
+ "fieldname": "sb2",
+ "fieldtype": "Section Break",
+ "label": "Reconciliation Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reconciliation_html",
+ "fieldtype": "HTML",
+ "hidden": 0,
+ "label": "Reconciliation HTML",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "reconciliation_json",
+ "fieldtype": "Long Text",
+ "hidden": 1,
+ "label": "Reconciliation JSON",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-upload-alt",
+ "idx": 1,
+ "is_submittable": 1,
+ "max_attachments": 1,
+ "modified": "2014-01-20 17:49:28.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Stock Reconciliation",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "permlevel": 0,
+ "read": 1,
+ "report": 1,
+ "role": "Material Manager",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "read_only_onload": 0,
+ "search_fields": "posting_date"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.py b/erpnext/stock/doctype/stock_settings/stock_settings.py
index 7f03bb1..cb266ed 100644
--- a/erpnext/stock/doctype/stock_settings/stock_settings.py
+++ b/erpnext/stock/doctype/stock_settings/stock_settings.py
@@ -7,9 +7,9 @@
import frappe
from frappe import _
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class StockSettings(Document):
def validate(self):
for key in ["item_naming_by", "item_group", "stock_uom",
diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.txt b/erpnext/stock/doctype/stock_settings/stock_settings.txt
index 556420c..2879c4b 100644
--- a/erpnext/stock/doctype/stock_settings/stock_settings.txt
+++ b/erpnext/stock/doctype/stock_settings/stock_settings.txt
@@ -1,137 +1,118 @@
-[
- {
- "creation": "2013-06-24 16:37:54",
- "docstatus": 0,
- "modified": "2014-02-19 19:02:23",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "description": "Settings",
- "doctype": "DocType",
- "icon": "icon-cog",
- "issingle": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Stock Settings",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Stock Settings",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "role": "Material Manager",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Stock Settings"
- },
- {
- "default": "Item Code",
- "doctype": "DocField",
- "fieldname": "item_naming_by",
- "fieldtype": "Select",
- "label": "Item Naming By",
- "options": "Item Code\nNaming Series"
- },
- {
- "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "item_group",
- "fieldtype": "Link",
- "label": "Default Item Group",
- "options": "Item Group"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_uom",
- "fieldtype": "Link",
- "label": "Default Stock UOM",
- "options": "UOM"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_4",
- "fieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "allow_negative_stock",
- "fieldtype": "Check",
- "label": "Allow Negative Stock"
- },
- {
- "doctype": "DocField",
- "fieldname": "valuation_method",
- "fieldtype": "Select",
- "label": "Default Valuation Method",
- "options": "FIFO\nMoving Average"
- },
- {
- "description": "Percentage you are allowed to receive or deliver more against the quantity ordered. For example: If you have ordered 100 units. and your Allowance is 10% then you are allowed to receive 110 units.",
- "doctype": "DocField",
- "fieldname": "tolerance",
- "fieldtype": "Float",
- "label": "Allowance Percent"
- },
- {
- "doctype": "DocField",
- "fieldname": "auto_material_request",
- "fieldtype": "Section Break",
- "label": "Auto Material Request"
- },
- {
- "doctype": "DocField",
- "fieldname": "auto_indent",
- "fieldtype": "Check",
- "label": "Raise Material Request when stock reaches re-order level"
- },
- {
- "doctype": "DocField",
- "fieldname": "reorder_email_notify",
- "fieldtype": "Check",
- "label": "Notify by Email on creation of automatic Material Request"
- },
- {
- "doctype": "DocField",
- "fieldname": "freeze_stock_entries",
- "fieldtype": "Section Break",
- "label": "Freeze Stock Entries"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_frozen_upto",
- "fieldtype": "Date",
- "label": "Stock Frozen Upto"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_frozen_upto_days",
- "fieldtype": "Int",
- "label": "Freeze Stocks Older Than [Days]"
- },
- {
- "doctype": "DocField",
- "fieldname": "stock_auth_role",
- "fieldtype": "Link",
- "label": "Role Allowed to edit frozen stock",
- "options": "Role"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-24 16:37:54.000000",
+ "description": "Settings",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "default": "Item Code",
+ "fieldname": "item_naming_by",
+ "fieldtype": "Select",
+ "label": "Item Naming By",
+ "options": "Item Code\nNaming Series",
+ "permlevel": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Item Group\">Add / Edit</a>",
+ "fieldname": "item_group",
+ "fieldtype": "Link",
+ "label": "Default Item Group",
+ "options": "Item Group",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "stock_uom",
+ "fieldtype": "Link",
+ "label": "Default Stock UOM",
+ "options": "UOM",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break_4",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "allow_negative_stock",
+ "fieldtype": "Check",
+ "label": "Allow Negative Stock",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "valuation_method",
+ "fieldtype": "Select",
+ "label": "Default Valuation Method",
+ "options": "FIFO\nMoving Average",
+ "permlevel": 0
+ },
+ {
+ "description": "Percentage you are allowed to receive or deliver more against the quantity ordered. For example: If you have ordered 100 units. and your Allowance is 10% then you are allowed to receive 110 units.",
+ "fieldname": "tolerance",
+ "fieldtype": "Float",
+ "label": "Allowance Percent",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "auto_material_request",
+ "fieldtype": "Section Break",
+ "label": "Auto Material Request",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "auto_indent",
+ "fieldtype": "Check",
+ "label": "Raise Material Request when stock reaches re-order level",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "reorder_email_notify",
+ "fieldtype": "Check",
+ "label": "Notify by Email on creation of automatic Material Request",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "freeze_stock_entries",
+ "fieldtype": "Section Break",
+ "label": "Freeze Stock Entries",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "stock_frozen_upto",
+ "fieldtype": "Date",
+ "label": "Stock Frozen Upto",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "stock_frozen_upto_days",
+ "fieldtype": "Int",
+ "label": "Freeze Stocks Older Than [Days]",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "stock_auth_role",
+ "fieldtype": "Link",
+ "label": "Role Allowed to edit frozen stock",
+ "options": "Role",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-cog",
+ "idx": 1,
+ "issingle": 1,
+ "modified": "2014-02-19 19:02:23.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Stock Settings",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "role": "Material Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py
index 8ff8938..62c80d2 100644
--- a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py
+++ b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py
@@ -7,7 +7,9 @@
from frappe import msgprint, _
-class DocType:
+from frappe.model.document import Document
+
+class StockUomReplaceUtility(Document):
def __init__(self, d, dl=[]):
self.doc, self.doclist = d,dl
diff --git a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt
index a4f368e..4a0a0ac 100644
--- a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt
+++ b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt
@@ -1,88 +1,76 @@
-[
- {
- "creation": "2013-01-10 16:34:30",
- "docstatus": 0,
- "modified": "2013-12-20 19:21:48",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "icon": "icon-magic",
- "in_create": 0,
- "issingle": 1,
- "module": "Stock",
- "name": "__common__",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Stock UOM Replace Utility",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Stock UOM Replace Utility",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 0,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Stock UOM Replace Utility"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "label": "Item",
- "options": "Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "current_stock_uom",
- "fieldtype": "Link",
- "label": "Current Stock UOM",
- "options": "UOM",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "new_stock_uom",
- "fieldtype": "Link",
- "label": "New Stock UOM",
- "options": "UOM"
- },
- {
- "doctype": "DocField",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "label": "Conversion Factor"
- },
- {
- "doctype": "DocField",
- "fieldname": "update",
- "fieldtype": "Button",
- "label": "Update",
- "options": "update_stock_uom"
- },
- {
- "doctype": "DocPerm",
- "role": "Material Master Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Material Manager"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-10 16:34:30.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "label": "Item",
+ "options": "Item",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "current_stock_uom",
+ "fieldtype": "Link",
+ "label": "Current Stock UOM",
+ "options": "UOM",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "new_stock_uom",
+ "fieldtype": "Link",
+ "label": "New Stock UOM",
+ "options": "UOM",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "label": "Conversion Factor",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "update",
+ "fieldtype": "Button",
+ "label": "Update",
+ "options": "update_stock_uom",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-magic",
+ "idx": 1,
+ "in_create": 0,
+ "issingle": 1,
+ "modified": "2013-12-20 19:21:48.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Stock UOM Replace Utility",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Material Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "create": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "Material Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "read_only": 0
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py
index 26c87f1..00cd847 100644
--- a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py
+++ b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class UomConversionDetail(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt
index 0843921..3c9c022 100644
--- a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt
+++ b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt
@@ -1,46 +1,34 @@
-[
- {
- "creation": "2013-02-22 01:28:04",
- "docstatus": 0,
- "modified": "2013-12-20 19:21:53",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "UCDD/.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "UOM Conversion Detail",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "UOM Conversion Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "uom",
- "fieldtype": "Link",
- "label": "UOM",
- "oldfieldname": "uom",
- "oldfieldtype": "Link",
- "options": "UOM"
- },
- {
- "doctype": "DocField",
- "fieldname": "conversion_factor",
- "fieldtype": "Float",
- "label": "Conversion Factor",
- "oldfieldname": "conversion_factor",
- "oldfieldtype": "Float"
- }
-]
\ No newline at end of file
+{
+ "autoname": "UCDD/.#####",
+ "creation": "2013-02-22 01:28:04.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "UOM",
+ "oldfieldname": "uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "conversion_factor",
+ "fieldtype": "Float",
+ "in_list_view": 1,
+ "label": "Conversion Factor",
+ "oldfieldname": "conversion_factor",
+ "oldfieldtype": "Float",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:21:53.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "UOM Conversion Detail",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py
index 8ec6235..d098cfe 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.py
+++ b/erpnext/stock/doctype/warehouse/warehouse.py
@@ -6,10 +6,9 @@
from frappe.utils import cint, validate_email_add
from frappe import throw, msgprint, _
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class Warehouse(Document):
def autoname(self):
suffix = " - " + frappe.db.get_value("Company", self.doc.company, "abbr")
diff --git a/erpnext/stock/doctype/warehouse/warehouse.txt b/erpnext/stock/doctype/warehouse/warehouse.txt
index 589fa99..52bb7e9 100644
--- a/erpnext/stock/doctype/warehouse/warehouse.txt
+++ b/erpnext/stock/doctype/warehouse/warehouse.txt
@@ -1,218 +1,215 @@
-[
- {
- "creation": "2013-03-07 18:50:32",
- "docstatus": 0,
- "modified": "2014-03-13 16:26:29",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "description": "A logical Warehouse against which stock entries are made.",
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-building",
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Warehouse",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Warehouse",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1
- },
- {
- "doctype": "DocType",
- "name": "Warehouse"
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse_detail",
- "fieldtype": "Section Break",
- "label": "Warehouse Detail",
- "oldfieldtype": "Section Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "warehouse_name",
- "fieldtype": "Data",
- "label": "Warehouse Name",
- "oldfieldname": "warehouse_name",
- "oldfieldtype": "Data",
- "read_only": 0,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "read_only": 0,
- "reqd": 1,
- "search_index": 1
- },
- {
- "depends_on": "eval:sys_defaults.auto_accounting_for_stock",
- "description": "Account for the warehouse (Perpetual Inventory) will be created under this Account.",
- "doctype": "DocField",
- "fieldname": "create_account_under",
- "fieldtype": "Link",
- "label": "Parent Account",
- "options": "Account"
- },
- {
- "doctype": "DocField",
- "fieldname": "disabled",
- "fieldtype": "Check",
- "label": "Disabled"
- },
- {
- "description": "For Reference Only.",
- "doctype": "DocField",
- "fieldname": "warehouse_contact_info",
- "fieldtype": "Section Break",
- "label": "Warehouse Contact Info",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "email_id",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Email Id",
- "oldfieldname": "email_id",
- "oldfieldtype": "Data",
- "print_hide": 0,
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "phone_no",
- "fieldtype": "Data",
- "label": "Phone No",
- "oldfieldname": "phone_no",
- "oldfieldtype": "Int",
- "options": "Phone",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "mobile_no",
- "fieldtype": "Data",
- "label": "Mobile No",
- "oldfieldname": "mobile_no",
- "oldfieldtype": "Int",
- "options": "Phone",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "address_line_1",
- "fieldtype": "Data",
- "label": "Address Line 1",
- "oldfieldname": "address_line_1",
- "oldfieldtype": "Data",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "address_line_2",
- "fieldtype": "Data",
- "label": "Address Line 2",
- "oldfieldname": "address_line_2",
- "oldfieldtype": "Data",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "city",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "City",
- "oldfieldname": "city",
- "oldfieldtype": "Data",
- "read_only": 0,
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "state",
- "fieldtype": "Data",
- "label": "State",
- "oldfieldname": "state",
- "oldfieldtype": "Select",
- "options": "Suggest",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "pin",
- "fieldtype": "Int",
- "label": "PIN",
- "oldfieldname": "pin",
- "oldfieldtype": "Int",
- "read_only": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Material Master Manager",
- "submit": 0,
- "write": 1
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 0,
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Material User",
- "submit": 0,
- "write": 0
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales User"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Purchase User"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Accounts User"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "creation": "2013-03-07 18:50:32.000000",
+ "description": "A logical Warehouse against which stock entries are made.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "warehouse_detail",
+ "fieldtype": "Section Break",
+ "label": "Warehouse Detail",
+ "oldfieldtype": "Section Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "warehouse_name",
+ "fieldtype": "Data",
+ "label": "Warehouse Name",
+ "oldfieldname": "warehouse_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "depends_on": "eval:sys_defaults.auto_accounting_for_stock",
+ "description": "Account for the warehouse (Perpetual Inventory) will be created under this Account.",
+ "fieldname": "create_account_under",
+ "fieldtype": "Link",
+ "label": "Parent Account",
+ "options": "Account",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "disabled",
+ "fieldtype": "Check",
+ "label": "Disabled",
+ "permlevel": 0
+ },
+ {
+ "description": "For Reference Only.",
+ "fieldname": "warehouse_contact_info",
+ "fieldtype": "Section Break",
+ "label": "Warehouse Contact Info",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "email_id",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Email Id",
+ "oldfieldname": "email_id",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "phone_no",
+ "fieldtype": "Data",
+ "label": "Phone No",
+ "oldfieldname": "phone_no",
+ "oldfieldtype": "Int",
+ "options": "Phone",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "mobile_no",
+ "fieldtype": "Data",
+ "label": "Mobile No",
+ "oldfieldname": "mobile_no",
+ "oldfieldtype": "Int",
+ "options": "Phone",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "address_line_1",
+ "fieldtype": "Data",
+ "label": "Address Line 1",
+ "oldfieldname": "address_line_1",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "address_line_2",
+ "fieldtype": "Data",
+ "label": "Address Line 2",
+ "oldfieldname": "address_line_2",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "city",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "City",
+ "oldfieldname": "city",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "state",
+ "fieldtype": "Data",
+ "label": "State",
+ "oldfieldname": "state",
+ "oldfieldtype": "Select",
+ "options": "Suggest",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "pin",
+ "fieldtype": "Int",
+ "label": "PIN",
+ "oldfieldname": "pin",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "read_only": 0
+ }
+ ],
+ "icon": "icon-building",
+ "idx": 1,
+ "modified": "2014-03-13 16:26:29.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Warehouse",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Material User",
+ "submit": 0,
+ "write": 0
+ },
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User"
+ },
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User"
+ },
+ {
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/warehouse_user/warehouse_user.py b/erpnext/stock/doctype/warehouse_user/warehouse_user.py
index 968a25b..59bfefe 100644
--- a/erpnext/stock/doctype/warehouse_user/warehouse_user.py
+++ b/erpnext/stock/doctype/warehouse_user/warehouse_user.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class WarehouseUser(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/stock/doctype/warehouse_user/warehouse_user.txt b/erpnext/stock/doctype/warehouse_user/warehouse_user.txt
index ae22eec..6e797a1 100644
--- a/erpnext/stock/doctype/warehouse_user/warehouse_user.txt
+++ b/erpnext/stock/doctype/warehouse_user/warehouse_user.txt
@@ -1,38 +1,25 @@
-[
- {
- "creation": "2013-02-22 01:28:05",
- "docstatus": 0,
- "modified": "2013-12-20 19:21:54",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "document_type": "Other",
- "istable": 1,
- "module": "Stock",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "fieldname": "user",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "User",
- "name": "__common__",
- "options": "User",
- "parent": "Warehouse User",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0,
- "print_width": "200px",
- "width": "200px"
- },
- {
- "doctype": "DocType",
- "name": "Warehouse User"
- },
- {
- "doctype": "DocField"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 01:28:05.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "fields": [
+ {
+ "fieldname": "user",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "User",
+ "options": "User",
+ "permlevel": 0,
+ "print_width": "200px",
+ "width": "200px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:21:54.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Warehouse User",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 39d494c..3cd49d9 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -138,7 +138,7 @@
if args.transaction_type == "selling" else item.buying_cost_center,
"batch_no": None,
"item_tax_rate": json.dumps(dict(([d.tax_type, d.tax_rate] for d in
- item_bean.doclist.get({"parentfield": "item_tax"})))),
+ item_bean.get("item_tax")))),
"uom": item.stock_uom,
"min_order_qty": flt(item.min_order_qty) if args.doctype == "Material Request" else "",
"conversion_factor": 1.0,
@@ -158,7 +158,7 @@
return out
def get_price_list_rate(args, item_bean, out):
- meta = frappe.get_doctype(args.doctype)
+ meta = frappe.get_meta(args.doctype)
if meta.get_field("currency"):
validate_price_list(args)
diff --git a/erpnext/stock/page/stock_ageing/stock_ageing.txt b/erpnext/stock/page/stock_ageing/stock_ageing.txt
index cd1cfbd..34c259e 100644
--- a/erpnext/stock/page/stock_ageing/stock_ageing.txt
+++ b/erpnext/stock/page/stock_ageing/stock_ageing.txt
@@ -1,37 +1,23 @@
-[
- {
- "creation": "2012-09-21 20:15:14",
- "docstatus": 0,
- "modified": "2013-07-11 14:44:08",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-table",
- "module": "Stock",
- "name": "__common__",
- "page_name": "stock-ageing",
- "standard": "Yes",
- "title": "Stock Ageing"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "stock-ageing",
- "parentfield": "roles",
- "parenttype": "Page"
- },
- {
- "doctype": "Page",
- "name": "stock-ageing"
- },
- {
- "doctype": "Page Role",
- "role": "Analytics"
- },
- {
- "doctype": "Page Role",
- "role": "Material Manager"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-09-21 20:15:14.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-table",
+ "idx": 1,
+ "modified": "2013-07-11 14:44:08.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "stock-ageing",
+ "owner": "Administrator",
+ "page_name": "stock-ageing",
+ "roles": [
+ {
+ "role": "Analytics"
+ },
+ {
+ "role": "Material Manager"
+ }
+ ],
+ "standard": "Yes",
+ "title": "Stock Ageing"
+}
\ No newline at end of file
diff --git a/erpnext/stock/page/stock_analytics/stock_analytics.txt b/erpnext/stock/page/stock_analytics/stock_analytics.txt
index 140b102..3b8380a 100644
--- a/erpnext/stock/page/stock_analytics/stock_analytics.txt
+++ b/erpnext/stock/page/stock_analytics/stock_analytics.txt
@@ -1,37 +1,23 @@
-[
- {
- "creation": "2012-09-21 20:15:14",
- "docstatus": 0,
- "modified": "2013-07-11 14:44:10",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-bar-chart",
- "module": "Stock",
- "name": "__common__",
- "page_name": "stock-analytics",
- "standard": "Yes",
- "title": "Stock Analytics"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "stock-analytics",
- "parentfield": "roles",
- "parenttype": "Page"
- },
- {
- "doctype": "Page",
- "name": "stock-analytics"
- },
- {
- "doctype": "Page Role",
- "role": "Analytics"
- },
- {
- "doctype": "Page Role",
- "role": "Material Manager"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-09-21 20:15:14.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-bar-chart",
+ "idx": 1,
+ "modified": "2013-07-11 14:44:10.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "stock-analytics",
+ "owner": "Administrator",
+ "page_name": "stock-analytics",
+ "roles": [
+ {
+ "role": "Analytics"
+ },
+ {
+ "role": "Material Manager"
+ }
+ ],
+ "standard": "Yes",
+ "title": "Stock Analytics"
+}
\ No newline at end of file
diff --git a/erpnext/stock/page/stock_balance/stock_balance.txt b/erpnext/stock/page/stock_balance/stock_balance.txt
index 536448c..6f25be4 100644
--- a/erpnext/stock/page/stock_balance/stock_balance.txt
+++ b/erpnext/stock/page/stock_balance/stock_balance.txt
@@ -1,37 +1,23 @@
-[
- {
- "creation": "2012-12-27 18:57:47",
- "docstatus": 0,
- "modified": "2013-07-11 14:44:15",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-table",
- "module": "Stock",
- "name": "__common__",
- "page_name": "stock-balance",
- "standard": "Yes",
- "title": "Stock Balance"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "stock-balance",
- "parentfield": "roles",
- "parenttype": "Page"
- },
- {
- "doctype": "Page",
- "name": "stock-balance"
- },
- {
- "doctype": "Page Role",
- "role": "Material Manager"
- },
- {
- "doctype": "Page Role",
- "role": "Analytics"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-12-27 18:57:47.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-table",
+ "idx": 1,
+ "modified": "2013-07-11 14:44:15.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "stock-balance",
+ "owner": "Administrator",
+ "page_name": "stock-balance",
+ "roles": [
+ {
+ "role": "Material Manager"
+ },
+ {
+ "role": "Analytics"
+ }
+ ],
+ "standard": "Yes",
+ "title": "Stock Balance"
+}
\ No newline at end of file
diff --git a/erpnext/stock/page/stock_ledger/stock_ledger.txt b/erpnext/stock/page/stock_ledger/stock_ledger.txt
index 9c2a4b7..e2bd8f7 100644
--- a/erpnext/stock/page/stock_ledger/stock_ledger.txt
+++ b/erpnext/stock/page/stock_ledger/stock_ledger.txt
@@ -1,41 +1,26 @@
-[
- {
- "creation": "2012-09-21 20:15:14",
- "docstatus": 0,
- "modified": "2013-07-11 14:44:19",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-table",
- "module": "Stock",
- "name": "__common__",
- "page_name": "stock-ledger",
- "standard": "Yes",
- "title": "Stock Ledger"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "stock-ledger",
- "parentfield": "roles",
- "parenttype": "Page"
- },
- {
- "doctype": "Page",
- "name": "stock-ledger"
- },
- {
- "doctype": "Page Role",
- "role": "Analytics"
- },
- {
- "doctype": "Page Role",
- "role": "Material Manager"
- },
- {
- "doctype": "Page Role",
- "role": "Material User"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-09-21 20:15:14.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-table",
+ "idx": 1,
+ "modified": "2013-07-11 14:44:19.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "stock-ledger",
+ "owner": "Administrator",
+ "page_name": "stock-ledger",
+ "roles": [
+ {
+ "role": "Analytics"
+ },
+ {
+ "role": "Material Manager"
+ },
+ {
+ "role": "Material User"
+ }
+ ],
+ "standard": "Yes",
+ "title": "Stock Ledger"
+}
\ No newline at end of file
diff --git a/erpnext/stock/page/stock_level/stock_level.txt b/erpnext/stock/page/stock_level/stock_level.txt
index bae3d9c..c6f3f96 100644
--- a/erpnext/stock/page/stock_level/stock_level.txt
+++ b/erpnext/stock/page/stock_level/stock_level.txt
@@ -1,37 +1,23 @@
-[
- {
- "creation": "2012-12-31 10:52:14",
- "docstatus": 0,
- "modified": "2013-07-11 14:44:21",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-table",
- "module": "Stock",
- "name": "__common__",
- "page_name": "stock-level",
- "standard": "Yes",
- "title": "Stock Level"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "stock-level",
- "parentfield": "roles",
- "parenttype": "Page"
- },
- {
- "doctype": "Page",
- "name": "stock-level"
- },
- {
- "doctype": "Page Role",
- "role": "Material Manager"
- },
- {
- "doctype": "Page Role",
- "role": "Analytics"
- }
-]
\ No newline at end of file
+{
+ "creation": "2012-12-31 10:52:14.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-table",
+ "idx": 1,
+ "modified": "2013-07-11 14:44:21.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "stock-level",
+ "owner": "Administrator",
+ "page_name": "stock-level",
+ "roles": [
+ {
+ "role": "Material Manager"
+ },
+ {
+ "role": "Analytics"
+ }
+ ],
+ "standard": "Yes",
+ "title": "Stock Level"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt
index 6a70042..e79ca82 100644
--- a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt
+++ b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-04 11:03:47",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Stock Ledger Entry",
- "report_name": "Batch-Wise Balance History",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Batch-Wise Balance History"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-04 11:03:47.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Batch-Wise Balance History",
+ "owner": "Administrator",
+ "ref_doctype": "Stock Ledger Entry",
+ "report_name": "Batch-Wise Balance History",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt
index 2d7c953..ccedc4b 100644
--- a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt
+++ b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-13 18:42:11",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Delivery Note",
- "report_name": "Delivery Note Trends",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Delivery Note Trends"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-13 18:42:11.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Delivery Note Trends",
+ "owner": "Administrator",
+ "ref_doctype": "Delivery Note",
+ "report_name": "Delivery Note Trends",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/item_prices/item_prices.txt b/erpnext/stock/report/item_prices/item_prices.txt
index e5e9634..cf0dde2 100644
--- a/erpnext/stock/report/item_prices/item_prices.txt
+++ b/erpnext/stock/report/item_prices/item_prices.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-05 11:43:30",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Stock Ledger Entry",
- "report_name": "Item Prices",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Item Prices"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-05 11:43:30.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item Prices",
+ "owner": "Administrator",
+ "ref_doctype": "Stock Ledger Entry",
+ "report_name": "Item Prices",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/item_shortage_report/item_shortage_report.txt b/erpnext/stock/report/item_shortage_report/item_shortage_report.txt
index 615c373..4af235a 100644
--- a/erpnext/stock/report/item_shortage_report/item_shortage_report.txt
+++ b/erpnext/stock/report/item_shortage_report/item_shortage_report.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-08-20 13:43:30",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "json": "{\"filters\":[[\"Bin\",\"projected_qty\",\"<\",\"0\"]],\"columns\":[[\"warehouse\",\"Bin\"],[\"item_code\",\"Bin\"],[\"actual_qty\",\"Bin\"],[\"ordered_qty\",\"Bin\"],[\"planned_qty\",\"Bin\"],[\"reserved_qty\",\"Bin\"],[\"projected_qty\",\"Bin\"]],\"sort_by\":\"Bin.projected_qty\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Bin",
- "report_name": "Item Shortage Report",
- "report_type": "Report Builder"
- },
- {
- "doctype": "Report",
- "name": "Item Shortage Report"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-08-20 13:43:30.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "json": "{\"filters\":[[\"Bin\",\"projected_qty\",\"<\",\"0\"]],\"columns\":[[\"warehouse\",\"Bin\"],[\"item_code\",\"Bin\"],[\"actual_qty\",\"Bin\"],[\"ordered_qty\",\"Bin\"],[\"planned_qty\",\"Bin\"],[\"reserved_qty\",\"Bin\"],[\"projected_qty\",\"Bin\"]],\"sort_by\":\"Bin.projected_qty\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item Shortage Report",
+ "owner": "Administrator",
+ "ref_doctype": "Bin",
+ "report_name": "Item Shortage Report",
+ "report_type": "Report Builder"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt b/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt
index 14b0872..6d4b7f7 100644
--- a/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt
+++ b/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-09-25 10:21:15",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "json": "{\"filters\":[[\"Item Price\",\"price_list\",\"like\",\"%\"],[\"Item Price\",\"item_code\",\"like\",\"%\"]],\"columns\":[[\"name\",\"Item Price\"],[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"ref_rate\",\"Item Price\"],[\"buying\",\"Item Price\"],[\"selling\",\"Item Price\"],[\"currency\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Price List",
- "report_name": "Item-wise Price List Rate",
- "report_type": "Report Builder"
- },
- {
- "doctype": "Report",
- "name": "Item-wise Price List Rate"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-09-25 10:21:15.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "json": "{\"filters\":[[\"Item Price\",\"price_list\",\"like\",\"%\"],[\"Item Price\",\"item_code\",\"like\",\"%\"]],\"columns\":[[\"name\",\"Item Price\"],[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"ref_rate\",\"Item Price\"],[\"buying\",\"Item Price\"],[\"selling\",\"Item Price\"],[\"currency\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Item-wise Price List Rate",
+ "owner": "Administrator",
+ "ref_doctype": "Price List",
+ "report_name": "Item-wise Price List Rate",
+ "report_type": "Report Builder"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt b/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt
index 97f45ce..a975110 100644
--- a/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt
+++ b/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-08-20 15:08:10",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "query": "SELECT\n tabBin.item_code as \"Item:Link/Item:120\",\n tabBin.warehouse as \"Warehouse:Link/Warehouse:120\",\n tabBin.actual_qty as \"Actual:Float:90\",\n tabBin.indented_qty as \"Requested:Float:90\",\n tabBin.reserved_qty as \"Reserved:Float:90\",\n tabBin.ordered_qty as \"Ordered:Float:90\",\n tabBin.projected_qty as \"Projected:Float:90\"\nFROM\n tabBin, tabItem\nWHERE\n tabBin.item_code = tabItem.name\n AND tabItem.is_purchase_item = \"Yes\"\n AND tabBin.projected_qty < 0\nORDER BY\n tabBin.projected_qty ASC",
- "ref_doctype": "Item",
- "report_name": "Items To Be Requested",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Items To Be Requested"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-08-20 15:08:10.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Items To Be Requested",
+ "owner": "Administrator",
+ "query": "SELECT\n tabBin.item_code as \"Item:Link/Item:120\",\n tabBin.warehouse as \"Warehouse:Link/Warehouse:120\",\n tabBin.actual_qty as \"Actual:Float:90\",\n tabBin.indented_qty as \"Requested:Float:90\",\n tabBin.reserved_qty as \"Reserved:Float:90\",\n tabBin.ordered_qty as \"Ordered:Float:90\",\n tabBin.projected_qty as \"Projected:Float:90\"\nFROM\n tabBin, tabItem\nWHERE\n tabBin.item_code = tabItem.name\n AND tabItem.is_purchase_item = \"Yes\"\n AND tabBin.projected_qty < 0\nORDER BY\n tabBin.projected_qty ASC",
+ "ref_doctype": "Item",
+ "report_name": "Items To Be Requested",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt
index 5f6cad9..36cbcaa 100644
--- a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt
+++ b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-07 12:47:22",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Item",
- "report_name": "Itemwise Recommended Reorder Level",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Itemwise Recommended Reorder Level"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-07 12:47:22.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Itemwise Recommended Reorder Level",
+ "owner": "Administrator",
+ "ref_doctype": "Item",
+ "report_name": "Itemwise Recommended Reorder Level",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt b/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt
index 05f7afb..c79c0bc 100644
--- a/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt
+++ b/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-08-09 12:20:58",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "query": "select \n mr.name as \"Material Request:Link/Material Request:120\",\n mr.transaction_date as \"Date:Date:100\",\n\tmr_item.item_code as \"Item Code:Link/Item:120\",\n\tmr_item.qty as \"Qty:Float:100\",\n\tmr_item.item_name as \"Item Name::150\",\n\tmr_item.description as \"Description::200\"\nfrom\n\t`tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n\tmr_item.parent = mr.name\n\tand mr.material_request_type = \"Purchase\"\n\tand mr.docstatus = 1\n\tand mr.status != \"Stopped\"\n\tand not exists(select name from `tabSupplier Quotation Item` where prevdoc_docname=mr.name)\norder by mr.transaction_date asc",
- "ref_doctype": "Material Request",
- "report_name": "Material Requests for which Supplier Quotations are not created",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Material Requests for which Supplier Quotations are not created"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-08-09 12:20:58.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Material Requests for which Supplier Quotations are not created",
+ "owner": "Administrator",
+ "query": "select \n mr.name as \"Material Request:Link/Material Request:120\",\n mr.transaction_date as \"Date:Date:100\",\n\tmr_item.item_code as \"Item Code:Link/Item:120\",\n\tmr_item.qty as \"Qty:Float:100\",\n\tmr_item.item_name as \"Item Name::150\",\n\tmr_item.description as \"Description::200\"\nfrom\n\t`tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n\tmr_item.parent = mr.name\n\tand mr.material_request_type = \"Purchase\"\n\tand mr.docstatus = 1\n\tand mr.status != \"Stopped\"\n\tand not exists(select name from `tabSupplier Quotation Item` where prevdoc_docname=mr.name)\norder by mr.transaction_date asc",
+ "ref_doctype": "Material Request",
+ "report_name": "Material Requests for which Supplier Quotations are not created",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt
index a0a34b9..d37cdab 100644
--- a/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt
+++ b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-02-22 18:01:55",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project_name` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.qty as \"Qty:Float:140\",\n `tabSales Order Item`.delivered_qty as \"Delivered Qty:Float:140\",\n (`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0)) as \"Qty to Deliver:Float:140\",\n `tabSales Order Item`.base_amount as \"Amount:Float:140\",\n `tabSales Order`.`delivery_date` as \"Expected Delivery Date:Date:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\",\n `tabSales Order Item`.item_group as \"Item Group:Link/Item Group:120\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status != \"Stopped\"\n and ifnull(`tabSales Order Item`.delivered_qty,0) < ifnull(`tabSales Order Item`.qty,0)\norder by `tabSales Order`.transaction_date asc",
- "ref_doctype": "Delivery Note",
- "report_name": "Ordered Items To Be Delivered",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Ordered Items To Be Delivered"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-02-22 18:01:55.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Ordered Items To Be Delivered",
+ "owner": "Administrator",
+ "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project_name` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.qty as \"Qty:Float:140\",\n `tabSales Order Item`.delivered_qty as \"Delivered Qty:Float:140\",\n (`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0)) as \"Qty to Deliver:Float:140\",\n `tabSales Order Item`.base_amount as \"Amount:Float:140\",\n `tabSales Order`.`delivery_date` as \"Expected Delivery Date:Date:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\",\n `tabSales Order Item`.item_group as \"Item Group:Link/Item Group:120\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status != \"Stopped\"\n and ifnull(`tabSales Order Item`.delivered_qty,0) < ifnull(`tabSales Order Item`.qty,0)\norder by `tabSales Order`.transaction_date asc",
+ "ref_doctype": "Delivery Note",
+ "report_name": "Ordered Items To Be Delivered",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt b/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt
index d0e17e0..f805385 100644
--- a/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt
+++ b/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-05-06 12:09:05",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "query": "SELECT\n pi.name as \"Purchase Invoice:Link/Purchase Invoice:120\",\n\tpi.posting_date as \"Posting Date:Date:100\",\n\tpi.credit_to as \"Supplier Account:Link/Account:120\",\n\tpi_item.item_code as \"Item Code:Link/Item:120\",\n\tpi_item.description as \"Description:Data:140\",\n\tpi_item.qty as \"Qty:Float:120\",\n\tpi_item.base_amount as \"Amount:Currency:120\",\n\tpi_item.purchase_order as \"Purchase Order:Link/Purchase Order:120\",\n\tpi_item.purchase_receipt as \"Purchase Receipt:Link/Purchase Receipt:120\",\n\tpr.posting_date as \"PR Posting Date:Date:130\",\n\tpi.company as \"Company:Link/Company:120\"\nFROM\n\t`tabPurchase Invoice` pi, `tabPurchase Invoice Item` pi_item, `tabPurchase Receipt` pr\nWHERE\n\tpi.name = pi_item.parent and pi_item.purchase_receipt = pr.name\n\tand pi.docstatus = 1 and pr.posting_date > pi.posting_date\nORDER BY\n\tpi.name desc",
- "ref_doctype": "Purchase Receipt",
- "report_name": "Purchase In Transit",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Purchase In Transit"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-05-06 12:09:05.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Purchase In Transit",
+ "owner": "Administrator",
+ "query": "SELECT\n pi.name as \"Purchase Invoice:Link/Purchase Invoice:120\",\n\tpi.posting_date as \"Posting Date:Date:100\",\n\tpi.credit_to as \"Supplier Account:Link/Account:120\",\n\tpi_item.item_code as \"Item Code:Link/Item:120\",\n\tpi_item.description as \"Description:Data:140\",\n\tpi_item.qty as \"Qty:Float:120\",\n\tpi_item.base_amount as \"Amount:Currency:120\",\n\tpi_item.purchase_order as \"Purchase Order:Link/Purchase Order:120\",\n\tpi_item.purchase_receipt as \"Purchase Receipt:Link/Purchase Receipt:120\",\n\tpr.posting_date as \"PR Posting Date:Date:130\",\n\tpi.company as \"Company:Link/Company:120\"\nFROM\n\t`tabPurchase Invoice` pi, `tabPurchase Invoice Item` pi_item, `tabPurchase Receipt` pr\nWHERE\n\tpi.name = pi_item.parent and pi_item.purchase_receipt = pr.name\n\tand pi.docstatus = 1 and pr.posting_date > pi.posting_date\nORDER BY\n\tpi.name desc",
+ "ref_doctype": "Purchase Receipt",
+ "report_name": "Purchase In Transit",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt b/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt
index 41aa05e..3fb562f 100644
--- a/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt
+++ b/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt
@@ -1,24 +1,17 @@
-[
- {
- "creation": "2013-02-22 18:01:55",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "query": "select \n `tabPurchase Order`.`name` as \"Purchase Order:Link/Purchase Order:120\",\n\t`tabPurchase Order`.`transaction_date` as \"Date:Date:100\",\n\t`tabPurchase Order`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Order Item`.`project_name` as \"Project\",\n\t`tabPurchase Order Item`.item_code as \"Item Code:Link/Item:120\",\n\t`tabPurchase Order Item`.qty as \"Qty:Float:100\",\n\t`tabPurchase Order Item`.received_qty as \"Received Qty:Float:100\", \n\t(`tabPurchase Order Item`.qty - ifnull(`tabPurchase Order Item`.received_qty, 0)) as \"Qty to Receive:Float:100\",\n `tabPurchase Order Item`.warehouse as \"Warehouse:Link/Warehouse:150\",\n\t`tabPurchase Order Item`.item_name as \"Item Name::150\",\n\t`tabPurchase Order Item`.description as \"Description::200\",\n `tabPurchase Order Item`.brand as \"Brand::100\"\nfrom\n\t`tabPurchase Order`, `tabPurchase Order Item`\nwhere\n\t`tabPurchase Order Item`.`parent` = `tabPurchase Order`.`name`\n\tand `tabPurchase Order`.docstatus = 1\n\tand `tabPurchase Order`.status != \"Stopped\"\n\tand ifnull(`tabPurchase Order Item`.received_qty, 0) < ifnull(`tabPurchase Order Item`.qty, 0)\norder by `tabPurchase Order`.transaction_date asc",
- "ref_doctype": "Purchase Receipt",
- "report_name": "Purchase Order Items To Be Received",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Purchase Order Items To Be Received"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-02-22 18:01:55.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Purchase Order Items To Be Received",
+ "owner": "Administrator",
+ "query": "select \n `tabPurchase Order`.`name` as \"Purchase Order:Link/Purchase Order:120\",\n\t`tabPurchase Order`.`transaction_date` as \"Date:Date:100\",\n\t`tabPurchase Order`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Order Item`.`project_name` as \"Project\",\n\t`tabPurchase Order Item`.item_code as \"Item Code:Link/Item:120\",\n\t`tabPurchase Order Item`.qty as \"Qty:Float:100\",\n\t`tabPurchase Order Item`.received_qty as \"Received Qty:Float:100\", \n\t(`tabPurchase Order Item`.qty - ifnull(`tabPurchase Order Item`.received_qty, 0)) as \"Qty to Receive:Float:100\",\n `tabPurchase Order Item`.warehouse as \"Warehouse:Link/Warehouse:150\",\n\t`tabPurchase Order Item`.item_name as \"Item Name::150\",\n\t`tabPurchase Order Item`.description as \"Description::200\",\n `tabPurchase Order Item`.brand as \"Brand::100\"\nfrom\n\t`tabPurchase Order`, `tabPurchase Order Item`\nwhere\n\t`tabPurchase Order Item`.`parent` = `tabPurchase Order`.`name`\n\tand `tabPurchase Order`.docstatus = 1\n\tand `tabPurchase Order`.status != \"Stopped\"\n\tand ifnull(`tabPurchase Order Item`.received_qty, 0) < ifnull(`tabPurchase Order Item`.qty, 0)\norder by `tabPurchase Order`.transaction_date asc",
+ "ref_doctype": "Purchase Receipt",
+ "report_name": "Purchase Order Items To Be Received",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt
index 11e0592..cd564ef 100644
--- a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt
+++ b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-13 18:45:44",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Purchase Receipt",
- "report_name": "Purchase Receipt Trends",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Purchase Receipt Trends"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-13 18:45:44.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Purchase Receipt Trends",
+ "owner": "Administrator",
+ "ref_doctype": "Purchase Receipt",
+ "report_name": "Purchase Receipt Trends",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt b/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt
index c86de91..1f31d20 100644
--- a/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt
+++ b/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt
@@ -1,24 +1,17 @@
-[
- {
- "creation": "2013-05-13 16:23:05",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "query": "select \n mr.name as \"Material Request:Link/Material Request:120\",\n\tmr.transaction_date as \"Date:Date:100\",\n\tmr_item.item_code as \"Item Code:Link/Item:120\",\n\tmr_item.qty as \"Qty:Float:100\",\n\tmr_item.ordered_qty as \"Transferred Qty:Float:100\", \n\t(mr_item.qty - ifnull(mr_item.ordered_qty, 0)) as \"Qty to Transfer:Float:100\",\n\tmr_item.item_name as \"Item Name::150\",\n\tmr_item.description as \"Description::200\"\nfrom\n\t`tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n\tmr_item.parent = mr.name\n\tand mr.material_request_type = \"Transfer\"\n\tand mr.docstatus = 1\n\tand mr.status != \"Stopped\"\n\tand ifnull(mr_item.ordered_qty, 0) < ifnull(mr_item.qty, 0)\norder by mr.transaction_date asc",
- "ref_doctype": "Stock Entry",
- "report_name": "Requested Items To Be Transferred",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Requested Items To Be Transferred"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-05-13 16:23:05.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Requested Items To Be Transferred",
+ "owner": "Administrator",
+ "query": "select \n mr.name as \"Material Request:Link/Material Request:120\",\n\tmr.transaction_date as \"Date:Date:100\",\n\tmr_item.item_code as \"Item Code:Link/Item:120\",\n\tmr_item.qty as \"Qty:Float:100\",\n\tmr_item.ordered_qty as \"Transferred Qty:Float:100\", \n\t(mr_item.qty - ifnull(mr_item.ordered_qty, 0)) as \"Qty to Transfer:Float:100\",\n\tmr_item.item_name as \"Item Name::150\",\n\tmr_item.description as \"Description::200\"\nfrom\n\t`tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n\tmr_item.parent = mr.name\n\tand mr.material_request_type = \"Transfer\"\n\tand mr.docstatus = 1\n\tand mr.status != \"Stopped\"\n\tand ifnull(mr_item.ordered_qty, 0) < ifnull(mr_item.qty, 0)\norder by mr.transaction_date asc",
+ "ref_doctype": "Stock Entry",
+ "report_name": "Requested Items To Be Transferred",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt b/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt
index b37b601..e47627a 100644
--- a/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt
+++ b/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-01-14 10:52:58",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "json": "{\"filters\":[[\"Serial No\",\"status\",\"=\",\"Delivered\"]],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"amc_expiry_date\",\"Serial No\"],[\"maintenance_status\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"]],\"sort_by\":\"Serial No.amc_expiry_date\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Serial No",
- "report_name": "Serial No Service Contract Expiry",
- "report_type": "Report Builder"
- },
- {
- "doctype": "Report",
- "name": "Serial No Service Contract Expiry"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-14 10:52:58.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "json": "{\"filters\":[[\"Serial No\",\"status\",\"=\",\"Delivered\"]],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"amc_expiry_date\",\"Serial No\"],[\"maintenance_status\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"]],\"sort_by\":\"Serial No.amc_expiry_date\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Serial No Service Contract Expiry",
+ "owner": "Administrator",
+ "ref_doctype": "Serial No",
+ "report_name": "Serial No Service Contract Expiry",
+ "report_type": "Report Builder"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/serial_no_status/serial_no_status.txt b/erpnext/stock/report/serial_no_status/serial_no_status.txt
index 68e4c2e..047259c 100644
--- a/erpnext/stock/report/serial_no_status/serial_no_status.txt
+++ b/erpnext/stock/report/serial_no_status/serial_no_status.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-01-14 10:52:58",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "json": "{\"filters\":[],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"warehouse\",\"Serial No\"],[\"status\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"],[\"purchase_document_no\",\"Serial No\"],[\"purchase_date\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"purchase_rate\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"delivery_date\",\"Serial No\"],[\"supplier\",\"Serial No\"],[\"supplier_name\",\"Serial No\"]],\"sort_by\":\"Serial No.name\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Serial No",
- "report_name": "Serial No Status",
- "report_type": "Report Builder"
- },
- {
- "doctype": "Report",
- "name": "Serial No Status"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-14 10:52:58.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "json": "{\"filters\":[],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"warehouse\",\"Serial No\"],[\"status\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"],[\"purchase_document_no\",\"Serial No\"],[\"purchase_date\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"purchase_rate\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"delivery_date\",\"Serial No\"],[\"supplier\",\"Serial No\"],[\"supplier_name\",\"Serial No\"]],\"sort_by\":\"Serial No.name\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Serial No Status",
+ "owner": "Administrator",
+ "ref_doctype": "Serial No",
+ "report_name": "Serial No Status",
+ "report_type": "Report Builder"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt b/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt
index 6471a58..0e48a3c 100644
--- a/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt
+++ b/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-01-14 10:52:58",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "json": "{\"filters\":[[\"Serial No\",\"status\",\"=\",\"Delivered\"]],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"warranty_expiry_date\",\"Serial No\"],[\"warranty_period\",\"Serial No\"],[\"maintenance_status\",\"Serial No\"],[\"purchase_document_no\",\"Serial No\"],[\"purchase_date\",\"Serial No\"],[\"supplier\",\"Serial No\"],[\"supplier_name\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"delivery_date\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"]],\"sort_by\":\"Serial No.warranty_expiry_date\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"asc\"}",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Serial No",
- "report_name": "Serial No Warranty Expiry",
- "report_type": "Report Builder"
- },
- {
- "doctype": "Report",
- "name": "Serial No Warranty Expiry"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-14 10:52:58.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "json": "{\"filters\":[[\"Serial No\",\"status\",\"=\",\"Delivered\"]],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"warranty_expiry_date\",\"Serial No\"],[\"warranty_period\",\"Serial No\"],[\"maintenance_status\",\"Serial No\"],[\"purchase_document_no\",\"Serial No\"],[\"purchase_date\",\"Serial No\"],[\"supplier\",\"Serial No\"],[\"supplier_name\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"delivery_date\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"]],\"sort_by\":\"Serial No.warranty_expiry_date\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"asc\"}",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Serial No Warranty Expiry",
+ "owner": "Administrator",
+ "ref_doctype": "Serial No",
+ "report_name": "Serial No Warranty Expiry",
+ "report_type": "Report Builder"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/stock_ageing/stock_ageing.txt b/erpnext/stock/report/stock_ageing/stock_ageing.txt
index 18a7ec8..af8b9c3 100644
--- a/erpnext/stock/report/stock_ageing/stock_ageing.txt
+++ b/erpnext/stock/report/stock_ageing/stock_ageing.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-12-02 17:09:31",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Item",
- "report_name": "Stock Ageing",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Stock Ageing"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-12-02 17:09:31.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Stock Ageing",
+ "owner": "Administrator",
+ "ref_doctype": "Item",
+ "report_name": "Stock Ageing",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.txt b/erpnext/stock/report/stock_ledger/stock_ledger.txt
index 7da9f93..da2056e 100644
--- a/erpnext/stock/report/stock_ledger/stock_ledger.txt
+++ b/erpnext/stock/report/stock_ledger/stock_ledger.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-11-29 17:08:23",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Stock Ledger Entry",
- "report_name": "Stock Ledger",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Stock Ledger"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-11-29 17:08:23.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Stock Ledger",
+ "owner": "Administrator",
+ "ref_doctype": "Stock Ledger Entry",
+ "report_name": "Stock Ledger",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt
index 4eb46c5..2b6be03 100644
--- a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt
+++ b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-12-04 18:21:56",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Item",
- "report_name": "Stock Projected Qty",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Stock Projected Qty"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-12-04 18:21:56.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Stock Projected Qty",
+ "owner": "Administrator",
+ "ref_doctype": "Item",
+ "report_name": "Stock Projected Qty",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt
index 53eeca7..ff495d9 100644
--- a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt
+++ b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-11-29 15:45:39",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "add_total_row": 1,
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Stock Ledger Entry",
- "report_name": "Supplier-Wise Sales Analytics",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Supplier-Wise Sales Analytics"
- }
-]
\ No newline at end of file
+{
+ "add_total_row": 1,
+ "creation": "2013-11-29 15:45:39.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Supplier-Wise Sales Analytics",
+ "owner": "Administrator",
+ "ref_doctype": "Stock Ledger Entry",
+ "report_name": "Supplier-Wise Sales Analytics",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt b/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt
index c8e36eb..c91906f 100644
--- a/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt
+++ b/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt
@@ -1,22 +1,15 @@
-[
- {
- "creation": "2013-06-05 11:00:31",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:28",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Stock",
- "name": "__common__",
- "ref_doctype": "Stock Ledger Entry",
- "report_name": "Warehouse-Wise Stock Balance",
- "report_type": "Script Report"
- },
- {
- "doctype": "Report",
- "name": "Warehouse-Wise Stock Balance"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-06-05 11:00:31.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:28.000000",
+ "modified_by": "Administrator",
+ "module": "Stock",
+ "name": "Warehouse-Wise Stock Balance",
+ "owner": "Administrator",
+ "ref_doctype": "Stock Ledger Entry",
+ "report_name": "Warehouse-Wise Stock Balance",
+ "report_type": "Script Report"
+}
\ No newline at end of file
diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py
index 822c8f2..4628b5b 100644
--- a/erpnext/stock/stock_ledger.py
+++ b/erpnext/stock/stock_ledger.py
@@ -116,7 +116,7 @@
# rounding as per precision
from frappe.model.meta import get_field_precision
- meta = frappe.get_doctype("Stock Ledger Entry")
+ meta = frappe.get_meta("Stock Ledger Entry")
stock_value = flt(stock_value, get_field_precision(meta.get_field("stock_value"),
frappe._dict({"fields": sle})))
diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py
index 3a0766a..e5099c4 100644
--- a/erpnext/stock/utils.py
+++ b/erpnext/stock/utils.py
@@ -299,7 +299,7 @@
for mr in mr_list:
msg += "<p><b><u>" + mr.doc.name + """</u></b></p><table class='table table-bordered'><tr>
<th>Item Code</th><th>Warehouse</th><th>Qty</th><th>UOM</th></tr>"""
- for item in mr.doclist.get({"parentfield": "indent_details"}):
+ for item in mr.get("indent_details"):
msg += "<tr><td>" + item.item_code + "</td><td>" + item.warehouse + "</td><td>" + \
cstr(item.qty) + "</td><td>" + cstr(item.uom) + "</td></tr>"
msg += "</table>"
diff --git a/erpnext/support/doctype/customer_issue/customer_issue.py b/erpnext/support/doctype/customer_issue/customer_issue.py
index 128accd..406ea61 100644
--- a/erpnext/support/doctype/customer_issue/customer_issue.py
+++ b/erpnext/support/doctype/customer_issue/customer_issue.py
@@ -11,10 +11,7 @@
from erpnext.utilities.transaction_base import TransactionBase
-class DocType(TransactionBase):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class CustomerIssue(TransactionBase):
def validate(self):
if session['user'] != 'Guest' and not self.doc.customer:
diff --git a/erpnext/support/doctype/customer_issue/customer_issue.txt b/erpnext/support/doctype/customer_issue/customer_issue.txt
index 90ac593..1f35744 100644
--- a/erpnext/support/doctype/customer_issue/customer_issue.txt
+++ b/erpnext/support/doctype/customer_issue/customer_issue.txt
@@ -1,438 +1,419 @@
-[
- {
- "creation": "2013-01-10 16:34:30",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:35",
- "modified_by": "Administrator",
- "owner": "harshada@webnotestech.com"
- },
- {
- "allow_import": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "icon": "icon-bug",
- "is_submittable": 0,
- "module": "Support",
- "name": "__common__",
- "search_fields": "status,customer,customer_name,territory"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Customer Issue",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Customer Issue",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Maintenance User",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Customer Issue"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_section",
- "fieldtype": "Section Break",
- "label": "Customer",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "in_filter": 0,
- "label": "Series",
- "no_copy": 1,
- "oldfieldname": "naming_series",
- "oldfieldtype": "Select",
- "options": "\nCI/2010-2011/",
- "reqd": 1,
- "search_index": 0
- },
- {
- "default": "Open",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nOpen\nClosed\nWork In Progress\nCancelled",
- "reqd": 1,
- "search_index": 1
- },
- {
- "default": "Today",
- "doctype": "DocField",
- "fieldname": "complaint_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Issue Date",
- "oldfieldname": "complaint_date",
- "oldfieldtype": "Date",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Customer",
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "label": "Customer Address",
- "options": "Address",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "label": "Contact Person",
- "options": "Contact",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "issue_details",
- "fieldtype": "Section Break",
- "label": "Issue Details",
- "oldfieldtype": "Section Break",
- "options": "icon-ticket"
- },
- {
- "doctype": "DocField",
- "fieldname": "complaint",
- "fieldtype": "Small Text",
- "label": "Issue",
- "no_copy": 1,
- "oldfieldname": "complaint",
- "oldfieldtype": "Small Text",
- "reqd": 1
- },
- {
- "description": "Item, Warranty, AMC (Annual Maintenance Contract) details will be automatically fetched when Serial Number is selected.",
- "doctype": "DocField",
- "fieldname": "serial_no",
- "fieldtype": "Link",
- "in_list_view": 0,
- "label": "Serial No",
- "options": "Serial No"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "depends_on": "eval:doc.item_code",
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "depends_on": "eval:doc.item_code",
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "read_only": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "warranty_amc_status",
- "fieldtype": "Select",
- "hidden": 0,
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Warranty / AMC Status",
- "options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC"
- },
- {
- "doctype": "DocField",
- "fieldname": "warranty_expiry_date",
- "fieldtype": "Date",
- "label": "Warranty Expiry Date"
- },
- {
- "doctype": "DocField",
- "fieldname": "amc_expiry_date",
- "fieldtype": "Date",
- "label": "AMC Expiry Date"
- },
- {
- "description": "To assign this issue, use the \"Assign\" button in the sidebar.",
- "doctype": "DocField",
- "fieldname": "resolution_section",
- "fieldtype": "Section Break",
- "label": "Resolution",
- "oldfieldtype": "Section Break",
- "options": "icon-thumbs-up"
- },
- {
- "doctype": "DocField",
- "fieldname": "resolution_date",
- "fieldtype": "Datetime",
- "in_filter": 1,
- "label": "Resolution Date",
- "no_copy": 1,
- "oldfieldname": "resolution_date",
- "oldfieldtype": "Date",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "resolved_by",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Resolved By",
- "no_copy": 1,
- "oldfieldname": "resolved_by",
- "oldfieldtype": "Link",
- "options": "User",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "resolution_details",
- "fieldtype": "Text",
- "label": "Resolution Details",
- "no_copy": 1,
- "oldfieldname": "resolution_details",
- "oldfieldtype": "Text"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_info",
- "fieldtype": "Section Break",
- "label": "Contact Info",
- "options": "icon-bullhorn"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "label": "Customer Name",
- "read_only": 1
- },
- {
- "depends_on": "customer",
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "label": "Customer Group",
- "options": "Customer Group",
- "print_hide": 1,
- "reqd": 0
- },
- {
- "depends_on": "customer",
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Territory",
- "oldfieldname": "territory",
- "oldfieldtype": "Link",
- "options": "Territory",
- "print_hide": 1,
- "reqd": 0,
- "search_index": 1
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "label": "Contact",
- "read_only": 1
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_mobile",
- "fieldtype": "Data",
- "label": "Mobile No",
- "read_only": 1
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_email",
- "fieldtype": "Data",
- "label": "Contact Email",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break4",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "depends_on": "customer",
- "description": "If different than customer address",
- "doctype": "DocField",
- "fieldname": "service_address",
- "fieldtype": "Small Text",
- "label": "Service Address",
- "oldfieldname": "service_address",
- "oldfieldtype": "Small Text"
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 0,
- "label": "Address",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "options": "icon-file-text"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break5",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break6",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "complaint_raised_by",
- "fieldtype": "Data",
- "label": "Raised By",
- "oldfieldname": "complaint_raised_by",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "from_company",
- "fieldtype": "Data",
- "label": "From Company",
- "oldfieldname": "from_company",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "hidden": 1,
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "width": "150px"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-01-10 16:34:30.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "customer_section",
+ "fieldtype": "Section Break",
+ "label": "Customer",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "in_filter": 0,
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "\nCI/2010-2011/",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "default": "Open",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nOpen\nClosed\nWork In Progress\nCancelled",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "default": "Today",
+ "fieldname": "complaint_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Issue Date",
+ "oldfieldname": "complaint_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Customer",
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "label": "Customer Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "label": "Contact Person",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "issue_details",
+ "fieldtype": "Section Break",
+ "label": "Issue Details",
+ "oldfieldtype": "Section Break",
+ "options": "icon-ticket",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "complaint",
+ "fieldtype": "Small Text",
+ "label": "Issue",
+ "no_copy": 1,
+ "oldfieldname": "complaint",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "description": "Item, Warranty, AMC (Annual Maintenance Contract) details will be automatically fetched when Serial Number is selected.",
+ "fieldname": "serial_no",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Serial No",
+ "options": "Serial No",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "depends_on": "eval:doc.item_code",
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:doc.item_code",
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "warranty_amc_status",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Warranty / AMC Status",
+ "options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "warranty_expiry_date",
+ "fieldtype": "Date",
+ "label": "Warranty Expiry Date",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "amc_expiry_date",
+ "fieldtype": "Date",
+ "label": "AMC Expiry Date",
+ "permlevel": 0
+ },
+ {
+ "description": "To assign this issue, use the \"Assign\" button in the sidebar.",
+ "fieldname": "resolution_section",
+ "fieldtype": "Section Break",
+ "label": "Resolution",
+ "oldfieldtype": "Section Break",
+ "options": "icon-thumbs-up",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "resolution_date",
+ "fieldtype": "Datetime",
+ "in_filter": 1,
+ "label": "Resolution Date",
+ "no_copy": 1,
+ "oldfieldname": "resolution_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "resolved_by",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Resolved By",
+ "no_copy": 1,
+ "oldfieldname": "resolved_by",
+ "oldfieldtype": "Link",
+ "options": "User",
+ "permlevel": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "resolution_details",
+ "fieldtype": "Text",
+ "label": "Resolution Details",
+ "no_copy": 1,
+ "oldfieldname": "resolution_details",
+ "oldfieldtype": "Text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "contact_info",
+ "fieldtype": "Section Break",
+ "label": "Contact Info",
+ "options": "icon-bullhorn",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "label": "Customer Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "customer",
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "label": "Customer Group",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 0
+ },
+ {
+ "depends_on": "customer",
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Territory",
+ "oldfieldname": "territory",
+ "oldfieldtype": "Link",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "label": "Contact",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_mobile",
+ "fieldtype": "Data",
+ "label": "Mobile No",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_email",
+ "fieldtype": "Data",
+ "label": "Contact Email",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "depends_on": "customer",
+ "description": "If different than customer address",
+ "fieldname": "service_address",
+ "fieldtype": "Small Text",
+ "label": "Service Address",
+ "oldfieldname": "service_address",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 0,
+ "label": "Address",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "options": "icon-file-text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "col_break5",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "col_break6",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "complaint_raised_by",
+ "fieldtype": "Data",
+ "label": "Raised By",
+ "oldfieldname": "complaint_raised_by",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "from_company",
+ "fieldtype": "Data",
+ "label": "From Company",
+ "oldfieldname": "from_company",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "width": "150px"
+ }
+ ],
+ "icon": "icon-bug",
+ "idx": 1,
+ "is_submittable": 0,
+ "modified": "2014-01-20 17:48:35.000000",
+ "modified_by": "Administrator",
+ "module": "Support",
+ "name": "Customer Issue",
+ "owner": "harshada@webnotestech.com",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance User",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "search_fields": "status,customer,customer_name,territory"
+}
\ No newline at end of file
diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js
index 328ca1d..c6ac73c 100644
--- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js
+++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js
@@ -94,8 +94,7 @@
cur_frm.cscript.generate_schedule = function(doc, cdt, cdn) {
if (!doc.__islocal) {
- return $c('runserverobj', args={'method':'generate_schedule',
- 'docs':frappe.model.compress(make_doclist(cdt,cdn))},
+ return $c('runserverobj', args={'method':'generate_schedule', 'docs':doc},
function(r, rt) {
refresh_field('maintenance_schedule_detail');
});
diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py
index 2fcd200..9f7aef1 100644
--- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py
+++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py
@@ -5,16 +5,12 @@
import frappe
from frappe.utils import add_days, cstr, getdate, cint
-from frappe.model.doc import addchild
from frappe.model.bean import getlist
from frappe import throw, _
from erpnext.utilities.transaction_base import TransactionBase, delete_events
from erpnext.stock.utils import get_valid_serial_nos
-class DocType(TransactionBase):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class MaintenanceSchedule(TransactionBase):
def get_item_details(self, item_code):
item = frappe.db.sql("""select item_name, description from `tabItem`
@@ -26,17 +22,16 @@
return ret
def generate_schedule(self):
- self.doclist = self.doc.clear_table(self.doclist, 'maintenance_schedule_detail')
+ self.set('maintenance_schedule_detail', [])
frappe.db.sql("""delete from `tabMaintenance Schedule Detail`
where parent=%s""", (self.doc.name))
count = 1
- for d in getlist(self.doclist, 'item_maintenance_detail'):
+ for d in self.get('item_maintenance_detail'):
self.validate_maintenance_detail()
s_list = []
s_list = self.create_schedule_list(d.start_date, d.end_date, d.no_of_visits, d.sales_person)
for i in range(d.no_of_visits):
- child = addchild(self.doc, 'maintenance_schedule_detail',
- 'Maintenance Schedule Detail', self.doclist)
+ child = self.append('maintenance_schedule_detail')
child.item_code = d.item_code
child.item_name = d.item_name
child.scheduled_date = s_list[i].strftime('%Y-%m-%d')
@@ -50,13 +45,13 @@
self.on_update()
def on_submit(self):
- if not getlist(self.doclist, 'maintenance_schedule_detail'):
+ if not self.get('maintenance_schedule_detail'):
throw("Please click on 'Generate Schedule' to get schedule")
self.check_serial_no_added()
self.validate_schedule()
email_map = {}
- for d in getlist(self.doclist, 'item_maintenance_detail'):
+ for d in self.get('item_maintenance_detail'):
if d.serial_no:
serial_nos = get_valid_serial_nos(d.serial_no)
self.validate_serial_no(serial_nos, d.start_date)
@@ -174,10 +169,10 @@
return ret
def validate_maintenance_detail(self):
- if not getlist(self.doclist, 'item_maintenance_detail'):
+ if not self.get('item_maintenance_detail'):
throw(_("Please enter Maintaince Details first"))
- for d in getlist(self.doclist, 'item_maintenance_detail'):
+ for d in self.get('item_maintenance_detail'):
if not d.item_code:
throw(_("Please select item code"))
elif not d.start_date or not d.end_date:
@@ -191,7 +186,7 @@
throw(_("Start date should be less than end date for item") + " " + d.item_code)
def validate_sales_order(self):
- for d in getlist(self.doclist, 'item_maintenance_detail'):
+ for d in self.get('item_maintenance_detail'):
if d.prevdoc_docname:
chk = frappe.db.sql("""select ms.name from `tabMaintenance Schedule` ms,
`tabMaintenance Schedule Item` msi where msi.parent=ms.name and
@@ -233,11 +228,11 @@
def validate_schedule(self):
item_lst1 =[]
item_lst2 =[]
- for d in getlist(self.doclist, 'item_maintenance_detail'):
+ for d in self.get('item_maintenance_detail'):
if d.item_code not in item_lst1:
item_lst1.append(d.item_code)
- for m in getlist(self.doclist, 'maintenance_schedule_detail'):
+ for m in self.get('maintenance_schedule_detail'):
if m.item_code not in item_lst2:
item_lst2.append(m.item_code)
@@ -252,17 +247,17 @@
def check_serial_no_added(self):
serial_present =[]
- for d in getlist(self.doclist, 'item_maintenance_detail'):
+ for d in self.get('item_maintenance_detail'):
if d.serial_no:
serial_present.append(d.item_code)
- for m in getlist(self.doclist, 'maintenance_schedule_detail'):
+ for m in self.get('maintenance_schedule_detail'):
if serial_present:
if m.item_code in serial_present and not m.serial_no:
throw("Please click on 'Generate Schedule' to fetch serial no added for item "+m.item_code)
def on_cancel(self):
- for d in getlist(self.doclist, 'item_maintenance_detail'):
+ for d in self.get('item_maintenance_detail'):
if d.serial_no:
serial_nos = get_valid_serial_nos(d.serial_no)
self.update_amc_date(serial_nos)
diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt
index 5627889..7035f43 100644
--- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt
+++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt
@@ -1,262 +1,243 @@
-[
- {
- "creation": "2013-01-10 16:34:30",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:56",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "MS.#####",
- "doctype": "DocType",
- "icon": "icon-calendar",
- "is_submittable": 1,
- "module": "Support",
- "name": "__common__",
- "search_fields": "status,customer,customer_name, sales_order_no"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Maintenance Schedule",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Maintenance Schedule",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Maintenance Manager",
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Maintenance Schedule"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_details",
- "fieldtype": "Section Break",
- "label": "Customer Details",
- "oldfieldtype": "Section Break",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer",
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break"
- },
- {
- "default": "Draft",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "\nDraft\nSubmitted\nCancelled",
- "read_only": 1,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "transaction_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "label": "Transaction Date",
- "oldfieldname": "transaction_date",
- "oldfieldtype": "Date",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "items",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_maintenance_detail",
- "fieldtype": "Table",
- "label": "Maintenance Schedule Item",
- "oldfieldname": "item_maintenance_detail",
- "oldfieldtype": "Table",
- "options": "Maintenance Schedule Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "schedule",
- "fieldtype": "Section Break",
- "label": "Schedule",
- "oldfieldtype": "Section Break",
- "options": "icon-time"
- },
- {
- "doctype": "DocField",
- "fieldname": "generate_schedule",
- "fieldtype": "Button",
- "label": "Generate Schedule",
- "oldfieldtype": "Button"
- },
- {
- "doctype": "DocField",
- "fieldname": "maintenance_schedule_detail",
- "fieldtype": "Table",
- "label": "Maintenance Schedule Detail",
- "oldfieldname": "maintenance_schedule_detail",
- "oldfieldtype": "Table",
- "options": "Maintenance Schedule Detail",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_info",
- "fieldtype": "Section Break",
- "label": "Contact Info"
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Customer Name",
- "oldfieldname": "customer_name",
- "oldfieldtype": "Data",
- "read_only": 1,
- "reqd": 0,
- "search_index": 0
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "label": "Contact Person",
- "options": "Contact",
- "print_hide": 1
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_mobile",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Mobile No",
- "read_only": 1
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_email",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Contact Email",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_17",
- "fieldtype": "Column Break"
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "label": "Customer Address",
- "options": "Address",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Address",
- "read_only": 1
- },
- {
- "depends_on": "customer",
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Territory",
- "oldfieldname": "territory",
- "oldfieldtype": "Link",
- "options": "Territory",
- "reqd": 1,
- "search_index": 0
- },
- {
- "depends_on": "customer",
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "label": "Customer Group",
- "options": "Customer Group",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "autoname": "MS.#####",
+ "creation": "2013-01-10 16:34:30.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "customer_details",
+ "fieldtype": "Section Break",
+ "label": "Customer Details",
+ "oldfieldtype": "Section Break",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer",
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "default": "Draft",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "\nDraft\nSubmitted\nCancelled",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "Transaction Date",
+ "oldfieldname": "transaction_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "items",
+ "fieldtype": "Section Break",
+ "label": "Items",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "item_maintenance_detail",
+ "fieldtype": "Table",
+ "label": "Maintenance Schedule Item",
+ "oldfieldname": "item_maintenance_detail",
+ "oldfieldtype": "Table",
+ "options": "Maintenance Schedule Item",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "schedule",
+ "fieldtype": "Section Break",
+ "label": "Schedule",
+ "oldfieldtype": "Section Break",
+ "options": "icon-time",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "generate_schedule",
+ "fieldtype": "Button",
+ "label": "Generate Schedule",
+ "oldfieldtype": "Button",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "maintenance_schedule_detail",
+ "fieldtype": "Table",
+ "label": "Maintenance Schedule Detail",
+ "oldfieldname": "maintenance_schedule_detail",
+ "oldfieldtype": "Table",
+ "options": "Maintenance Schedule Detail",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_info",
+ "fieldtype": "Section Break",
+ "label": "Contact Info",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Customer Name",
+ "oldfieldname": "customer_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "label": "Contact Person",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_mobile",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Mobile No",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_email",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Contact Email",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break_17",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "label": "Customer Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Address",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "customer",
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Territory",
+ "oldfieldname": "territory",
+ "oldfieldtype": "Link",
+ "options": "Territory",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "depends_on": "customer",
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "label": "Customer Group",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Link",
+ "options": "Company",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ }
+ ],
+ "icon": "icon-calendar",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-20 17:48:56.000000",
+ "modified_by": "Administrator",
+ "module": "Support",
+ "name": "Maintenance Schedule",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance Manager",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "search_fields": "status,customer,customer_name, sales_order_no"
+}
\ No newline at end of file
diff --git a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py
index 26c87f1..8c15d32 100644
--- a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py
+++ b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class MaintenanceScheduleDetail(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt
index 8ed6856..aee7274 100644
--- a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt
+++ b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt
@@ -1,110 +1,97 @@
-[
- {
- "creation": "2013-02-22 01:28:05",
- "docstatus": 0,
- "modified": "2013-12-31 12:13:38",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "MSD.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Support",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Maintenance Schedule Detail",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Maintenance Schedule Detail"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "read_only": 1,
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "read_only": 1,
- "search_index": 0
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "scheduled_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Scheduled Date",
- "oldfieldname": "scheduled_date",
- "oldfieldtype": "Date",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "actual_date",
- "fieldtype": "Date",
- "hidden": 1,
- "in_list_view": 0,
- "label": "Actual Date",
- "no_copy": 1,
- "oldfieldname": "actual_date",
- "oldfieldtype": "Date",
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "allow_on_submit": 0,
- "doctype": "DocField",
- "fieldname": "sales_person",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Sales Person",
- "oldfieldname": "incharge_name",
- "oldfieldtype": "Link",
- "options": "Sales Person",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no",
- "fieldtype": "Small Text",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Serial No",
- "no_copy": 0,
- "oldfieldname": "serial_no",
- "oldfieldtype": "Small Text",
- "print_width": "160px",
- "read_only": 1,
- "search_index": 0,
- "width": "160px"
- }
-]
\ No newline at end of file
+{
+ "autoname": "MSD.#####",
+ "creation": "2013-02-22 01:28:05.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "scheduled_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Scheduled Date",
+ "oldfieldname": "scheduled_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "actual_date",
+ "fieldtype": "Date",
+ "hidden": 1,
+ "in_list_view": 0,
+ "label": "Actual Date",
+ "no_copy": 1,
+ "oldfieldname": "actual_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "report_hide": 1
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "sales_person",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Sales Person",
+ "oldfieldname": "incharge_name",
+ "oldfieldtype": "Link",
+ "options": "Sales Person",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "serial_no",
+ "fieldtype": "Small Text",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Serial No",
+ "no_copy": 0,
+ "oldfieldname": "serial_no",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "160px",
+ "read_only": 1,
+ "search_index": 0,
+ "width": "160px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-31 12:13:38.000000",
+ "modified_by": "Administrator",
+ "module": "Support",
+ "name": "Maintenance Schedule Detail",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.py b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.py
index 26c87f1..47000c1 100644
--- a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.py
+++ b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class MaintenanceScheduleItem(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt
index 43d281d..38fa4b5 100644
--- a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt
+++ b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt
@@ -1,154 +1,141 @@
-[
- {
- "creation": "2013-02-22 01:28:05",
- "docstatus": 0,
- "modified": "2013-12-31 12:08:32",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "IMD.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Support",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Maintenance Schedule Item",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Maintenance Schedule Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Data",
- "print_width": "300px",
- "read_only": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "schedule_details",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Schedule Details"
- },
- {
- "doctype": "DocField",
- "fieldname": "start_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Start Date",
- "oldfieldname": "start_date",
- "oldfieldtype": "Date",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "end_date",
- "fieldtype": "Date",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "End Date",
- "oldfieldname": "end_date",
- "oldfieldtype": "Date",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "periodicity",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Periodicity",
- "oldfieldname": "periodicity",
- "oldfieldtype": "Select",
- "options": "\nWeekly\nMonthly\nQuarterly\nHalf Yearly\nYearly\nRandom"
- },
- {
- "doctype": "DocField",
- "fieldname": "no_of_visits",
- "fieldtype": "Int",
- "label": "No of Visits",
- "oldfieldname": "no_of_visits",
- "oldfieldtype": "Int",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_person",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Sales Person",
- "oldfieldname": "incharge_name",
- "oldfieldtype": "Link",
- "options": "Sales Person",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "reference",
- "fieldtype": "Section Break",
- "label": "Reference"
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no",
- "fieldtype": "Small Text",
- "label": "Serial No",
- "oldfieldname": "serial_no",
- "oldfieldtype": "Small Text"
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_docname",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Against Docname",
- "no_copy": 1,
- "oldfieldname": "prevdoc_docname",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "search_index": 1,
- "width": "150px"
- }
-]
\ No newline at end of file
+{
+ "autoname": "IMD.#####",
+ "creation": "2013-02-22 01:28:05.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_width": "300px",
+ "read_only": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "schedule_details",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Schedule Details",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "start_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Start Date",
+ "oldfieldname": "start_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "end_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "End Date",
+ "oldfieldname": "end_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "periodicity",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Periodicity",
+ "oldfieldname": "periodicity",
+ "oldfieldtype": "Select",
+ "options": "\nWeekly\nMonthly\nQuarterly\nHalf Yearly\nYearly\nRandom",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "no_of_visits",
+ "fieldtype": "Int",
+ "label": "No of Visits",
+ "oldfieldname": "no_of_visits",
+ "oldfieldtype": "Int",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "sales_person",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Sales Person",
+ "oldfieldname": "incharge_name",
+ "oldfieldtype": "Link",
+ "options": "Sales Person",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "reference",
+ "fieldtype": "Section Break",
+ "label": "Reference",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "serial_no",
+ "fieldtype": "Small Text",
+ "label": "Serial No",
+ "oldfieldname": "serial_no",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "prevdoc_docname",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Against Docname",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_docname",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "search_index": 1,
+ "width": "150px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-31 12:08:32.000000",
+ "modified_by": "Administrator",
+ "module": "Support",
+ "name": "Maintenance Schedule Item",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py
index 1ddf67b..234756b 100644
--- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py
+++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py
@@ -12,29 +12,26 @@
from erpnext.utilities.transaction_base import TransactionBase
-class DocType(TransactionBase):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class MaintenanceVisit(TransactionBase):
def get_item_details(self, item_code):
return frappe.db.get_value("Item", item_code, ["item_name", "description"], as_dict=1)
def validate_serial_no(self):
- for d in getlist(self.doclist, 'maintenance_visit_details'):
+ for d in self.get('maintenance_visit_details'):
if d.serial_no and not frappe.db.exists("Serial No", d.serial_no):
frappe.throw("Serial No: "+ d.serial_no + " not exists in the system")
def validate(self):
- if not getlist(self.doclist, 'maintenance_visit_details'):
+ if not self.get('maintenance_visit_details'):
msgprint("Please enter maintenance details")
raise Exception
self.validate_serial_no()
def update_customer_issue(self, flag):
- for d in getlist(self.doclist, 'maintenance_visit_details'):
+ for d in self.get('maintenance_visit_details'):
if d.prevdoc_docname and d.prevdoc_doctype == 'Customer Issue' :
if flag==1:
mntc_date = self.doc.mntc_date
@@ -64,7 +61,7 @@
def check_if_last_visit(self):
"""check if last maintenance visit against same sales order/ customer issue"""
check_for_docname = check_for_doctype = None
- for d in getlist(self.doclist, 'maintenance_visit_details'):
+ for d in self.get('maintenance_visit_details'):
if d.prevdoc_docname:
check_for_docname = d.prevdoc_docname
check_for_doctype = d.prevdoc_doctype
diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt b/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt
index 6a03292..7d93bba 100644
--- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt
+++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt
@@ -1,321 +1,302 @@
-[
- {
- "creation": "2013-01-10 16:34:31",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:57",
- "modified_by": "Administrator",
- "owner": "ashwini@webnotestech.com"
- },
- {
- "autoname": "MV.#####",
- "doctype": "DocType",
- "icon": "icon-file-text",
- "is_submittable": 1,
- "module": "Support",
- "name": "__common__",
- "search_fields": "status,maintenance_type,customer,customer_name, address,mntc_date,company,fiscal_year"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Maintenance Visit",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Maintenance Visit",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Maintenance User",
- "submit": 1,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Maintenance Visit"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_details",
- "fieldtype": "Section Break",
- "label": "Customer Details",
- "oldfieldtype": "Section Break",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Customer",
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "hidden": 1,
- "in_list_view": 1,
- "label": "Customer Name",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Address",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_display",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_mobile",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Mobile No",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_email",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Contact Email",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "default": "Today",
- "doctype": "DocField",
- "fieldname": "mntc_date",
- "fieldtype": "Date",
- "label": "Maintenance Date",
- "no_copy": 1,
- "oldfieldname": "mntc_date",
- "oldfieldtype": "Date",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "mntc_time",
- "fieldtype": "Time",
- "label": "Maintenance Time",
- "no_copy": 1,
- "oldfieldname": "mntc_time",
- "oldfieldtype": "Time"
- },
- {
- "doctype": "DocField",
- "fieldname": "maintenance_details",
- "fieldtype": "Section Break",
- "label": "Maintenance Details",
- "oldfieldtype": "Section Break",
- "options": "icon-wrench"
- },
- {
- "doctype": "DocField",
- "fieldname": "completion_status",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Completion Status",
- "oldfieldname": "completion_status",
- "oldfieldtype": "Select",
- "options": "\nPartially Completed\nFully Completed",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_14",
- "fieldtype": "Column Break"
- },
- {
- "default": "Unscheduled",
- "doctype": "DocField",
- "fieldname": "maintenance_type",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Maintenance Type",
- "oldfieldname": "maintenance_type",
- "oldfieldtype": "Select",
- "options": "\nScheduled\nUnscheduled\nBreakdown",
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "section_break0",
- "fieldtype": "Section Break",
- "oldfieldtype": "Section Break",
- "options": "icon-wrench"
- },
- {
- "doctype": "DocField",
- "fieldname": "maintenance_visit_details",
- "fieldtype": "Table",
- "label": "Maintenance Visit Purpose",
- "oldfieldname": "maintenance_visit_details",
- "oldfieldtype": "Table",
- "options": "Maintenance Visit Purpose"
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "oldfieldtype": "Section Break",
- "options": "icon-file-text"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_feedback",
- "fieldtype": "Small Text",
- "label": "Customer Feedback",
- "oldfieldname": "customer_feedback",
- "oldfieldtype": "Small Text"
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break3",
- "fieldtype": "Column Break"
- },
- {
- "default": "Draft",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Data",
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Data",
- "options": "\nDraft\nCancelled\nSubmitted",
- "read_only": 1,
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "amended_from",
- "fieldtype": "Data",
- "ignore_restrictions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "read_only": 1,
- "width": "150px"
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Select",
- "options": "link:Company",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "fiscal_year",
- "fieldtype": "Select",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "link:Fiscal Year",
- "print_hide": 1,
- "reqd": 1,
- "search_index": 0
- },
- {
- "depends_on": "customer",
- "doctype": "DocField",
- "fieldname": "contact_info_section",
- "fieldtype": "Section Break",
- "label": "Contact Info",
- "options": "icon-bullhorn"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_address",
- "fieldtype": "Link",
- "label": "Customer Address",
- "options": "Address",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_person",
- "fieldtype": "Link",
- "label": "Contact Person",
- "options": "Contact",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "col_break4",
- "fieldtype": "Column Break"
- },
- {
- "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "territory",
- "fieldtype": "Link",
- "label": "Territory",
- "options": "Territory",
- "print_hide": 1
- },
- {
- "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
- "doctype": "DocField",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "label": "Customer Group",
- "options": "Customer Group",
- "print_hide": 1
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "autoname": "MV.#####",
+ "creation": "2013-01-10 16:34:31.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "customer_details",
+ "fieldtype": "Section Break",
+ "label": "Customer Details",
+ "oldfieldtype": "Section Break",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Customer",
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "in_list_view": 1,
+ "label": "Customer Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Address",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_mobile",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Mobile No",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "contact_email",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Contact Email",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "default": "Today",
+ "fieldname": "mntc_date",
+ "fieldtype": "Date",
+ "label": "Maintenance Date",
+ "no_copy": 1,
+ "oldfieldname": "mntc_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "mntc_time",
+ "fieldtype": "Time",
+ "label": "Maintenance Time",
+ "no_copy": 1,
+ "oldfieldname": "mntc_time",
+ "oldfieldtype": "Time",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "maintenance_details",
+ "fieldtype": "Section Break",
+ "label": "Maintenance Details",
+ "oldfieldtype": "Section Break",
+ "options": "icon-wrench",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "completion_status",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Completion Status",
+ "oldfieldname": "completion_status",
+ "oldfieldtype": "Select",
+ "options": "\nPartially Completed\nFully Completed",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break_14",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "default": "Unscheduled",
+ "fieldname": "maintenance_type",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Maintenance Type",
+ "oldfieldname": "maintenance_type",
+ "oldfieldtype": "Select",
+ "options": "\nScheduled\nUnscheduled\nBreakdown",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "section_break0",
+ "fieldtype": "Section Break",
+ "oldfieldtype": "Section Break",
+ "options": "icon-wrench",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "maintenance_visit_details",
+ "fieldtype": "Table",
+ "label": "Maintenance Visit Purpose",
+ "oldfieldname": "maintenance_visit_details",
+ "oldfieldtype": "Table",
+ "options": "Maintenance Visit Purpose",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "oldfieldtype": "Section Break",
+ "options": "icon-file-text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "customer_feedback",
+ "fieldtype": "Small Text",
+ "label": "Customer Feedback",
+ "oldfieldname": "customer_feedback",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "col_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "default": "Draft",
+ "fieldname": "status",
+ "fieldtype": "Data",
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Data",
+ "options": "\nDraft\nCancelled\nSubmitted",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 1
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Data",
+ "ignore_restrictions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
+ "width": "150px"
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Company",
+ "oldfieldname": "company",
+ "oldfieldtype": "Select",
+ "options": "link:Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "link:Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "depends_on": "customer",
+ "fieldname": "contact_info_section",
+ "fieldtype": "Section Break",
+ "label": "Contact Info",
+ "options": "icon-bullhorn",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "customer_address",
+ "fieldtype": "Link",
+ "label": "Customer Address",
+ "options": "Address",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "contact_person",
+ "fieldtype": "Link",
+ "label": "Contact Person",
+ "options": "Contact",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "col_break4",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Territory\">Add / Edit</a>",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "description": "<a href=\"#Sales Browser/Customer Group\">Add / Edit</a>",
+ "fieldname": "customer_group",
+ "fieldtype": "Link",
+ "label": "Customer Group",
+ "options": "Customer Group",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2014-01-20 17:48:57.000000",
+ "modified_by": "Administrator",
+ "module": "Support",
+ "name": "Maintenance Visit",
+ "owner": "ashwini@webnotestech.com",
+ "permissions": [
+ {
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance User",
+ "submit": 1,
+ "write": 1
+ }
+ ],
+ "search_fields": "status,maintenance_type,customer,customer_name, address,mntc_date,company,fiscal_year"
+}
\ No newline at end of file
diff --git a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py
index 26c87f1..ac30b7a 100644
--- a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py
+++ b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class MaintenanceVisitPurpose(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt
index 6a45e55..32e3769 100644
--- a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt
+++ b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt
@@ -1,142 +1,129 @@
-[
- {
- "creation": "2013-02-22 01:28:06",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:20",
- "modified_by": "Administrator",
- "owner": "ashwini@webnotestech.com"
- },
- {
- "autoname": "MVD.#####",
- "doctype": "DocType",
- "istable": 1,
- "module": "Support",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Maintenance Visit Purpose",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Maintenance Visit Purpose"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_code",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Item Code",
- "oldfieldname": "item_code",
- "oldfieldtype": "Link",
- "options": "Item"
- },
- {
- "doctype": "DocField",
- "fieldname": "item_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "serial_no",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Serial No",
- "oldfieldname": "serial_no",
- "oldfieldtype": "Small Text"
- },
- {
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Description",
- "oldfieldname": "description",
- "oldfieldtype": "Small Text",
- "print_width": "300px",
- "reqd": 1,
- "width": "300px"
- },
- {
- "doctype": "DocField",
- "fieldname": "work_details",
- "fieldtype": "Section Break",
- "in_list_view": 0,
- "label": "Work Details"
- },
- {
- "doctype": "DocField",
- "fieldname": "service_person",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Sales Person",
- "oldfieldname": "service_person",
- "oldfieldtype": "Link",
- "options": "Sales Person",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "work_done",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Work Done",
- "oldfieldname": "work_done",
- "oldfieldtype": "Small Text",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_docname",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Against Document No",
- "no_copy": 1,
- "oldfieldname": "prevdoc_docname",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "160px",
- "read_only": 1,
- "report_hide": 1,
- "width": "160px"
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_detail_docname",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Against Document Detail No",
- "no_copy": 1,
- "oldfieldname": "prevdoc_detail_docname",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "160px",
- "read_only": 1,
- "report_hide": 1,
- "width": "160px"
- },
- {
- "doctype": "DocField",
- "fieldname": "prevdoc_doctype",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Document Type",
- "no_copy": 1,
- "oldfieldname": "prevdoc_doctype",
- "oldfieldtype": "Data",
- "print_hide": 1,
- "print_width": "150px",
- "read_only": 1,
- "report_hide": 1,
- "width": "150px"
- }
-]
\ No newline at end of file
+{
+ "autoname": "MVD.#####",
+ "creation": "2013-02-22 01:28:06.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "item_code",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Item Code",
+ "oldfieldname": "item_code",
+ "oldfieldtype": "Link",
+ "options": "Item",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "serial_no",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Serial No",
+ "oldfieldname": "serial_no",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "description",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Description",
+ "oldfieldname": "description",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "print_width": "300px",
+ "reqd": 1,
+ "width": "300px"
+ },
+ {
+ "fieldname": "work_details",
+ "fieldtype": "Section Break",
+ "in_list_view": 0,
+ "label": "Work Details",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "service_person",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Sales Person",
+ "oldfieldname": "service_person",
+ "oldfieldtype": "Link",
+ "options": "Sales Person",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "work_done",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Work Done",
+ "oldfieldname": "work_done",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "prevdoc_docname",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Against Document No",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_docname",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "160px",
+ "read_only": 1,
+ "report_hide": 1,
+ "width": "160px"
+ },
+ {
+ "fieldname": "prevdoc_detail_docname",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Against Document Detail No",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_detail_docname",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "160px",
+ "read_only": 1,
+ "report_hide": 1,
+ "width": "160px"
+ },
+ {
+ "fieldname": "prevdoc_doctype",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Document Type",
+ "no_copy": 1,
+ "oldfieldname": "prevdoc_doctype",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 1,
+ "print_width": "150px",
+ "read_only": 1,
+ "report_hide": 1,
+ "width": "150px"
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:20.000000",
+ "modified_by": "Administrator",
+ "module": "Support",
+ "name": "Maintenance Visit Purpose",
+ "owner": "ashwini@webnotestech.com"
+}
\ No newline at end of file
diff --git a/erpnext/support/doctype/newsletter/newsletter.js b/erpnext/support/doctype/newsletter/newsletter.js
index dfa9af9..5c88692 100644
--- a/erpnext/support/doctype/newsletter/newsletter.js
+++ b/erpnext/support/doctype/newsletter/newsletter.js
@@ -17,7 +17,7 @@
if(!doc.__islocal && !cint(doc.email_sent) && !doc.__unsaved
&& inList(frappe.boot.user.can_write, doc.doctype)) {
cur_frm.add_custom_button(frappe._('Send'), function() {
- return $c_obj(make_doclist(doc.doctype, doc.name), 'send_emails', '', function(r) {
+ return $c_obj(doc, 'send_emails', '', function(r) {
cur_frm.refresh();
});
})
diff --git a/erpnext/support/doctype/newsletter/newsletter.py b/erpnext/support/doctype/newsletter/newsletter.py
index 72d05af..7ede45c 100644
--- a/erpnext/support/doctype/newsletter/newsletter.py
+++ b/erpnext/support/doctype/newsletter/newsletter.py
@@ -7,10 +7,9 @@
import frappe.utils
from frappe.utils import cstr
from frappe import msgprint, throw, _
+from frappe.model.document import Document
-class DocType():
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+class Newsletter(Document):
def onload(self):
if self.doc.email_sent:
diff --git a/erpnext/support/doctype/newsletter/newsletter.txt b/erpnext/support/doctype/newsletter/newsletter.txt
index d0ce1f4..600ac3f 100644
--- a/erpnext/support/doctype/newsletter/newsletter.txt
+++ b/erpnext/support/doctype/newsletter/newsletter.txt
@@ -1,179 +1,169 @@
-[
- {
- "creation": "2013-01-10 16:34:31",
- "docstatus": 0,
- "modified": "2014-02-03 11:32:22",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "naming_series:",
- "description": "Create and Send Newsletters",
- "doctype": "DocType",
- "document_type": "Other",
- "icon": "icon-envelope",
- "module": "Support",
- "name": "__common__",
- "title_field": "subject"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Newsletter",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 0,
- "name": "__common__",
- "parent": "Newsletter",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 0,
- "read": 1,
- "report": 0,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Newsletter"
- },
- {
- "description": "Select who you want to send this newsletter to",
- "doctype": "DocField",
- "fieldname": "send_to",
- "fieldtype": "Section Break",
- "label": "Send To"
- },
- {
- "default": "NL-",
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "label": "Series",
- "options": "NL-",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "send_to_type",
- "fieldtype": "Select",
- "label": "Send To Type",
- "options": "Lead\nContact\nEmployee\nCustom"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break"
- },
- {
- "depends_on": "eval:doc.send_to_type==\"Lead\"",
- "doctype": "DocField",
- "fieldname": "lead_source",
- "fieldtype": "Select",
- "label": "Lead Source"
- },
- {
- "depends_on": "eval:doc.send_to_type==\"Lead\"",
- "doctype": "DocField",
- "fieldname": "lead_status",
- "fieldtype": "Select",
- "label": "Lead Status"
- },
- {
- "depends_on": "eval:doc.send_to_type==\"Contact\"",
- "doctype": "DocField",
- "fieldname": "contact_type",
- "fieldtype": "Select",
- "label": "Contact Type",
- "options": "Customer\nSupplier"
- },
- {
- "depends_on": "eval:doc.send_to_type==\"Custom\"",
- "description": "Comma separated list of email addresses",
- "doctype": "DocField",
- "fieldname": "email_list",
- "fieldtype": "Text",
- "label": "Send to this list"
- },
- {
- "doctype": "DocField",
- "fieldname": "newsletter_content",
- "fieldtype": "Section Break",
- "label": "Newsletter Content"
- },
- {
- "description": "If specified, send the newsletter using this email address",
- "doctype": "DocField",
- "fieldname": "send_from",
- "fieldtype": "Data",
- "label": "Send From",
- "no_copy": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "subject",
- "fieldtype": "Small Text",
- "in_list_view": 1,
- "label": "Subject",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "message",
- "fieldtype": "Text Editor",
- "label": "Message",
- "reqd": 0
- },
- {
- "description": "Check how the newsletter looks in an email by sending it to your email.",
- "doctype": "DocField",
- "fieldname": "test_the_newsletter",
- "fieldtype": "Section Break",
- "label": "Test the Newsletter"
- },
- {
- "description": "A Lead with this email id should exist",
- "doctype": "DocField",
- "fieldname": "test_email_id",
- "fieldtype": "Data",
- "label": "Test Email Id"
- },
- {
- "doctype": "DocField",
- "fieldname": "test_send",
- "fieldtype": "Button",
- "label": "Test",
- "options": "test_send"
- },
- {
- "doctype": "DocField",
- "fieldname": "newsletter_status",
- "fieldtype": "Section Break",
- "label": "Newsletter Status"
- },
- {
- "doctype": "DocField",
- "fieldname": "email_sent",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Email Sent?",
- "no_copy": 1,
- "read_only": 1
- },
- {
- "doctype": "DocPerm",
- "role": "Sales Manager"
- },
- {
- "doctype": "DocPerm",
- "role": "Support Manager"
- }
-]
\ No newline at end of file
+{
+ "autoname": "naming_series:",
+ "creation": "2013-01-10 16:34:31.000000",
+ "description": "Create and Send Newsletters",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "fields": [
+ {
+ "description": "Select who you want to send this newsletter to",
+ "fieldname": "send_to",
+ "fieldtype": "Section Break",
+ "label": "Send To",
+ "permlevel": 0
+ },
+ {
+ "default": "NL-",
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "options": "NL-",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "send_to_type",
+ "fieldtype": "Select",
+ "label": "Send To Type",
+ "options": "Lead\nContact\nEmployee\nCustom",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.send_to_type==\"Lead\"",
+ "fieldname": "lead_source",
+ "fieldtype": "Select",
+ "label": "Lead Source",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.send_to_type==\"Lead\"",
+ "fieldname": "lead_status",
+ "fieldtype": "Select",
+ "label": "Lead Status",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.send_to_type==\"Contact\"",
+ "fieldname": "contact_type",
+ "fieldtype": "Select",
+ "label": "Contact Type",
+ "options": "Customer\nSupplier",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.send_to_type==\"Custom\"",
+ "description": "Comma separated list of email addresses",
+ "fieldname": "email_list",
+ "fieldtype": "Text",
+ "label": "Send to this list",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "newsletter_content",
+ "fieldtype": "Section Break",
+ "label": "Newsletter Content",
+ "permlevel": 0
+ },
+ {
+ "description": "If specified, send the newsletter using this email address",
+ "fieldname": "send_from",
+ "fieldtype": "Data",
+ "label": "Send From",
+ "no_copy": 1,
+ "permlevel": 0
+ },
+ {
+ "fieldname": "subject",
+ "fieldtype": "Small Text",
+ "in_list_view": 1,
+ "label": "Subject",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "message",
+ "fieldtype": "Text Editor",
+ "label": "Message",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "description": "Check how the newsletter looks in an email by sending it to your email.",
+ "fieldname": "test_the_newsletter",
+ "fieldtype": "Section Break",
+ "label": "Test the Newsletter",
+ "permlevel": 0
+ },
+ {
+ "description": "A Lead with this email id should exist",
+ "fieldname": "test_email_id",
+ "fieldtype": "Data",
+ "label": "Test Email Id",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "test_send",
+ "fieldtype": "Button",
+ "label": "Test",
+ "options": "test_send",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "newsletter_status",
+ "fieldtype": "Section Break",
+ "label": "Newsletter Status",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "email_sent",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Email Sent?",
+ "no_copy": 1,
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-envelope",
+ "idx": 1,
+ "modified": "2014-02-03 11:32:22.000000",
+ "modified_by": "Administrator",
+ "module": "Support",
+ "name": "Newsletter",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 0,
+ "permlevel": 0,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Sales Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 0,
+ "permlevel": 0,
+ "print": 0,
+ "read": 1,
+ "report": 0,
+ "role": "Support Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "title_field": "subject"
+}
\ No newline at end of file
diff --git a/erpnext/support/doctype/support_email_settings/support_email_settings.py b/erpnext/support/doctype/support_email_settings/support_email_settings.py
index 203bf72..011a943 100644
--- a/erpnext/support/doctype/support_email_settings/support_email_settings.py
+++ b/erpnext/support/doctype/support_email_settings/support_email_settings.py
@@ -6,9 +6,9 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class SupportEmailSettings(Document):
def validate(self):
"""
@@ -16,11 +16,10 @@
"""
if self.doc.sync_support_mails and self.doc.mail_server:
from frappe.utils.email_lib.receive import POP3Mailbox
- from frappe.model.doc import Document
- import _socket, poplib
+ import _socket, poplib
- inc_email = Document('Incoming Email Settings')
- inc_email.encode()
+ inc_email = frappe.get_doc('Incoming Email Settings')
+ # inc_email.encode()
inc_email.host = self.doc.mail_server
inc_email.use_ssl = self.doc.use_ssl
try:
diff --git a/erpnext/support/doctype/support_email_settings/support_email_settings.txt b/erpnext/support/doctype/support_email_settings/support_email_settings.txt
index 5775c28..dd45049 100644
--- a/erpnext/support/doctype/support_email_settings/support_email_settings.txt
+++ b/erpnext/support/doctype/support_email_settings/support_email_settings.txt
@@ -1,111 +1,92 @@
-[
- {
- "creation": "2014-03-03 19:48:46",
- "docstatus": 0,
- "modified": "2014-03-03 20:20:34",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_copy": 1,
- "description": "Email Settings for Outgoing and Incoming Emails.",
- "doctype": "DocType",
- "icon": "icon-cog",
- "in_create": 1,
- "issingle": 1,
- "module": "Support",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Support Email Settings",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Support Email Settings",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "role": "System Manager",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Support Email Settings"
- },
- {
- "description": "Check this to pull emails from your mailbox",
- "doctype": "DocField",
- "fieldname": "sync_support_mails",
- "fieldtype": "Check",
- "label": "Sync Support Mails"
- },
- {
- "description": "Your support email id - must be a valid email - this is where your emails will come!",
- "doctype": "DocField",
- "fieldname": "support_email",
- "fieldtype": "Data",
- "label": "Support Email"
- },
- {
- "description": "POP3 mail server (e.g. pop.gmail.com)",
- "doctype": "DocField",
- "fieldname": "mail_server",
- "fieldtype": "Data",
- "label": "POP3 Mail Server"
- },
- {
- "doctype": "DocField",
- "fieldname": "use_ssl",
- "fieldtype": "Check",
- "label": "Use SSL"
- },
- {
- "doctype": "DocField",
- "fieldname": "mail_login",
- "fieldtype": "Data",
- "label": "User Name"
- },
- {
- "doctype": "DocField",
- "fieldname": "mail_password",
- "fieldtype": "Password",
- "label": "Support Password"
- },
- {
- "doctype": "DocField",
- "fieldname": "cb1",
- "fieldtype": "Column Break"
- },
- {
- "description": "Signature to be appended at the end of every email",
- "doctype": "DocField",
- "fieldname": "support_signature",
- "fieldtype": "Text",
- "label": "Signature"
- },
- {
- "default": "1",
- "doctype": "DocField",
- "fieldname": "send_autoreply",
- "fieldtype": "Check",
- "label": "Send Autoreply"
- },
- {
- "description": "Autoreply when a new mail is received",
- "doctype": "DocField",
- "fieldname": "support_autoreply",
- "fieldtype": "Text",
- "label": "Custom Autoreply Message"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_copy": 1,
+ "creation": "2014-03-03 19:48:46.000000",
+ "description": "Email Settings for Outgoing and Incoming Emails.",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "Check this to pull emails from your mailbox",
+ "fieldname": "sync_support_mails",
+ "fieldtype": "Check",
+ "label": "Sync Support Mails",
+ "permlevel": 0
+ },
+ {
+ "description": "Your support email id - must be a valid email - this is where your emails will come!",
+ "fieldname": "support_email",
+ "fieldtype": "Data",
+ "label": "Support Email",
+ "permlevel": 0
+ },
+ {
+ "description": "POP3 mail server (e.g. pop.gmail.com)",
+ "fieldname": "mail_server",
+ "fieldtype": "Data",
+ "label": "POP3 Mail Server",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "use_ssl",
+ "fieldtype": "Check",
+ "label": "Use SSL",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "mail_login",
+ "fieldtype": "Data",
+ "label": "User Name",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "mail_password",
+ "fieldtype": "Password",
+ "label": "Support Password",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "cb1",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "description": "Signature to be appended at the end of every email",
+ "fieldname": "support_signature",
+ "fieldtype": "Text",
+ "label": "Signature",
+ "permlevel": 0
+ },
+ {
+ "default": "1",
+ "fieldname": "send_autoreply",
+ "fieldtype": "Check",
+ "label": "Send Autoreply",
+ "permlevel": 0
+ },
+ {
+ "description": "Autoreply when a new mail is received",
+ "fieldname": "support_autoreply",
+ "fieldtype": "Text",
+ "label": "Custom Autoreply Message",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-cog",
+ "idx": 1,
+ "in_create": 1,
+ "issingle": 1,
+ "modified": "2014-03-03 20:20:34.000000",
+ "modified_by": "Administrator",
+ "module": "Support",
+ "name": "Support Email Settings",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "permlevel": 0,
+ "read": 1,
+ "role": "System Manager",
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/support/doctype/support_ticket/support_ticket.js b/erpnext/support/doctype/support_ticket/support_ticket.js
index 034fa86..c186535 100644
--- a/erpnext/support/doctype/support_ticket/support_ticket.js
+++ b/erpnext/support/doctype/support_ticket/support_ticket.js
@@ -34,7 +34,7 @@
make_listing: function(doc) {
var wrapper = cur_frm.fields_dict['thread_html'].wrapper;
- var comm_list = frappe.model.get("Communication", {"parent": doc.name, "parenttype":"Support Ticket"})
+ var comm_list = frappe.get_list("Communication", {"parent": doc.name, "parenttype":"Support Ticket"})
if(!comm_list.length) {
comm_list.push({
diff --git a/erpnext/support/doctype/support_ticket/support_ticket.py b/erpnext/support/doctype/support_ticket/support_ticket.py
index 57d141e..a01dad3 100644
--- a/erpnext/support/doctype/support_ticket/support_ticket.py
+++ b/erpnext/support/doctype/support_ticket/support_ticket.py
@@ -7,10 +7,7 @@
from erpnext.utilities.transaction_base import TransactionBase
from frappe.utils import now, extract_email_id
-class DocType(TransactionBase):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class SupportTicket(TransactionBase):
def get_sender(self, comm):
return frappe.db.get_value('Support Email Settings',None,'support_email')
diff --git a/erpnext/support/doctype/support_ticket/support_ticket.txt b/erpnext/support/doctype/support_ticket/support_ticket.txt
index 2eac196..1a2e856 100644
--- a/erpnext/support/doctype/support_ticket/support_ticket.txt
+++ b/erpnext/support/doctype/support_ticket/support_ticket.txt
@@ -1,291 +1,290 @@
-[
- {
- "creation": "2013-02-01 10:36:25",
- "docstatus": 0,
- "modified": "2014-01-20 17:49:31",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 1,
- "autoname": "naming_series:",
- "doctype": "DocType",
- "icon": "icon-ticket",
- "module": "Support",
- "name": "__common__",
- "search_fields": "status,customer,allocated_to,subject,raised_by"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Support Ticket",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Support Ticket",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Support Ticket"
- },
- {
- "doctype": "DocField",
- "fieldname": "subject_section",
- "fieldtype": "Section Break",
- "label": "Subject",
- "options": "icon-flag"
- },
- {
- "doctype": "DocField",
- "fieldname": "naming_series",
- "fieldtype": "Select",
- "hidden": 0,
- "label": "Series",
- "no_copy": 1,
- "options": "SUP",
- "print_hide": 1,
- "reqd": 0,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "subject",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Subject",
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "cb00",
- "fieldtype": "Column Break"
- },
- {
- "default": "Open",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "Open\nReplied\nHold\nClosed",
- "read_only": 0,
- "reqd": 0,
- "search_index": 1
- },
- {
- "depends_on": "eval:doc.__islocal",
- "doctype": "DocField",
- "fieldname": "raised_by",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Raised By (Email)",
- "oldfieldname": "raised_by",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "sb00",
- "fieldtype": "Section Break",
- "label": "Messages",
- "options": "icon-comments"
- },
- {
- "depends_on": "eval:doc.__islocal",
- "doctype": "DocField",
- "fieldname": "description",
- "fieldtype": "Text",
- "label": "Description",
- "oldfieldname": "problem_description",
- "oldfieldtype": "Text",
- "reqd": 0
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "thread_html",
- "fieldtype": "HTML",
- "label": "Thread HTML",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "additional_info",
- "fieldtype": "Section Break",
- "label": "Reference",
- "options": "icon-pushpin",
- "read_only": 1
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 1,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "lead",
- "fieldtype": "Link",
- "label": "Lead",
- "options": "Lead"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact",
- "fieldtype": "Link",
- "label": "Contact",
- "options": "Contact"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Customer",
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Customer Name",
- "oldfieldname": "customer_name",
- "oldfieldtype": "Data",
- "read_only": 1,
- "reqd": 0,
- "search_index": 0
- },
- {
- "default": "Today",
- "doctype": "DocField",
- "fieldname": "opening_date",
- "fieldtype": "Date",
- "label": "Opening Date",
- "no_copy": 1,
- "oldfieldname": "opening_date",
- "oldfieldtype": "Date",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "opening_time",
- "fieldtype": "Time",
- "label": "Opening Time",
- "no_copy": 1,
- "oldfieldname": "opening_time",
- "oldfieldtype": "Time",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "company",
- "fieldtype": "Link",
- "label": "Company",
- "options": "Company",
- "print_hide": 1,
- "reqd": 0
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "first_responded_on",
- "fieldtype": "Datetime",
- "label": "First Responded On"
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "resolution_date",
- "fieldtype": "Datetime",
- "in_filter": 0,
- "label": "Resolution Date",
- "no_copy": 1,
- "oldfieldname": "resolution_date",
- "oldfieldtype": "Date",
- "read_only": 1,
- "search_index": 0
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "doctype": "DocField",
- "fieldname": "resolution_details",
- "fieldtype": "Small Text",
- "label": "Resolution Details",
- "no_copy": 1,
- "oldfieldname": "resolution_details",
- "oldfieldtype": "Text",
- "read_only": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "content_type",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Content Type"
- },
- {
- "doctype": "DocField",
- "fieldname": "communications",
- "fieldtype": "Table",
- "hidden": 1,
- "label": "Communications",
- "options": "Communication",
- "print_hide": 1
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Guest"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Customer"
- },
- {
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Support Team"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-02-01 10:36:25.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "subject_section",
+ "fieldtype": "Section Break",
+ "label": "Subject",
+ "options": "icon-flag",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "label": "Series",
+ "no_copy": 1,
+ "options": "SUP",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "subject",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Subject",
+ "permlevel": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "cb00",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "default": "Open",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "Open\nReplied\nHold\nClosed",
+ "permlevel": 0,
+ "read_only": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "depends_on": "eval:doc.__islocal",
+ "fieldname": "raised_by",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Raised By (Email)",
+ "oldfieldname": "raised_by",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "sb00",
+ "fieldtype": "Section Break",
+ "label": "Messages",
+ "options": "icon-comments",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:doc.__islocal",
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "label": "Description",
+ "oldfieldname": "problem_description",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "thread_html",
+ "fieldtype": "HTML",
+ "label": "Thread HTML",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "additional_info",
+ "fieldtype": "Section Break",
+ "label": "Reference",
+ "options": "icon-pushpin",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 1,
+ "width": "50%"
+ },
+ {
+ "fieldname": "lead",
+ "fieldtype": "Link",
+ "label": "Lead",
+ "options": "Lead",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "contact",
+ "fieldtype": "Link",
+ "label": "Contact",
+ "options": "Contact",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Customer",
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Customer Name",
+ "oldfieldname": "customer_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "read_only": 1,
+ "reqd": 0,
+ "search_index": 0
+ },
+ {
+ "default": "Today",
+ "fieldname": "opening_date",
+ "fieldtype": "Date",
+ "label": "Opening Date",
+ "no_copy": 1,
+ "oldfieldname": "opening_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "opening_time",
+ "fieldtype": "Time",
+ "label": "Opening Time",
+ "no_copy": 1,
+ "oldfieldname": "opening_time",
+ "oldfieldtype": "Time",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "options": "Company",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "first_responded_on",
+ "fieldtype": "Datetime",
+ "label": "First Responded On",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "resolution_date",
+ "fieldtype": "Datetime",
+ "in_filter": 0,
+ "label": "Resolution Date",
+ "no_copy": 1,
+ "oldfieldname": "resolution_date",
+ "oldfieldtype": "Date",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "depends_on": "eval:!doc.__islocal",
+ "fieldname": "resolution_details",
+ "fieldtype": "Small Text",
+ "label": "Resolution Details",
+ "no_copy": 1,
+ "oldfieldname": "resolution_details",
+ "oldfieldtype": "Text",
+ "permlevel": 0,
+ "read_only": 0
+ },
+ {
+ "fieldname": "content_type",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Content Type",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "icon": "icon-ticket",
+ "idx": 1,
+ "modified": "2014-01-20 17:49:31.000000",
+ "modified_by": "Administrator",
+ "module": "Support",
+ "name": "Support Ticket",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Guest",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Customer",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Support Team",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "search_fields": "status,customer,allocated_to,subject,raised_by"
+}
\ No newline at end of file
diff --git a/erpnext/support/page/support_analytics/support_analytics.txt b/erpnext/support/page/support_analytics/support_analytics.txt
index 3b9f190..3d8b486 100644
--- a/erpnext/support/page/support_analytics/support_analytics.txt
+++ b/erpnext/support/page/support_analytics/support_analytics.txt
@@ -1,33 +1,20 @@
-[
- {
- "creation": "2013-01-04 15:31:45",
- "docstatus": 0,
- "modified": "2013-07-11 14:44:24",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Page",
- "icon": "icon-bar-chart",
- "module": "Support",
- "name": "__common__",
- "page_name": "support-analytics",
- "standard": "Yes",
- "title": "Support Analytics"
- },
- {
- "doctype": "Page Role",
- "name": "__common__",
- "parent": "support-analytics",
- "parentfield": "roles",
- "parenttype": "Page",
- "role": "Support Team"
- },
- {
- "doctype": "Page",
- "name": "support-analytics"
- },
- {
- "doctype": "Page Role"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-04 15:31:45.000000",
+ "docstatus": 0,
+ "doctype": "Page",
+ "icon": "icon-bar-chart",
+ "idx": 1,
+ "modified": "2013-07-11 14:44:24.000000",
+ "modified_by": "Administrator",
+ "module": "Support",
+ "name": "support-analytics",
+ "owner": "Administrator",
+ "page_name": "support-analytics",
+ "roles": [
+ {
+ "role": "Support Team"
+ }
+ ],
+ "standard": "Yes",
+ "title": "Support Analytics"
+}
\ No newline at end of file
diff --git a/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt b/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt
index a4c6fdb..b8885d4 100644
--- a/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt
+++ b/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt
@@ -1,23 +1,16 @@
-[
- {
- "creation": "2013-05-06 14:25:21",
- "docstatus": 0,
- "modified": "2014-03-07 15:30:27",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "Report",
- "is_standard": "Yes",
- "module": "Support",
- "name": "__common__",
- "query": "SELECT\n ms_sch.scheduled_date as \"Schedule Date:Date:120\",\n\tms_sch.item_code as \"Item Code:Link/Item:120\",\n\tms_sch.item_name as \"Item Name::120\",\n\tms_sch.serial_no as \"Serial No::120\",\n\tms_sch.sales_person as \"Sales Person::120\",\n\tms.customer_name as \"Customer:Link/Customer:120\",\n\tms.address_display as \"Customer Address::120\",\n\tms_item.prevdoc_docname as \"Sales Order:Link/Sales Order:120\",\n\tms.company as \"Company:Link/Company:120\"\n\t\nFROM\n\t`tabMaintenance Schedule` ms, \n `tabMaintenance Schedule Detail` ms_sch, \n `tabMaintenance Schedule Item` ms_item\nWHERE\n\tms.name = ms_sch.parent and ms.name = ms_item.parent and ms.docstatus = 1\nORDER BY\n\tms_sch.scheduled_date asc, ms_sch.item_code asc",
- "ref_doctype": "Maintenance Schedule",
- "report_name": "Maintenance Schedules",
- "report_type": "Query Report"
- },
- {
- "doctype": "Report",
- "name": "Maintenance Schedules"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-05-06 14:25:21.000000",
+ "docstatus": 0,
+ "doctype": "Report",
+ "idx": 1,
+ "is_standard": "Yes",
+ "modified": "2014-03-07 15:30:27.000000",
+ "modified_by": "Administrator",
+ "module": "Support",
+ "name": "Maintenance Schedules",
+ "owner": "Administrator",
+ "query": "SELECT\n ms_sch.scheduled_date as \"Schedule Date:Date:120\",\n\tms_sch.item_code as \"Item Code:Link/Item:120\",\n\tms_sch.item_name as \"Item Name::120\",\n\tms_sch.serial_no as \"Serial No::120\",\n\tms_sch.sales_person as \"Sales Person::120\",\n\tms.customer_name as \"Customer:Link/Customer:120\",\n\tms.address_display as \"Customer Address::120\",\n\tms_item.prevdoc_docname as \"Sales Order:Link/Sales Order:120\",\n\tms.company as \"Company:Link/Company:120\"\n\t\nFROM\n\t`tabMaintenance Schedule` ms, \n `tabMaintenance Schedule Detail` ms_sch, \n `tabMaintenance Schedule Item` ms_item\nWHERE\n\tms.name = ms_sch.parent and ms.name = ms_item.parent and ms.docstatus = 1\nORDER BY\n\tms_sch.scheduled_date asc, ms_sch.item_code asc",
+ "ref_doctype": "Maintenance Schedule",
+ "report_name": "Maintenance Schedules",
+ "report_type": "Query Report"
+}
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/address/address.py b/erpnext/utilities/doctype/address/address.py
index b80f13a..778451b 100644
--- a/erpnext/utilities/doctype/address/address.py
+++ b/erpnext/utilities/doctype/address/address.py
@@ -7,10 +7,9 @@
from frappe import msgprint, throw, _
from frappe.utils import cstr, cint
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class Address(Document):
def autoname(self):
if not self.doc.address_title:
@@ -57,7 +56,7 @@
if not isinstance(address_dict, dict):
address_dict = frappe.db.get_value("Address", address_dict, "*", as_dict=True) or {}
- meta = frappe.get_doctype("Address")
+ meta = frappe.get_meta("Address")
sequence = (("", "address_line1"),
("\n", "address_line2"),
("\n", "city"),
diff --git a/erpnext/utilities/doctype/address/address.txt b/erpnext/utilities/doctype/address/address.txt
index aa9230d..e1532d6 100644
--- a/erpnext/utilities/doctype/address/address.txt
+++ b/erpnext/utilities/doctype/address/address.txt
@@ -1,254 +1,262 @@
-[
- {
- "creation": "2013-01-10 16:34:32",
- "docstatus": 0,
- "modified": "2014-01-27 11:19:06",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-map-marker",
- "in_dialog": 0,
- "module": "Utilities",
- "name": "__common__",
- "search_fields": "customer, supplier, sales_partner, country, state"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Address",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Address",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Address"
- },
- {
- "doctype": "DocField",
- "fieldname": "address_details",
- "fieldtype": "Section Break",
- "label": "Address Details",
- "options": "icon-map-marker"
- },
- {
- "description": "Name of person or organization that this address belongs to.",
- "doctype": "DocField",
- "fieldname": "address_title",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Address Title",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "address_type",
- "fieldtype": "Select",
- "label": "Address Type",
- "options": "Billing\nShipping\nOffice\nPersonal\nPlant\nPostal\nShop\nSubsidiary\nWarehouse\nOther",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_line1",
- "fieldtype": "Data",
- "label": "Address Line 1",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "address_line2",
- "fieldtype": "Data",
- "label": "Address Line 2"
- },
- {
- "doctype": "DocField",
- "fieldname": "city",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "City/Town",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "state",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "State",
- "options": "Suggest",
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "pincode",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Pincode",
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "country",
- "fieldtype": "Select",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Country",
- "options": "link:Country",
- "reqd": 1,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "print_hide": 0,
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "email_id",
- "fieldtype": "Data",
- "label": "Email Id"
- },
- {
- "doctype": "DocField",
- "fieldname": "phone",
- "fieldtype": "Data",
- "label": "Phone",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "fax",
- "fieldtype": "Data",
- "in_filter": 1,
- "label": "Fax"
- },
- {
- "default": "0",
- "description": "Check to make primary address",
- "doctype": "DocField",
- "fieldname": "is_primary_address",
- "fieldtype": "Check",
- "label": "Preferred Billing Address"
- },
- {
- "default": "0",
- "description": "Check to make Shipping Address",
- "doctype": "DocField",
- "fieldname": "is_shipping_address",
- "fieldtype": "Check",
- "in_list_view": 1,
- "label": "Preferred Shipping Address"
- },
- {
- "doctype": "DocField",
- "fieldname": "linked_with",
- "fieldtype": "Section Break",
- "label": "Reference",
- "options": "icon-pushpin"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "label": "Customer",
- "options": "Customer"
- },
- {
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Customer Name",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier",
- "fieldtype": "Link",
- "label": "Supplier",
- "options": "Supplier"
- },
- {
- "doctype": "DocField",
- "fieldname": "supplier_name",
- "fieldtype": "Data",
- "in_filter": 1,
- "in_list_view": 0,
- "label": "Supplier Name",
- "read_only": 1,
- "search_index": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sales_partner",
- "fieldtype": "Link",
- "label": "Sales Partner",
- "options": "Sales Partner"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break_22",
- "fieldtype": "Column Break"
- },
- {
- "depends_on": "eval:!doc.supplier && !doc.sales_partner",
- "doctype": "DocField",
- "fieldname": "lead",
- "fieldtype": "Link",
- "label": "Lead",
- "options": "Lead"
- },
- {
- "depends_on": "eval:!doc.supplier && !doc.sales_partner",
- "doctype": "DocField",
- "fieldname": "lead_name",
- "fieldtype": "Data",
- "label": "Lead Name",
- "read_only": 1
- },
- {
- "doctype": "DocPerm",
- "role": "Sales User"
- },
- {
- "doctype": "DocPerm",
- "role": "Purchase User"
- },
- {
- "doctype": "DocPerm",
- "role": "Maintenance User"
- },
- {
- "doctype": "DocPerm",
- "role": "Accounts User"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "creation": "2013-01-10 16:34:32.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "address_details",
+ "fieldtype": "Section Break",
+ "label": "Address Details",
+ "options": "icon-map-marker",
+ "permlevel": 0
+ },
+ {
+ "description": "Name of person or organization that this address belongs to.",
+ "fieldname": "address_title",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Address Title",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "address_type",
+ "fieldtype": "Select",
+ "label": "Address Type",
+ "options": "Billing\nShipping\nOffice\nPersonal\nPlant\nPostal\nShop\nSubsidiary\nWarehouse\nOther",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "address_line1",
+ "fieldtype": "Data",
+ "label": "Address Line 1",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "address_line2",
+ "fieldtype": "Data",
+ "label": "Address Line 2",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "city",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "City/Town",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "state",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "State",
+ "options": "Suggest",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "pincode",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Pincode",
+ "permlevel": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "country",
+ "fieldtype": "Select",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Country",
+ "options": "link:Country",
+ "permlevel": 0,
+ "reqd": 1,
+ "search_index": 1
+ },
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "email_id",
+ "fieldtype": "Data",
+ "label": "Email Id",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "phone",
+ "fieldtype": "Data",
+ "label": "Phone",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "fax",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "label": "Fax",
+ "permlevel": 0
+ },
+ {
+ "default": "0",
+ "description": "Check to make primary address",
+ "fieldname": "is_primary_address",
+ "fieldtype": "Check",
+ "label": "Preferred Billing Address",
+ "permlevel": 0
+ },
+ {
+ "default": "0",
+ "description": "Check to make Shipping Address",
+ "fieldname": "is_shipping_address",
+ "fieldtype": "Check",
+ "in_list_view": 1,
+ "label": "Preferred Shipping Address",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "linked_with",
+ "fieldtype": "Section Break",
+ "label": "Reference",
+ "options": "icon-pushpin",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "label": "Customer",
+ "options": "Customer",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "label": "Supplier",
+ "options": "Supplier",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "supplier_name",
+ "fieldtype": "Data",
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Supplier Name",
+ "permlevel": 0,
+ "read_only": 1,
+ "search_index": 0
+ },
+ {
+ "fieldname": "sales_partner",
+ "fieldtype": "Link",
+ "label": "Sales Partner",
+ "options": "Sales Partner",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break_22",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:!doc.supplier && !doc.sales_partner",
+ "fieldname": "lead",
+ "fieldtype": "Link",
+ "label": "Lead",
+ "options": "Lead",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:!doc.supplier && !doc.sales_partner",
+ "fieldname": "lead_name",
+ "fieldtype": "Data",
+ "label": "Lead Name",
+ "permlevel": 0,
+ "read_only": 1
+ }
+ ],
+ "icon": "icon-map-marker",
+ "idx": 1,
+ "in_dialog": 0,
+ "modified": "2014-01-27 11:19:06.000000",
+ "modified_by": "Administrator",
+ "module": "Utilities",
+ "name": "Address",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 0,
+ "write": 1
+ }
+ ],
+ "search_fields": "customer, supplier, sales_partner, country, state"
+}
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/contact/contact.js b/erpnext/utilities/doctype/contact/contact.js
index eb7681f..f2a2fdc 100644
--- a/erpnext/utilities/doctype/contact/contact.js
+++ b/erpnext/utilities/doctype/contact/contact.js
@@ -5,7 +5,7 @@
cur_frm.cscript.refresh = function(doc) {
cur_frm.communication_view = new frappe.views.CommunicationList({
- list: frappe.model.get("Communication", {"parent": doc.name, "parenttype": "Contact"}),
+ list: frappe.get_list("Communication", {"parent": doc.name, "parenttype": "Contact"}),
parent: cur_frm.fields_dict.communication_html.wrapper,
doc: doc,
recipients: doc.email_id
diff --git a/erpnext/utilities/doctype/contact/contact.py b/erpnext/utilities/doctype/contact/contact.py
index 948b753..16522a8 100644
--- a/erpnext/utilities/doctype/contact/contact.py
+++ b/erpnext/utilities/doctype/contact/contact.py
@@ -7,10 +7,7 @@
from erpnext.controllers.status_updater import StatusUpdater
-class DocType(StatusUpdater):
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+class Contact(StatusUpdater):
def autoname(self):
# concat first and last name
diff --git a/erpnext/utilities/doctype/contact/contact.txt b/erpnext/utilities/doctype/contact/contact.txt
index 5a3e32d..bf9f075 100644
--- a/erpnext/utilities/doctype/contact/contact.txt
+++ b/erpnext/utilities/doctype/contact/contact.txt
@@ -1,301 +1,362 @@
-[
- {
- "creation": "2013-01-10 16:34:32",
- "docstatus": 0,
- "modified": "2014-01-20 17:48:29",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_import": 1,
- "allow_rename": 1,
- "doctype": "DocType",
- "document_type": "Master",
- "icon": "icon-user",
- "in_create": 0,
- "in_dialog": 0,
- "module": "Utilities",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Contact",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Contact",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Contact"
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_section",
- "fieldtype": "Section Break",
- "label": "Contact Details",
- "options": "icon-user"
- },
- {
- "doctype": "DocField",
- "fieldname": "first_name",
- "fieldtype": "Data",
- "label": "First Name",
- "oldfieldname": "first_name",
- "oldfieldtype": "Data",
- "reqd": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "last_name",
- "fieldtype": "Data",
- "label": "Last Name",
- "oldfieldname": "last_name",
- "oldfieldtype": "Data"
- },
- {
- "doctype": "DocField",
- "fieldname": "cb00",
- "fieldtype": "Column Break"
- },
- {
- "default": "Passive",
- "doctype": "DocField",
- "fieldname": "status",
- "fieldtype": "Select",
- "label": "Status",
- "options": "Passive\nOpen\nReplied"
- },
- {
- "doctype": "DocField",
- "fieldname": "email_id",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Email Id",
- "oldfieldname": "email_id",
- "oldfieldtype": "Data",
- "reqd": 0,
- "search_index": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "phone",
- "fieldtype": "Data",
- "label": "Phone",
- "oldfieldname": "contact_no",
- "oldfieldtype": "Data",
- "reqd": 0
- },
- {
- "doctype": "DocField",
- "fieldname": "sb00",
- "fieldtype": "Section Break",
- "label": "Communication History",
- "options": "icon-comments",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "communication_html",
- "fieldtype": "HTML",
- "label": "Communication HTML",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "contact_details",
- "fieldtype": "Section Break",
- "label": "Reference",
- "options": "icon-pushpin"
- },
- {
- "depends_on": "eval:!doc.supplier && !doc.sales_partner",
- "doctype": "DocField",
- "fieldname": "customer",
- "fieldtype": "Link",
- "label": "Customer",
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "print_hide": 0
- },
- {
- "depends_on": "eval:!doc.supplier && !doc.sales_partner",
- "doctype": "DocField",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Customer Name",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "width": "50%"
- },
- {
- "depends_on": "eval:!doc.customer && !doc.sales_partner",
- "doctype": "DocField",
- "fieldname": "supplier",
- "fieldtype": "Link",
- "label": "Supplier",
- "options": "Supplier"
- },
- {
- "allow_on_submit": 0,
- "depends_on": "eval:!doc.customer && !doc.sales_partner",
- "doctype": "DocField",
- "fieldname": "supplier_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Supplier Name",
- "read_only": 1
- },
- {
- "depends_on": "eval:!doc.customer && !doc.supplier",
- "doctype": "DocField",
- "fieldname": "sales_partner",
- "fieldtype": "Link",
- "label": "Sales Partner",
- "options": "Sales Partner"
- },
- {
- "default": "0",
- "depends_on": "eval:(doc.customer || doc.supplier || doc.sales_partner)",
- "doctype": "DocField",
- "fieldname": "is_primary_contact",
- "fieldtype": "Check",
- "label": "Is Primary Contact",
- "oldfieldname": "is_primary_contact",
- "oldfieldtype": "Select"
- },
- {
- "doctype": "DocField",
- "fieldname": "more_info",
- "fieldtype": "Section Break",
- "label": "More Info",
- "options": "icon-file-text"
- },
- {
- "doctype": "DocField",
- "fieldname": "mobile_no",
- "fieldtype": "Data",
- "label": "Mobile No",
- "oldfieldname": "mobile_no",
- "oldfieldtype": "Data"
- },
- {
- "description": "Enter department to which this Contact belongs",
- "doctype": "DocField",
- "fieldname": "department",
- "fieldtype": "Data",
- "label": "Department",
- "options": "Suggest"
- },
- {
- "description": "Enter designation of this Contact",
- "doctype": "DocField",
- "fieldname": "designation",
- "fieldtype": "Data",
- "label": "Designation",
- "options": "Suggest"
- },
- {
- "doctype": "DocField",
- "fieldname": "unsubscribed",
- "fieldtype": "Check",
- "label": "Unsubscribed"
- },
- {
- "doctype": "DocField",
- "fieldname": "trash_reason",
- "fieldtype": "Small Text",
- "label": "Trash Reason",
- "oldfieldname": "trash_reason",
- "oldfieldtype": "Small Text",
- "read_only": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "communications",
- "fieldtype": "Table",
- "hidden": 1,
- "label": "Communications",
- "options": "Communication",
- "print_hide": 1
- },
- {
- "delete": 1,
- "doctype": "DocPerm",
- "role": "System Manager"
- },
- {
- "amend": 0,
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Sales Master Manager"
- },
- {
- "delete": 1,
- "doctype": "DocPerm",
- "role": "Purchase Master Manager"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales Manager"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Purchase Manager"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Maintenance Manager"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Accounts Manager"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Sales User"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Purchase User"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Maintenance User"
- },
- {
- "delete": 0,
- "doctype": "DocPerm",
- "role": "Accounts User"
- }
-]
\ No newline at end of file
+{
+ "allow_import": 1,
+ "allow_rename": 1,
+ "creation": "2013-01-10 16:34:32.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Master",
+ "fields": [
+ {
+ "fieldname": "contact_section",
+ "fieldtype": "Section Break",
+ "label": "Contact Details",
+ "options": "icon-user",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "first_name",
+ "fieldtype": "Data",
+ "label": "First Name",
+ "oldfieldname": "first_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "fieldname": "last_name",
+ "fieldtype": "Data",
+ "label": "Last Name",
+ "oldfieldname": "last_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "cb00",
+ "fieldtype": "Column Break",
+ "permlevel": 0
+ },
+ {
+ "default": "Passive",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "label": "Status",
+ "options": "Passive\nOpen\nReplied",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "email_id",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Email Id",
+ "oldfieldname": "email_id",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 0,
+ "search_index": 1
+ },
+ {
+ "fieldname": "phone",
+ "fieldtype": "Data",
+ "label": "Phone",
+ "oldfieldname": "contact_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
+ "fieldname": "sb00",
+ "fieldtype": "Section Break",
+ "label": "Communication History",
+ "options": "icon-comments",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "communication_html",
+ "fieldtype": "HTML",
+ "label": "Communication HTML",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "contact_details",
+ "fieldtype": "Section Break",
+ "label": "Reference",
+ "options": "icon-pushpin",
+ "permlevel": 0
+ },
+ {
+ "depends_on": "eval:!doc.supplier && !doc.sales_partner",
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "label": "Customer",
+ "oldfieldname": "customer",
+ "oldfieldtype": "Link",
+ "options": "Customer",
+ "permlevel": 0,
+ "print_hide": 0
+ },
+ {
+ "depends_on": "eval:!doc.supplier && !doc.sales_partner",
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Customer Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "depends_on": "eval:!doc.customer && !doc.sales_partner",
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "label": "Supplier",
+ "options": "Supplier",
+ "permlevel": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "depends_on": "eval:!doc.customer && !doc.sales_partner",
+ "fieldname": "supplier_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Supplier Name",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "depends_on": "eval:!doc.customer && !doc.supplier",
+ "fieldname": "sales_partner",
+ "fieldtype": "Link",
+ "label": "Sales Partner",
+ "options": "Sales Partner",
+ "permlevel": 0
+ },
+ {
+ "default": "0",
+ "depends_on": "eval:(doc.customer || doc.supplier || doc.sales_partner)",
+ "fieldname": "is_primary_contact",
+ "fieldtype": "Check",
+ "label": "Is Primary Contact",
+ "oldfieldname": "is_primary_contact",
+ "oldfieldtype": "Select",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "more_info",
+ "fieldtype": "Section Break",
+ "label": "More Info",
+ "options": "icon-file-text",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "mobile_no",
+ "fieldtype": "Data",
+ "label": "Mobile No",
+ "oldfieldname": "mobile_no",
+ "oldfieldtype": "Data",
+ "permlevel": 0
+ },
+ {
+ "description": "Enter department to which this Contact belongs",
+ "fieldname": "department",
+ "fieldtype": "Data",
+ "label": "Department",
+ "options": "Suggest",
+ "permlevel": 0
+ },
+ {
+ "description": "Enter designation of this Contact",
+ "fieldname": "designation",
+ "fieldtype": "Data",
+ "label": "Designation",
+ "options": "Suggest",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "unsubscribed",
+ "fieldtype": "Check",
+ "label": "Unsubscribed",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "trash_reason",
+ "fieldtype": "Small Text",
+ "label": "Trash Reason",
+ "oldfieldname": "trash_reason",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
+ "read_only": 1
+ },
+ {
+ "fieldname": "communications",
+ "fieldtype": "Table",
+ "hidden": 1,
+ "label": "Communications",
+ "options": "Communication",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "icon": "icon-user",
+ "idx": 1,
+ "in_create": 0,
+ "in_dialog": 0,
+ "modified": "2014-01-20 17:48:29.000000",
+ "modified_by": "Administrator",
+ "module": "Utilities",
+ "name": "Contact",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "amend": 0,
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Master Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts Manager",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Purchase User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance User",
+ "submit": 0,
+ "write": 1
+ },
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Accounts User",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/note/note.py b/erpnext/utilities/doctype/note/note.py
index 99846d9..8936da7 100644
--- a/erpnext/utilities/doctype/note/note.py
+++ b/erpnext/utilities/doctype/note/note.py
@@ -6,9 +6,9 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class Note(Document):
def autoname(self):
# replace forbidden characters
diff --git a/erpnext/utilities/doctype/note/note.txt b/erpnext/utilities/doctype/note/note.txt
index 94e5a0f..9eab6a1 100644
--- a/erpnext/utilities/doctype/note/note.txt
+++ b/erpnext/utilities/doctype/note/note.txt
@@ -1,88 +1,69 @@
-[
- {
- "creation": "2013-05-24 13:41:00",
- "docstatus": 0,
- "modified": "2014-01-22 16:05:35",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_rename": 1,
- "description": "Note is a free page where users can share documents / notes",
- "doctype": "DocType",
- "document_type": "Transaction",
- "icon": "icon-file-text",
- "module": "Utilities",
- "name": "__common__",
- "read_only_onload": 1
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Note",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "cancel": 0,
- "create": 1,
- "delete": 1,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "Note",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "restricted": 1,
- "role": "All",
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Note"
- },
- {
- "doctype": "DocField",
- "fieldname": "title",
- "fieldtype": "Data",
- "label": "Title",
- "print_hide": 1
- },
- {
- "description": "Help: To link to another record in the system, use \"#Form/Note/[Note Name]\" as the Link URL. (don't use \"http://\")",
- "doctype": "DocField",
- "fieldname": "content",
- "fieldtype": "Text Editor",
- "in_list_view": 0,
- "label": "Content"
- },
- {
- "doctype": "DocField",
- "fieldname": "share",
- "fieldtype": "Section Break",
- "label": "Share"
- },
- {
- "description": "Everyone can read",
- "doctype": "DocField",
- "fieldname": "public",
- "fieldtype": "Check",
- "label": "Public",
- "print_hide": 1
- },
- {
- "doctype": "DocField",
- "fieldname": "share_with",
- "fieldtype": "Table",
- "label": "Share With",
- "options": "Note User",
- "print_hide": 1
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_rename": 1,
+ "creation": "2013-05-24 13:41:00.000000",
+ "description": "Note is a free page where users can share documents / notes",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
+ "fields": [
+ {
+ "fieldname": "title",
+ "fieldtype": "Data",
+ "label": "Title",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "description": "Help: To link to another record in the system, use \"#Form/Note/[Note Name]\" as the Link URL. (don't use \"http://\")",
+ "fieldname": "content",
+ "fieldtype": "Text Editor",
+ "in_list_view": 0,
+ "label": "Content",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "share",
+ "fieldtype": "Section Break",
+ "label": "Share",
+ "permlevel": 0
+ },
+ {
+ "description": "Everyone can read",
+ "fieldname": "public",
+ "fieldtype": "Check",
+ "label": "Public",
+ "permlevel": 0,
+ "print_hide": 1
+ },
+ {
+ "fieldname": "share_with",
+ "fieldtype": "Table",
+ "label": "Share With",
+ "options": "Note User",
+ "permlevel": 0,
+ "print_hide": 1
+ }
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "modified": "2014-01-22 16:05:35.000000",
+ "modified_by": "Administrator",
+ "module": "Utilities",
+ "name": "Note",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "cancel": 0,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "restricted": 1,
+ "role": "All",
+ "write": 1
+ }
+ ],
+ "read_only_onload": 1
+}
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/note_user/note_user.py b/erpnext/utilities/doctype/note_user/note_user.py
index 968a25b..1594f78 100644
--- a/erpnext/utilities/doctype/note_user/note_user.py
+++ b/erpnext/utilities/doctype/note_user/note_user.py
@@ -6,6 +6,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class NoteUser(Document):
+ pass
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/note_user/note_user.txt b/erpnext/utilities/doctype/note_user/note_user.txt
index 6ae80de..f72f1bd 100644
--- a/erpnext/utilities/doctype/note_user/note_user.txt
+++ b/erpnext/utilities/doctype/note_user/note_user.txt
@@ -1,46 +1,34 @@
-[
- {
- "creation": "2013-05-24 14:24:48",
- "docstatus": 0,
- "modified": "2013-12-20 19:23:23",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "description": "List of users who can edit a particular Note",
- "doctype": "DocType",
- "document_type": "Other",
- "istable": 1,
- "module": "Utilities",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "in_list_view": 1,
- "name": "__common__",
- "parent": "Note User",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "doctype": "DocType",
- "name": "Note User"
- },
- {
- "doctype": "DocField",
- "fieldname": "user",
- "fieldtype": "Link",
- "label": "User",
- "options": "User",
- "reqd": 1
- },
- {
- "default": "Edit",
- "doctype": "DocField",
- "fieldname": "permission",
- "fieldtype": "Select",
- "label": "Permission",
- "options": "Edit\nRead"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-05-24 14:24:48.000000",
+ "description": "List of users who can edit a particular Note",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "fields": [
+ {
+ "fieldname": "user",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "User",
+ "options": "User",
+ "permlevel": 0,
+ "reqd": 1
+ },
+ {
+ "default": "Edit",
+ "fieldname": "permission",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "label": "Permission",
+ "options": "Edit\nRead",
+ "permlevel": 0
+ }
+ ],
+ "idx": 1,
+ "istable": 1,
+ "modified": "2013-12-20 19:23:23.000000",
+ "modified_by": "Administrator",
+ "module": "Utilities",
+ "name": "Note User",
+ "owner": "Administrator"
+}
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/rename_tool/rename_tool.py b/erpnext/utilities/doctype/rename_tool/rename_tool.py
index 835e647..7ee46df 100644
--- a/erpnext/utilities/doctype/rename_tool/rename_tool.py
+++ b/erpnext/utilities/doctype/rename_tool/rename_tool.py
@@ -7,9 +7,9 @@
import frappe
from frappe import _
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
+from frappe.model.document import Document
+
+class RenameTool(Document):
@frappe.whitelist()
def get_doctypes():
diff --git a/erpnext/utilities/doctype/rename_tool/rename_tool.txt b/erpnext/utilities/doctype/rename_tool/rename_tool.txt
index e397cf3..a7384ec 100644
--- a/erpnext/utilities/doctype/rename_tool/rename_tool.txt
+++ b/erpnext/utilities/doctype/rename_tool/rename_tool.txt
@@ -1,70 +1,51 @@
-[
- {
- "creation": "2012-12-03 10:25:59",
- "docstatus": 0,
- "modified": "2013-07-05 14:52:51",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "allow_attach": 0,
- "allow_email": 1,
- "allow_print": 1,
- "doctype": "DocType",
- "hide_heading": 0,
- "hide_toolbar": 1,
- "icon": "icon-magic",
- "issingle": 1,
- "max_attachments": 1,
- "module": "Utilities",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "Rename Tool",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "name": "__common__",
- "parent": "Rename Tool",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "read": 1,
- "report": 0,
- "role": "System Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "Rename Tool"
- },
- {
- "description": "Type of document to rename.",
- "doctype": "DocField",
- "fieldname": "select_doctype",
- "fieldtype": "Select",
- "label": "Select DocType"
- },
- {
- "doctype": "DocField",
- "fieldname": "upload_html",
- "fieldtype": "HTML",
- "label": "Upload HTML"
- },
- {
- "doctype": "DocField",
- "fieldname": "rename_log",
- "fieldtype": "HTML",
- "label": "Rename Log"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "allow_attach": 0,
+ "allow_email": 1,
+ "allow_print": 1,
+ "creation": "2012-12-03 10:25:59.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "description": "Type of document to rename.",
+ "fieldname": "select_doctype",
+ "fieldtype": "Select",
+ "label": "Select DocType",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "upload_html",
+ "fieldtype": "HTML",
+ "label": "Upload HTML",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "rename_log",
+ "fieldtype": "HTML",
+ "label": "Rename Log",
+ "permlevel": 0
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 1,
+ "icon": "icon-magic",
+ "idx": 1,
+ "issingle": 1,
+ "max_attachments": 1,
+ "modified": "2013-07-05 14:52:51.000000",
+ "modified_by": "Administrator",
+ "module": "Utilities",
+ "name": "Rename Tool",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "permlevel": 0,
+ "read": 1,
+ "report": 0,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sms_control/sms_control.py b/erpnext/utilities/doctype/sms_control/sms_control.py
index 832c443..3a23558 100644
--- a/erpnext/utilities/doctype/sms_control/sms_control.py
+++ b/erpnext/utilities/doctype/sms_control/sms_control.py
@@ -6,14 +6,12 @@
from frappe.utils import nowdate, cstr
from frappe.model.code import get_obj
-from frappe.model.doc import Document
from frappe import msgprint, throw, _
from frappe.model.bean import getlist
-class DocType:
- def __init__(self, doc, doclist=[]):
- self.doc = doc
- self.doclist = doclist
+from frappe.model.document import Document
+
+class SmsControl(Document):
def validate_receiver_nos(self,receiver_list):
validated_receiver_list = []
@@ -110,11 +108,11 @@
# Create SMS Log
# =========================================================
def create_sms_log(self, arg, sent_sms):
- sl = Document('SMS Log')
+ sl = frappe.get_doc('SMS Log')
sl.sender_name = arg['sender_name']
sl.sent_on = nowdate()
sl.receiver_list = cstr(arg['receiver_list'])
sl.message = arg['message']
sl.no_of_requested_sms = len(arg['receiver_list'])
sl.no_of_sent_sms = sent_sms
- sl.save(new=1)
+ sl.save()
diff --git a/erpnext/utilities/doctype/sms_control/sms_control.txt b/erpnext/utilities/doctype/sms_control/sms_control.txt
index f8e0fae..1c933f2 100644
--- a/erpnext/utilities/doctype/sms_control/sms_control.txt
+++ b/erpnext/utilities/doctype/sms_control/sms_control.txt
@@ -1,42 +1,29 @@
-[
- {
- "creation": "2013-01-10 16:34:32",
- "docstatus": 0,
- "modified": "2013-12-20 19:21:47",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "doctype": "DocType",
- "icon": "icon-mobile-phone",
- "in_create": 0,
- "issingle": 1,
- "module": "Utilities",
- "name": "__common__"
- },
- {
- "create": 1,
- "doctype": "DocPerm",
- "email": 1,
- "export": 0,
- "import": 0,
- "name": "__common__",
- "parent": "SMS Control",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 0,
- "role": "System Manager",
- "submit": 0,
- "write": 1
- },
- {
- "doctype": "DocType",
- "name": "SMS Control"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "creation": "2013-01-10 16:34:32.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "icon": "icon-mobile-phone",
+ "idx": 1,
+ "in_create": 0,
+ "issingle": 1,
+ "modified": "2013-12-20 19:21:47.000000",
+ "modified_by": "Administrator",
+ "module": "Utilities",
+ "name": "SMS Control",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 1,
+ "email": 1,
+ "export": 0,
+ "import": 0,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 0,
+ "role": "System Manager",
+ "submit": 0,
+ "write": 1
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/utilities/doctype/sms_log/sms_log.py b/erpnext/utilities/doctype/sms_log/sms_log.py
index 26c87f1..573054e 100644
--- a/erpnext/utilities/doctype/sms_log/sms_log.py
+++ b/erpnext/utilities/doctype/sms_log/sms_log.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
-class DocType:
- def __init__(self, d, dl):
- self.doc, self.doclist = d, dl
\ No newline at end of file
+from frappe.model.document import Document
+
+class SmsLog(Document):
+ pass
diff --git a/erpnext/utilities/doctype/sms_log/sms_log.txt b/erpnext/utilities/doctype/sms_log/sms_log.txt
index 43cb1ff..e3c7741 100644
--- a/erpnext/utilities/doctype/sms_log/sms_log.txt
+++ b/erpnext/utilities/doctype/sms_log/sms_log.txt
@@ -1,94 +1,75 @@
-[
- {
- "creation": "2012-03-27 14:36:47",
- "docstatus": 0,
- "modified": "2013-12-20 19:24:35",
- "modified_by": "Administrator",
- "owner": "Administrator"
- },
- {
- "autoname": "SMSLOG/.########",
- "doctype": "DocType",
- "icon": "icon-mobile-phone",
- "module": "Utilities",
- "name": "__common__"
- },
- {
- "doctype": "DocField",
- "name": "__common__",
- "parent": "SMS Log",
- "parentfield": "fields",
- "parenttype": "DocType",
- "permlevel": 0
- },
- {
- "create": 0,
- "doctype": "DocPerm",
- "email": 1,
- "name": "__common__",
- "parent": "SMS Log",
- "parentfield": "permissions",
- "parenttype": "DocType",
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "write": 0
- },
- {
- "doctype": "DocType",
- "name": "SMS Log"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "sender_name",
- "fieldtype": "Data",
- "label": "Sender Name"
- },
- {
- "doctype": "DocField",
- "fieldname": "sent_on",
- "fieldtype": "Date",
- "label": "Sent On"
- },
- {
- "doctype": "DocField",
- "fieldname": "receiver_list",
- "fieldtype": "Small Text",
- "label": "Receiver List"
- },
- {
- "doctype": "DocField",
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "width": "50%"
- },
- {
- "doctype": "DocField",
- "fieldname": "no_of_requested_sms",
- "fieldtype": "Int",
- "label": "No of Requested SMS"
- },
- {
- "doctype": "DocField",
- "fieldname": "no_of_sent_sms",
- "fieldtype": "Int",
- "label": "No of Sent SMS"
- },
- {
- "doctype": "DocField",
- "fieldname": "message",
- "fieldtype": "Small Text",
- "label": "Message"
- },
- {
- "doctype": "DocPerm"
- }
-]
\ No newline at end of file
+{
+ "autoname": "SMSLOG/.########",
+ "creation": "2012-03-27 14:36:47.000000",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "fields": [
+ {
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "sender_name",
+ "fieldtype": "Data",
+ "label": "Sender Name",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "sent_on",
+ "fieldtype": "Date",
+ "label": "Sent On",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "receiver_list",
+ "fieldtype": "Small Text",
+ "label": "Receiver List",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "width": "50%"
+ },
+ {
+ "fieldname": "no_of_requested_sms",
+ "fieldtype": "Int",
+ "label": "No of Requested SMS",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "no_of_sent_sms",
+ "fieldtype": "Int",
+ "label": "No of Sent SMS",
+ "permlevel": 0
+ },
+ {
+ "fieldname": "message",
+ "fieldtype": "Small Text",
+ "label": "Message",
+ "permlevel": 0
+ }
+ ],
+ "icon": "icon-mobile-phone",
+ "idx": 1,
+ "modified": "2013-12-20 19:24:35.000000",
+ "modified_by": "Administrator",
+ "module": "Utilities",
+ "name": "SMS Log",
+ "owner": "Administrator",
+ "permissions": [
+ {
+ "create": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "System Manager",
+ "write": 0
+ }
+ ]
+}
\ No newline at end of file
diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py
index 11dfc52..ee78ced 100644
--- a/erpnext/utilities/transaction_base.py
+++ b/erpnext/utilities/transaction_base.py
@@ -36,7 +36,7 @@
opts = frappe._dict(opts)
if self.doc.contact_date:
- event_doclist = [{
+ event_doclist = frappe.get_doc({
"doctype": "Event",
"owner": opts.owner or self.doc.owner,
"subject": opts.subject,
@@ -45,16 +45,15 @@
"event_type": "Private",
"ref_type": self.doc.doctype,
"ref_name": self.doc.name
- }]
+ })
if frappe.db.exists("User", self.doc.contact_by):
- event_doclist.append({
+ event_doclist.append("event_individuals", {
"doctype": "Event User",
- "parentfield": "event_individuals",
"person": self.doc.contact_by
})
- frappe.bean(event_doclist).insert()
+ event_doclist.insert()
def validate_uom_is_integer(self, uom_field, qty_fields):
validate_uom_is_integer(self.doclist, uom_field, qty_fields)