Merge pull request #2839 from pdvyas/v5-lang
update translations and patch to new format
diff --git a/erpnext/accounts/doctype/account/account.json b/erpnext/accounts/doctype/account/account.json
index 77eb223..4862962 100644
--- a/erpnext/accounts/doctype/account/account.json
+++ b/erpnext/accounts/doctype/account/account.json
@@ -12,7 +12,7 @@
"fieldname": "properties",
"fieldtype": "Section Break",
"in_list_view": 0,
- "label": "Account Details",
+ "label": "",
"oldfieldtype": "Section Break",
"permlevel": 0
},
@@ -177,7 +177,7 @@
"icon": "icon-money",
"idx": 1,
"in_create": 0,
- "modified": "2015-02-05 05:11:34.054236",
+ "modified": "2015-02-20 05:09:22.108350",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Account",
diff --git a/erpnext/accounts/doctype/c_form/test_c_form.py b/erpnext/accounts/doctype/c_form/test_c_form.py
deleted file mode 100644
index 4b0fb9c..0000000
--- a/erpnext/accounts/doctype/c_form/test_c_form.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
-# See license.txt
-
-import frappe
-import unittest
-
-test_records = frappe.get_test_records('C-Form')
-
-class TestC-Form(unittest.TestCase):
- pass
diff --git a/erpnext/accounts/doctype/c_form/test_records.json b/erpnext/accounts/doctype/c_form/test_records.json
deleted file mode 100644
index 074674d..0000000
--- a/erpnext/accounts/doctype/c_form/test_records.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- {
- "doctype": "C-Form",
- "name": "_Test C-Form 1"
- }
-]
diff --git a/erpnext/accounts/doctype/cost_center/cost_center.json b/erpnext/accounts/doctype/cost_center/cost_center.json
index 17e7865..b37fa96 100644
--- a/erpnext/accounts/doctype/cost_center/cost_center.json
+++ b/erpnext/accounts/doctype/cost_center/cost_center.json
@@ -12,7 +12,7 @@
{
"fieldname": "sb0",
"fieldtype": "Section Break",
- "label": "Cost Center Details",
+ "label": "",
"permlevel": 0
},
{
@@ -145,7 +145,7 @@
"icon": "icon-money",
"idx": 1,
"in_create": 0,
- "modified": "2015-02-05 05:11:36.155435",
+ "modified": "2015-02-20 05:07:59.251051",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Cost Center",
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json
index 330c122..7c1273d 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.json
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json
@@ -8,7 +8,7 @@
{
"fieldname": "entry_type_and_date",
"fieldtype": "Section Break",
- "label": "Entry Type and Date",
+ "label": "",
"options": "icon-flag",
"permlevel": 0
},
@@ -17,7 +17,7 @@
"fieldname": "voucher_type",
"fieldtype": "Select",
"in_filter": 1,
- "in_list_view": 1,
+ "in_list_view": 0,
"label": "Voucher Type",
"oldfieldname": "voucher_type",
"oldfieldtype": "Select",
@@ -74,7 +74,7 @@
{
"fieldname": "2_add_edit_gl_entries",
"fieldtype": "Section Break",
- "label": "Journal Entries",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-table",
"permlevel": 0,
@@ -273,7 +273,7 @@
{
"fieldname": "addtional_info",
"fieldtype": "Section Break",
- "label": "More Info",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-file-text",
"permlevel": 0,
@@ -289,7 +289,7 @@
},
{
"default": "No",
- "description": "Considered as Opening Balance",
+ "description": "",
"fieldname": "is_opening",
"fieldtype": "Select",
"in_filter": 1,
@@ -303,10 +303,10 @@
"search_index": 1
},
{
- "description": "Actual Posting Date",
+ "description": "",
"fieldname": "aging_date",
"fieldtype": "Date",
- "label": "Aging Date",
+ "label": "Ageing Date",
"no_copy": 0,
"oldfieldname": "aging_date",
"oldfieldtype": "Date",
@@ -356,6 +356,33 @@
"permlevel": 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": "amended_from",
+ "fieldtype": "Link",
+ "ignore_user_permissions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Link",
+ "options": "Journal Entry",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
"fieldname": "column_break3",
"fieldtype": "Column Break",
"oldfieldtype": "Column Break",
@@ -427,37 +454,18 @@
"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",
+ "fieldname": "title",
+ "fieldtype": "Data",
+ "hidden": 1,
+ "label": "Title",
"permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 1
- },
- {
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "ignore_user_permissions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Link",
- "options": "Journal Entry",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1
+ "precision": ""
}
],
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:40.139467",
+ "modified": "2015-02-23 04:46:05.569476",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry",
@@ -514,5 +522,5 @@
"search_fields": "voucher_type,posting_date, due_date, cheque_no",
"sort_field": "modified",
"sort_order": "DESC",
- "title_field": "voucher_type"
+ "title_field": "title"
}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py
index 66e4854..a0a5a86 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry.py
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py
@@ -40,6 +40,7 @@
self.validate_expense_claim()
self.validate_credit_debit_note()
self.validate_empty_accounts_table()
+ self.set_title()
def on_submit(self):
self.check_credit_limit()
@@ -47,6 +48,9 @@
self.update_advance_paid()
self.update_expense_claim()
+ def set_title(self):
+ self.title = self.pay_to_recd_from or self.accounts[0].account
+
def update_advance_paid(self):
advance_paid = frappe._dict()
for d in self.get("accounts"):
@@ -442,16 +446,16 @@
if d.debit > pending_amount:
frappe.throw(_("Row No {0}: Amount cannot be greater than Pending Amount against Expense Claim {1}. \
Pending Amount is {2}".format(d.idx, d.against_expense_claim, pending_amount)))
-
+
def validate_credit_debit_note(self):
count = frappe.db.exists({
"doctype": "Journal Entry",
"stock_entry":self.stock_entry,
- "docstatus":1
+ "docstatus":1
})
if count:
frappe.throw(_("{0} already made against stock entry {1}".format(self.voucher_type, self.stock_entry)))
-
+
def validate_empty_accounts_table(self):
if not self.get('accounts'):
frappe.throw("Accounts table cannot be blank.")
@@ -462,11 +466,17 @@
if mode_of_payment:
account = get_bank_cash_account(mode_of_payment, company)
if account.get("bank_cash_account"):
- account.update({"balance": get_balance_on(account.get("cash_bank_account"))})
+ account.update({"balance": get_balance_on(account.get("bank_cash_account"))})
return account
- account = frappe.db.get_value("Company", company, \
- voucher_type=="Bank Voucher" and "default_bank_account" or "default_cash_account")
+ if voucher_type=="Bank Entry":
+ account = frappe.db.get_value("Company", company, "default_bank_account")
+ if not account:
+ account = frappe.db.get_value("Account", {"company": company, "account_type": "Bank"})
+ elif voucher_type=="Cash Entry":
+ account = frappe.db.get_value("Company", company, "default_cash_account")
+ if not account:
+ account = frappe.db.get_value("Account", {"company": company, "account_type": "Cash"})
if account:
return {
diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry_list.js b/erpnext/accounts/doctype/journal_entry/journal_entry_list.js
index 101793c..48d6115 100644
--- a/erpnext/accounts/doctype/journal_entry/journal_entry_list.js
+++ b/erpnext/accounts/doctype/journal_entry/journal_entry_list.js
@@ -1,3 +1,12 @@
frappe.listview_settings['Journal Entry'] = {
- add_fields: ["voucher_type", "posting_date", "total_debit", "company", "user_remark"]
+ add_fields: ["voucher_type", "posting_date", "total_debit", "company", "user_remark"],
+ get_indicator: function(doc) {
+ if(doc.docstatus==0) {
+ return [__("Draft", "red", "docstatus,=,0")]
+ } else if(doc.docstatus==2) {
+ return [__("Cancelled", "grey", "docstatus,=,2")]
+ } else {
+ return [__(doc.voucher_type), "blue", "voucher_type,=," + doc.voucher_type]
+ }
+ }
};
diff --git a/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py b/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py
deleted file mode 100644
index 2008f98..0000000
--- a/erpnext/accounts/doctype/mode_of_payment/test_mode_of_payment.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
-# See license.txt
-
-import frappe
-import unittest
-
-test_records = frappe.get_test_records('Mode of Payment')
-
-class TestModeofPayment(unittest.TestCase):
- pass
diff --git a/erpnext/accounts/doctype/mode_of_payment/test_records.json b/erpnext/accounts/doctype/mode_of_payment/test_records.json
deleted file mode 100644
index f1ff01c..0000000
--- a/erpnext/accounts/doctype/mode_of_payment/test_records.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- {
- "doctype": "Mode of Payment",
- "name": "_Test Mode of Payment 1"
- }
-]
diff --git a/erpnext/accounts/doctype/payment_tool/payment_tool.js b/erpnext/accounts/doctype/payment_tool/payment_tool.js
index 0cb51d3..8ff9597 100644
--- a/erpnext/accounts/doctype/payment_tool/payment_tool.js
+++ b/erpnext/accounts/doctype/payment_tool/payment_tool.js
@@ -5,7 +5,7 @@
// Help content
frappe.ui.form.on("Payment Tool", "onload", function(frm) {
- frm.set_value("make_jv_help", '<i class="icon-hand-right"></i> '
+ frm.set_value("make_jv_help",
+ __("Note: If payment is not made against any reference, make Journal Entry manually."));
frm.set_query("party_type", function() {
@@ -36,7 +36,7 @@
});
frappe.ui.form.on("Payment Tool", "party", function(frm) {
- if(!frm.doc.party_account && frm.doc.party_type && frm.doc.party) {
+ if(frm.doc.party_type && frm.doc.party) {
return frappe.call({
method: "erpnext.accounts.party.get_party_account",
args: {
@@ -46,7 +46,7 @@
},
callback: function(r) {
if(!r.exc && r.message) {
- frappe.model.set_value("party_account", r.message);
+ frm.set_value("party_account", r.message);
erpnext.payment_tool.check_mandatory_to_set_button(frm);
}
}
@@ -62,12 +62,16 @@
erpnext.payment_tool.check_mandatory_to_set_button(frm);
});
+frappe.ui.form.on("Payment Tool", "party", function(frm) {
+ erpnext.payment_tool.check_mandatory_to_set_button(frm);
+});
+
// Fetch bank/cash account based on payment mode
frappe.ui.form.on("Payment Tool", "payment_mode", function(frm) {
return frappe.call({
method: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_bank_cash_account",
args: {
- "mode_of_payment": frm.doc.mode_of_payment,
+ "mode_of_payment": frm.doc.payment_mode,
"company": frm.doc.company
},
callback: function(r, rt) {
@@ -81,7 +85,7 @@
erpnext.payment_tool.check_mandatory_to_set_button = function(frm) {
- if (frm.doc.company && frm.doc.party_type && frm.doc.party && frm.doc.received_or_paid) {
+ if (frm.doc.company && frm.doc.party_type && frm.doc.party && frm.doc.received_or_paid && frm.doc.party_account) {
frm.fields_dict.get_outstanding_vouchers.$input.addClass("btn-primary");
}
}
@@ -108,16 +112,18 @@
frm.fields_dict.get_outstanding_vouchers.$input.removeClass("btn-primary");
frm.fields_dict.make_journal_entry.$input.addClass("btn-primary");
- frappe.model.clear_table(frm.doc, "vouchers");
+ frm.clear_table("vouchers");
+
$.each(r.message, function(i, d) {
- var invoice_detail = frappe.model.add_child(frm.doc, "Payment Tool Detail", "vouchers");
- invoice_detail.against_voucher_type = d.voucher_type;
- invoice_detail.against_voucher_no = d.voucher_no;
- invoice_detail.total_amount = d.invoice_amount;
- invoice_detail.outstanding_amount = d.outstanding_amount;
+ var c = frm.add_child("vouchers");
+ c.against_voucher_type = d.voucher_type;
+ c.against_voucher_no = d.voucher_no;
+ c.total_amount = d.invoice_amount;
+ c.outstanding_amount = d.outstanding_amount;
});
}
refresh_field("vouchers");
+ frm.layout.refresh_sections();
erpnext.payment_tool.set_total_payment_amount(frm);
}
});
diff --git a/erpnext/accounts/doctype/payment_tool/payment_tool.json b/erpnext/accounts/doctype/payment_tool/payment_tool.json
index e7973f9..909f9c4 100644
--- a/erpnext/accounts/doctype/payment_tool/payment_tool.json
+++ b/erpnext/accounts/doctype/payment_tool/payment_tool.json
@@ -11,7 +11,7 @@
{
"fieldname": "sec_break1",
"fieldtype": "Section Break",
- "label": "Party Details",
+ "label": "Find Invoices to Match",
"permlevel": 0
},
{
@@ -44,6 +44,43 @@
},
{
"allow_on_submit": 0,
+ "fieldname": "received_or_paid",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Received Or Paid",
+ "no_copy": 0,
+ "options": "Received\nPaid",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "col_break1",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Column Break 1",
+ "no_copy": 0,
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0
+ },
+ {
+ "allow_on_submit": 0,
"depends_on": "",
"fieldname": "party",
"fieldtype": "Dynamic Link",
@@ -70,26 +107,8 @@
"no_copy": 1,
"options": "Account",
"permlevel": 0,
- "read_only": 0
- },
- {
- "allow_on_submit": 0,
- "fieldname": "received_or_paid",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 1,
- "label": "Received Or Paid",
- "no_copy": 0,
- "options": "Received\nPaid",
- "permlevel": 0,
- "print_hide": 0,
"read_only": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0
+ "reqd": 1
},
{
"allow_on_submit": 0,
@@ -111,13 +130,14 @@
},
{
"allow_on_submit": 0,
- "fieldname": "col_break1",
- "fieldtype": "Column Break",
+ "depends_on": "eval:(doc.company && doc.party_type && doc.received_or_paid && doc.party_account)",
+ "fieldname": "sec_break3",
+ "fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Column Break 1",
+ "label": "Set Matching Amounts",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -129,6 +149,33 @@
},
{
"allow_on_submit": 0,
+ "fieldname": "vouchers",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Against Vouchers",
+ "no_copy": 0,
+ "options": "Payment Tool Detail",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0
+ },
+ {
+ "depends_on": "eval:(doc.company && doc.party_type && doc.received_or_paid && doc.party_account)",
+ "fieldname": "section_break_19",
+ "fieldtype": "Section Break",
+ "label": "Make Payment Entry",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "allow_on_submit": 0,
"fieldname": "payment_mode",
"fieldtype": "Link",
"hidden": 0,
@@ -166,22 +213,17 @@
"set_only_once": 0
},
{
- "allow_on_submit": 0,
- "fieldname": "reference_no",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Reference No",
- "no_copy": 0,
+ "fieldname": "total_payment_amount",
+ "fieldtype": "Currency",
+ "label": "Total Payment Amount",
"permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0
+ "read_only": 1
+ },
+ {
+ "fieldname": "data_22",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "precision": ""
},
{
"allow_on_submit": 0,
@@ -203,14 +245,13 @@
},
{
"allow_on_submit": 0,
- "depends_on": "eval:(doc.company && doc.party_type && doc.received_or_paid && (doc.customer || doc.supplier))",
- "fieldname": "sec_break3",
- "fieldtype": "Section Break",
+ "fieldname": "reference_no",
+ "fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Against Voucher",
+ "label": "Reference No",
"no_copy": 0,
"permlevel": 0,
"print_hide": 0,
@@ -222,39 +263,6 @@
},
{
"allow_on_submit": 0,
- "fieldname": "vouchers",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "in_filter": 0,
- "in_list_view": 0,
- "label": "Against Vouchers",
- "no_copy": 0,
- "options": "Payment Tool Detail",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0
- },
- {
- "depends_on": "eval:(doc.company && doc.party_type && doc.received_or_paid && (doc.customer || doc.supplier))",
- "fieldname": "section_break_19",
- "fieldtype": "Section Break",
- "permlevel": 0,
- "precision": ""
- },
- {
- "fieldname": "total_payment_amount",
- "fieldtype": "Currency",
- "label": "Total Payment Amount",
- "permlevel": 0,
- "read_only": 1
- },
- {
- "allow_on_submit": 0,
"fieldname": "make_journal_entry",
"fieldtype": "Button",
"hidden": 0,
@@ -272,13 +280,7 @@
"set_only_once": 0
},
{
- "fieldname": "data_22",
- "fieldtype": "Column Break",
- "permlevel": 0,
- "precision": ""
- },
- {
- "depends_on": "eval:(doc.company && doc.party_type && doc.received_or_paid && (doc.customer || doc.supplier))",
+ "depends_on": "eval:(doc.company && doc.party_type && doc.received_or_paid && doc.party_account)",
"fieldname": "section_break_21",
"fieldtype": "Section Break",
"permlevel": 0,
@@ -310,7 +312,7 @@
"is_submittable": 0,
"issingle": 1,
"istable": 0,
- "modified": "2015-02-05 05:11:42.181439",
+ "modified": "2015-02-21 03:59:08.154966",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Tool",
diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
index 6c32971..eb756de 100755
--- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
+++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json
@@ -171,7 +171,7 @@
{
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
- "label": "Currency and Price List",
+ "label": "",
"options": "icon-tag",
"permlevel": 0,
"read_only": 0
@@ -241,7 +241,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
- "label": "Items",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart",
"permlevel": 0,
@@ -333,7 +333,7 @@
{
"fieldname": "totals",
"fieldtype": "Section Break",
- "label": "Totals",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-money",
"permlevel": 0,
@@ -888,7 +888,7 @@
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-11 16:56:27.871736",
+ "modified": "2015-02-20 05:16:22.693978",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Purchase Invoice",
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
index 81427fe..bbc0dd2 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js
@@ -71,7 +71,7 @@
}
if(doc.outstanding_amount!=0) {
- cur_frm.page.add_menu_item(__('Make Payment Entry'), cur_frm.cscript.make_bank_entry, "icon-money");
+ cur_frm.add_custom_button(__('Make Payment Entry'), cur_frm.cscript.make_bank_entry, "icon-money");
}
}
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
index 8e79603..61eb191 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json
@@ -10,7 +10,7 @@
{
"fieldname": "customer_section",
"fieldtype": "Section Break",
- "label": "Customer",
+ "label": "",
"options": "icon-user",
"permlevel": 0
},
@@ -192,7 +192,7 @@
{
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
- "label": "Currency and Price List",
+ "label": "",
"options": "icon-tag",
"permlevel": 0,
"read_only": 0
@@ -272,7 +272,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
- "label": "Items",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart",
"permlevel": 0,
@@ -468,7 +468,7 @@
{
"fieldname": "totals",
"fieldtype": "Section Break",
- "label": "Totals",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-money",
"permlevel": 0,
@@ -1202,7 +1202,7 @@
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-11 15:57:57.399512",
+ "modified": "2015-02-20 05:16:19.256361",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice",
diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
index 4e46fde..f3ff9e1 100644
--- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
+++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py
@@ -134,9 +134,6 @@
where name=`tabSales Invoice Item`.parent and ifnull(update_stock, 0) = 1)"""
})
- def get_portal_page(self):
- return "invoice" if self.docstatus==1 else None
-
def set_missing_values(self, for_validate=False):
self.set_pos_fields(for_validate)
@@ -576,6 +573,13 @@
})
)
+ @staticmethod
+ def get_list_context(context=None):
+ from erpnext.controllers.website_list_for_contact import get_list_context
+ list_context = get_list_context(context)
+ list_context["title"] = _("My Invoices")
+ return list_context
+
@frappe.whitelist()
def get_bank_cash_account(mode_of_payment, company):
account = frappe.db.get_value("Mode of Payment Account", {"parent": mode_of_payment, "company": company}, \
diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py
index 0d9876a..79460db 100644
--- a/erpnext/accounts/party.py
+++ b/erpnext/accounts/party.py
@@ -128,22 +128,26 @@
@frappe.whitelist()
def get_party_account(company, party, party_type):
+ """Returns the account for the given `party`.
+ Will first search in party (Customer / Supplier) record, if not found,
+ will search in group (Customer Group / Supplier Type),
+ finally will return default."""
if not company:
frappe.throw(_("Please select company first."))
if party:
- party_group_doctype = "Customer Group" if party_type=="Customer" else "Supplier Type"
- party_details = frappe.db.sql("""select p.{0}, pa.account
- from `tab{1}` p left join `tabParty Account` pa on pa.parent = p.name
- where p.name = %s""".format(scrub(party_group_doctype), party_type), party)
- if party_details:
- party_group, account = party_details[0]
+ account = frappe.db.get_value("Party Account",
+ {"parenttype": party_type, "parent": party, "company": company}, "account")
if not account:
+ party_group_doctype = "Customer Group" if party_type=="Customer" else "Supplier Type"
+ group = frappe.db.get_value(party_type, party, scrub(party_group_doctype))
account = frappe.db.get_value("Party Account",
- {"parenttype": party_group_doctype, "parent": party_group, "company": company}, "account") or \
- frappe.db.get_value("Company", company,
- "default_receivable_account" if party_type=="Customer" else "default_payable_account")
+ {"parenttype": party_group_doctype, "parent": group, "company": company}, "account")
+
+ if not account:
+ default_account_name = "default_receivable_account" if party_type=="Customer" else "default_payable_account"
+ account = frappe.db.get_value("Company", company, default_account_name)
return account
diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
index dbfdee7..27f1249 100644
--- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
+++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py
@@ -23,7 +23,7 @@
purchase_receipt = d.purchase_receipt
elif d.po_detail:
purchase_receipt = ", ".join(frappe.db.sql_list("""select distinct parent
- from `tabPurchase Receipt Item` where docstatus=1 and prevdoc_detail_docname=%s""", d.po_detail))
+ from `tabPurchase Receipt Item` where docstatus=1 and po_detail=%s""", d.po_detail))
expense_account = d.expense_account or aii_account_map.get(d.company)
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.supplier,
diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
index 4907cbb..fef397f 100644
--- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
+++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py
@@ -22,7 +22,7 @@
delivery_note = d.delivery_note
elif d.so_detail:
delivery_note = ", ".join(frappe.db.sql_list("""select distinct parent
- from `tabDelivery Note Item` where docstatus=1 and prevdoc_detail_docname=%s""", d.so_detail))
+ from `tabDelivery Note Item` where docstatus=1 and so_detail=%s""", d.so_detail))
row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.customer, d.customer_name,
d.customer_group, d.debit_to, d.territory, d.project_name, d.company, d.sales_order,
diff --git a/erpnext/accounts/report/purchase_register/purchase_register.py b/erpnext/accounts/report/purchase_register/purchase_register.py
index 727a663..724b678 100644
--- a/erpnext/accounts/report/purchase_register/purchase_register.py
+++ b/erpnext/accounts/report/purchase_register/purchase_register.py
@@ -160,7 +160,7 @@
pr_list = [d.purchase_receipt]
elif d.po_detail:
pr_list = frappe.db.sql_list("""select distinct parent from `tabPurchase Receipt Item`
- where docstatus=1 and prevdoc_detail_docname=%s""", d.pr_detail)
+ where docstatus=1 and po_detail=%s""", d.pr_detail)
if pr_list:
invoice_po_pr_map.setdefault(d.parent, frappe._dict()).setdefault("purchase_receipt", pr_list)
diff --git a/erpnext/accounts/report/sales_register/sales_register.py b/erpnext/accounts/report/sales_register/sales_register.py
index bdce7bd..3bd82b6 100644
--- a/erpnext/accounts/report/sales_register/sales_register.py
+++ b/erpnext/accounts/report/sales_register/sales_register.py
@@ -160,7 +160,7 @@
delivery_note_list = [d.delivery_note]
elif d.sales_order:
delivery_note_list = frappe.db.sql_list("""select distinct parent from `tabDelivery Note Item`
- where docstatus=1 and prevdoc_detail_docname=%s""", d.so_detail)
+ where docstatus=1 and so_detail=%s""", d.so_detail)
if delivery_note_list:
invoice_so_dn_map.setdefault(d.parent, frappe._dict()).setdefault("delivery_note", delivery_note_list)
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js
index 30affb8..b1eee0e 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.js
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.js
@@ -9,13 +9,13 @@
erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend({
refresh: function(doc, cdt, cdn) {
this._super();
- this.frm.dashboard.reset();
+ // this.frm.dashboard.reset();
if(doc.docstatus == 1 && doc.status != 'Stopped'){
- cur_frm.dashboard.add_progress(cint(doc.per_received) + __("% Received"),
- doc.per_received);
- cur_frm.dashboard.add_progress(cint(doc.per_billed) + __("% Billed"),
- doc.per_billed);
+ // cur_frm.dashboard.add_progress(cint(doc.per_received) + __("% Received"),
+ // doc.per_received);
+ // cur_frm.dashboard.add_progress(cint(doc.per_billed) + __("% Billed"),
+ // doc.per_billed);
if(flt(doc.per_received, 2) < 100)
cur_frm.add_custom_button(__('Make Purchase Receipt'),
diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.json b/erpnext/buying/doctype/purchase_order/purchase_order.json
index 30b5ed5..2698f24 100644
--- a/erpnext/buying/doctype/purchase_order/purchase_order.json
+++ b/erpnext/buying/doctype/purchase_order/purchase_order.json
@@ -134,7 +134,7 @@
{
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
- "label": "Currency and Price List",
+ "label": "",
"options": "icon-tag",
"permlevel": 0
},
@@ -208,7 +208,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
- "label": "Items",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart",
"permlevel": 0
@@ -310,7 +310,7 @@
{
"fieldname": "totals",
"fieldtype": "Section Break",
- "label": "Totals",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-money",
"permlevel": 0
@@ -783,7 +783,7 @@
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-18 15:05:33.635613",
+ "modified": "2015-02-20 05:16:19.990723",
"modified_by": "Administrator",
"module": "Buying",
"name": "Purchase Order",
diff --git a/erpnext/buying/doctype/quality_inspection/quality_inspection.json b/erpnext/buying/doctype/quality_inspection/quality_inspection.json
index 4f41d3b..97d6f31 100644
--- a/erpnext/buying/doctype/quality_inspection/quality_inspection.json
+++ b/erpnext/buying/doctype/quality_inspection/quality_inspection.json
@@ -182,7 +182,7 @@
{
"fieldname": "specification_details",
"fieldtype": "Section Break",
- "label": "Specification Details",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "Simple",
"permlevel": 0
@@ -207,7 +207,7 @@
"icon": "icon-search",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:44.292242",
+ "modified": "2015-02-20 05:09:09.998457",
"modified_by": "Administrator",
"module": "Buying",
"name": "Quality Inspection",
diff --git a/erpnext/buying/doctype/quality_inspection/test_quality_inspection.py b/erpnext/buying/doctype/quality_inspection/test_quality_inspection.py
index 91aff3b..e47bbd5 100644
--- a/erpnext/buying/doctype/quality_inspection/test_quality_inspection.py
+++ b/erpnext/buying/doctype/quality_inspection/test_quality_inspection.py
@@ -4,7 +4,7 @@
import frappe
import unittest
-test_records = frappe.get_test_records('Quality Inspection')
+# test_records = frappe.get_test_records('Quality Inspection')
class TestQualityInspection(unittest.TestCase):
pass
diff --git a/erpnext/buying/doctype/quality_inspection/test_records.json b/erpnext/buying/doctype/quality_inspection/test_records.json
deleted file mode 100644
index 5d8c0a0..0000000
--- a/erpnext/buying/doctype/quality_inspection/test_records.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- {
- "doctype": "Quality Inspection",
- "name": "_Test Quality Inspection 1"
- }
-]
diff --git a/erpnext/buying/doctype/supplier/supplier.json b/erpnext/buying/doctype/supplier/supplier.json
index 87f8008..f441e9b 100644
--- a/erpnext/buying/doctype/supplier/supplier.json
+++ b/erpnext/buying/doctype/supplier/supplier.json
@@ -11,7 +11,7 @@
{
"fieldname": "basic_info",
"fieldtype": "Section Break",
- "label": "Basic Info",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-user",
"permlevel": 0
@@ -170,7 +170,7 @@
],
"icon": "icon-user",
"idx": 1,
- "modified": "2015-02-05 05:11:47.468728",
+ "modified": "2015-02-20 05:07:32.060901",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier",
diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
index bd1e93a..99471ca 100644
--- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
+++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json
@@ -134,7 +134,7 @@
{
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
- "label": "Currency and Price List",
+ "label": "",
"options": "icon-tag",
"permlevel": 0
},
@@ -207,7 +207,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
- "label": "Items",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart",
"permlevel": 0
@@ -300,7 +300,7 @@
{
"fieldname": "totals",
"fieldtype": "Section Break",
- "label": "Totals",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-money",
"permlevel": 0
@@ -583,7 +583,7 @@
"icon": "icon-shopping-cart",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-11 16:08:30.374140",
+ "modified": "2015-02-20 05:16:21.307774",
"modified_by": "Administrator",
"module": "Buying",
"name": "Supplier Quotation",
diff --git a/erpnext/config/manufacturing.py b/erpnext/config/manufacturing.py
index 6c915b7..bd258fb 100644
--- a/erpnext/config/manufacturing.py
+++ b/erpnext/config/manufacturing.py
@@ -19,6 +19,11 @@
},
{
"type": "doctype",
+ "name": "Time Log",
+ "description": _("Time Logs for manufacturing."),
+ },
+ {
+ "type": "doctype",
"name": "Item",
"description": _("All Products or Services."),
},
diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py
index f5ce9f7..fc09b59 100644
--- a/erpnext/config/selling.py
+++ b/erpnext/config/selling.py
@@ -8,21 +8,11 @@
"items": [
{
"type": "doctype",
- "name": "Lead",
- "description": _("Database of potential customers."),
- },
- {
- "type": "doctype",
"name": "Customer",
"description": _("Customer database."),
},
{
"type": "doctype",
- "name": "Opportunity",
- "description": _("Potential opportunities for selling."),
- },
- {
- "type": "doctype",
"name": "Quotation",
"description": _("Quotes to Leads or Customers."),
},
diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py
index 93a0145..5e27b3a 100644
--- a/erpnext/controllers/buying_controller.py
+++ b/erpnext/controllers/buying_controller.py
@@ -288,4 +288,3 @@
if not d.conversion_factor:
frappe.throw(_("Row {0}: Conversion Factor is mandatory"))
d.stock_qty = flt(d.qty) * flt(d.conversion_factor)
-
diff --git a/erpnext/controllers/tests/test_recurring_document.py b/erpnext/controllers/tests/test_recurring_document.py
index e5c6513..021940a 100644
--- a/erpnext/controllers/tests/test_recurring_document.py
+++ b/erpnext/controllers/tests/test_recurring_document.py
@@ -6,6 +6,7 @@
from erpnext.controllers.recurring_document import date_field_map
def test_recurring_document(obj, test_records):
+ pass
from frappe.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate, add_days
from erpnext.accounts.utils import get_fiscal_year
frappe.db.set_value("Print Settings", "Print Settings", "send_print_as_pdf", 1)
@@ -102,6 +103,7 @@
_test_recurring_document(obj, doc7, date_field, True)
def _test_recurring_document(obj, base_doc, date_field, first_and_last_day):
+ pass
from frappe.utils import add_months, get_last_day
from erpnext.controllers.recurring_document import manage_recurring_documents, \
get_next_date
diff --git a/erpnext/controllers/website_list_for_contact.py b/erpnext/controllers/website_list_for_contact.py
new file mode 100644
index 0000000..4c729b6
--- /dev/null
+++ b/erpnext/controllers/website_list_for_contact.py
@@ -0,0 +1,78 @@
+# Copyright (c) 2015, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import json
+import frappe
+from frappe import _
+from frappe.utils import flt
+from frappe.utils.user import is_website_user
+
+def get_list_context(context=None):
+ return {
+ "global_number_format": frappe.db.get_default("number_format") or "#,###.##",
+ "currency": frappe.db.get_default("currency"),
+ "currency_symbols": json.dumps(dict(frappe.db.sql("""select name, symbol
+ from tabCurrency where ifnull(enabled,0)=1"""))),
+ "row_template": "templates/includes/transaction_row.html",
+ "get_list": get_transaction_list
+ }
+
+def get_transaction_list(doctype, txt=None, filters=None, limit_start=0, limit_page_length=20):
+ from frappe.templates.pages.list import get_list
+ user = frappe.session.user
+
+ if user != "Guest" and is_website_user(user):
+ # find party for this contact
+ customers, suppliers = get_customers_suppliers(doctype, user)
+ if customers:
+ return post_process(get_list(doctype, txt, filters=[(doctype, "customer", "in", customers)],
+ limit_start=limit_start, limit_page_length=limit_page_length, ignore_permissions=True))
+
+ elif suppliers:
+ return post_process(get_list(doctype, txt, filters=[(doctype, "supplier", "in", suppliers)],
+ limit_start=limit_start, limit_page_length=limit_page_length, ignore_permissions=True))
+
+ else:
+ return []
+
+ return post_process(get_list(doctype, txt, filters, limit_start, limit_page_length))
+
+def post_process(result):
+ for r in result:
+ r.status_percent = 0
+ r.status_display = []
+
+ if r.get("per_billed"):
+ r.status_percent += flt(r.per_billed)
+ r.status_display.append(_("Billed") if r.per_billed==100 else _("{0}% Billed").format(r.per_billed))
+
+ if r.get("per_delivered"):
+ r.status_percent += flt(r.per_delivered)
+ r.status_display.append(_("Delivered") if r.per_delivered==100 else _("{0}% Delivered").format(r.per_delivered))
+
+ r.status_display = ", ".join(r.status_display)
+
+ return result
+
+def get_customers_suppliers(doctype, user):
+ meta = frappe.get_meta(doctype)
+ contacts = frappe.get_all("Contact", fields=["customer", "supplier", "email_id"],
+ filters={"email_id": user})
+
+ customers = [c.customer for c in contacts if c.customer] if meta.get_field("customer") else None
+ suppliers = [c.supplier for c in contacts if c.supplier] if meta.get_field("supplier") else None
+
+ return customers, suppliers
+
+def has_website_permission(doc, ptype, user, verbose=False):
+ doctype = doc.doctype
+ customers, suppliers = get_customers_suppliers(doctype, user)
+ if customers:
+ return frappe.get_all(doctype, filters=[(doctype, "customer", "in", customers),
+ (doctype, "name", "=", doc.name)]) and True or False
+ elif suppliers:
+ return frappe.get_all(doctype, filters=[(doctype, "suppliers", "in", suppliers),
+ (doctype, "name", "=", doc.name)]) and True or False
+ else:
+ return False
diff --git a/erpnext/crm/doctype/lead/lead.json b/erpnext/crm/doctype/lead/lead.json
index 32b604d..2f6a293 100644
--- a/erpnext/crm/doctype/lead/lead.json
+++ b/erpnext/crm/doctype/lead/lead.json
@@ -9,7 +9,7 @@
{
"fieldname": "lead_details",
"fieldtype": "Section Break",
- "label": "Lead Details",
+ "label": "",
"options": "icon-user",
"permlevel": 0
},
@@ -331,7 +331,7 @@
],
"icon": "icon-user",
"idx": 1,
- "modified": "2015-02-16 23:54:10.622839",
+ "modified": "2015-02-20 05:07:57.739910",
"modified_by": "Administrator",
"module": "CRM",
"name": "Lead",
diff --git a/erpnext/crm/doctype/opportunity/opportunity.json b/erpnext/crm/doctype/opportunity/opportunity.json
index 9863d42..186e866 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.json
+++ b/erpnext/crm/doctype/opportunity/opportunity.json
@@ -1,436 +1,436 @@
{
- "allow_import": 1,
- "autoname": "naming_series:",
- "creation": "2013-03-07 18:50:30",
- "description": "Potential Sales Deal",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Transaction",
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-03-07 18:50:30",
+ "description": "Potential Sales Deal",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
"fields": [
{
- "fieldname": "from_section",
- "fieldtype": "Section Break",
- "label": "From",
- "options": "icon-user",
+ "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": "OPTY-",
- "permlevel": 0,
- "read_only": 0,
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "OPTY-",
+ "permlevel": 0,
+ "read_only": 0,
"reqd": 1
- },
+ },
{
- "fieldname": "enquiry_from",
- "fieldtype": "Select",
- "in_list_view": 0,
- "label": "Opportunity From",
- "oldfieldname": "enquiry_from",
- "oldfieldtype": "Select",
- "options": "\nLead\nCustomer",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "report_hide": 0,
+ "fieldname": "enquiry_from",
+ "fieldtype": "Select",
+ "in_list_view": 0,
+ "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": 0,
- "label": "Customer",
- "no_copy": 1,
- "oldfieldname": "customer",
- "oldfieldtype": "Link",
- "options": "Customer",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0,
+ "depends_on": "eval:doc.enquiry_from===\"Customer\"",
+ "fieldname": "customer",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Customer",
+ "no_copy": 0,
+ "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": 0,
- "label": "Lead",
- "oldfieldname": "lead",
- "oldfieldtype": "Link",
- "options": "Lead",
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "eval:doc.enquiry_from===\"Lead\"",
+ "fieldname": "lead",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "in_filter": 1,
+ "in_list_view": 0,
+ "label": "Lead",
+ "oldfieldname": "lead",
+ "oldfieldtype": "Link",
+ "options": "Lead",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 0
- },
+ },
{
- "depends_on": "",
- "fieldname": "customer_name",
- "fieldtype": "Data",
- "hidden": 1,
- "label": "Customer / Lead Name",
- "permlevel": 0,
- "print_hide": 0,
+ "depends_on": "",
+ "fieldname": "customer_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Customer / Lead Name",
+ "permlevel": 0,
+ "print_hide": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "read_only": 0,
+ "fieldname": "column_break0",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "read_only": 0,
"width": "50%"
- },
+ },
{
- "fieldname": "enquiry_type",
- "fieldtype": "Select",
- "label": "Opportunity Type",
- "oldfieldname": "enquiry_type",
- "oldfieldtype": "Select",
- "options": "\nSales\nMaintenance",
- "permlevel": 0,
- "read_only": 0,
+ "fieldname": "enquiry_type",
+ "fieldtype": "Select",
+ "label": "Opportunity Type",
+ "oldfieldname": "enquiry_type",
+ "oldfieldtype": "Select",
+ "options": "\nSales\nMaintenance",
+ "permlevel": 0,
+ "read_only": 0,
"reqd": 1
- },
+ },
{
- "default": "Draft",
- "fieldname": "status",
- "fieldtype": "Select",
- "in_list_view": 0,
- "label": "Status",
- "no_copy": 1,
- "oldfieldname": "status",
- "oldfieldtype": "Select",
- "options": "Draft\nSubmitted\nQuotation\nLost\nCancelled\nReplied\nOpen",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
+ "default": "Draft",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "in_list_view": 0,
+ "label": "Status",
+ "no_copy": 1,
+ "oldfieldname": "status",
+ "oldfieldtype": "Select",
+ "options": "Draft\nSubmitted\nQuotation\nLost\nCancelled\nReplied\nOpen",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
"reqd": 1
- },
+ },
{
- "fieldname": "items_section",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart",
- "permlevel": 0,
+ "fieldname": "items_section",
+ "fieldtype": "Section Break",
+ "label": "",
+ "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": "items",
- "fieldtype": "Table",
- "label": "Items",
- "oldfieldname": "enquiry_details",
- "oldfieldtype": "Table",
- "options": "Opportunity Item",
- "permlevel": 0,
+ "description": "Items which do not exist in Item master can also be entered on customer's request",
+ "fieldname": "items",
+ "fieldtype": "Table",
+ "label": "Items",
+ "oldfieldname": "enquiry_details",
+ "oldfieldtype": "Table",
+ "options": "Opportunity Item",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "fieldname": "fold",
- "fieldtype": "Fold",
+ "fieldname": "fold",
+ "fieldtype": "Fold",
"permlevel": 0
- },
+ },
{
- "depends_on": "eval:doc.lead || doc.customer",
- "fieldname": "contact_info",
- "fieldtype": "Section Break",
- "label": "Contact Info",
- "options": "icon-bullhorn",
- "permlevel": 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,
+ "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,
+ "fieldname": "address_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Address",
+ "oldfieldname": "address",
+ "oldfieldtype": "Small Text",
+ "permlevel": 0,
"read_only": 1
- },
+ },
{
- "depends_on": "customer",
- "description": "",
- "fieldname": "territory",
- "fieldtype": "Link",
- "in_filter": 1,
- "in_list_view": 1,
- "label": "Territory",
- "options": "Territory",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 0,
+ "depends_on": "customer",
+ "description": "",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "in_list_view": 1,
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 0,
+ "reqd": 0,
"search_index": 1
- },
+ },
{
- "depends_on": "customer",
- "description": "",
- "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,
+ "depends_on": "customer",
+ "description": "",
+ "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,
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
"read_only": 0
- },
+ },
{
- "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,
+ "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,
+ "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": "Small Text",
- "label": "Contact Email",
- "permlevel": 0,
+ "depends_on": "eval:doc.lead || doc.customer",
+ "fieldname": "contact_email",
+ "fieldtype": "Small Text",
+ "label": "Contact Email",
+ "permlevel": 0,
"read_only": 1
- },
+ },
{
- "depends_on": "eval:doc.lead || doc.customer",
- "fieldname": "contact_mobile",
- "fieldtype": "Small Text",
- "label": "Contact Mobile No",
- "permlevel": 0,
+ "depends_on": "eval:doc.lead || doc.customer",
+ "fieldname": "contact_mobile",
+ "fieldtype": "Small 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,
+ "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,
+ "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,
+ "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": "company",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Company",
- "oldfieldname": "company",
- "oldfieldtype": "Link",
- "options": "Company",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 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
- },
+ },
{
- "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,
+ "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,
+ "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": "fiscal_year",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "Fiscal Year",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 0,
- "reqd": 1,
+ "fieldname": "fiscal_year",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "Fiscal Year",
+ "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,
+ "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,
+ "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,
+ "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": "Datetime",
- "label": "Next Contact Date",
- "oldfieldname": "contact_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
+ "description": "Your sales person will get a reminder on this date to contact the customer",
+ "fieldname": "contact_date",
+ "fieldtype": "Datetime",
+ "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,
+ "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": "Link",
- "ignore_user_permissions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "options": "Opportunity",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "ignore_user_permissions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "options": "Opportunity",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
"width": "150px"
}
- ],
- "icon": "icon-info-sign",
- "idx": 1,
- "is_submittable": 1,
- "modified": "2015-02-16 23:52:23.489259",
- "modified_by": "Administrator",
- "module": "CRM",
- "name": "Opportunity",
- "owner": "Administrator",
+ ],
+ "icon": "icon-info-sign",
+ "idx": 1,
+ "is_submittable": 1,
+ "modified": "2015-02-23 02:19:39.853388",
+ "modified_by": "Administrator",
+ "module": "CRM",
+ "name": "Opportunity",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 1,
- "apply_user_permissions": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Sales User",
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "apply_user_permissions": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "share": 1,
+ "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",
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "share": 1,
+ "submit": 1,
"write": 1
}
- ],
- "search_fields": "status,transaction_date,customer,lead,enquiry_type,territory,company",
- "sort_field": "modified",
- "sort_order": "DESC",
+ ],
+ "search_fields": "status,transaction_date,customer,lead,enquiry_type,territory,company",
+ "sort_field": "modified",
+ "sort_order": "DESC",
"title_field": "customer_name"
-}
+}
\ No newline at end of file
diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py
index f368998..c2378a7 100644
--- a/erpnext/crm/doctype/opportunity/opportunity.py
+++ b/erpnext/crm/doctype/opportunity/opportunity.py
@@ -120,6 +120,14 @@
if not self.get('items'):
frappe.throw(_("Items required"))
+ # set missing values
+ item_fields = ("item_name", "description", "item_group", "brand")
+
+ for d in self.items:
+ item = frappe.db.get_value("Item", d.item_code, item_fields, as_dict=True)
+ for key in item_fields:
+ if not d.get(key): d.set(key, item.get(key))
+
def validate_lead_cust(self):
if self.enquiry_from == 'Lead':
if not self.lead:
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index ffc9496..0edaa92 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -20,7 +20,28 @@
on_session_creation = "erpnext.shopping_cart.utils.set_cart_count"
on_logout = "erpnext.shopping_cart.utils.clear_cart_count"
-update_website_context = ["erpnext.shopping_cart.utils.update_website_context", "erpnext.startup.webutils.update_website_context"]
+
+# website
+update_website_context = "erpnext.shopping_cart.utils.update_website_context"
+my_account_context = "erpnext.shopping_cart.utils.update_my_account_context"
+
+website_route_rules = [
+ {"from_route": "/orders", "to_route": "Sales Order"},
+ {"from_route": "/orders/<name>", "to_route": "print", "defaults": {"doctype": "Sales Order"}},
+ {"from_route": "/invoices", "to_route": "Sales Invoice"},
+ {"from_route": "/invoices/<name>", "to_route": "print", "defaults": {"doctype": "Sales Invoice"}},
+ {"from_route": "/shipments", "to_route": "Delivery Note"},
+ {"from_route": "/shipments/<name>", "to_route": "print", "defaults": {"doctype": "Delivery Note"}},
+ {"from_route": "/issues", "to_route": "Issue"},
+ {"from_route": "/issues/<name>", "to_route": "print", "defaults": {"doctype": "Issue"}},
+ {"from_route": "/addresses", "to_route": "Address"},
+]
+
+has_website_permission = {
+ "Sales Order": "erpnext.controllers.website_list_for_contact.has_website_permission",
+ "Sales Invoice": "erpnext.controllers.website_list_for_contact.has_website_permission",
+ "Delivery Note": "erpnext.controllers.website_list_for_contact.has_website_permission"
+}
dump_report_map = "erpnext.startup.report_data_map.data_map"
diff --git a/erpnext/hr/doctype/appraisal/appraisal.json b/erpnext/hr/doctype/appraisal/appraisal.json
index 1f4e239..7dc86ad 100644
--- a/erpnext/hr/doctype/appraisal/appraisal.json
+++ b/erpnext/hr/doctype/appraisal/appraisal.json
@@ -7,7 +7,7 @@
{
"fieldname": "employee_details",
"fieldtype": "Section Break",
- "label": "Employee Details",
+ "label": "",
"oldfieldtype": "Section Break",
"permlevel": 0
},
@@ -152,7 +152,7 @@
"depends_on": "kra_template",
"fieldname": "other_details",
"fieldtype": "Section Break",
- "label": "Other Details",
+ "label": "",
"permlevel": 0
},
{
@@ -197,7 +197,7 @@
"icon": "icon-thumbs-up",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:34.405796",
+ "modified": "2015-02-20 05:08:10.903126",
"modified_by": "Administrator",
"module": "HR",
"name": "Appraisal",
diff --git a/erpnext/hr/doctype/appraisal/test_appraisal.py b/erpnext/hr/doctype/appraisal/test_appraisal.py
deleted file mode 100644
index 814baa2..0000000
--- a/erpnext/hr/doctype/appraisal/test_appraisal.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
-# See license.txt
-
-import frappe
-import unittest
-
-test_records = frappe.get_test_records('Appraisal')
-
-class TestAppraisal(unittest.TestCase):
- pass
diff --git a/erpnext/hr/doctype/appraisal/test_records.json b/erpnext/hr/doctype/appraisal/test_records.json
deleted file mode 100644
index 992043f..0000000
--- a/erpnext/hr/doctype/appraisal/test_records.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- {
- "doctype": "Appraisal",
- "name": "_Test Appraisal 1"
- }
-]
diff --git a/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py b/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py
deleted file mode 100644
index e9531dc..0000000
--- a/erpnext/hr/doctype/appraisal_template/test_appraisal_template.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
-# See license.txt
-
-import frappe
-import unittest
-
-test_records = frappe.get_test_records('Appraisal Template')
-
-class TestAppraisalTemplate(unittest.TestCase):
- pass
diff --git a/erpnext/hr/doctype/appraisal_template/test_records.json b/erpnext/hr/doctype/appraisal_template/test_records.json
deleted file mode 100644
index 441f55a..0000000
--- a/erpnext/hr/doctype/appraisal_template/test_records.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- {
- "doctype": "Appraisal Template",
- "name": "_Test Appraisal Template 1"
- }
-]
diff --git a/erpnext/hr/doctype/attendance/attendance.json b/erpnext/hr/doctype/attendance/attendance.json
index bf72327..cab1486 100644
--- a/erpnext/hr/doctype/attendance/attendance.json
+++ b/erpnext/hr/doctype/attendance/attendance.json
@@ -9,7 +9,7 @@
{
"fieldname": "attendance_details",
"fieldtype": "Section Break",
- "label": "Attendance Details",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "Simple",
"permlevel": 0
@@ -130,7 +130,7 @@
"icon": "icon-ok",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:34.545262",
+ "modified": "2015-02-20 05:09:39.161541",
"modified_by": "Administrator",
"module": "HR",
"name": "Attendance",
diff --git a/erpnext/hr/doctype/employee/employee.json b/erpnext/hr/doctype/employee/employee.json
index 718a6b1..7dfc0b8 100644
--- a/erpnext/hr/doctype/employee/employee.json
+++ b/erpnext/hr/doctype/employee/employee.json
@@ -10,7 +10,7 @@
{
"fieldname": "basic_information",
"fieldtype": "Section Break",
- "label": "Basic Information",
+ "label": "",
"oldfieldtype": "Section Break",
"permlevel": 0
},
@@ -453,7 +453,7 @@
{
"fieldname": "sb53",
"fieldtype": "Section Break",
- "label": "Bio",
+ "label": "",
"permlevel": 0
},
{
@@ -674,7 +674,7 @@
],
"icon": "icon-user",
"idx": 1,
- "modified": "2015-02-19 09:28:40.628101",
+ "modified": "2015-02-20 05:02:14.205144",
"modified_by": "Administrator",
"module": "HR",
"name": "Employee",
diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.json b/erpnext/hr/doctype/expense_claim/expense_claim.json
index c71a379..5152ec6 100644
--- a/erpnext/hr/doctype/expense_claim/expense_claim.json
+++ b/erpnext/hr/doctype/expense_claim/expense_claim.json
@@ -81,7 +81,7 @@
{
"fieldname": "expense_details",
"fieldtype": "Section Break",
- "label": "Expense Details",
+ "label": "",
"oldfieldtype": "Section Break",
"permlevel": 0
},
@@ -202,7 +202,7 @@
"icon": "icon-money",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:38.702422",
+ "modified": "2015-02-20 05:08:42.455478",
"modified_by": "Administrator",
"module": "HR",
"name": "Expense Claim",
diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.json b/erpnext/hr/doctype/salary_slip/salary_slip.json
index a3906f3..1a9f760 100644
--- a/erpnext/hr/doctype/salary_slip/salary_slip.json
+++ b/erpnext/hr/doctype/salary_slip/salary_slip.json
@@ -252,7 +252,7 @@
{
"fieldname": "totals",
"fieldtype": "Section Break",
- "label": "Totals",
+ "label": "",
"oldfieldtype": "Section Break",
"permlevel": 0
},
@@ -337,7 +337,7 @@
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:44.967827",
+ "modified": "2015-02-20 05:12:10.770423",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Slip",
diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py
index 3c64f5d..596184f 100644
--- a/erpnext/hr/doctype/salary_structure/salary_structure.py
+++ b/erpnext/hr/doctype/salary_structure/salary_structure.py
@@ -52,11 +52,22 @@
self.make_table('Deduction Type','deductions', 'Salary Structure Deduction')
def check_existing(self):
+ ret = self.get_other_active_salary_structure()
+
+ if ret and self.is_active=='Yes':
+ frappe.throw(_("Another Salary Structure {0} is active for employee {1}. Please make its status 'Inactive' to proceed.").format(ret, self.employee))
+
+ def get_other_active_salary_structure(self):
ret = frappe.db.sql("""select name from `tabSalary Structure` where is_active = 'Yes'
and employee = %s and name!=%s""", (self.employee,self.name))
- if ret and self.is_active=='Yes':
- frappe.throw(_("Another Salary Structure {0} is active for employee {1}. Please make its status 'Inactive' to proceed.").format(cstr(ret[0][0]), self.employee))
+ return ret[0][0] if ret else None
+
+ def before_test_insert(self):
+ """Make any existing salary structure for employee inactive."""
+ ret = self.get_other_active_salary_structure()
+ if ret:
+ frappe.db.set_value("Salary Structure", ret, "is_active", "No")
def validate_amount(self):
if flt(self.net_pay) < 0:
diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js
index 2ec74f2..7bff687 100644
--- a/erpnext/manufacturing/doctype/bom/bom.js
+++ b/erpnext/manufacturing/doctype/bom/bom.js
@@ -173,8 +173,12 @@
name: d.operation
},
callback: function (data) {
- frappe.model.set_value(d.doctype, d.name, "opn_description", data.message.opn_description);
- frappe.model.set_value(d.doctype, d.name, "workstation", data.message.workstation);
+ if(data.message.description) {
+ frappe.model.set_value(d.doctype, d.name, "description", data.message.description);
+ }
+ if(data.message.workstation) {
+ frappe.model.set_value(d.doctype, d.name, "workstation", data.message.workstation);
+ }
}
})
});
diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json
index 78a800b..2f95e85 100644
--- a/erpnext/manufacturing/doctype/bom/bom.json
+++ b/erpnext/manufacturing/doctype/bom/bom.json
@@ -168,7 +168,7 @@
{
"fieldname": "more_info_section",
"fieldtype": "Section Break",
- "label": "More Info",
+ "label": "",
"permlevel": 0
},
{
@@ -279,7 +279,7 @@
"is_submittable": 1,
"issingle": 0,
"istable": 0,
- "modified": "2015-02-18 14:58:32.967368",
+ "modified": "2015-02-21 10:31:18.889394",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM",
diff --git a/erpnext/manufacturing/doctype/bom/test_bom.py b/erpnext/manufacturing/doctype/bom/test_bom.py
index 4889638..c03e621 100644
--- a/erpnext/manufacturing/doctype/bom/test_bom.py
+++ b/erpnext/manufacturing/doctype/bom/test_bom.py
@@ -7,7 +7,7 @@
import frappe
from frappe.utils import cstr
-test_records = frappe.get_test_records('Bom')
+test_records = frappe.get_test_records('BOM')
class TestBOM(unittest.TestCase):
def test_get_items(self):
diff --git a/erpnext/manufacturing/doctype/bom/test_records.json b/erpnext/manufacturing/doctype/bom/test_records.json
index 6f10b21..f0980e1 100644
--- a/erpnext/manufacturing/doctype/bom/test_records.json
+++ b/erpnext/manufacturing/doctype/bom/test_records.json
@@ -61,7 +61,7 @@
"operation": "_Test Operation 1",
"opn_description": "_Test",
"workstation": "_Test Workstation 1",
- "time_in_min": 60,
+ "time_in_mins": 60,
"operating_cost": 100
}
],
@@ -100,7 +100,7 @@
"operation": "_Test Operation 1",
"opn_description": "_Test",
"workstation": "_Test Workstation 1",
- "time_in_min": 60,
+ "time_in_mins": 60,
"operating_cost": 140
}
],
diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.json b/erpnext/manufacturing/doctype/bom_operation/bom_operation.json
index aedc074..ca040a0 100644
--- a/erpnext/manufacturing/doctype/bom_operation/bom_operation.json
+++ b/erpnext/manufacturing/doctype/bom_operation/bom_operation.json
@@ -26,7 +26,7 @@
"reqd": 0
},
{
- "fieldname": "opn_description",
+ "fieldname": "description",
"fieldtype": "Text",
"in_list_view": 1,
"label": "Operation Description",
@@ -77,7 +77,7 @@
],
"idx": 1,
"istable": 1,
- "modified": "2015-02-12 17:49:00.126034",
+ "modified": "2015-02-22 10:26:15.377498",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "BOM Operation",
diff --git a/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.json b/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.json
index be5d5fc..1fa949d 100644
--- a/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.json
+++ b/erpnext/manufacturing/doctype/manufacturing_settings/manufacturing_settings.json
@@ -34,11 +34,10 @@
},
{
"default": "30",
- "description": "Delay in start time of production order operations if automatically make time logs is used.\n(in mins)",
- "fieldname": "operations_start_delay",
- "fieldtype": "Float",
- "in_list_view": 1,
- "label": "Operations Start Delay",
+ "description": "Try planning operations for X days in advance.",
+ "fieldname": "capacity_planning_for_days",
+ "fieldtype": "Data",
+ "label": "Capacity Planning For (Days)",
"permlevel": 0,
"precision": ""
}
@@ -51,7 +50,7 @@
"is_submittable": 0,
"issingle": 1,
"istable": 0,
- "modified": "2015-02-05 05:11:41.192126",
+ "modified": "2015-02-23 09:05:58.927098",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Manufacturing Settings",
diff --git a/erpnext/manufacturing/doctype/operation/operation.json b/erpnext/manufacturing/doctype/operation/operation.json
index 4ef4a0f..5ebc1bf 100644
--- a/erpnext/manufacturing/doctype/operation/operation.json
+++ b/erpnext/manufacturing/doctype/operation/operation.json
@@ -50,7 +50,7 @@
"precision": ""
},
{
- "fieldname": "opn_description",
+ "fieldname": "description",
"fieldtype": "Text",
"label": "Operation Description",
"permlevel": 0,
@@ -65,7 +65,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 0,
- "modified": "2015-02-05 05:11:41.666429",
+ "modified": "2015-02-22 10:24:26.834166",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Operation",
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js
index 3f4e99e..48fe7a0 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.js
+++ b/erpnext/manufacturing/doctype/production_order/production_order.js
@@ -59,12 +59,12 @@
var doc = frm.doc;
if (doc.docstatus === 1) {
- if (doc.material_transferred_for_qty < doc.qty) {
+ if (flt(doc.material_transferred_for_qty) < flt(doc.qty)) {
frm.add_custom_button(__('Transfer Materials for Manufacture'),
cur_frm.cscript['Transfer Raw Materials'], frappe.boot.doctype_icons["Stock Entry"]);
}
- if (doc.produced_qty < doc.material_transferred_for_qty) {
+ if (flt(doc.produced_qty) < flt(doc.material_transferred_for_qty)) {
frm.add_custom_button(__('Update Finished Goods'),
cur_frm.cscript['Update Finished Goods'], frappe.boot.doctype_icons["Stock Entry"]);
}
@@ -85,6 +85,14 @@
frm.add_custom_button(__('Unstop'), cur_frm.cscript['Unstop Production Order'],
"icon-check", "btn-default");
}
+
+ // opertions
+ if ((doc.operations || []).length) {
+ frm.add_custom_button(__('Show Time Logs'), function() {
+ frappe.route_options = {"production_order": frm.doc.name};
+ frappe.set_route("List", "Time Log");
+ });
+ }
}
},
@@ -191,6 +199,11 @@
});
},
+ show_time_logs: function(doc, doctype, name) {
+ frappe.route_options = {"operation_id": name};
+ frappe.set_route("List", "Time Log");
+ },
+
make_time_log: function(doc, cdt, cdn){
var child = locals[cdt][cdn]
frappe.call({
@@ -209,16 +222,7 @@
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
}
});
- },
-
- auto_time_log: function(doc){
- frappe.call({
- method:"erpnext.manufacturing.doctype.production_order.production_order.auto_make_time_log",
- args: {
- "production_order_id": doc.name
- }
- });
- },
+ }
});
cur_frm.cscript['Stop Production Order'] = function() {
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.json b/erpnext/manufacturing/doctype/production_order/production_order.json
index 1c6245b..089fd38 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.json
+++ b/erpnext/manufacturing/doctype/production_order/production_order.json
@@ -8,7 +8,7 @@
{
"fieldname": "item",
"fieldtype": "Section Break",
- "label": "Item",
+ "label": "",
"options": "icon-gift",
"permlevel": 0
},
@@ -271,15 +271,6 @@
"read_only": 1
},
{
- "allow_on_submit": 1,
- "depends_on": "eval:doc.docstatus==1",
- "fieldname": "auto_time_log",
- "fieldtype": "Button",
- "label": "Automatically Make Time logs",
- "permlevel": 0,
- "precision": ""
- },
- {
"fieldname": "more_info",
"fieldtype": "Section Break",
"label": "More Info",
@@ -360,7 +351,7 @@
"idx": 1,
"in_create": 0,
"is_submittable": 1,
- "modified": "2015-02-19 06:00:33.277637",
+ "modified": "2015-02-23 07:42:05.639225",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Production Order",
diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py
index b7f2ba9..ba61b3c 100644
--- a/erpnext/manufacturing/doctype/production_order/production_order.py
+++ b/erpnext/manufacturing/doctype/production_order/production_order.py
@@ -4,14 +4,19 @@
from __future__ import unicode_literals
import frappe, json
-from frappe.utils import flt, nowdate, cstr, get_datetime, getdate
+from frappe.utils import flt, nowdate, get_datetime, getdate, date_diff, time_diff_in_seconds
from frappe import _
from frappe.model.document import Document
from erpnext.manufacturing.doctype.bom.bom import validate_bom_no
from dateutil.relativedelta import relativedelta
+from dateutil.parser import parse
class OverProductionError(frappe.ValidationError): pass
class StockOverProductionError(frappe.ValidationError): pass
+class OperationTooLongError(frappe.ValidationError): pass
+
+from erpnext.manufacturing.doctype.workstation.workstation import WorkstationHolidayError, NotInWorkingHoursError
+from erpnext.projects.doctype.time_log.time_log import OverlapError
form_grid_templates = {
"operations": "templates/form_grid/production_order_grid.html"
@@ -141,6 +146,7 @@
if not self.fg_warehouse:
frappe.throw(_("For Warehouse is required before Submit"))
frappe.db.set(self,'status', 'Submitted')
+ self.make_time_logs()
self.update_planned_qty(self.qty)
@@ -170,7 +176,7 @@
self.set('operations', [])
- operations = frappe.db.sql("""select operation, opn_description, workstation,
+ operations = frappe.db.sql("""select operation, description, workstation,
hour_rate, time_in_mins, operating_cost as "planned_operating_cost", "Pending" as status
from `tabBOM Operation` where parent = %s""", self.bom_no, as_dict=1)
@@ -198,12 +204,64 @@
if holiday_list not in self.holidays:
holiday_list_days = [getdate(d[0]) for d in frappe.get_all("Holiday", fields=["holiday_date"],
- filters={"parent": holiday_list}, order_by="holiday_date", limit_page_length=0, as_list=1)]
+ filters={"parent": holiday_list}, order_by="holiday_date", as_list=1)]
self.holidays[holiday_list] = holiday_list_days
return self.holidays[holiday_list]
+ def make_time_logs(self):
+ time_logs = []
+
+ plan_days = frappe.db.get_single_value("Manufacturing Settings", "capacity_planning_for_days") or 30
+
+ for d in self.operations:
+ time_log = make_time_log(self.name, d.operation, d.planned_start_time, d.planned_end_time,
+ flt(self.qty) - flt(d.completed_qty), self.project_name, d.workstation)
+
+ self.check_operation_fits_in_working_hours(d)
+
+ original_start_time = time_log.from_time
+ while True:
+ try:
+ time_log.save()
+ break
+ except WorkstationHolidayError:
+ time_log.move_to_next_day()
+ except NotInWorkingHoursError:
+ time_log.move_to_next_working_slot()
+ except OverlapError:
+ time_log.move_to_next_non_overlapping_slot()
+
+ # reset end time
+ time_log.to_time = get_datetime(time_log.from_time) + relativedelta(minutes=d.time_in_mins)
+
+ if date_diff(time_log.from_time, original_start_time) > plan_days:
+ frappe.msgprint(_("Unable to find Time Slot in the next {0} days for Operation {1}").format(plan_days, d.operation))
+ break
+
+ print time_log.as_json()
+
+ if time_log.name:
+ time_logs.append(time_log.name)
+
+ if time_logs:
+ frappe.msgprint(_("Time Logs created:") + "\n" + "\n".join(time_logs))
+
+
+ def check_operation_fits_in_working_hours(self, d):
+ """Raises expection if operation is longer than working hours in the given workstation."""
+ operation_length = time_diff_in_seconds(d.planned_end_time, d.planned_start_time)
+
+ workstation = frappe.get_doc("Workstation", d.workstation)
+ for working_hour in workstation.working_hours:
+ slot_length = (parse(working_hour.end_time) - parse(working_hour.start_time)).total_seconds()
+ if slot_length >= operation_length:
+ return
+
+ frappe.throw(_("Operation {0} longer than any available working hours in workstation {1}, break down the operation into multiple operations").format(d.operation, d.workstation),
+ OperationTooLongError)
+
def update_operation_status(self):
for d in self.get("operations"):
if not d.completed_qty:
@@ -293,13 +351,14 @@
return data
@frappe.whitelist()
-def make_time_log(name, operation, from_time, to_time, qty=None, project=None, workstation=None):
+def make_time_log(name, operation, from_time, to_time, qty=None, project=None, workstation=None, operation_id=None):
time_log = frappe.new_doc("Time Log")
time_log.time_log_for = 'Manufacturing'
time_log.from_time = from_time
time_log.to_time = to_time
time_log.production_order = name
time_log.project = project
+ time_log.operation_id = operation_id
time_log.operation= operation
time_log.workstation= workstation
time_log.activity_type= "Manufacturing"
@@ -307,20 +366,3 @@
if from_time and to_time :
time_log.calculate_total_hours()
return time_log
-
-@frappe.whitelist()
-def auto_make_time_log(production_order_id):
- if frappe.db.get_value("Time Log", filters={"production_order": production_order_id, "docstatus":1}):
- frappe.throw(_("Time logs already exists against this Production Order"))
-
- time_logs = []
- prod_order = frappe.get_doc("Production Order", production_order_id)
-
- for d in prod_order.operations:
- operation = cstr(d.idx) + ". " + d.operation
- time_log = make_time_log(prod_order.name, operation, d.planned_start_time, d.planned_end_time,
- flt(prod_order.qty) - flt(d.completed_qty), prod_order.project_name, d.workstation)
- time_log.save()
- time_logs.append(time_log.name)
- if time_logs:
- frappe.msgprint(_("Time Logs created:") + "\n" + "\n".join(time_logs))
diff --git a/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json b/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json
index cd62ad2..2fe6c32 100644
--- a/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json
+++ b/erpnext/manufacturing/doctype/production_order_operation/production_order_operation.json
@@ -11,7 +11,7 @@
{
"fieldname": "details",
"fieldtype": "Section Break",
- "label": "Details",
+ "label": "",
"permlevel": 0,
"precision": ""
},
@@ -40,7 +40,7 @@
},
{
"allow_on_submit": 0,
- "fieldname": "opn_description",
+ "fieldname": "description",
"fieldtype": "Text",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -125,6 +125,15 @@
"unique": 0
},
{
+ "allow_on_submit": 1,
+ "depends_on": "eval:(doc.docstatus==1 && doc.status!=\"Completed\")",
+ "fieldname": "show_time_logs",
+ "fieldtype": "Button",
+ "label": "Show Time Logs",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
"fieldname": "estimated_time_and_cost",
"fieldtype": "Section Break",
"label": "Estimated Time and Cost",
@@ -266,7 +275,6 @@
"read_only": 1
},
{
- "allow_on_submit": 1,
"depends_on": "eval:(doc.docstatus==1 && doc.status!=\"Completed\")",
"fieldname": "make_time_log",
"fieldtype": "Button",
@@ -282,7 +290,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
- "modified": "2015-02-13 16:26:30.441657",
+ "modified": "2015-02-23 07:55:19.368919",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Production Order Operation",
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 6eddb3f..f365733 100644
--- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
+++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
@@ -8,6 +8,7 @@
from frappe import msgprint, _
from frappe.model.document import Document
+from erpnext.manufacturing.doctype.bom.bom import validate_bom_no
class ProductionPlanningTool(Document):
def __init__(self, arg1, arg2=None):
@@ -156,20 +157,10 @@
def validate_data(self):
self.validate_company()
for d in self.get('items'):
- self.validate_bom_no(d)
+ validate_bom_no(d.item_code, d.bom_no)
if not flt(d.planned_qty):
frappe.throw(_("Please enter Planned Qty for Item {0} at row {1}").format(d.item_code, d.idx))
- def validate_bom_no(self, d):
- if not d.bom_no:
- frappe.throw(_("Please enter BOM for Item {0} at row {1}").format(d.item_code, d.idx))
- else:
- bom = frappe.db.sql("""select name from `tabBOM` where name = %s and item = %s
- and docstatus = 1 and is_active = 1""",
- (d.bom_no, d.item_code), as_dict = 1)
- if not bom:
- frappe.throw(_("Incorrect or Inactive BOM {0} for Item {1} at row {2}").format(d.bom_no, d.item_code, d.idx))
-
def raise_production_order(self):
"""It will raise production order (Draft) for all distinct FG items"""
self.validate_data()
@@ -218,7 +209,7 @@
for key in items:
pro = frappe.new_doc("Production Order")
pro.update(items[key])
-
+
pro.planned_start_date = now()
pro.set_production_order_operations()
diff --git a/erpnext/manufacturing/doctype/workstation/workstation.json b/erpnext/manufacturing/doctype/workstation/workstation.json
index e4cda3d..b65560c 100644
--- a/erpnext/manufacturing/doctype/workstation/workstation.json
+++ b/erpnext/manufacturing/doctype/workstation/workstation.json
@@ -10,7 +10,7 @@
{
"fieldname": "description_and_warehouse",
"fieldtype": "Section Break",
- "label": "Description and Warehouse",
+ "label": "",
"permlevel": 0,
"precision": ""
},
@@ -70,7 +70,7 @@
{
"description": "per hour",
"fieldname": "hour_rate_electricity",
- "fieldtype": "Float",
+ "fieldtype": "Currency",
"label": "Electricity Cost",
"oldfieldname": "hour_rate_electricity",
"oldfieldtype": "Currency",
@@ -79,7 +79,7 @@
{
"description": "per hour",
"fieldname": "hour_rate_consumable",
- "fieldtype": "Float",
+ "fieldtype": "Currency",
"label": "Consumable Cost",
"oldfieldname": "hour_rate_consumable",
"oldfieldtype": "Currency",
@@ -94,7 +94,7 @@
{
"description": "per hour",
"fieldname": "hour_rate_rent",
- "fieldtype": "Float",
+ "fieldtype": "Currency",
"label": "Rent Cost",
"oldfieldname": "hour_rate_rent",
"oldfieldtype": "Currency",
@@ -103,7 +103,7 @@
{
"description": "Wages per hour",
"fieldname": "hour_rate_labour",
- "fieldtype": "Float",
+ "fieldtype": "Currency",
"label": "Wages",
"oldfieldname": "hour_rate_labour",
"oldfieldtype": "Currency",
@@ -113,7 +113,7 @@
{
"description": "per hour",
"fieldname": "hour_rate",
- "fieldtype": "Float",
+ "fieldtype": "Currency",
"label": "Net Hour Rate",
"oldfieldname": "hour_rate",
"oldfieldtype": "Currency",
@@ -123,7 +123,7 @@
{
"fieldname": "working_hours_section",
"fieldtype": "Section Break",
- "label": "Wroking Hours",
+ "label": "Working Hours",
"permlevel": 0,
"precision": ""
},
@@ -133,12 +133,13 @@
"label": "Working Hours",
"options": "Workstation Working Hour",
"permlevel": 0,
- "precision": ""
+ "precision": "",
+ "reqd": 1
}
],
"icon": "icon-wrench",
"idx": 1,
- "modified": "2015-02-05 05:13:38.580439",
+ "modified": "2015-02-23 09:43:35.903827",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Workstation",
diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py
index 00f7ee6..d345e26 100644
--- a/erpnext/manufacturing/doctype/workstation/workstation.py
+++ b/erpnext/manufacturing/doctype/workstation/workstation.py
@@ -10,7 +10,7 @@
from frappe.model.document import Document
class WorkstationHolidayError(frappe.ValidationError): pass
-class WorkstationIsClosedError(frappe.ValidationError): pass
+class NotInWorkingHoursError(frappe.ValidationError): pass
class OverlapError(frappe.ValidationError): pass
class Workstation(Document):
@@ -31,6 +31,7 @@
self.update_bom_operation()
def validate_overlap_for_operation_timings(self):
+ """Check if there is no overlap in setting Workstation Operating Hours"""
for d in self.get("working_hours"):
existing = frappe.db.sql_list("""select idx from `tabWorkstation Working Hour`
where parent = %s and name != %s
@@ -49,7 +50,7 @@
def check_if_within_operating_hours(workstation, from_datetime, to_datetime):
if not is_within_operating_hours(workstation, from_datetime, to_datetime):
- frappe.throw(_("Time Log timings outside workstation operating hours"), WorkstationIsClosedError)
+ frappe.throw(_("Time Log timings outside workstation operating hours"), NotInWorkingHoursError)
if not cint(frappe.db.get_value("Manufacturing Settings", "None", "allow_production_on_holidays")):
check_workstation_for_holiday(workstation, from_datetime, to_datetime)
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 17e6435..05b92b1 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -120,3 +120,7 @@
erpnext.patches.v5_0.update_item_description_and_image
erpnext.patches.v5_0.update_material_transferred_for_qty
erpnext.patches.v5_0.stock_entry_update_value
+erpnext.patches.v5_0.convert_stock_reconciliation
+erpnext.patches.v5_0.update_projects
+erpnext.patches.v5_0.item_patches
+erpnext.patches.v5_0.update_journal_entry_title
diff --git a/erpnext/patches/v5_0/convert_stock_reconciliation.py b/erpnext/patches/v5_0/convert_stock_reconciliation.py
new file mode 100644
index 0000000..ce649c0
--- /dev/null
+++ b/erpnext/patches/v5_0/convert_stock_reconciliation.py
@@ -0,0 +1,21 @@
+import frappe, json
+
+def execute():
+ # stock reco now amendable
+ frappe.db.sql("""update tabDocPerm set `amend` = 1 where parent='Stock Reconciliation' and submit = 1""")
+
+ if frappe.db.has_column("Stock Reconciliation", "reconciliation_json"):
+ for sr in frappe.db.get_all("Stock Reconciliation", ["name"],
+ {"reconciliation_json": ["!=", ""]}):
+ sr = frappe.get_doc("Stock Reconciliation", sr.name)
+ for item in json.loads(sr.reconciliation_json):
+ sr.append("items", {
+ "item_code": item.item_code,
+ "warehouse": item.warehouse,
+ "valuation_rate": item.valuation_rate,
+ "qty": item.qty
+ })
+
+ for item in sr.items:
+ item.db_update()
+
diff --git a/erpnext/patches/v5_0/item_patches.py b/erpnext/patches/v5_0/item_patches.py
new file mode 100644
index 0000000..37992ad
--- /dev/null
+++ b/erpnext/patches/v5_0/item_patches.py
@@ -0,0 +1,5 @@
+import frappe
+
+def execute():
+ frappe.db.sql("update `tabItem` set end_of_life='2099-12-31' where ifnull(end_of_life, '0000-00-00')='0000-00-00'")
+ frappe.db.sql("update `tabItem` set website_image = image where ifnull(website_image, '') = 'attach_files:'")
diff --git a/erpnext/patches/v5_0/update_journal_entry_title.py b/erpnext/patches/v5_0/update_journal_entry_title.py
new file mode 100644
index 0000000..59e6f41
--- /dev/null
+++ b/erpnext/patches/v5_0/update_journal_entry_title.py
@@ -0,0 +1,7 @@
+import frappe
+
+def execute():
+ frappe.db.sql("""update `tabJournal Entry` set title =
+ if(ifnull(pay_to_recd_from, "")!="", pay_to_recd_from,
+ (select account from `tabJournal Entry Account`
+ where parent=`tabJournal Entry`.name and idx=1 limit 1))""")
diff --git a/erpnext/patches/v5_0/update_projects.py b/erpnext/patches/v5_0/update_projects.py
new file mode 100644
index 0000000..967352d
--- /dev/null
+++ b/erpnext/patches/v5_0/update_projects.py
@@ -0,0 +1,21 @@
+import frappe
+
+def execute():
+ # convert milestones to tasks
+ frappe.reload_doctype("Project")
+
+ for m in frappe.get_all("Project Milestone", "*"):
+ frappe.get_doc({
+ "doctype": "Task",
+ "subject": m.milestone,
+ "expected_start_date": m.milestone_date,
+ "status": "Open" if m.status=="Pending" else "Closed",
+ "project": m.parent,
+ }).insert(ignore_permissions=True)
+
+ # remove project milestone
+ frappe.delete_doc("DocType", "Project Milestone")
+
+ # remove calendar events for milestone
+ for e in frappe.get_all("Event", ["name"], {"ref_type": "Project"}):
+ frappe.delete_doc("Event", e.name)
diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js
index fa75c52..39835fa 100644
--- a/erpnext/projects/doctype/project/project.js
+++ b/erpnext/projects/doctype/project/project.js
@@ -1,6 +1,15 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
+frappe.ui.form.on("Project Task", "edit_task", function(frm, doctype, name) {
+ var doc = frappe.get_doc(doctype, name);
+ if(doc.task_id) {
+ frappe.set_route("Form", "Task", doc.task_id);
+ } else {
+ msgprint(__("Save the document first."));
+ }
+})
+
// show tasks
cur_frm.cscript.refresh = function(doc) {
if(!doc.__islocal) {
diff --git a/erpnext/projects/doctype/project/project.json b/erpnext/projects/doctype/project/project.json
index f5cfde2..6a143ab 100644
--- a/erpnext/projects/doctype/project/project.json
+++ b/erpnext/projects/doctype/project/project.json
@@ -21,7 +21,7 @@
"permlevel": 0
},
{
- "description": "Project will get saved and will be searchable with project name given",
+ "description": "",
"fieldname": "project_name",
"fieldtype": "Data",
"label": "Project Name",
@@ -119,34 +119,31 @@
{
"fieldname": "sb_milestones",
"fieldtype": "Section Break",
- "label": "Milestones",
+ "label": "Tasks",
"oldfieldtype": "Section Break",
"options": "icon-flag",
"permlevel": 0
},
{
- "description": "Milestones will be added as Events in the Calendar",
- "fieldname": "milestones",
+ "fieldname": "tasks",
"fieldtype": "Table",
- "label": "Milestones",
- "no_copy": 0,
- "oldfieldname": "project_milestones",
- "oldfieldtype": "Table",
- "options": "Project Milestone",
+ "label": "Tasks",
+ "options": "Project Task",
"permlevel": 0,
- "search_index": 0
+ "precision": ""
},
{
- "fieldname": "percent_milestones_completed",
+ "fieldname": "percent_complete",
"fieldtype": "Percent",
- "label": "% Milestones Completed",
+ "in_list_view": 0,
+ "label": "% Tasks Completed",
"permlevel": 0,
"read_only": 1
},
{
"fieldname": "section_break0",
"fieldtype": "Section Break",
- "label": "Project Details",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-list",
"permlevel": 0
@@ -162,14 +159,6 @@
"search_index": 0
},
{
- "fieldname": "percent_complete",
- "fieldtype": "Percent",
- "in_list_view": 0,
- "label": "% Tasks Completed",
- "permlevel": 0,
- "read_only": 1
- },
- {
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
@@ -273,7 +262,7 @@
"icon": "icon-puzzle-piece",
"idx": 1,
"max_attachments": 4,
- "modified": "2015-02-05 05:11:43.094638",
+ "modified": "2015-02-22 11:17:49.051755",
"modified_by": "Administrator",
"module": "Projects",
"name": "Project",
diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py
index 8dc65a6..469c629 100644
--- a/erpnext/projects/doctype/project/project.py
+++ b/erpnext/projects/doctype/project/project.py
@@ -6,7 +6,6 @@
from frappe.utils import flt, getdate
from frappe import _
-from erpnext.utilities.transaction_base import delete_events
from frappe.model.document import Document
@@ -14,6 +13,18 @@
def get_feed(self):
return '{0}: {1}'.format(_(self.status), self.project_name)
+ def onload(self):
+ """Load project tasks for quick view"""
+ for task in frappe.get_all("Task", "*", {"project": self.name}, order_by="exp_start_date asc"):
+ self.append("tasks", {
+ "title": task.subject,
+ "status": task.status,
+ "start_date": task.exp_start_date,
+ "end_date": task.exp_end_date,
+ "desciption": task.description,
+ "task_id": task.name
+ })
+
def get_gross_profit(self):
pft, per_pft =0, 0
pft = flt(self.project_value) - flt(self.est_material_cost)
@@ -23,20 +34,40 @@
return ret
def validate(self):
- """validate start date before end date"""
if self.project_start_date and self.completion_date:
if getdate(self.completion_date) < getdate(self.project_start_date):
frappe.throw(_("Expected Completion Date can not be less than Project Start Date"))
- self.update_milestones_completed()
+ self.sync_tasks()
- def update_milestones_completed(self):
- if self.milestones:
- completed = filter(lambda x: x.status=="Completed", self.milestones)
- self.percent_milestones_completed = len(completed) * 100 / len(self.milestones)
+ def sync_tasks(self):
+ """sync tasks and remove table"""
+ task_names = []
+ for t in self.tasks:
+ if t.task_id:
+ task = frappe.get_doc("Task", t.task_id)
+ else:
+ task = frappe.new_doc("Task")
+ task.project = self.name
- def on_update(self):
- self.add_calendar_event()
+ task.update({
+ "subject": t.title,
+ "status": t.status,
+ "exp_start_date": t.start_date,
+ "exp_end_date": t.end_date,
+ "desciption": t.description,
+ })
+
+ task.flags.ignore_links = True
+ task.flags.from_project = True
+ task.save(ignore_permissions = True)
+ task_names.append(task.name)
+
+ # delete
+ for t in frappe.get_all("Task", ["name"], {"project": self.name, "name": ("not in", task_names)}):
+ frappe.delete_doc("Task", t.name)
+
+ self.tasks = []
def update_percent_complete(self):
total = frappe.db.sql("""select count(*) from tabTask where project=%s""",
@@ -48,28 +79,6 @@
int(float(completed) / total * 100))
- def add_calendar_event(self):
- # delete any earlier event for this project
- delete_events(self.doctype, self.name)
-
- # add events
- for milestone in self.get("milestones"):
- if milestone.milestone_date:
- description = (milestone.milestone or "Milestone") + " for " + self.name
- frappe.get_doc({
- "doctype": "Event",
- "owner": self.owner,
- "subject": description,
- "description": description,
- "starts_on": milestone.milestone_date + " 10:00:00",
- "event_type": "Private",
- "ref_type": self.doctype,
- "ref_name": self.name
- }).insert(ignore_permissions=True)
-
- def on_trash(self):
- delete_events(self.doctype, self.name)
-
@frappe.whitelist()
def get_cost_center_name(project_name):
return frappe.db.get_value("Project", project_name, "cost_center")
diff --git a/erpnext/projects/doctype/project/project_list.js b/erpnext/projects/doctype/project/project_list.js
index e440de8..8281c7d 100644
--- a/erpnext/projects/doctype/project/project_list.js
+++ b/erpnext/projects/doctype/project/project_list.js
@@ -1,6 +1,5 @@
frappe.listview_settings['Project'] = {
- add_fields: ["status", "priority", "is_active", "percent_complete",
- "percent_milestones_completed", "completion_date"],
+ add_fields: ["status", "priority", "is_active", "percent_complete", "completion_date"],
filters:[["status","=", "Open"]],
get_indicator: function(doc) {
if(doc.status=="Open" && doc.percent_complete) {
diff --git a/erpnext/projects/doctype/project_milestone/README.md b/erpnext/projects/doctype/project_milestone/README.md
deleted file mode 100644
index d47db7b..0000000
--- a/erpnext/projects/doctype/project_milestone/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Important date in the project lifecycle.
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project_milestone/__init__.py b/erpnext/projects/doctype/project_milestone/__init__.py
deleted file mode 100644
index baffc48..0000000
--- a/erpnext/projects/doctype/project_milestone/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from __future__ import unicode_literals
diff --git a/erpnext/projects/doctype/project_milestone/project_milestone.json b/erpnext/projects/doctype/project_milestone/project_milestone.json
deleted file mode 100644
index 7de9948..0000000
--- a/erpnext/projects/doctype/project_milestone/project_milestone.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "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/project_task/__init__.py b/erpnext/projects/doctype/project_task/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/projects/doctype/project_task/__init__.py
diff --git a/erpnext/projects/doctype/project_task/project_task.json b/erpnext/projects/doctype/project_task/project_task.json
new file mode 100644
index 0000000..c29dcc0
--- /dev/null
+++ b/erpnext/projects/doctype/project_task/project_task.json
@@ -0,0 +1,157 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "creation": "2015-02-22 11:15:28.201059",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Other",
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "fieldname": "title",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Title",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "default": "Open",
+ "fieldname": "status",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Status",
+ "no_copy": 0,
+ "options": "Open\nWorking\nPending Review\nClosed\nCancelled",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0
+ },
+ {
+ "fieldname": "edit_task",
+ "fieldtype": "Button",
+ "label": "Edit Task",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "start_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Start Date",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "default": "",
+ "fieldname": "end_date",
+ "fieldtype": "Date",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "End Date",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0
+ },
+ {
+ "fieldname": "section_break_6",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "allow_on_submit": 0,
+ "fieldname": "description",
+ "fieldtype": "Text",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Description",
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0
+ },
+ {
+ "fieldname": "task_id",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "label": "Task ID",
+ "no_copy": 1,
+ "options": "Task",
+ "permlevel": 0,
+ "precision": ""
+ }
+ ],
+ "hide_heading": 0,
+ "hide_toolbar": 0,
+ "in_create": 0,
+ "in_dialog": 0,
+ "is_submittable": 0,
+ "issingle": 0,
+ "istable": 1,
+ "modified": "2015-02-23 01:55:18.865117",
+ "modified_by": "Administrator",
+ "module": "Projects",
+ "name": "Project Task",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "read_only": 0,
+ "read_only_onload": 0,
+ "sort_field": "modified",
+ "sort_order": "DESC"
+}
\ No newline at end of file
diff --git a/erpnext/projects/doctype/project_milestone/project_milestone.py b/erpnext/projects/doctype/project_task/project_task.py
similarity index 61%
rename from erpnext/projects/doctype/project_milestone/project_milestone.py
rename to erpnext/projects/doctype/project_task/project_task.py
index 57bcfc4..e79a000 100644
--- a/erpnext/projects/doctype/project_milestone/project_milestone.py
+++ b/erpnext/projects/doctype/project_task/project_task.py
@@ -1,10 +1,9 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and contributors
+# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
-
from frappe.model.document import Document
-class ProjectMilestone(Document):
- pass
\ No newline at end of file
+class ProjectTask(Document):
+ pass
diff --git a/erpnext/projects/doctype/task/task.json b/erpnext/projects/doctype/task/task.json
index 258f469..e547834 100644
--- a/erpnext/projects/doctype/task/task.json
+++ b/erpnext/projects/doctype/task/task.json
@@ -9,7 +9,7 @@
{
"fieldname": "task_details",
"fieldtype": "Section Break",
- "label": "Task Details",
+ "label": "",
"oldfieldtype": "Section Break",
"permlevel": 0,
"print_width": "50%",
@@ -178,7 +178,7 @@
{
"fieldname": "more_details",
"fieldtype": "Section Break",
- "label": "More Details",
+ "label": "",
"permlevel": 0
},
{
@@ -217,7 +217,7 @@
"icon": "icon-check",
"idx": 1,
"max_attachments": 5,
- "modified": "2015-02-05 05:11:47.984820",
+ "modified": "2015-02-20 05:09:27.295024",
"modified_by": "Administrator",
"module": "Projects",
"name": "Task",
diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py
index fe1ce7f..0d37754 100644
--- a/erpnext/projects/doctype/task/task.py
+++ b/erpnext/projects/doctype/task/task.py
@@ -44,7 +44,7 @@
def on_update(self):
"""update percent complete in project"""
- if self.project:
+ if self.project and not self.flags.from_project:
project = frappe.get_doc("Project", self.project)
project.run_method("update_percent_complete")
diff --git a/erpnext/projects/doctype/time_log/time_log.js b/erpnext/projects/doctype/time_log/time_log.js
index 8172650..5f7e846 100644
--- a/erpnext/projects/doctype/time_log/time_log.js
+++ b/erpnext/projects/doctype/time_log/time_log.js
@@ -10,6 +10,14 @@
}
});
+frappe.ui.form.on("Time Log", "refresh", function(frm) {
+ // set default user if created
+ if (frm.doc.__islocal && !frm.doc.user) {
+ frm.set_value("user", user);
+ }
+});
+
+
// set to time if hours is updated
frappe.ui.form.on("Time Log", "hours", function(frm) {
if(!frm.doc.from_time) {
diff --git a/erpnext/projects/doctype/time_log/time_log.json b/erpnext/projects/doctype/time_log/time_log.json
index bc68805..603efe3 100644
--- a/erpnext/projects/doctype/time_log/time_log.json
+++ b/erpnext/projects/doctype/time_log/time_log.json
@@ -51,6 +51,14 @@
"read_only": 0
},
{
+ "fieldname": "user",
+ "fieldtype": "Link",
+ "label": "User",
+ "options": "User",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"permlevel": 0,
@@ -121,6 +129,15 @@
"precision": ""
},
{
+ "fieldname": "operation_id",
+ "fieldtype": "Data",
+ "label": "Operation ID",
+ "options": "",
+ "permlevel": 0,
+ "precision": "",
+ "read_only": 1
+ },
+ {
"fieldname": "column_break_14",
"fieldtype": "Column Break",
"permlevel": 0,
@@ -213,7 +230,7 @@
"icon": "icon-time",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-19 04:16:33.756377",
+ "modified": "2015-02-23 08:00:48.195775",
"modified_by": "Administrator",
"module": "Projects",
"name": "Time Log",
diff --git a/erpnext/projects/doctype/time_log/time_log.py b/erpnext/projects/doctype/time_log/time_log.py
index 33855af..3adf879 100644
--- a/erpnext/projects/doctype/time_log/time_log.py
+++ b/erpnext/projects/doctype/time_log/time_log.py
@@ -6,7 +6,9 @@
from __future__ import unicode_literals
import frappe, json
from frappe import _
-from frappe.utils import cstr, comma_and, flt
+from frappe.utils import cstr, flt, add_days, get_datetime, get_time
+from dateutil.relativedelta import relativedelta
+from dateutil.parser import parse
class OverlapError(frappe.ValidationError): pass
class OverProductionError(frappe.ValidationError): pass
@@ -52,24 +54,35 @@
self.status="Billed"
def validate_overlap(self):
- """Checks if 'Time Log' entries overlap each other. """
- existing = frappe.db.sql_list("""select name from `tabTime Log` where owner=%s and
+ """Checks if 'Time Log' entries overlap for a user, workstation. """
+ self.validate_overlap_for("user")
+ self.validate_overlap_for("workstation")
+
+ def validate_overlap_for(self, fieldname):
+ existing = self.get_overlap_for(fieldname)
+ if existing:
+ frappe.throw(_("This Time Log conflicts with {0} for {1}").format(existing.name,
+ self.meta.get_label(fieldname)), OverlapError)
+
+ def get_overlap_for(self, fieldname):
+ if not self.get(fieldname):
+ return
+ existing = frappe.db.sql("""select name, from_time, to_time from `tabTime Log` where `{0}`=%s and
(
(from_time between %s and %s) or
(to_time between %s and %s) or
(%s between from_time and to_time))
and name!=%s
and ifnull(task, "")=%s
- and docstatus < 2""",
- (self.owner, self.from_time, self.to_time, self.from_time,
+ and docstatus < 2""".format(fieldname),
+ (self.get(fieldname), self.from_time, self.to_time, self.from_time,
self.to_time, self.from_time, self.name or "No Name",
- cstr(self.task)))
+ cstr(self.task)), as_dict=True)
- if existing:
- frappe.throw(_("This Time Log conflicts with {0}").format(comma_and(existing)), OverlapError)
+ return existing[0] if existing else None
def validate_timings(self):
- if self.to_time < self.from_time:
+ if get_datetime(self.to_time) < get_datetime(self.from_time):
frappe.throw(_("From Time cannot be greater than To Time"))
def calculate_total_hours(self):
@@ -97,7 +110,7 @@
"""Updates `start_date`, `end_date`, `status` for operation in Production Order."""
if self.time_log_for=="Manufacturing" and self.operation:
- operation = self.operation.split('. ',1)
+ operation = self.operation
dates = self.get_operation_start_end_time()
tl = self.get_all_time_logs()
@@ -122,6 +135,31 @@
where production_order = %s and operation = %s and docstatus=1""",
(self.production_order, self.operation), as_dict=1)[0]
+ def move_to_next_day(self):
+ """Move start and end time one day forward"""
+ self.from_time = add_days(self.from_time, 1)
+
+ def move_to_next_working_slot(self):
+ """Move to next working slot from workstation"""
+ workstation = frappe.get_doc("Workstation", self.workstation)
+ slot_found = False
+ for working_hour in workstation.working_hours:
+ if get_datetime(self.from_time).time() < get_time(working_hour.start_time):
+ self.from_time = self.from_time.split()[0] + " " + working_hour.start_time
+ slot_found = True
+ break
+
+ if not slot_found:
+ # later than last time
+ self.from_time = self.from_time.split()[0] + workstation.working_hours[0].start_time
+ self.move_to_next_day()
+
+ def move_to_next_non_overlapping_slot(self):
+ """If in overlap, set start as the end point of the overlapping time log"""
+ overlapping = self.get_overlap_for("workstation")
+ if overlapping:
+ self.from_time = parse(overlapping.to_time) + relativedelta(minutes=10)
+
def get_all_time_logs(self):
"""Returns 'Actual Operating Time'. """
return frappe.db.sql("""select
diff --git a/erpnext/projects/doctype/time_log_batch/test_records.json b/erpnext/projects/doctype/time_log_batch/test_records.json
deleted file mode 100644
index 0b85c16..0000000
--- a/erpnext/projects/doctype/time_log_batch/test_records.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- {
- "doctype": "Time Log Batch",
- "name": "_Test Time Log Batch 1"
- }
-]
diff --git a/erpnext/public/css/erpnext.css b/erpnext/public/css/erpnext.css
index 747311c..e524a7c 100644
--- a/erpnext/public/css/erpnext.css
+++ b/erpnext/public/css/erpnext.css
@@ -48,7 +48,6 @@
.pos-item-image {
padding-bottom: 100%;
background-size: cover;
- background-position: center;
border: 1px solid transparent;
}
diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js
index 5d349f6..fa42e40 100644
--- a/erpnext/selling/doctype/customer/customer.js
+++ b/erpnext/selling/doctype/customer/customer.js
@@ -1,6 +1,20 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
+frappe.ui.form.on("Customer", "refresh", function(frm) {
+ cur_frm.cscript.setup_dashboard(frm.doc);
+
+ if(frappe.defaults.get_default("cust_master_name")!="Naming Series") {
+ frm.toggle_display("naming_series", false);
+ } else {
+ erpnext.toggle_naming_series();
+ }
+
+ frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
+
+ if(!frm.doc.__islocal) erpnext.utils.render_address_and_contact(frm);
+})
+
cur_frm.cscript.onload = function(doc, dt, dn) {
cur_frm.cscript.load_defaults(doc, dt, dn);
}
@@ -16,24 +30,6 @@
cur_frm.add_fetch('lead_name', 'company_name', 'customer_name');
cur_frm.add_fetch('default_sales_partner','commission_rate','default_commission_rate');
-cur_frm.cscript.refresh = function(doc, dt, dn) {
- cur_frm.cscript.setup_dashboard(doc);
-
- if(frappe.defaults.get_default("cust_master_name")!="Naming Series") {
- cur_frm.toggle_display("naming_series", false);
- } else {
- erpnext.toggle_naming_series();
- }
-
- if(doc.__islocal){
- hide_field(['address_html','contact_html']);
- }else{
- unhide_field(['address_html','contact_html']);
- // make lists
- erpnext.utils.render_address_and_contact(cur_frm);
- }
-}
-
cur_frm.cscript.validate = function(doc, dt, dn) {
if(doc.lead_name) frappe.model.clear_doc("Lead", doc.lead_name);
}
diff --git a/erpnext/selling/doctype/customer/customer.json b/erpnext/selling/doctype/customer/customer.json
index 562a9dc..dcfbf1e 100644
--- a/erpnext/selling/doctype/customer/customer.json
+++ b/erpnext/selling/doctype/customer/customer.json
@@ -11,7 +11,7 @@
{
"fieldname": "basic_info",
"fieldtype": "Section Break",
- "label": "Basic Info",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-user",
"permlevel": 0,
@@ -105,7 +105,7 @@
"depends_on": "eval:!doc.__islocal",
"fieldname": "address_contacts",
"fieldtype": "Section Break",
- "label": "Address & Contacts",
+ "label": "",
"options": "icon-map-marker",
"permlevel": 0
},
@@ -137,6 +137,7 @@
"permlevel": 0
},
{
+ "description": "",
"fieldname": "accounts",
"fieldtype": "Table",
"label": "Accounts",
@@ -146,7 +147,7 @@
{
"fieldname": "more_info",
"fieldtype": "Section Break",
- "label": "More Info",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-file-text",
"permlevel": 0
@@ -223,7 +224,7 @@
{
"fieldname": "sales_team_section_break",
"fieldtype": "Section Break",
- "label": "Sales Team",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-group",
"permlevel": 0
@@ -267,7 +268,7 @@
],
"icon": "icon-user",
"idx": 1,
- "modified": "2015-02-05 05:11:36.603762",
+ "modified": "2015-02-20 01:39:41.062529",
"modified_by": "Administrator",
"module": "Selling",
"name": "Customer",
diff --git a/erpnext/selling/doctype/installation_note/installation_note.json b/erpnext/selling/doctype/installation_note/installation_note.json
index ded7d6c..4e50a22 100644
--- a/erpnext/selling/doctype/installation_note/installation_note.json
+++ b/erpnext/selling/doctype/installation_note/installation_note.json
@@ -219,7 +219,7 @@
{
"fieldname": "item_details",
"fieldtype": "Section Break",
- "label": "Item Details",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "Simple",
"permlevel": 0
@@ -237,7 +237,7 @@
"icon": "icon-wrench",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:39.246897",
+ "modified": "2015-02-20 05:04:05.403625",
"modified_by": "Administrator",
"module": "Selling",
"name": "Installation Note",
diff --git a/erpnext/selling/doctype/installation_note/test_installation_note.py b/erpnext/selling/doctype/installation_note/test_installation_note.py
deleted file mode 100644
index 252126e..0000000
--- a/erpnext/selling/doctype/installation_note/test_installation_note.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
-# See license.txt
-
-import frappe
-import unittest
-
-test_records = frappe.get_test_records('Installation Note')
-
-class TestInstallationNote(unittest.TestCase):
- pass
diff --git a/erpnext/selling/doctype/opportunity_item/opportunity_item.json b/erpnext/selling/doctype/opportunity_item/opportunity_item.json
index e9342dc..889b05f 100644
--- a/erpnext/selling/doctype/opportunity_item/opportunity_item.json
+++ b/erpnext/selling/doctype/opportunity_item/opportunity_item.json
@@ -20,14 +20,13 @@
"permlevel": 0
},
{
- "fieldname": "item_name",
- "fieldtype": "Data",
+ "fieldname": "qty",
+ "fieldtype": "Float",
"in_list_view": 1,
- "label": "Item Name",
- "oldfieldname": "item_name",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "reqd": 1
+ "label": "Qty",
+ "oldfieldname": "qty",
+ "oldfieldtype": "Currency",
+ "permlevel": 0
},
{
"description": "",
@@ -63,6 +62,27 @@
"precision": ""
},
{
+ "fieldname": "uom",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "UOM",
+ "oldfieldname": "uom",
+ "oldfieldtype": "Link",
+ "options": "UOM",
+ "permlevel": 0,
+ "search_index": 0
+ },
+ {
+ "fieldname": "item_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Item Name",
+ "oldfieldname": "item_name",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "reqd": 0
+ },
+ {
"fieldname": "description",
"fieldtype": "Text",
"in_list_view": 1,
@@ -71,7 +91,7 @@
"oldfieldtype": "Text",
"permlevel": 0,
"print_width": "300px",
- "reqd": 1,
+ "reqd": 0,
"width": "300px"
},
{
@@ -99,22 +119,6 @@
"precision": ""
},
{
- "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,
@@ -125,27 +129,11 @@
"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": "2015-02-12 15:18:08.997193",
+ "modified": "2015-02-23 02:09:55.105233",
"modified_by": "Administrator",
"module": "Selling",
"name": "Opportunity Item",
diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json
index 9c8ddaa..14bce04 100644
--- a/erpnext/selling/doctype/quotation/quotation.json
+++ b/erpnext/selling/doctype/quotation/quotation.json
@@ -9,7 +9,7 @@
{
"fieldname": "customer_section",
"fieldtype": "Section Break",
- "label": "Customer",
+ "label": "",
"options": "icon-user",
"permlevel": 0
},
@@ -199,7 +199,7 @@
{
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
- "label": "Currency and Price List",
+ "label": "",
"options": "icon-tag",
"permlevel": 0,
"read_only": 0
@@ -285,7 +285,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
- "label": "Items",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart",
"permlevel": 0,
@@ -450,7 +450,7 @@
{
"fieldname": "totals",
"fieldtype": "Section Break",
- "label": "Totals",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-money",
"permlevel": 0,
@@ -810,7 +810,7 @@
"idx": 1,
"is_submittable": 1,
"max_attachments": 1,
- "modified": "2015-02-11 15:15:29.475837",
+ "modified": "2015-02-20 05:16:20.664025",
"modified_by": "Administrator",
"module": "Selling",
"name": "Quotation",
diff --git a/erpnext/selling/doctype/sales_bom/sales_bom.json b/erpnext/selling/doctype/sales_bom/sales_bom.json
index 54babc0..bf366f7 100644
--- a/erpnext/selling/doctype/sales_bom/sales_bom.json
+++ b/erpnext/selling/doctype/sales_bom/sales_bom.json
@@ -9,7 +9,7 @@
{
"fieldname": "basic_section",
"fieldtype": "Section Break",
- "label": "Sales BOM Item",
+ "label": "",
"permlevel": 0
},
{
@@ -29,7 +29,7 @@
"description": "List items that form the package.",
"fieldname": "item_section",
"fieldtype": "Section Break",
- "label": "Package Items",
+ "label": "",
"permlevel": 0
},
{
@@ -46,7 +46,7 @@
"icon": "icon-sitemap",
"idx": 1,
"is_submittable": 0,
- "modified": "2015-02-05 05:11:45.221748",
+ "modified": "2015-02-20 05:05:03.719573",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales BOM",
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index 3bbe694..07649a2 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -1,1132 +1,1132 @@
{
- "allow_import": 1,
- "autoname": "naming_series:",
- "creation": "2013-06-18 12:39:59",
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "Transaction",
+ "allow_import": 1,
+ "autoname": "naming_series:",
+ "creation": "2013-06-18 12:39:59",
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "Transaction",
"fields": [
{
- "fieldname": "customer_section",
- "fieldtype": "Section Break",
- "label": "Customer",
- "options": "icon-user",
+ "fieldname": "customer_section",
+ "fieldtype": "Section Break",
+ "label": "",
+ "options": "icon-user",
"permlevel": 0
- },
+ },
{
- "fieldname": "column_break0",
- "fieldtype": "Column Break",
- "in_filter": 0,
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "search_index": 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": "SO-",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "naming_series",
+ "fieldtype": "Select",
+ "label": "Series",
+ "no_copy": 1,
+ "oldfieldname": "naming_series",
+ "oldfieldtype": "Select",
+ "options": "SO-",
+ "permlevel": 0,
+ "print_hide": 1,
"reqd": 1
- },
+ },
{
- "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,
+ "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": "customer_name",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Name",
- "permlevel": 0,
+ "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,
+ "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,
+ "fieldname": "contact_display",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact",
+ "permlevel": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "contact_mobile",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Mobile No",
- "permlevel": 0,
+ "fieldname": "contact_mobile",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Mobile No",
+ "permlevel": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "contact_email",
- "fieldtype": "Small Text",
- "hidden": 1,
- "label": "Contact Email",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "contact_email",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Contact Email",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "default": "Sales",
- "fieldname": "order_type",
- "fieldtype": "Select",
- "in_list_view": 0,
- "label": "Order Type",
- "oldfieldname": "order_type",
- "oldfieldtype": "Select",
- "options": "\nSales\nMaintenance\nShopping Cart",
- "permlevel": 0,
- "print_hide": 1,
+ "default": "Sales",
+ "fieldname": "order_type",
+ "fieldtype": "Select",
+ "in_list_view": 0,
+ "label": "Order Type",
+ "oldfieldname": "order_type",
+ "oldfieldtype": "Select",
+ "options": "\nSales\nMaintenance\nShopping Cart",
+ "permlevel": 0,
+ "print_hide": 1,
"reqd": 1
- },
+ },
{
- "fieldname": "column_break1",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "permlevel": 0,
+ "fieldname": "column_break1",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
"width": "50%"
- },
+ },
{
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "hidden": 1,
- "ignore_user_permissions": 1,
- "label": "Amended From",
- "no_copy": 1,
- "oldfieldname": "amended_from",
- "oldfieldtype": "Data",
- "options": "Sales Order",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "ignore_user_permissions": 1,
+ "label": "Amended From",
+ "no_copy": 1,
+ "oldfieldname": "amended_from",
+ "oldfieldtype": "Data",
+ "options": "Sales Order",
+ "permlevel": 0,
+ "print_hide": 1,
+ "read_only": 1,
"width": "150px"
- },
+ },
{
- "description": "",
- "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,
+ "description": "",
+ "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": "Date",
- "no_copy": 1,
- "oldfieldname": "transaction_date",
- "oldfieldtype": "Date",
- "permlevel": 0,
- "print_hide": 0,
- "reqd": 1,
- "search_index": 1,
+ "default": "Today",
+ "fieldname": "transaction_date",
+ "fieldtype": "Date",
+ "in_filter": 1,
+ "label": "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,
+ "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",
- "no_copy": 0,
- "oldfieldname": "po_no",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "reqd": 0,
+ "description": "Customer's Purchase Order Number",
+ "fieldname": "po_no",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "PO No",
+ "no_copy": 0,
+ "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,
+ "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 Name",
- "options": "Address",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "shipping_address_name",
+ "fieldtype": "Link",
+ "hidden": 1,
+ "in_filter": 1,
+ "label": "Shipping Address Name",
+ "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,
+ "fieldname": "shipping_address",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "in_filter": 0,
+ "label": "Shipping Address",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "currency_and_price_list",
- "fieldtype": "Section Break",
- "label": "Currency and Price List",
- "options": "icon-tag",
- "permlevel": 0,
+ "fieldname": "currency_and_price_list",
+ "fieldtype": "Section Break",
+ "label": "",
+ "options": "icon-tag",
+ "permlevel": 0,
"print_hide": 1
- },
+ },
{
- "fieldname": "currency",
- "fieldtype": "Link",
- "label": "Currency",
- "oldfieldname": "currency",
- "oldfieldtype": "Select",
- "options": "Currency",
- "permlevel": 0,
- "print_hide": 1,
- "reqd": 1,
+ "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,
+ "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,
+ "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,
+ "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,
+ "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,
+ "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": "ignore_pricing_rule",
- "fieldtype": "Check",
- "label": "Ignore Pricing Rule",
- "no_copy": 1,
- "permlevel": 1,
+ "fieldname": "ignore_pricing_rule",
+ "fieldtype": "Check",
+ "label": "Ignore Pricing Rule",
+ "no_copy": 1,
+ "permlevel": 1,
"print_hide": 1
- },
+ },
{
- "fieldname": "items_section",
- "fieldtype": "Section Break",
- "label": "Items",
- "oldfieldtype": "Section Break",
- "options": "icon-shopping-cart",
+ "fieldname": "items_section",
+ "fieldtype": "Section Break",
+ "label": "",
+ "oldfieldtype": "Section Break",
+ "options": "icon-shopping-cart",
"permlevel": 0
- },
+ },
{
- "allow_on_submit": 1,
- "fieldname": "items",
- "fieldtype": "Table",
- "label": "Items",
- "oldfieldname": "sales_order_details",
- "oldfieldtype": "Table",
- "options": "Sales Order Item",
- "permlevel": 0,
- "print_hide": 0,
+ "allow_on_submit": 1,
+ "fieldname": "items",
+ "fieldtype": "Table",
+ "label": "Items",
+ "oldfieldname": "sales_order_details",
+ "oldfieldtype": "Table",
+ "options": "Sales Order Item",
+ "permlevel": 0,
+ "print_hide": 0,
"reqd": 1
- },
+ },
{
- "fieldname": "section_break_31",
- "fieldtype": "Section Break",
+ "fieldname": "section_break_31",
+ "fieldtype": "Section Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "column_break_33a",
- "fieldtype": "Column Break",
+ "fieldname": "column_break_33a",
+ "fieldtype": "Column Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "base_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,
+ "fieldname": "base_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": "column_break_33",
- "fieldtype": "Column Break",
+ "fieldname": "column_break_33",
+ "fieldtype": "Column Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "net_total",
- "fieldtype": "Currency",
- "label": "Net Total",
- "options": "currency",
- "permlevel": 0,
+ "fieldname": "net_total",
+ "fieldtype": "Currency",
+ "label": "Net Total",
+ "options": "currency",
+ "permlevel": 0,
"read_only": 1
- },
+ },
{
- "fieldname": "taxes_section",
- "fieldtype": "Section Break",
- "label": "Taxes and Charges",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "permlevel": 0,
+ "fieldname": "taxes_section",
+ "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,
+ "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",
+ "fieldname": "column_break_38",
+ "fieldtype": "Column Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "shipping_rule",
- "fieldtype": "Link",
- "label": "Shipping Rule",
- "oldfieldtype": "Button",
- "options": "Shipping Rule",
- "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",
+ "fieldname": "section_break_40",
+ "fieldtype": "Section Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "taxes",
- "fieldtype": "Table",
- "label": "Sales Taxes and Charges",
- "oldfieldname": "other_charges",
- "oldfieldtype": "Table",
- "options": "Sales Taxes and Charges",
+ "fieldname": "taxes",
+ "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,
+ "fieldname": "other_charges_calculation",
+ "fieldtype": "HTML",
+ "label": "Taxes and Charges Calculation",
+ "oldfieldtype": "HTML",
+ "permlevel": 0,
"print_hide": 1
- },
+ },
{
- "fieldname": "section_break_43",
- "fieldtype": "Section Break",
+ "fieldname": "section_break_43",
+ "fieldtype": "Section Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "total_taxes_and_charges",
- "fieldtype": "Currency",
- "label": "Total Taxes and Charges",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "total_taxes_and_charges",
+ "fieldtype": "Currency",
+ "label": "Total Taxes and Charges",
+ "options": "currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "base_total_taxes_and_charges",
- "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": "base_total_taxes_and_charges",
+ "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,
"width": "150px"
- },
+ },
{
- "fieldname": "column_break_46",
- "fieldtype": "Column Break",
+ "fieldname": "column_break_46",
+ "fieldtype": "Column Break",
"permlevel": 0
- },
+ },
{
- "fieldname": "discount_amount",
- "fieldtype": "Currency",
- "label": "Discount Amount",
- "options": "currency",
- "permlevel": 0,
+ "fieldname": "discount_amount",
+ "fieldtype": "Currency",
+ "label": "Discount Amount",
+ "options": "currency",
+ "permlevel": 0,
"print_hide": 0
- },
+ },
{
- "fieldname": "base_discount_amount",
- "fieldtype": "Currency",
- "label": "Discount Amount (Company Currency)",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "precision": "",
- "print_hide": 1,
+ "fieldname": "base_discount_amount",
+ "fieldtype": "Currency",
+ "label": "Discount Amount (Company Currency)",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "totals",
- "fieldtype": "Section Break",
- "label": "Totals",
- "oldfieldtype": "Section Break",
- "options": "icon-money",
- "permlevel": 0,
+ "fieldname": "totals",
+ "fieldtype": "Section Break",
+ "label": "",
+ "oldfieldtype": "Section Break",
+ "options": "icon-money",
+ "permlevel": 0,
"print_hide": 1
- },
+ },
{
- "fieldname": "base_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,
+ "fieldname": "base_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": "base_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,
+ "fieldname": "base_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": "base_in_words",
- "fieldtype": "Data",
- "label": "In Words (Company Currency)",
- "oldfieldname": "in_words",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 1,
- "read_only": 1,
+ "description": "In Words will be visible once you save the Sales Order.",
+ "fieldname": "base_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": "column_break3",
- "fieldtype": "Column Break",
- "oldfieldtype": "Column Break",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "column_break3",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
"width": "50%"
- },
+ },
{
- "fieldname": "grand_total",
- "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": 0,
+ "fieldname": "grand_total",
+ "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": 0,
"width": "150px"
- },
+ },
{
- "fieldname": "rounded_total",
- "fieldtype": "Currency",
- "label": "Rounded Total",
- "oldfieldname": "rounded_total_export",
- "oldfieldtype": "Currency",
- "options": "currency",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
+ "fieldname": "rounded_total",
+ "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",
- "fieldtype": "Data",
- "label": "In Words",
- "oldfieldname": "in_words_export",
- "oldfieldtype": "Data",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1,
+ "fieldname": "in_words",
+ "fieldtype": "Data",
+ "label": "In Words",
+ "oldfieldname": "in_words_export",
+ "oldfieldtype": "Data",
+ "permlevel": 0,
+ "print_hide": 0,
+ "read_only": 1,
"width": "200px"
- },
+ },
{
- "fieldname": "advance_paid",
- "fieldtype": "Currency",
- "label": "Advance Paid",
- "options": "Company:company:default_currency",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "advance_paid",
+ "fieldtype": "Currency",
+ "label": "Advance Paid",
+ "options": "Company:company:default_currency",
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "fieldname": "view_details",
- "fieldtype": "Fold",
- "label": "View Details",
+ "fieldname": "view_details",
+ "fieldtype": "Fold",
+ "label": "View Details",
"permlevel": 0
- },
+ },
{
- "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,
+ "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": "packed_items",
- "fieldtype": "Table",
- "label": "Packed Items",
- "oldfieldname": "packing_details",
- "oldfieldtype": "Table",
- "options": "Packed Item",
- "permlevel": 0,
- "print_hide": 1,
+ "fieldname": "packed_items",
+ "fieldtype": "Table",
+ "label": "Packed Items",
+ "oldfieldname": "packing_details",
+ "oldfieldtype": "Table",
+ "options": "Packed Item",
+ "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": "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,
+ "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,
+ "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",
+ "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,
+ "fieldname": "col_break45",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
"width": "50%"
- },
+ },
{
- "description": "",
- "fieldname": "territory",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Territory",
- "options": "Territory",
- "permlevel": 0,
- "print_hide": 1,
- "reqd": 1,
+ "description": "",
+ "fieldname": "territory",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Territory",
+ "options": "Territory",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1,
"search_index": 1
- },
+ },
{
- "description": "",
- "fieldname": "customer_group",
- "fieldtype": "Link",
- "in_filter": 1,
- "label": "Customer Group",
- "options": "Customer Group",
- "permlevel": 0,
- "print_hide": 1,
- "reqd": 1,
+ "description": "",
+ "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,
+ "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,
+ "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,
+ "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": "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,
+ "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,
+ "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,
+ "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,
+ "fieldname": "column_break4",
+ "fieldtype": "Column Break",
+ "oldfieldtype": "Column Break",
+ "permlevel": 0,
+ "print_hide": 1,
"width": "50%"
- },
+ },
{
- "allow_on_submit": 1,
- "fieldname": "letter_head",
- "fieldtype": "Link",
- "label": "Letter Head",
- "oldfieldname": "letter_head",
- "oldfieldtype": "Select",
- "options": "Letter Head",
- "permlevel": 0,
+ "allow_on_submit": 1,
+ "fieldname": "letter_head",
+ "fieldtype": "Link",
+ "label": "Letter Head",
+ "oldfieldname": "letter_head",
+ "oldfieldtype": "Select",
+ "options": "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,
+ "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": "Link",
- "in_filter": 1,
- "label": "Fiscal Year",
- "oldfieldname": "fiscal_year",
- "oldfieldtype": "Select",
- "options": "Fiscal Year",
- "permlevel": 0,
- "print_hide": 1,
- "reqd": 1,
- "search_index": 1,
+ "fieldname": "fiscal_year",
+ "fieldtype": "Link",
+ "in_filter": 1,
+ "label": "Fiscal Year",
+ "oldfieldname": "fiscal_year",
+ "oldfieldtype": "Select",
+ "options": "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,
+ "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,
+ "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": "Not Delivered\nFully Delivered\nPartly Delivered\nClosed\nNot Applicable",
- "permlevel": 0,
+ "fieldname": "delivery_status",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "label": "Delivery Status",
+ "no_copy": 1,
+ "options": "Not Delivered\nFully 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,
+ "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",
+ "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,
+ "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": "Not Billed\nFully Billed\nPartly Billed\nClosed",
- "permlevel": 0,
+ "fieldname": "billing_status",
+ "fieldtype": "Select",
+ "hidden": 1,
+ "label": "Billing Status",
+ "no_copy": 1,
+ "options": "Not Billed\nFully 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,
+ "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,
+ "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,
+ "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,
+ "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,
+ "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,
+ "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,
+ "fieldname": "sales_team",
+ "fieldtype": "Table",
+ "label": "Sales Team1",
+ "oldfieldname": "sales_team",
+ "oldfieldtype": "Table",
+ "options": "Sales Team",
+ "permlevel": 0,
"print_hide": 1
- },
+ },
{
- "fieldname": "recurring_order",
- "fieldtype": "Section Break",
- "label": "Recurring Order",
- "options": "icon-time",
+ "fieldname": "recurring_order",
+ "fieldtype": "Section Break",
+ "label": "Recurring Order",
+ "options": "icon-time",
"permlevel": 0
- },
+ },
{
- "fieldname": "column_break82",
- "fieldtype": "Column Break",
- "label": "Column Break",
+ "fieldname": "column_break82",
+ "fieldtype": "Column Break",
+ "label": "Column Break",
"permlevel": 0
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "eval:doc.docstatus<2",
- "description": "Check if recurring order, uncheck to stop recurring or put proper End Date",
- "fieldname": "is_recurring",
- "fieldtype": "Check",
- "label": "Is Recurring",
- "no_copy": 1,
- "permlevel": 0,
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.docstatus<2",
+ "description": "Check if recurring order, uncheck to stop recurring or put proper End Date",
+ "fieldname": "is_recurring",
+ "fieldtype": "Check",
+ "label": "Is Recurring",
+ "no_copy": 1,
+ "permlevel": 0,
"print_hide": 1
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "eval:doc.is_recurring==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,
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.is_recurring==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
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "Start date of current order's period",
- "fieldname": "from_date",
- "fieldtype": "Date",
- "label": "From Date",
- "no_copy": 1,
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "Start date of current order's period",
+ "fieldname": "from_date",
+ "fieldtype": "Date",
+ "label": "From Date",
+ "no_copy": 1,
"permlevel": 0
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "End date of current order's period",
- "fieldname": "to_date",
- "fieldtype": "Date",
- "label": "To Date",
- "no_copy": 1,
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "End date of current order's period",
+ "fieldname": "to_date",
+ "fieldtype": "Date",
+ "label": "To Date",
+ "no_copy": 1,
"permlevel": 0
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The day of the month on which auto order 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,
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The day of the month on which auto order 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
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The date on which recurring order will be stop",
- "fieldname": "end_date",
- "fieldtype": "Date",
- "label": "End Date",
- "no_copy": 1,
- "permlevel": 0,
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The date on which recurring order will be stop",
+ "fieldname": "end_date",
+ "fieldtype": "Date",
+ "label": "End Date",
+ "no_copy": 1,
+ "permlevel": 0,
"print_hide": 1
- },
+ },
{
- "fieldname": "column_break83",
- "fieldtype": "Column Break",
- "label": "Column Break",
- "permlevel": 0,
+ "fieldname": "column_break83",
+ "fieldtype": "Column Break",
+ "label": "Column Break",
+ "permlevel": 0,
"print_hide": 1
- },
+ },
{
- "depends_on": "eval:doc.is_recurring==1",
- "description": "The date on which next invoice will be generated. It is generated on submit.",
- "fieldname": "next_date",
- "fieldtype": "Date",
- "label": "Next Date",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "The date on which next invoice will be generated. It is generated on submit.",
+ "fieldname": "next_date",
+ "fieldtype": "Date",
+ "label": "Next Date",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "depends_on": "eval:doc.is_recurring==1",
- "fieldname": "recurring_id",
- "fieldtype": "Data",
- "label": "Recurring Id",
- "no_copy": 1,
- "permlevel": 0,
- "print_hide": 1,
+ "depends_on": "eval:doc.is_recurring==1",
+ "fieldname": "recurring_id",
+ "fieldtype": "Data",
+ "label": "Recurring Id",
+ "no_copy": 1,
+ "permlevel": 0,
+ "print_hide": 1,
"read_only": 1
- },
+ },
{
- "allow_on_submit": 1,
- "depends_on": "eval:doc.is_recurring==1",
- "description": "Enter email id separated by commas, order will be mailed automatically on particular date",
- "fieldname": "notification_email_address",
- "fieldtype": "Small Text",
- "ignore_user_permissions": 0,
- "label": "Notification Email Address",
- "no_copy": 1,
- "permlevel": 0,
+ "allow_on_submit": 1,
+ "depends_on": "eval:doc.is_recurring==1",
+ "description": "Enter email id separated by commas, order will be mailed automatically on particular date",
+ "fieldname": "notification_email_address",
+ "fieldtype": "Small Text",
+ "ignore_user_permissions": 0,
+ "label": "Notification Email Address",
+ "no_copy": 1,
+ "permlevel": 0,
"print_hide": 1
}
- ],
- "icon": "icon-file-text",
- "idx": 1,
- "is_submittable": 1,
- "issingle": 0,
- "modified": "2015-02-11 15:42:09.174504",
- "modified_by": "Administrator",
- "module": "Selling",
- "name": "Sales Order",
- "owner": "Administrator",
+ ],
+ "icon": "icon-file-text",
+ "idx": 1,
+ "is_submittable": 1,
+ "issingle": 0,
+ "modified": "2015-02-20 05:16:18.207123",
+ "modified_by": "Administrator",
+ "module": "Selling",
+ "name": "Sales Order",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 1,
- "apply_user_permissions": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Sales User",
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "apply_user_permissions": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales User",
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "import": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Sales Manager",
- "set_user_permissions": 1,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "import": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Sales Manager",
+ "set_user_permissions": 1,
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "amend": 1,
- "apply_user_permissions": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Maintenance User",
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "apply_user_permissions": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "Maintenance User",
+ "share": 1,
+ "submit": 1,
"write": 1
- },
+ },
{
- "apply_user_permissions": 1,
- "cancel": 0,
- "delete": 0,
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
+ "apply_user_permissions": 1,
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
"role": "Accounts User"
- },
+ },
{
- "apply_user_permissions": 1,
- "cancel": 0,
- "delete": 0,
- "email": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
+ "apply_user_permissions": 1,
+ "cancel": 0,
+ "delete": 0,
+ "email": 1,
+ "permlevel": 0,
+ "print": 1,
+ "read": 1,
"role": "Customer"
- },
+ },
{
- "apply_user_permissions": 1,
- "permlevel": 0,
- "read": 1,
- "report": 1,
+ "apply_user_permissions": 1,
+ "permlevel": 0,
+ "read": 1,
+ "report": 1,
"role": "Material User"
- },
+ },
{
- "permlevel": 1,
- "read": 1,
- "role": "Sales Manager",
+ "permlevel": 1,
+ "read": 1,
+ "role": "Sales Manager",
"write": 1
}
- ],
- "read_only_onload": 1,
- "search_fields": "status,transaction_date,customer,customer_name, territory,order_type,company",
- "sort_field": "modified",
- "sort_order": "DESC",
+ ],
+ "read_only_onload": 1,
+ "search_fields": "status,transaction_date,customer,customer_name, territory,order_type,company",
+ "sort_field": "modified",
+ "sort_order": "DESC",
"title_field": "customer_name"
-}
+}
\ No newline at end of file
diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py
index 64523a9..b5659be 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.py
+++ b/erpnext/selling/doctype/sales_order/sales_order.py
@@ -5,7 +5,7 @@
import frappe
import frappe.utils
from frappe.utils import cstr, flt, getdate, comma_and
-from frappe import _ , msgprint
+from frappe import _
from frappe.model.mapper import get_mapped_doc
from erpnext.controllers.selling_controller import SellingController
@@ -231,8 +231,12 @@
def on_update(self):
pass
- def get_portal_page(self):
- return "order" if self.docstatus==1 else None
+ @staticmethod
+ def get_list_context(context=None):
+ from erpnext.controllers.website_list_for_contact import get_list_context
+ list_context = get_list_context(context)
+ list_context["title"] = _("My Orders")
+ return list_context
@frappe.whitelist()
def make_material_request(source_name, target_doc=None):
diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json
index 3168877..67e1ba8 100644
--- a/erpnext/setup/doctype/company/company.json
+++ b/erpnext/setup/doctype/company/company.json
@@ -11,7 +11,7 @@
{
"fieldname": "details",
"fieldtype": "Section Break",
- "label": "Company Details",
+ "label": "",
"oldfieldtype": "Section Break",
"permlevel": 0,
"read_only": 0
@@ -72,7 +72,7 @@
"fieldname": "charts_section",
"fieldtype": "Section Break",
"hidden": 0,
- "label": "Localization",
+ "label": "Country Settings",
"permlevel": 0
},
{
@@ -272,7 +272,7 @@
"depends_on": "eval:!doc.__islocal",
"fieldname": "auto_accounting_for_stock_settings",
"fieldtype": "Section Break",
- "label": "Auto Accounting For Stock Settings",
+ "label": "Stock Settings",
"permlevel": 0,
"read_only": 0
},
@@ -380,7 +380,7 @@
"description": "Company registration numbers for your reference. Example: VAT Registration Numbers etc.",
"fieldname": "registration_info",
"fieldtype": "Section Break",
- "label": "Registration Info",
+ "label": "",
"oldfieldtype": "Section Break",
"permlevel": 0,
"read_only": 0,
@@ -399,7 +399,7 @@
],
"icon": "icon-building",
"idx": 1,
- "modified": "2015-02-19 00:37:55.472911",
+ "modified": "2015-02-21 10:32:38.523900",
"modified_by": "Administrator",
"module": "Setup",
"name": "Company",
diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.json b/erpnext/setup/doctype/global_defaults/global_defaults.json
index 811c279..4d8aeb4 100644
--- a/erpnext/setup/doctype/global_defaults/global_defaults.json
+++ b/erpnext/setup/doctype/global_defaults/global_defaults.json
@@ -8,7 +8,7 @@
"fieldname": "currency_settings",
"fieldtype": "Section Break",
"in_list_view": 0,
- "label": "Currency Settings",
+ "label": "",
"permlevel": 0
},
{
@@ -105,7 +105,7 @@
"idx": 1,
"in_create": 1,
"issingle": 1,
- "modified": "2015-02-05 05:11:39.042446",
+ "modified": "2015-02-20 05:16:23.324563",
"modified_by": "Administrator",
"module": "Setup",
"name": "Global Defaults",
diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py
index ba95bd0..6e313eb 100644
--- a/erpnext/setup/doctype/item_group/item_group.py
+++ b/erpnext/setup/doctype/item_group/item_group.py
@@ -12,9 +12,11 @@
class ItemGroup(NestedSet, WebsiteGenerator):
nsm_parent_field = 'parent_item_group'
- condition_field = "show_in_website"
- template = "templates/generators/item_group.html"
- parent_website_route_field = "parent_item_group"
+ website = frappe._dict(
+ condition_field = "show_in_website",
+ template = "templates/generators/item_group.html",
+ parent_website_route_field = "parent_item_group"
+ )
def autoname(self):
self.name = self.item_group_name
diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.py b/erpnext/setup/doctype/sales_partner/sales_partner.py
index 0dfbe4c..b6a63ae 100644
--- a/erpnext/setup/doctype/sales_partner/sales_partner.py
+++ b/erpnext/setup/doctype/sales_partner/sales_partner.py
@@ -8,9 +8,12 @@
from erpnext.utilities.address_and_contact import load_address_and_contact
class SalesPartner(WebsiteGenerator):
- page_title_field = "partner_name"
- condition_field = "show_in_website"
- template = "templates/generators/sales_partner.html"
+ website = frappe._dict(
+ page_title_field = "partner_name",
+ condition_field = "show_in_website",
+ template = "templates/generators/sales_partner.html"
+ )
+
def onload(self):
"""Load address and contacts in `__onload`"""
load_address_and_contact(self, "sales_partner")
diff --git a/erpnext/setup/page/setup_wizard/default_website.py b/erpnext/setup/page/setup_wizard/default_website.py
index 5dbb7fc..66a3df7 100644
--- a/erpnext/setup/page/setup_wizard/default_website.py
+++ b/erpnext/setup/page/setup_wizard/default_website.py
@@ -6,7 +6,6 @@
from frappe import _
from frappe.utils import nowdate
-from frappe.templates.pages.style_settings import default_properties
class website_maker(object):
def __init__(self, company, tagline, user):
@@ -14,7 +13,6 @@
self.tagline = tagline
self.user = user
self.make_web_page()
- self.make_style_settings()
self.make_website_settings()
self.make_blog()
@@ -34,12 +32,6 @@
})
}).insert()
- def make_style_settings(self):
- style_settings = frappe.get_doc("Style Settings", "Style Settings")
- style_settings.update(default_properties)
- style_settings.apply_style = 1
- style_settings.save()
-
def make_website_settings(self):
# update in home page in settings
website_settings = frappe.get_doc("Website Settings", "Website Settings")
diff --git a/erpnext/setup/page/setup_wizard/fixtures/__init__.py b/erpnext/setup/page/setup_wizard/fixtures/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/setup/page/setup_wizard/fixtures/__init__.py
diff --git a/erpnext/setup/page/setup_wizard/fixtures/industry_type.py b/erpnext/setup/page/setup_wizard/fixtures/industry_type.py
new file mode 100644
index 0000000..af508c2
--- /dev/null
+++ b/erpnext/setup/page/setup_wizard/fixtures/industry_type.py
@@ -0,0 +1,54 @@
+from frappe import _
+
+items = [
+_('Accounting'),
+_('Advertising'),
+_('Aerospace'),
+_('Agriculture'),
+_('Airline'),
+_('Apparel & Accessories'),
+_('Automotive'),
+_('Banking'),
+_('Biotechnology'),
+_('Broadcasting'),
+_('Brokerage'),
+_('Chemical'),
+_('Computer'),
+_('Consulting'),
+_('Consumer Products'),
+_('Cosmetics'),
+_('Defense'),
+_('Department Stores'),
+_('Education'),
+_('Electronics'),
+_('Energy'),
+_('Entertainment & Leisure'),
+_('Executive Search'),
+_('Financial Services'),
+_('Food, Beverage & Tobacco'),
+_('Grocery'),
+_('Health Care'),
+_('Internet Publishing'),
+_('Investment Banking'),
+_('Legal'),
+_('Manufacturing'),
+_('Motion Picture & Video'),
+_('Music'),
+_('Newspaper Publishers'),
+_('Online Auctions'),
+_('Pension Funds'),
+_('Pharmaceuticals'),
+_('Private Equity'),
+_('Publishing'),
+_('Real Estate'),
+_('Retail & Wholesale'),
+_('Securities & Commodity Exchanges'),
+_('Service'),
+_('Soap & Detergent'),
+_('Software'),
+_('Sports'),
+_('Technology'),
+_('Telecommunications'),
+_('Television'),
+_('Transportation'),
+_('Venture Capital')]
diff --git a/erpnext/setup/page/setup_wizard/fixtures/operations.py b/erpnext/setup/page/setup_wizard/fixtures/operations.py
new file mode 100644
index 0000000..4c982c1
--- /dev/null
+++ b/erpnext/setup/page/setup_wizard/fixtures/operations.py
@@ -0,0 +1,165 @@
+# source: http://en.wikipedia.org/wiki/List_of_manufacturing_processes"
+
+from __future__ import unicode_literals
+from frappe import _
+
+items = [
+_("Centrifugal casting"),
+_("Continuous casting"),
+_("Die casting"),
+_("Evaporative-pattern casting"),
+_("Full-mold casting"),
+_("Lost-foam casting"),
+_("Investment casting"),
+_("Countergravity casting"),
+_("Permanent mold casting"),
+_("Resin casting"),
+_("Sand casting"),
+_("Shell molding"),
+_("Spray forming"),
+_("Vacuum molding"),
+_("Molding"),
+_("Compaction plus sintering"),
+_("Hot isostatic pressing"),
+_("Metal injection molding"),
+_("Injection molding"),
+_("Compression molding"),
+_("Blow molding"),
+_("Dip molding"),
+_("Rotational molding"),
+_("Thermoforming"),
+_("Laminating"),
+_("Shrink fitting"),
+_("Shrink wrapping"),
+_("End tube forming"),
+_("Tube beading"),
+_("Forging"),
+_("Rolling"),
+_("Cold rolling"),
+_("Hot rolling"),
+_("Cryorolling"),
+_("Cross-rolling"),
+_("Pressing"),
+_("Embossing"),
+_("Stretch forming"),
+_("Blanking"),
+_("Drawing"),
+_("Bulging"),
+_("Necking"),
+_("Nosing"),
+_("Deep drawing"),
+_("Bending"),
+_("Hemming"),
+_("Shearing"),
+_("Piercing"),
+_("Trimming"),
+_("Shaving"),
+_("Notching"),
+_("Perforating"),
+_("Nibbling"),
+_("Lancing"),
+_("Cutting"),
+_("Stamping"),
+_("Coining"),
+_("Straight shearing"),
+_("Slitting"),
+_("Redrawing"),
+_("Ironing"),
+_("Flattening"),
+_("Swaging"),
+_("Spinning"),
+_("Peening"),
+_("Explosive forming"),
+_("Electroforming"),
+_("Staking"),
+_("Seaming"),
+_("Flanging"),
+_("Straightening"),
+_("Decambering"),
+_("Cold sizing"),
+_("Hubbing"),
+_("Hot metal gas forming"),
+_("Curling"),
+_("Hydroforming"),
+_("Machining"),
+_("Milling"),
+_("Hammering"),
+_("Smelting"),
+_("Refining"),
+_("Annealing"),
+_("Pickling"),
+_("Coating"),
+_("Turning"),
+_("Facing"),
+_("Boring"),
+_("Knurling"),
+_("Hard turning"),
+_("Drilling"),
+_("Reaming"),
+_("Countersinking"),
+_("Tapping"),
+_("Sawing"),
+_("Filing"),
+_("Broaching"),
+_("Shaping"),
+_("Planing"),
+_("Double housing"),
+_("Abrasive jet machining"),
+_("Water jet cutting"),
+_("Photochemical machining"),
+_("Honing"),
+_("Electro-chemical grinding"),
+_("Finishing & industrial finishing"),
+_("Abrasive blasting"),
+_("Buffing"),
+_("Burnishing"),
+_("Electroplating"),
+_("Electropolishing"),
+_("Magnetic field-assisted finishing"),
+_("Etching"),
+_("Linishing"),
+_("Mass finishing"),
+_("Tumbling"),
+_("Spindle finishing"),
+_("Vibratory finishing"),
+_("Plating"),
+_("Polishing"),
+_("Superfinishing"),
+_("Wire brushing"),
+_("Routing"),
+_("Hobbing"),
+_("Ultrasonic machining"),
+_("Electron beam machining"),
+_("Electrochemical machining"),
+_("Laser cutting"),
+_("Laser drilling"),
+_("Grinding"),
+_("Gashing"),
+_("Biomachining"),
+_("Joining"),
+_("Welding"),
+_("Brazing"),
+_("Sintering"),
+_("Adhesive bonding"),
+_("Nailing"),
+_("Screwing"),
+_("Riveting"),
+_("Clinching"),
+_("Pinning"),
+_("Stitching"),
+_("Stapling"),
+_("Press fitting"),
+_("3D printing"),
+_("Direct metal laser sintering"),
+_("Fused deposition modeling"),
+_("Laminated object manufacturing"),
+_("Laser engineered net shaping"),
+_("Selective laser sintering"),
+_("Mining"),
+_("Quarrying"),
+_("Blasting"),
+_("Woodworking"),
+_("Lapping"),
+_("Morticing"),
+_("Crushing"),
+_("Packaging and labeling")]
diff --git a/erpnext/setup/page/setup_wizard/install_fixtures.py b/erpnext/setup/page/setup_wizard/install_fixtures.py
index b24eaa6..bb16fb6 100644
--- a/erpnext/setup/page/setup_wizard/install_fixtures.py
+++ b/erpnext/setup/page/setup_wizard/install_fixtures.py
@@ -137,64 +137,31 @@
{'doctype': 'Activity Type', 'activity_type': _('Communication')},
{'doctype': 'Activity Type', 'activity_type': 'Manufacturing'},
- # Industry Type
- {'doctype': 'Industry Type', 'industry': _('Accounting')},
- {'doctype': 'Industry Type', 'industry': _('Advertising')},
- {'doctype': 'Industry Type', 'industry': _('Aerospace')},
- {'doctype': 'Industry Type', 'industry': _('Agriculture')},
- {'doctype': 'Industry Type', 'industry': _('Airline')},
- {'doctype': 'Industry Type', 'industry': _('Apparel & Accessories')},
- {'doctype': 'Industry Type', 'industry': _('Automotive')},
- {'doctype': 'Industry Type', 'industry': _('Banking')},
- {'doctype': 'Industry Type', 'industry': _('Biotechnology')},
- {'doctype': 'Industry Type', 'industry': _('Broadcasting')},
- {'doctype': 'Industry Type', 'industry': _('Brokerage')},
- {'doctype': 'Industry Type', 'industry': _('Chemical')},
- {'doctype': 'Industry Type', 'industry': _('Computer')},
- {'doctype': 'Industry Type', 'industry': _('Consulting')},
- {'doctype': 'Industry Type', 'industry': _('Consumer Products')},
- {'doctype': 'Industry Type', 'industry': _('Cosmetics')},
- {'doctype': 'Industry Type', 'industry': _('Defense')},
- {'doctype': 'Industry Type', 'industry': _('Department Stores')},
- {'doctype': 'Industry Type', 'industry': _('Education')},
- {'doctype': 'Industry Type', 'industry': _('Electronics')},
- {'doctype': 'Industry Type', 'industry': _('Energy')},
- {'doctype': 'Industry Type', 'industry': _('Entertainment & Leisure')},
- {'doctype': 'Industry Type', 'industry': _('Executive Search')},
- {'doctype': 'Industry Type', 'industry': _('Financial Services')},
- {'doctype': 'Industry Type', 'industry': _('Food, Beverage & Tobacco')},
- {'doctype': 'Industry Type', 'industry': _('Grocery')},
- {'doctype': 'Industry Type', 'industry': _('Health Care')},
- {'doctype': 'Industry Type', 'industry': _('Internet Publishing')},
- {'doctype': 'Industry Type', 'industry': _('Investment Banking')},
- {'doctype': 'Industry Type', 'industry': _('Legal')},
- {'doctype': 'Industry Type', 'industry': _('Manufacturing')},
- {'doctype': 'Industry Type', 'industry': _('Motion Picture & Video')},
- {'doctype': 'Industry Type', 'industry': _('Music')},
- {'doctype': 'Industry Type', 'industry': _('Newspaper Publishers')},
- {'doctype': 'Industry Type', 'industry': _('Online Auctions')},
- {'doctype': 'Industry Type', 'industry': _('Pension Funds')},
- {'doctype': 'Industry Type', 'industry': _('Pharmaceuticals')},
- {'doctype': 'Industry Type', 'industry': _('Private Equity')},
- {'doctype': 'Industry Type', 'industry': _('Publishing')},
- {'doctype': 'Industry Type', 'industry': _('Real Estate')},
- {'doctype': 'Industry Type', 'industry': _('Retail & Wholesale')},
- {'doctype': 'Industry Type', 'industry': _('Securities & Commodity Exchanges')},
- {'doctype': 'Industry Type', 'industry': _('Service')},
- {'doctype': 'Industry Type', 'industry': _('Soap & Detergent')},
- {'doctype': 'Industry Type', 'industry': _('Software')},
- {'doctype': 'Industry Type', 'industry': _('Sports')},
- {'doctype': 'Industry Type', 'industry': _('Technology')},
- {'doctype': 'Industry Type', 'industry': _('Telecommunications')},
- {'doctype': 'Industry Type', 'industry': _('Television')},
- {'doctype': 'Industry Type', 'industry': _('Transportation')},
- {'doctype': 'Industry Type', 'industry': _('Venture Capital')},
+ {'doctype': "Item Attribute", "attribute_name": _("Size"), "item_attribute_values": [
+ {"attribute_value": _("Extra Small"), "abbr": "XS"},
+ {"attribute_value": _("Small"), "abbr": "S"},
+ {"attribute_value": _("Medium"), "abbr": "M"},
+ {"attribute_value": _("Large"), "abbr": "L"},
+ {"attribute_value": _("Extra Large"), "abbr": "XL"}
+ ]},
+
+ {'doctype': "Item Attribute", "attribute_name": _("Colour"), "item_attribute_values": [
+ {"attribute_value": _("Red"), "abbr": "RED"},
+ {"attribute_value": _("Green"), "abbr": "GRE"},
+ {"attribute_value": _("Blue"), "abbr": "BLU"},
+ {"attribute_value": _("Black"), "abbr": "BLA"},
+ {"attribute_value": _("White"), "abbr": "WHI"}
+ ]},
{'doctype': "Email Account", "email_id": "sales@example.com", "append_to": "Lead"},
{'doctype': "Email Account", "email_id": "support@example.com", "append_to": "Issue"},
{'doctype': "Email Account", "email_id": "jobs@example.com", "append_to": "Job Applicant"}
]
+ from erpnext.setup.page.setup_wizard.fixtures import industry_type, operations
+ records += [{"doctype":"Industry Type", "industry": d} for d in industry_type.items]
+ # records += [{"doctype":"Operation", "operation": d} for d in operations.items]
+
from frappe.modules import scrub
for r in records:
doc = frappe.new_doc(r.get("doctype"))
diff --git a/erpnext/shopping_cart/__init__.py b/erpnext/shopping_cart/__init__.py
index ddee6dc..28ba5f9 100644
--- a/erpnext/shopping_cart/__init__.py
+++ b/erpnext/shopping_cart/__init__.py
@@ -5,7 +5,7 @@
import frappe
from frappe import _
from frappe.utils import get_fullname, flt
-from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import is_shopping_cart_enabled, get_default_territory
+from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import check_shopping_cart_enabled, get_default_territory
# TODO
# validate stock of each item in Website Warehouse or have a list of possible warehouses in Shopping Cart Settings
@@ -17,7 +17,7 @@
if user == "Guest":
raise frappe.PermissionError
- is_shopping_cart_enabled()
+ check_shopping_cart_enabled()
party = get_party(user)
values = {
"order_type": "Shopping Cart",
diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
index cdbe6c2..ec8fea3 100644
--- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
+++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py
@@ -158,10 +158,13 @@
return frappe.local.shopping_cart_settings
+def is_cart_enabled():
+ return get_shopping_cart_settings().enabled
+
def get_default_territory():
return get_shopping_cart_settings().default_territory
-def is_shopping_cart_enabled():
+def check_shopping_cart_enabled():
if not get_shopping_cart_settings().enabled:
frappe.throw(_("You need to enable Shopping Cart"), ShoppingCartSetupError)
diff --git a/erpnext/shopping_cart/utils.py b/erpnext/shopping_cart/utils.py
index ee011a4..67b6bc0 100644
--- a/erpnext/shopping_cart/utils.py
+++ b/erpnext/shopping_cart/utils.py
@@ -4,8 +4,10 @@
from __future__ import unicode_literals
import frappe
+from frappe import _
import frappe.defaults
from frappe.utils import cint
+from erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings import is_cart_enabled
def show_cart_count():
if (frappe.db.get_default("shopping_cart_enabled") and
@@ -16,32 +18,32 @@
def set_cart_count(login_manager):
if show_cart_count():
- from .shopping_cart.cart import set_cart_count
+ from erpnext.shopping_cart.cart import set_cart_count
set_cart_count()
def clear_cart_count(login_manager):
if show_cart_count():
frappe.local.cookie_manager.delete_cookie("cart_count")
-def update_website_context(context):
- post_login = []
- cart_enabled = cint(frappe.db.get_default("shopping_cart_enabled"))
+def update_website_params(context):
+ cart_enabled = is_cart_enabled()
context["shopping_cart_enabled"] = cart_enabled
if cart_enabled:
- post_login += [
- {"label": "Cart", "url": "cart", "icon": "icon-shopping-cart", "class": "cart-count"},
+ post_login = [
+ {"label": _("Cart"), "url": "cart", "class": "cart-count"},
{"class": "divider"}
]
+ context["post_login"] = post_login + context.get("post_login", [])
- post_login += [
- {"label": "User", "url": "user", "icon": "icon-user"},
- {"label": "Addresses", "url": "addresses", "icon": "icon-map-marker"},
- {"label": "My Orders", "url": "orders", "icon": "icon-list"},
- {"label": "My Tickets", "url": "tickets", "icon": "icon-tags"},
- {"label": "Invoices", "url": "invoices", "icon": "icon-file-text"},
- {"label": "Shipments", "url": "shipments", "icon": "icon-truck"},
- {"class": "divider"}
- ]
+def update_my_account_context(context):
+ if is_cart_enabled():
+ context["my_account_list"].append({"label": _("Cart"), "url": "cart"})
- context["post_login"] = post_login + context.get("post_login", [])
+ context["my_account_list"].extend([
+ {"label": _("Orders"), "url": "orders"},
+ {"label": _("Invoices"), "url": "invoices"},
+ {"label": _("Shipments"), "url": "shipments"},
+ {"label": _("Issues"), "url": "tickets"},
+ {"label": _("Addresses"), "url": "addresses"},
+ ])
diff --git a/erpnext/startup/webutils.py b/erpnext/startup/webutils.py
deleted file mode 100644
index 9942b1b..0000000
--- a/erpnext/startup/webutils.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-
-import frappe
-
-def update_website_context(context):
- if not context.get("favicon"):
- context["favicon"] = "app/images/favicon.ico"
\ No newline at end of file
diff --git a/erpnext/stock/doctype/batch/test_records.json b/erpnext/stock/doctype/batch/test_records.json
deleted file mode 100644
index 172cdee..0000000
--- a/erpnext/stock/doctype/batch/test_records.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- {
- "doctype": "Batch",
- "name": "_Test Batch 1"
- }
-]
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index d518e8c..6c8881e 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -207,7 +207,7 @@
{
"fieldname": "cusrrency_and_price_list",
"fieldtype": "Section Break",
- "label": "Currency and Price List",
+ "label": "",
"options": "icon-tag",
"permlevel": 0,
"read_only": 0
@@ -286,7 +286,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
- "label": "Items",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart",
"permlevel": 0,
@@ -481,7 +481,7 @@
{
"fieldname": "totals",
"fieldtype": "Section Break",
- "label": "Totals",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-money",
"permlevel": 0,
@@ -1024,7 +1024,7 @@
"idx": 1,
"in_create": 0,
"is_submittable": 1,
- "modified": "2015-02-11 15:45:06.803707",
+ "modified": "2015-02-20 05:16:21.997931",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py
index ec45623..91b4af4 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.py
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.py
@@ -75,9 +75,6 @@
for f in fieldname:
toggle_print_hide(self.meta if key == "parent" else item_meta, f)
- def get_portal_page(self):
- return "shipment" if self.docstatus==1 else None
-
def set_actual_qty(self):
for d in self.get('items'):
if d.item_code and d.warehouse:
@@ -288,6 +285,13 @@
}
update_bin(args)
+ @staticmethod
+ def get_list_context(context=None):
+ from erpnext.controllers.website_list_for_contact import get_list_context
+ list_context = get_list_context(context)
+ list_context["title"] = _("My Shipments")
+ return list_context
+
def get_invoiced_qty_map(delivery_note):
"""returns a map: {dn_detail: invoiced_qty}"""
invoiced_qty_map = {}
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 66f0ee2..83f7a84 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -113,6 +113,17 @@
"read_only": 0
},
{
+ "default": "2099-12-31",
+ "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
+ },
+ {
"fieldname": "column_break0",
"fieldtype": "Column Break",
"permlevel": 0,
@@ -122,7 +133,7 @@
"fieldname": "image",
"fieldtype": "Attach",
"label": "Image",
- "options": "",
+ "options": "image",
"permlevel": 0,
"precision": ""
},
@@ -155,6 +166,7 @@
"search_index": 0
},
{
+ "depends_on": "eval:!!!doc.variant_of",
"fieldname": "variants_section",
"fieldtype": "Section Break",
"label": "Variants",
@@ -321,16 +333,6 @@
},
{
"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",
@@ -404,7 +406,7 @@
{
"fieldname": "purchase_details",
"fieldtype": "Section Break",
- "label": "Purchase Details",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart",
"permlevel": 0,
@@ -701,7 +703,7 @@
"fieldtype": "Link",
"ignore_user_permissions": 1,
"label": "Default BOM",
- "no_copy": 1,
+ "no_copy": 0,
"oldfieldname": "default_bom",
"oldfieldtype": "Link",
"options": "BOM",
@@ -873,7 +875,7 @@
"icon": "icon-tag",
"idx": 1,
"max_attachments": 1,
- "modified": "2015-02-19 09:24:59.397525",
+ "modified": "2015-02-23 06:12:13.359646",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py
index 8988ca3..ef45a31 100644
--- a/erpnext/stock/doctype/item/item.py
+++ b/erpnext/stock/doctype/item/item.py
@@ -16,10 +16,12 @@
class ItemTemplateCannotHaveStock(frappe.ValidationError): pass
class Item(WebsiteGenerator):
- page_title_field = "item_name"
- condition_field = "show_in_website"
- template = "templates/generators/item.html"
- parent_website_route_field = "item_group"
+ website = frappe._dict(
+ page_title_field = "item_name",
+ condition_field = "show_in_website",
+ template = "templates/generators/item.html",
+ parent_website_route_field = "item_group",
+ )
def onload(self):
super(Item, self).onload()
@@ -82,6 +84,8 @@
if self.slideshow:
context.update(get_slideshow(self))
+ context["parents"] = self.get_parents(context)
+
return context
def check_warehouse_is_set_for_stock_item(self):
@@ -160,7 +164,7 @@
# delete missing variants
existing_variants = [d.name for d in frappe.get_all("Item",
- {"variant_of":self.name})]
+ filters={"variant_of":self.name})]
updated, deleted = [], []
for existing_variant in existing_variants:
@@ -187,6 +191,7 @@
frappe.msgprint(_("Item Variants {0} deleted").format(", ".join(deleted)))
def get_variant_item_codes(self):
+ """Get all possible suffixes for variants"""
if not self.variants:
return []
@@ -234,7 +239,7 @@
from frappe.model import no_value_fields
for field in self.meta.fields:
if field.fieldtype not in no_value_fields and (insert or not field.no_copy)\
- and field.fieldname != "item_code":
+ and field.fieldname not in ("item_code", "item_name"):
if variant.get(field.fieldname) != template.get(field.fieldname):
variant.set(field.fieldname, template.get(field.fieldname))
variant.__dirty = True
@@ -245,7 +250,10 @@
template.get_variant_item_codes()
for attr in template.variant_attributes[variant.item_code]:
- variant.description += "\n" + attr[0] + ": " + attr[1]
+ variant.description += "<p>" + attr[0] + ": " + attr[1] + "</p>"
+
+ variant.item_name = self.item_name + variant.item_code[len(self.name):]
+
variant.variant_of = template.name
variant.has_variants = 0
variant.show_in_website = 0
@@ -292,7 +300,7 @@
if self.default_bom:
bom_item = frappe.db.get_value("BOM", self.default_bom, "item")
if bom_item not in (self.name, self.variant_of):
- frappe.throw(_("Default BOM must be for this item or its template"))
+ frappe.throw(_("Default BOM ({0}) must be active for this item or its template").format(bom_item))
if self.is_purchase_item != "Yes":
bom_mat = frappe.db.sql("""select distinct t1.parent
@@ -385,7 +393,7 @@
super(Item, self).on_trash()
frappe.db.sql("""delete from tabBin where item_code=%s""", self.item_code)
frappe.db.sql("delete from `tabItem Price` where item_code=%s", self.name)
- for variant_of in frappe.get_all("Item", {"variant_of": self.name}):
+ for variant_of in frappe.get_all("Item", filters={"variant_of": self.name}):
frappe.delete_doc("Item", variant_of.name)
def before_rename(self, olddn, newdn, merge=False):
diff --git a/erpnext/stock/doctype/item/item_list.js b/erpnext/stock/doctype/item/item_list.js
index 0436721..8e96ce5 100644
--- a/erpnext/stock/doctype/item/item_list.js
+++ b/erpnext/stock/doctype/item/item_list.js
@@ -1,10 +1,15 @@
frappe.listview_settings['Item'] = {
- add_fields: ["item_name", "stock_uom", "item_group", "image", "variant_of", "has_variants"],
+ add_fields: ["item_name", "stock_uom", "item_group", "image", "variant_of",
+ "has_variants", "end_of_life", "is_sales_item"],
get_indicator: function(doc) {
- if(doc.has_variants) {
+ if(doc.end_of_life < frappe.datetime.get_today()) {
+ return [__("Expired"), "grey", "end_of_life,<,Today"]
+ } else if(doc.has_variants) {
return [__("Template"), "blue", "has_variant,=,1"]
} else if(doc.variant_of) {
return [__("Variant"), "green", "variant_of,=," + doc.variant_of]
+ } else {
+ return [__("Active"), "blue", "end_of_life,>=,Today"]
}
}
};
diff --git a/erpnext/stock/doctype/item_price/item_price.json b/erpnext/stock/doctype/item_price/item_price.json
index da5e196..73c967a 100644
--- a/erpnext/stock/doctype/item_price/item_price.json
+++ b/erpnext/stock/doctype/item_price/item_price.json
@@ -1,6 +1,6 @@
{
"allow_import": 1,
- "autoname": "RFD/.#####",
+ "autoname": "ITEM-PRICE-.#####",
"creation": "2013-05-02 16:29:48",
"description": "Multiple Item prices.",
"docstatus": 0,
@@ -42,7 +42,7 @@
{
"fieldname": "item_details",
"fieldtype": "Section Break",
- "label": "Item",
+ "label": "",
"options": "icon-tag",
"permlevel": 0
},
@@ -105,7 +105,7 @@
"idx": 1,
"in_create": 0,
"istable": 0,
- "modified": "2015-02-05 05:11:39.951804",
+ "modified": "2015-02-20 05:04:11.609416",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item Price",
diff --git a/erpnext/stock/doctype/landed_cost_voucher/test_records.json b/erpnext/stock/doctype/landed_cost_voucher/test_records.json
deleted file mode 100644
index 4fc0017..0000000
--- a/erpnext/stock/doctype/landed_cost_voucher/test_records.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- {
- "doctype": "Landed Cost Voucher",
- "name": "_Test Landed Cost Voucher 1"
- }
-]
diff --git a/erpnext/stock/doctype/material_request/material_request.json b/erpnext/stock/doctype/material_request/material_request.json
index 625baa4..9734512 100644
--- a/erpnext/stock/doctype/material_request/material_request.json
+++ b/erpnext/stock/doctype/material_request/material_request.json
@@ -8,7 +8,7 @@
{
"fieldname": "type_section",
"fieldtype": "Section Break",
- "label": "Basic Info",
+ "label": "",
"options": "icon-pushpin",
"permlevel": 0
},
@@ -72,7 +72,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
- "label": "Items",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart",
"permlevel": 0
@@ -236,7 +236,7 @@
"icon": "icon-ticket",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:41.240828",
+ "modified": "2015-02-20 05:07:33.215371",
"modified_by": "Administrator",
"module": "Stock",
"name": "Material Request",
diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.json b/erpnext/stock/doctype/packing_slip/packing_slip.json
index 3884042..431ac9b 100644
--- a/erpnext/stock/doctype/packing_slip/packing_slip.json
+++ b/erpnext/stock/doctype/packing_slip/packing_slip.json
@@ -9,7 +9,7 @@
{
"fieldname": "packing_slip_details",
"fieldtype": "Section Break",
- "label": "Packing Slip Items",
+ "label": "",
"permlevel": 0,
"read_only": 0
},
@@ -91,7 +91,7 @@
{
"fieldname": "package_item_details",
"fieldtype": "Section Break",
- "label": "Package Item Details",
+ "label": "",
"permlevel": 0,
"read_only": 0
},
@@ -178,7 +178,7 @@
{
"fieldname": "misc_details",
"fieldtype": "Section Break",
- "label": "Misc Details",
+ "label": "",
"permlevel": 0,
"read_only": 0
},
@@ -197,7 +197,7 @@
"icon": "icon-suitcase",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:41.872466",
+ "modified": "2015-02-20 05:09:24.405911",
"modified_by": "Administrator",
"module": "Stock",
"name": "Packing Slip",
diff --git a/erpnext/stock/doctype/packing_slip/test_packing_slip.py b/erpnext/stock/doctype/packing_slip/test_packing_slip.py
deleted file mode 100644
index 1cb1fe0..0000000
--- a/erpnext/stock/doctype/packing_slip/test_packing_slip.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
-# See license.txt
-
-import frappe
-import unittest
-
-test_records = frappe.get_test_records('Packing Slip')
-
-class TestPackingSlip(unittest.TestCase):
- pass
diff --git a/erpnext/stock/doctype/packing_slip/test_records.json b/erpnext/stock/doctype/packing_slip/test_records.json
deleted file mode 100644
index 9837e8b..0000000
--- a/erpnext/stock/doctype/packing_slip/test_records.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- {
- "doctype": "Packing Slip",
- "name": "_Test Packing Slip 1"
- }
-]
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index 4d4ad70..947c94c 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -133,7 +133,7 @@
{
"fieldname": "currency_and_price_list",
"fieldtype": "Section Break",
- "label": "Currency and Price List",
+ "label": "",
"options": "icon-tag",
"permlevel": 0
},
@@ -205,7 +205,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
- "label": "Items",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart",
"permlevel": 0
@@ -308,7 +308,7 @@
"description": "Detailed Breakup of the totals",
"fieldname": "totals",
"fieldtype": "Section Break",
- "label": "Totals",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-money",
"permlevel": 0
@@ -775,7 +775,7 @@
"icon": "icon-truck",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-11 16:13:02.294088",
+ "modified": "2015-02-20 05:16:24.035630",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",
diff --git a/erpnext/stock/doctype/serial_no/serial_no.json b/erpnext/stock/doctype/serial_no/serial_no.json
index 77cd328..9d31f09 100644
--- a/erpnext/stock/doctype/serial_no/serial_no.json
+++ b/erpnext/stock/doctype/serial_no/serial_no.json
@@ -11,7 +11,7 @@
{
"fieldname": "details",
"fieldtype": "Section Break",
- "label": "Details",
+ "label": "",
"oldfieldtype": "Section Break",
"permlevel": 0,
"read_only": 0
@@ -417,7 +417,7 @@
"icon": "icon-barcode",
"idx": 1,
"in_create": 0,
- "modified": "2015-02-05 05:11:46.454105",
+ "modified": "2015-02-20 05:08:12.961403",
"modified_by": "Administrator",
"module": "Stock",
"name": "Serial No",
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.json b/erpnext/stock/doctype/stock_entry/stock_entry.json
index bcbfb01..db40708 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.json
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.json
@@ -180,7 +180,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
- "label": "Items",
+ "label": "",
"oldfieldtype": "Section Break",
"permlevel": 0,
"read_only": 0
@@ -632,7 +632,7 @@
"is_submittable": 1,
"issingle": 0,
"max_attachments": 0,
- "modified": "2015-02-19 04:53:05.361046",
+ "modified": "2015-02-20 05:04:09.060180",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Entry",
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 98f9fae..4e229cb 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -179,13 +179,13 @@
self.production_order = None
def check_if_operations_completed(self):
+ """Check if Time Logs are completed against before manufacturing to capture operating costs."""
prod_order = frappe.get_doc("Production Order", self.production_order)
- if prod_order.actual_operating_cost:
- for d in prod_order.get("operations"):
- total_completed_qty = flt(self.fg_completed_qty) + flt(prod_order.produced_qty)
- if total_completed_qty > flt(d.completed_qty):
- frappe.throw(_("Row #{0}: Operation {1} is not completed for {2} qty of finished goods in Production Order # {3}. Please update operation status via Time Logs")
- .format(d.idx, d.operation, total_completed_qty, self.production_order))
+ for d in prod_order.get("operations"):
+ total_completed_qty = flt(self.fg_completed_qty) + flt(prod_order.produced_qty)
+ if total_completed_qty > flt(d.completed_qty):
+ frappe.throw(_("Row #{0}: Operation {1} is not completed for {2} qty of finished goods in Production Order # {3}. Please update operation status via Time Logs")
+ .format(d.idx, d.operation, total_completed_qty, self.production_order))
def check_duplicate_entry_for_production_order(self):
other_ste = [t[0] for t in frappe.db.get_values("Stock Entry", {
@@ -427,7 +427,7 @@
pro_doc = frappe.get_doc("Production Order", self.production_order)
_validate_production_order(pro_doc)
pro_doc.run_method("update_status")
- if self.purpose == "Manufacture":
+ if self.purpose in ("Manufacture", "Material Transfer for Manufacture"):
pro_doc.run_method("update_production_order_qty")
self.update_planned_qty(pro_doc)
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
index 535a548..2a9cb3f 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.js
@@ -10,7 +10,11 @@
function(data) {
frappe.call({
method:"erpnext.stock.doctype.stock_reconciliation.stock_reconciliation.get_items",
- args: {warehouse: data.warehouse},
+ args: {
+ warehouse: data.warehouse,
+ posting_date: frm.doc.posting_date,
+ posting_time: frm.doc.posting_time
+ },
callback: function(r) {
var items = [];
frm.clear_table("items");
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
index 6ca212d..763680f 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json
@@ -32,11 +32,8 @@
"reqd": 1
},
{
- "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
- "fieldname": "expense_account",
- "fieldtype": "Link",
- "label": "Difference Account",
- "options": "Account",
+ "fieldname": "col1",
+ "fieldtype": "Column Break",
"permlevel": 0
},
{
@@ -51,11 +48,6 @@
"read_only": 1
},
{
- "fieldname": "col1",
- "fieldtype": "Column Break",
- "permlevel": 0
- },
- {
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
@@ -64,23 +56,6 @@
"reqd": 1
},
{
- "fieldname": "fiscal_year",
- "fieldtype": "Link",
- "label": "Fiscal Year",
- "options": "Fiscal Year",
- "permlevel": 0,
- "print_hide": 1,
- "reqd": 1
- },
- {
- "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
- "fieldname": "cost_center",
- "fieldtype": "Link",
- "label": "Cost Center",
- "options": "Cost Center",
- "permlevel": 0
- },
- {
"fieldname": "sb9",
"fieldtype": "Section Break",
"permlevel": 0,
@@ -108,28 +83,20 @@
"precision": ""
},
{
- "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",
+ "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
+ "fieldname": "expense_account",
+ "fieldtype": "Link",
+ "label": "Difference Account",
+ "options": "Account",
"permlevel": 0
},
{
- "fieldname": "reconciliation_html",
- "fieldtype": "HTML",
- "hidden": 0,
- "label": "Reconciliation HTML",
- "permlevel": 0,
- "print_hide": 0,
- "read_only": 1
+ "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)",
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "label": "Cost Center",
+ "options": "Cost Center",
+ "permlevel": 0
},
{
"fieldname": "reconciliation_json",
@@ -140,20 +107,55 @@
"permlevel": 0,
"print_hide": 1,
"read_only": 1
+ },
+ {
+ "fieldname": "column_break_13",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "fieldname": "difference_amount",
+ "fieldtype": "Currency",
+ "label": "Difference Amount",
+ "permlevel": 0,
+ "precision": "",
+ "read_only": 1
+ },
+ {
+ "fieldname": "fold_15",
+ "fieldtype": "Fold",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "fieldname": "section_break_16",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "fieldname": "fiscal_year",
+ "fieldtype": "Link",
+ "label": "Fiscal Year",
+ "options": "Fiscal Year",
+ "permlevel": 0,
+ "print_hide": 1,
+ "reqd": 1
}
],
"icon": "icon-upload-alt",
"idx": 1,
"is_submittable": 1,
"max_attachments": 1,
- "modified": "2015-02-17 02:09:17.483016",
+ "modified": "2015-02-20 04:39:46.585018",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Reconciliation",
"owner": "Administrator",
"permissions": [
{
- "amend": 0,
+ "amend": 1,
"cancel": 1,
"create": 1,
"delete": 1,
diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
index ef4403f..14a54e9 100644
--- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py
@@ -8,6 +8,7 @@
from frappe.utils import cstr, flt, cint
from erpnext.stock.stock_ledger import update_entries_after
from erpnext.controllers.stock_controller import StockController
+from erpnext.stock.utils import get_stock_balance
class StockReconciliation(StockController):
def __init__(self, arg1, arg2=None):
@@ -15,6 +16,7 @@
self.head_row = ["Item Code", "Warehouse", "Quantity", "Valuation Rate"]
def validate(self):
+ self.remove_items_with_no_change()
self.validate_data()
self.validate_expense_account()
@@ -26,6 +28,28 @@
self.delete_and_repost_sle()
self.make_gl_entries_on_cancel()
+ def remove_items_with_no_change(self):
+ """Remove items if qty or rate is not changed"""
+ self.difference_amount = 0.0
+ def _changed(item):
+ qty, rate = get_stock_balance(item.item_code, item.warehouse,
+ self.posting_date, self.posting_time, with_valuation_rate=True)
+ if (item.qty==None or item.qty==qty) and (item.valuation_rate==None or item.valuation_rate==rate):
+ return False
+ else:
+ item.current_qty = qty
+ item.current_valuation_rate = rate
+ self.difference_amount += ((item.qty or qty) * (item.valuation_rate or rate) - (qty * rate))
+ return True
+
+ items = filter(lambda d: _changed(d), self.items)
+
+ if len(items) != len(self.items):
+ self.items = items
+ for i, item in enumerate(self.items):
+ item.idx = i + 1
+ frappe.msgprint(_("Removed items with no change in quantity or value."))
+
def validate_data(self):
def _get_msg(row_num, msg):
return _("Row # {0}: ").format(row_num+1) + msg
@@ -38,6 +62,7 @@
# validate no of rows
if len(self.items) > 100:
frappe.throw(_("""Max 100 rows for Stock Reconciliation."""))
+
for row_num, row in enumerate(self.items):
# find duplicates
if [row.item_code, row.warehouse] in item_warehouse_combinations:
@@ -88,8 +113,6 @@
try:
item = frappe.get_doc("Item", item_code)
- if not item:
- raise frappe.ValidationError, (_("Item: {0} not found in the system").format(item_code))
# end of life and stock item
validate_end_of_life(item_code, item.end_of_life, verbose=0)
@@ -194,14 +217,16 @@
frappe.throw(_("Difference Account must be a 'Liability' type account, since this Stock Reconciliation is an Opening Entry"))
@frappe.whitelist()
-def get_items(warehouse):
- from erpnext.stock.utils import get_stock_balance
+def get_items(warehouse, posting_date, posting_time):
items = frappe.get_list("Item", fields=["name"], filters=
{"is_stock_item": "Yes", "has_serial_no": "No", "has_batch_no": "No"})
for item in items:
item.item_code = item.name
item.warehouse = warehouse
+ item.qty, item.valuation_rate = get_stock_balance(item.name, warehouse,
+ posting_date, posting_time, with_valuation_rate=True)
+ item.current_qty = item.qty
+ item.current_valuation_rate = item.valuation_rate
del item["name"]
- item.qty, item.valuation_rate = get_stock_balance(item.name, warehouse, with_valuation_rate=True)
return items
diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
index d36d756..fff4ce5 100644
--- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
+++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py
@@ -12,6 +12,9 @@
class TestStockReconciliation(unittest.TestCase):
+ def setUp(self):
+ frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1)
+
def test_reco_for_fifo(self):
frappe.defaults.set_global_default("auto_accounting_for_stock", 0)
# [[qty, valuation_rate, posting_date,
@@ -183,10 +186,12 @@
"company": "_Test Company",
"expense_account": "Stock Adjustment - _TC",
"cost_center": "_Test Cost Center - _TC",
- "reconciliation_json": json.dumps([
- ["Item Code", "Warehouse", "Quantity", "Valuation Rate"],
- ["_Test Item", "_Test Warehouse - _TC", qty, rate]
- ]),
+ "items": [{
+ "item_code": "_Test Item",
+ "warehouse": "_Test Warehouse - _TC",
+ "qty": qty,
+ "valuation_rate": rate
+ }]
})
stock_reco.insert()
stock_reco.submit()
diff --git a/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json b/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json
index aa55031..c94b940 100644
--- a/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json
+++ b/erpnext/stock/doctype/stock_reconciliation_item/stock_reconciliation_item.json
@@ -49,6 +49,12 @@
"set_only_once": 0
},
{
+ "fieldname": "section_break_3",
+ "fieldtype": "Section Break",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
"allow_on_submit": 0,
"description": "Leave blank if no change",
"fieldname": "qty",
@@ -87,6 +93,30 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0
+ },
+ {
+ "fieldname": "column_break_6",
+ "fieldtype": "Column Break",
+ "permlevel": 0,
+ "precision": ""
+ },
+ {
+ "description": "Before reconciliation",
+ "fieldname": "current_qty",
+ "fieldtype": "Float",
+ "label": "Current Qty",
+ "permlevel": 0,
+ "precision": "",
+ "read_only": 1
+ },
+ {
+ "description": "Before reconciliation",
+ "fieldname": "current_valuation_rate",
+ "fieldtype": "Read Only",
+ "label": "Current Valuation Rate",
+ "permlevel": 0,
+ "precision": "",
+ "read_only": 1
}
],
"hide_heading": 0,
@@ -96,7 +126,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
- "modified": "2015-02-17 01:07:50.200649",
+ "modified": "2015-02-20 04:20:46.692967",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Reconciliation Item",
diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py
index 29897ef..d7ace2f 100644
--- a/erpnext/stock/get_item_details.py
+++ b/erpnext/stock/get_item_details.py
@@ -124,6 +124,9 @@
elif item.is_sales_item != "Yes":
throw(_("Item {0} must be a Sales Item").format(item.name))
+ if cint(item.has_variants):
+ throw(_("Item {0} is a template, please select one of its variants").format(item.name))
+
elif args.transaction_type == "buying" and args.parenttype != "Material Request":
# validate if purchase item or subcontracted item
if item.is_purchase_item != "Yes":
diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py
index 5f70c49..84743ae 100644
--- a/erpnext/stock/stock_ledger.py
+++ b/erpnext/stock/stock_ledger.py
@@ -241,9 +241,9 @@
if new_stock_qty:
self.valuation_rate = new_stock_value / flt(new_stock_qty)
elif not self.valuation_rate and self.qty_after_transaction <= 0:
- valuation_rate = get_valuation_rate(sle.item_code, sle.warehouse, self.allow_zero_rate)
+ self.valuation_rate = get_valuation_rate(sle.item_code, sle.warehouse, self.allow_zero_rate)
- return abs(flt(valuation_rate))
+ return abs(flt(self.valuation_rate))
def get_fifo_values(self, sle):
incoming_rate = flt(sle.incoming_rate)
diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py
index 9a33735..4b1567c 100644
--- a/erpnext/stock/utils.py
+++ b/erpnext/stock/utils.py
@@ -38,18 +38,22 @@
"""Returns stock balance quantity at given warehouse on given posting date or current date.
If `with_valuation_rate` is True, will return tuple (qty, rate)"""
+
+ from erpnext.stock.stock_ledger import get_previous_sle
+
if not posting_date: posting_date = nowdate()
if not posting_time: posting_time = nowtime()
- last_entry = frappe.db.sql("""select qty_after_transaction, valuation_rate from `tabStock Ledger Entry`
- where item_code=%s and warehouse=%s
- and timestamp(posting_date, posting_time) < timestamp(%s, %s)
- order by timestamp(posting_date, posting_time) limit 1""",
- (item_code, warehouse, posting_date, posting_time))
+
+ last_entry = get_previous_sle({
+ "item_code": item_code,
+ "warehouse":warehouse,
+ "posting_date": posting_date,
+ "posting_time": posting_time })
if with_valuation_rate:
- return (last_entry[0][0], last_entry[0][1]) if last_entry else (0.0, 0.0)
+ return (last_entry.qty_after_transaction, last_entry.valuation_rate) if last_entry else (0.0, 0.0)
else:
- return last_entry[0][0] if last_entry else 0.0
+ return last_entry.qty_after_transaction or 0.0
def get_latest_stock_balance():
bin_map = {}
diff --git a/erpnext/support/doctype/issue/issue.py b/erpnext/support/doctype/issue/issue.py
index e322c9c..1c11065 100644
--- a/erpnext/support/doctype/issue/issue.py
+++ b/erpnext/support/doctype/issue/issue.py
@@ -7,14 +7,12 @@
from frappe.model.document import Document
from frappe.utils import now
+from frappe.utils.user import is_website_user
class Issue(Document):
def get_feed(self):
return "{0}: {1}".format(_(self.status), self.subject)
- def get_portal_page(self):
- return "ticket"
-
def set_sender(self, sender):
"""Will be called by **Communication** when the Issue is created from an incoming email."""
self.raised_by = sender
@@ -50,6 +48,24 @@
# if no date, it should be set as None and not a blank string "", as per mysql strict config
self.resolution_date = None
+ @staticmethod
+ def get_list_context(context=None):
+ return {
+ "title": _("My Issues"),
+ "get_list": get_issue_list
+ }
+
+def get_issue_list(doctype, txt, filters, limit_start, limit_page_length=20):
+ from frappe.templates.pages.list import get_list
+ user = frappe.session.user
+ ignore_permissions = False
+ if is_website_user(user):
+ if not filters: filters = []
+ filters.append(("Issue", "raised_by", "=", user))
+ ignore_permissions = True
+
+ return get_list(doctype, txt, filters, limit_start, limit_page_length, ignore_permissions=ignore_permissions)
+
@frappe.whitelist()
def set_status(name, status):
st = frappe.get_doc("Issue", name)
diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json
index 821a872..8ccaac6 100644
--- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json
+++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json
@@ -7,7 +7,7 @@
{
"fieldname": "customer_details",
"fieldtype": "Section Break",
- "label": "Customer Details",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-user",
"permlevel": 0
@@ -61,7 +61,7 @@
{
"fieldname": "items_section",
"fieldtype": "Section Break",
- "label": "Items",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart",
"permlevel": 0
@@ -228,7 +228,7 @@
"icon": "icon-calendar",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:40.965832",
+ "modified": "2015-02-20 05:04:06.871850",
"modified_by": "Administrator",
"module": "Support",
"name": "Maintenance Schedule",
diff --git a/erpnext/support/doctype/maintenance_schedule/test_maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/test_maintenance_schedule.py
deleted file mode 100644
index c2c6e01..0000000
--- a/erpnext/support/doctype/maintenance_schedule/test_maintenance_schedule.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
-# See license.txt
-
-import frappe
-import unittest
-
-test_records = frappe.get_test_records('Maintenance Schedule')
-
-class TestMaintenanceSchedule(unittest.TestCase):
- pass
diff --git a/erpnext/support/doctype/maintenance_schedule/test_records.json b/erpnext/support/doctype/maintenance_schedule/test_records.json
deleted file mode 100644
index 8c2a059..0000000
--- a/erpnext/support/doctype/maintenance_schedule/test_records.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- {
- "doctype": "Maintenance Schedule",
- "name": "_Test Maintenance Schedule 1"
- }
-]
diff --git a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.json b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.json
index d0c080a..45b0a04 100644
--- a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.json
+++ b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.json
@@ -43,7 +43,7 @@
"fieldname": "schedule_details",
"fieldtype": "Section Break",
"in_list_view": 0,
- "label": "Schedule Details",
+ "label": "",
"permlevel": 0
},
{
@@ -133,7 +133,7 @@
],
"idx": 1,
"istable": 1,
- "modified": "2015-02-19 01:07:00.550040",
+ "modified": "2015-02-20 05:07:52.854082",
"modified_by": "Administrator",
"module": "Support",
"name": "Maintenance Schedule Item",
diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.json b/erpnext/support/doctype/maintenance_visit/maintenance_visit.json
index 25a785d..528a866 100644
--- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.json
+++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.json
@@ -7,7 +7,7 @@
{
"fieldname": "customer_details",
"fieldtype": "Section Break",
- "label": "Customer Details",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-user",
"permlevel": 0
@@ -102,7 +102,7 @@
{
"fieldname": "maintenance_details",
"fieldtype": "Section Break",
- "label": "Maintenance Details",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-wrench",
"permlevel": 0
@@ -279,7 +279,7 @@
"icon": "icon-file-text",
"idx": 1,
"is_submittable": 1,
- "modified": "2015-02-05 05:11:41.072187",
+ "modified": "2015-02-20 05:08:31.875844",
"modified_by": "Administrator",
"module": "Support",
"name": "Maintenance Visit",
diff --git a/erpnext/support/doctype/maintenance_visit/test_maintenance_visit.py b/erpnext/support/doctype/maintenance_visit/test_maintenance_visit.py
deleted file mode 100644
index 71e5d64..0000000
--- a/erpnext/support/doctype/maintenance_visit/test_maintenance_visit.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors
-# See license.txt
-
-import frappe
-import unittest
-
-test_records = frappe.get_test_records('Maintenance Visit')
-
-class TestMaintenanceVisit(unittest.TestCase):
- pass
diff --git a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json
index 8dd525b..86aafc1 100644
--- a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json
+++ b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json
@@ -49,7 +49,7 @@
"fieldname": "work_details",
"fieldtype": "Section Break",
"in_list_view": 0,
- "label": "Work Details",
+ "label": "",
"permlevel": 0
},
{
@@ -123,7 +123,7 @@
],
"idx": 1,
"istable": 1,
- "modified": "2015-02-19 01:07:00.623383",
+ "modified": "2015-02-20 05:08:56.512144",
"modified_by": "Administrator",
"module": "Support",
"name": "Maintenance Visit Purpose",
diff --git a/erpnext/support/doctype/warranty_claim/test_records.json b/erpnext/support/doctype/warranty_claim/test_records.json
deleted file mode 100644
index b5b1904..0000000
--- a/erpnext/support/doctype/warranty_claim/test_records.json
+++ /dev/null
@@ -1,6 +0,0 @@
-[
- {
- "doctype": "Warranty Claim",
- "name": "_Test Warranty Claim 1"
- }
-]
diff --git a/erpnext/support/doctype/warranty_claim/warranty_claim.js b/erpnext/support/doctype/warranty_claim/warranty_claim.js
index 0d6d6f5..9e60dde 100644
--- a/erpnext/support/doctype/warranty_claim/warranty_claim.js
+++ b/erpnext/support/doctype/warranty_claim/warranty_claim.js
@@ -13,7 +13,8 @@
erpnext.support.WarrantyClaim = frappe.ui.form.Controller.extend({
refresh: function() {
- if((cur_frm.doc.status=='Open' || cur_frm.doc.status == 'Work In Progress')) {
+ if(!cur_frm.doc.__islocal &&
+ (cur_frm.doc.status=='Open' || cur_frm.doc.status == 'Work In Progress')) {
cur_frm.add_custom_button(__('Make Maintenance Visit'),
this.make_maintenance_visit, frappe.boot.doctype_icons["Maintenance Visit"], "btn-default")
}
diff --git a/erpnext/support/doctype/warranty_claim/warranty_claim.json b/erpnext/support/doctype/warranty_claim/warranty_claim.json
index 71fa5a0..cabbdae 100644
--- a/erpnext/support/doctype/warranty_claim/warranty_claim.json
+++ b/erpnext/support/doctype/warranty_claim/warranty_claim.json
@@ -8,7 +8,7 @@
{
"fieldname": "customer_section",
"fieldtype": "Section Break",
- "label": "Customer",
+ "label": "",
"options": "icon-user",
"permlevel": 0
},
@@ -60,6 +60,15 @@
"width": "50%"
},
{
+ "description": "",
+ "fieldname": "serial_no",
+ "fieldtype": "Link",
+ "in_list_view": 0,
+ "label": "Serial No",
+ "options": "Serial No",
+ "permlevel": 0
+ },
+ {
"fieldname": "customer",
"fieldtype": "Link",
"in_filter": 1,
@@ -92,7 +101,7 @@
{
"fieldname": "issue_details",
"fieldtype": "Section Break",
- "label": "Issue Details",
+ "label": "",
"oldfieldtype": "Section Break",
"options": "icon-ticket",
"permlevel": 0
@@ -108,15 +117,6 @@
"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,
@@ -396,7 +396,7 @@
"icon": "icon-bug",
"idx": 1,
"is_submittable": 0,
- "modified": "2015-02-17 00:12:52.430072",
+ "modified": "2015-02-21 04:11:40.653543",
"modified_by": "Administrator",
"module": "Support",
"name": "Warranty Claim",
diff --git a/erpnext/templates/generators/item_group.html b/erpnext/templates/generators/item_group.html
index 8597864..6cc4212 100644
--- a/erpnext/templates/generators/item_group.html
+++ b/erpnext/templates/generators/item_group.html
@@ -36,3 +36,36 @@
</script>
{% endblock %}
+
+{% block style %}
+<style>
+ .product-link {
+ display: block;
+ text-align: center;
+ }
+
+ .product-image-wrapper {
+ max-width: 300px;
+ margin: auto;
+ }
+
+ .product-image {
+ width: 100%;
+ height: 0;
+ padding-bottom: 100%;
+ border-radius: 4px;
+ border: 1px solid transparent;
+ background-size: cover;
+ background-repeat: no-repeat;
+ }
+
+ .product-image.missing-image {
+ border: 1px dashed {{ border_color or "#d1d8dd" }};
+ }
+
+ .product-text {
+ padding: 15px 0px;
+ }
+
+</style>
+{% endblock %}
diff --git a/erpnext/templates/includes/product_in_grid.html b/erpnext/templates/includes/product_in_grid.html
index 4c4be71..27cc321 100644
--- a/erpnext/templates/includes/product_in_grid.html
+++ b/erpnext/templates/includes/product_in_grid.html
@@ -1,14 +1,8 @@
-<div class="col-sm-3">
- <div style="height: 120px; overflow: hidden;">
- <a href="{{ route or page_name }}">
- {%- if website_image -%}
- <img class="product-image" style="width: 80%; margin: auto;" src="{{ website_image }}">
- {%- else -%}
- {% include 'templates/includes/product_missing_image.html' %}
- {%- endif -%}
- </a>
+<a class="product-link" href="{{ route or page_name }}">
+ <div class="col-sm-2 product-image-wrapper">
+ <div class="product-image {% if not website_image -%}missing-image{%- endif %}"
+ {% if website_image -%} style="background-image: url({{ website_image }});" {%- endif %}>
+ </div>
+ <div class="product-text small">{{ item_name }}</div>
</div>
- <div style="height: 100px; overflow: hidden; font-size: 80%;">
- <div style="margin-bottom: 2px;"><a href="{{ route or page_name }}">{{ item_name }}</a></div>
- </div>
-</div>
+</a>
diff --git a/erpnext/templates/includes/sale.html b/erpnext/templates/includes/sale.html
deleted file mode 100644
index 6323995..0000000
--- a/erpnext/templates/includes/sale.html
+++ /dev/null
@@ -1,85 +0,0 @@
-<div class="sale-content">
- <ul class="breadcrumb">
- <li><a href="index">Home</a></li>
- <li><a href="{{ parent_link }}">{{ parent_title }}</a></li>
- <li class="active"><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</li>
- </ul>
- <h3><i class="icon-file icon-fixed-width"></i> {{ doc.name }}</h3>
- {% if doc.name == _("Not Allowed") -%}
- <script>ask_to_login();</script>
- {% else %}
- <hr>
- <div>
- <div class="row">
- <div class="col-xs-6">
- {% if doc.status -%}{{ doc.status }}{%- endif %}
- </div>
- <div class="col-xs-6">
- <span class="pull-right">{{ frappe.utils.formatdate(doc.posting_date or doc.transaction_date) }}</span>
- </div>
- </div>
- <br>
- <div class="row">
- <div class="col-md-12">
- <table class="table table-bordered">
- <tbody>
- <tr>
- <th>Sr</th>
- <th>Item Name</th>
- <th>Description</th>
- <th>Qty</th>
- <th>UoM</th>
- <th>Basic Rate</th>
- <th>Amount</th>
- </tr>
- {%- for row in doc.get({"doctype": doc.doctype + " Item"}) %}
- <tr>
- <td style="width: 3%;">{{ row.idx }}</td>
- <td style="width: 20%;">{{ row.item_name }}</td>
- <td style="width: 37%;">{{ row.description }}</td>
- <td style="width: 5%; text-align: right;">{{ row.qty }}</td>
- <td style="width: 5%;">{{ row.stock_uom }}</td>
- <td style="width: 15%; text-align: right;">{{ frappe.utils.fmt_money(row.rate, currency=doc.currency) }}</td>
- <td style="width: 15%; text-align: right;">{{ frappe.utils.fmt_money(row.amount, currency=doc.currency) }}</td>
- </tr>
- {% endfor -%}
- </tbody>
- </table>
- </div>
- </div>
- <div class="row">
- <div class="col-md-6"></div>
- <div class="col-md-6">
- <table cellspacing=0 width=100%>
- <tbody>
- <tr>
- <td>Net Total</td>
- <td width=40% style="text-align: right;">{{
- frappe.utils.fmt_money(doc.base_net_total/doc.conversion_rate, currency=doc.currency)
- }}</td>
- </tr>
- {%- for charge in doc.get({"doctype":"Sales Taxes and Charges"}) -%}
- {%- if not charge.included_in_print_rate -%}
- <tr>
- <td>{{ charge.description }}</td>
- <td style="text-align: right;">{{ frappe.utils.fmt_money(charge.tax_amount / doc.conversion_rate, currency=doc.currency) }}</td>
- </tr>
- {%- endif -%}
- {%- endfor -%}
- <tr>
- <td>Grand Total</td>
- <td style="text-align: right;">{{ frappe.utils.fmt_money(doc.grand_total, currency=doc.currency) }}</td>
- </tr>
- <tr style='font-weight: bold'>
- <td>Rounded Total</td>
- <td style="text-align: right;">{{ frappe.utils.fmt_money(doc.rounded_total, currency=doc.currency) }}</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- {%- endif %}
-</div>
-
-<!-- no-sidebar -->
diff --git a/erpnext/templates/includes/sales_transactions.html b/erpnext/templates/includes/sales_transactions.html
deleted file mode 100644
index 465f5ed..0000000
--- a/erpnext/templates/includes/sales_transactions.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<script>
-$(document).ready(function() {
- global_number_format = "{{ global_number_format }}";
- currency = "{{ currency }}";
- frappe.currency_symbols = {{ currency_symbols }};
-});
-</script>
-
-{% include "templates/includes/transactions.html" %}
-
-<script>
- var render = function(doc) {
- doc.grand_total = format_currency(doc.grand_total, doc.currency);
- if(!doc.status) doc.status = "";
-
- $(repl('<a href="{{ page }}?name=%(name)s" class="list-group-item">\
- <div class="row">\
- <div class="col-md-6">\
- <div class="row col-md-12">%(name)s</div>\
- <div class="row col-md-12 text-muted">%(items)s</div>\
- <div class="row col-md-12">%(status)s</div>\
- </div>\
- <div class="col-md-3 text-right">%(grand_total)s</div>\
- <div class="col-md-3 text-right text-muted">%(creation)s</div>\
- </div>\
- </a>', doc)).appendTo($list);
- };
-</script>
-
-<!-- no-sidebar -->
diff --git a/erpnext/templates/includes/transaction_row.html b/erpnext/templates/includes/transaction_row.html
new file mode 100644
index 0000000..ca03bd3
--- /dev/null
+++ b/erpnext/templates/includes/transaction_row.html
@@ -0,0 +1,30 @@
+{% set doc = frappe.get_doc(doc) %}
+<a class="website-list-row" href="/{{ pathname }}/{{ doc.name }}" no-pjax>
+<div class="row">
+ <div class="col-sm-6 col-xs-7">
+ <div class="row">
+ <div class="col-sm-9">{{ doc.customer or doc.supplier }}</div>
+ <div class="col-sm-3">
+ {%- if doc.status_percent > 0 -%}
+ {%- if doc.status_percent % 100 == 0 -%}
+ <span class="indicator green">{{ doc.status_display }}</span>
+ {%- else -%}
+ <span class="indicator orange">{{ doc.status_display }}</span>
+ {%- endif -%}
+ {%- elif doc.status -%}
+ <span class="indicator">{{ doc.status }}</span>
+ {%- endif -%}
+ </div>
+ </div>
+ </div>
+ <div class="col-sm-2 col-xs-5 text-right">
+ {{ doc.get_formatted("grand_total") }}
+ </div>
+ <div class="col-sm-2 text-muted text-right">
+ {{ doc.name }}
+ </div>
+ <div class="col-sm-2 small text-muted text-right" title="{{ frappe.utils.format_datetime(doc.creation, "medium") }}">
+ {{ frappe.utils.pretty_date(doc.creation) }}</div>
+</div>
+</a>
+
diff --git a/erpnext/templates/includes/transactions.html b/erpnext/templates/includes/transactions.html
deleted file mode 100644
index fb570cd..0000000
--- a/erpnext/templates/includes/transactions.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<div class="transactions-content">
- <ul class="breadcrumb">
- <li><a href="index">Home</a></li>
- <li class="active"><i class="{{ icon }} icon-fixed-width"></i> {{ title }}</li>
- </ul>
- <p id="msgprint-alert" class="alert alert-danger"
- style="display: none;"> </p>
- <div class="list-group transaction-list">
- <div class="text-muted progress">{{ _("Loading") }}...</div>
- </div>
- <div class="text-center">
- <button class="btn btn-default btn-show-more hide">More</button>
- </div>
-</div>
-<script>
-var get_transactions = function(btn) {
- frappe.call({
- method: "{{ method }}",
- args: { start: start },
- btn: btn,
- callback: function(r) {
- $list.find(".progress").remove();
- $show_more.toggleClass("hide", !(r.message && r.message.length===20));
- if(!(r.message && r.message.length)) {
- if(!$list.html().trim()) {
- $list.html("<div class='text-muted'>\
- {{ empty_list_message }}</div>");
- }
- return;
- }
-
- start += r.message.length;
-
- $.each(r.message, function(i, doc) {
- render(doc);
- });
- }
- })
-};
-
-$(document).ready(function() {
- window.start = 0;
- window.$list = $(".transaction-list");
- window.$list.find(".list-group-item").remove();
- window.$show_more = $(".btn-show-more").on("click", function() { get_transactions(this); })
-
- get_transactions();
-});
-</script>
-
-<!-- no-sidebar -->
diff --git a/erpnext/templates/pages/invoice.html b/erpnext/templates/pages/invoice.html
deleted file mode 100644
index 13b0e72..0000000
--- a/erpnext/templates/pages/invoice.html
+++ /dev/null
@@ -1,6 +0,0 @@
-{% block title %} {{ doc.name }} {% endblock %}
-
-{% block header %}<h2>{{ doc.name }}</h2>{% endblock %}
-
-{% block content%}{% include "templates/includes/sale.html" %}{% endblock %}
-
diff --git a/erpnext/templates/pages/invoice.py b/erpnext/templates/pages/invoice.py
deleted file mode 100644
index 8109109..0000000
--- a/erpnext/templates/pages/invoice.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import frappe
-from frappe import _
-from frappe.utils import flt, fmt_money
-from erpnext.templates.utils import get_transaction_context
-
-no_cache = 1
-no_sitemap = 1
-
-def get_context(context):
- invoice_context = frappe._dict({
- "parent_link": "invoices",
- "parent_title": "Invoices"
- })
- invoice_context.update(get_transaction_context("Sales Invoice", frappe.form_dict.name))
- modify_status(invoice_context.doc)
- return invoice_context
-
-def modify_status(doc):
- doc.status = ""
- if flt(doc.outstanding_amount):
- doc.status = '<span class="label %s"><i class="icon-fixed-width %s"></i> %s</span>' % \
- ("label-warning", "icon-exclamation-sign",
- _("To Pay") + " = " + fmt_money(doc.outstanding_amount, currency=doc.currency))
- else:
- doc.status = '<span class="label %s"><i class="icon-fixed-width %s"></i> %s</span>' % \
- ("label-success", "icon-ok", _("Paid"))
-
\ No newline at end of file
diff --git a/erpnext/templates/pages/invoices.html b/erpnext/templates/pages/invoices.html
deleted file mode 100644
index 9f493ca..0000000
--- a/erpnext/templates/pages/invoices.html
+++ /dev/null
@@ -1,6 +0,0 @@
-{% block title %} {{ title }} {% endblock %}
-
-{% block header %}<h2>{{ title }}</h2>{% endblock %}
-
-{% block content %}{% include "templates/includes/sales_transactions.html" %}{% endblock %}
-
diff --git a/erpnext/templates/pages/invoices.py b/erpnext/templates/pages/invoices.py
deleted file mode 100644
index 87aff21..0000000
--- a/erpnext/templates/pages/invoices.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import frappe
-from erpnext.templates.utils import get_currency_context
-
-no_cache = 1
-no_sitemap = 1
-
-def get_context(context):
- invoices_context = get_currency_context()
- invoices_context.update({
- "title": "Invoices",
- "method": "erpnext.templates.pages.invoices.get_invoices",
- "icon": "icon-file-text",
- "empty_list_message": "No Invoices Found",
- "page": "invoice"
- })
- return invoices_context
-
-@frappe.whitelist()
-def get_invoices(start=0):
- from erpnext.templates.utils import get_transaction_list
- from erpnext.templates.pages.invoice import modify_status
- invoices = get_transaction_list("Sales Invoice", start, ["outstanding_amount"])
- for d in invoices:
- modify_status(d)
- return invoices
\ No newline at end of file
diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html
deleted file mode 100644
index 13b0e72..0000000
--- a/erpnext/templates/pages/order.html
+++ /dev/null
@@ -1,6 +0,0 @@
-{% block title %} {{ doc.name }} {% endblock %}
-
-{% block header %}<h2>{{ doc.name }}</h2>{% endblock %}
-
-{% block content%}{% include "templates/includes/sale.html" %}{% endblock %}
-
diff --git a/erpnext/templates/pages/order.py b/erpnext/templates/pages/order.py
deleted file mode 100644
index 527caba..0000000
--- a/erpnext/templates/pages/order.py
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import frappe
-from frappe import _
-from erpnext.templates.utils import get_transaction_context
-
-no_cache = 1
-no_sitemap = 1
-
-def get_context(context):
- order_context = frappe._dict({
- "parent_link": "orders",
- "parent_title": "My Orders"
- })
-
- order_context.update(get_transaction_context("Sales Order", frappe.form_dict.name))
- modify_status(order_context.doc)
- return order_context
-
-def modify_status(doc):
- doc.status = []
- if 0 < doc.per_billed < 100:
- doc.status.append(("label-warning", "icon-ok", _("Partially Billed")))
- elif doc.per_billed == 100:
- doc.status.append(("label-success", "icon-ok", _("Billed")))
-
- if 0 < doc.per_delivered < 100:
- doc.status.append(("label-warning", "icon-truck", _("Partially Delivered")))
- elif doc.per_delivered == 100:
- doc.status.append(("label-success", "icon-truck", _("Delivered")))
- doc.status = " " + " ".join(('<span class="label %s"><i class="icon-fixed-width %s"></i> %s</span>' % s
- for s in doc.status))
diff --git a/erpnext/templates/pages/orders.html b/erpnext/templates/pages/orders.html
deleted file mode 100644
index d58cbd8..0000000
--- a/erpnext/templates/pages/orders.html
+++ /dev/null
@@ -1,5 +0,0 @@
-{% block title %} {{ title }} {% endblock %}
-
-{% block header %}<h2>{{ title }}</h2>{% endblock %}
-
-{% block content %}{% include "templates/includes/sales_transactions.html" %}{% endblock %}
diff --git a/erpnext/templates/pages/orders.py b/erpnext/templates/pages/orders.py
deleted file mode 100644
index ebf75b3..0000000
--- a/erpnext/templates/pages/orders.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import frappe
-from erpnext.templates.utils import get_currency_context, get_transaction_list
-from erpnext.templates.pages.order import modify_status
-
-no_cache = 1
-no_sitemap = 1
-
-def get_context(context):
- orders_context = get_currency_context()
- orders_context.update({
- "title": "My Orders",
- "method": "erpnext.templates.pages.orders.get_orders",
- "icon": "icon-list",
- "empty_list_message": "No Orders Yet",
- "page": "order",
- })
- return orders_context
-
-@frappe.whitelist()
-def get_orders(start=0):
- orders = get_transaction_list("Sales Order", start, ["per_billed", "per_delivered"])
- for d in orders:
- modify_status(d)
-
- return orders
-
\ No newline at end of file
diff --git a/erpnext/templates/pages/shipment.html b/erpnext/templates/pages/shipment.html
deleted file mode 100644
index 13b0e72..0000000
--- a/erpnext/templates/pages/shipment.html
+++ /dev/null
@@ -1,6 +0,0 @@
-{% block title %} {{ doc.name }} {% endblock %}
-
-{% block header %}<h2>{{ doc.name }}</h2>{% endblock %}
-
-{% block content%}{% include "templates/includes/sale.html" %}{% endblock %}
-
diff --git a/erpnext/templates/pages/shipment.py b/erpnext/templates/pages/shipment.py
deleted file mode 100644
index a8047f5..0000000
--- a/erpnext/templates/pages/shipment.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import frappe
-from erpnext.templates.utils import get_transaction_context
-
-no_cache = 1
-no_sitemap = 1
-
-def get_context(context):
- shipment_context = frappe._dict({
- "parent_link": "shipments",
- "parent_title": "Shipments"
- })
- shipment_context.update(get_transaction_context("Delivery Note", frappe.form_dict.name))
- return shipment_context
diff --git a/erpnext/templates/pages/shipments.html b/erpnext/templates/pages/shipments.html
deleted file mode 100644
index d58cbd8..0000000
--- a/erpnext/templates/pages/shipments.html
+++ /dev/null
@@ -1,5 +0,0 @@
-{% block title %} {{ title }} {% endblock %}
-
-{% block header %}<h2>{{ title }}</h2>{% endblock %}
-
-{% block content %}{% include "templates/includes/sales_transactions.html" %}{% endblock %}
diff --git a/erpnext/templates/pages/shipments.py b/erpnext/templates/pages/shipments.py
deleted file mode 100644
index 350b3e4..0000000
--- a/erpnext/templates/pages/shipments.py
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from __future__ import unicode_literals
-import frappe
-from erpnext.templates.utils import get_currency_context
-
-no_cache = 1
-no_sitemap = 1
-
-def get_context(context):
- shipments_context = get_currency_context()
- shipments_context.update({
- "title": "Shipments",
- "method": "erpnext.templates.pages.shipments.get_shipments",
- "icon": "icon-truck",
- "empty_list_message": "No Shipments Found",
- "page": "shipment"
- })
- return shipments_context
-
-@frappe.whitelist()
-def get_shipments(start=0):
- from erpnext.templates.utils import get_transaction_list
- return get_transaction_list("Delivery Note", start)
diff --git a/erpnext/templates/utils.py b/erpnext/templates/utils.py
index 9108acf..9ce1111 100644
--- a/erpnext/templates/utils.py
+++ b/erpnext/templates/utils.py
@@ -21,47 +21,3 @@
"sent_or_received": "Received"
})
comm.insert(ignore_permissions=True)
-
-def get_transaction_list(doctype, start, additional_fields=None):
- # find customer id
- customer = frappe.db.get_value("Contact", {"email_id": frappe.session.user},
- "customer")
-
- if customer:
- if additional_fields:
- additional_fields = ", " + ", ".join(("`%s`" % f for f in additional_fields))
- else:
- additional_fields = ""
-
- transactions = frappe.db.sql("""select name, creation, currency, grand_total
- %s
- from `tab%s` where customer=%s and docstatus=1
- order by creation desc
- limit %s, 20""" % (additional_fields, doctype, "%s", "%s"),
- (customer, cint(start)), as_dict=True)
- for doc in transactions:
- items = frappe.db.sql_list("""select item_name
- from `tab%s Item` where parent=%s limit 6""" % (doctype, "%s"), doc.name)
- doc.items = ", ".join(items[:5]) + ("..." if (len(items) > 5) else "")
- doc.creation = formatdate(doc.creation)
- return transactions
- else:
- return []
-
-def get_currency_context():
- return {
- "global_number_format": frappe.db.get_default("number_format") or "#,###.##",
- "currency": frappe.db.get_default("currency"),
- "currency_symbols": json.dumps(dict(frappe.db.sql("""select name, symbol
- from tabCurrency where ifnull(enabled,0)=1""")))
- }
-
-def get_transaction_context(doctype, name):
- customer = frappe.db.get_value("Contact", {"email_id": frappe.session.user},
- "customer")
-
- doc = frappe.get_doc(doctype, name)
- if doc.customer != customer:
- return { "doc": frappe._dict({"name": _("Not Allowed")}) }
- else:
- return { "doc": doc }
diff --git a/erpnext/utilities/doctype/address/address.json b/erpnext/utilities/doctype/address/address.json
index 9e73389..49cdd83 100644
--- a/erpnext/utilities/doctype/address/address.json
+++ b/erpnext/utilities/doctype/address/address.json
@@ -9,7 +9,7 @@
{
"fieldname": "address_details",
"fieldtype": "Section Break",
- "label": "Address Details",
+ "label": "",
"options": "icon-map-marker",
"permlevel": 0
},
@@ -199,7 +199,7 @@
"icon": "icon-map-marker",
"idx": 1,
"in_dialog": 0,
- "modified": "2015-02-05 05:11:34.249167",
+ "modified": "2015-02-20 05:07:56.567822",
"modified_by": "Administrator",
"module": "Utilities",
"name": "Address",
diff --git a/erpnext/utilities/doctype/contact/contact.json b/erpnext/utilities/doctype/contact/contact.json
index 41a89c5..186432e 100644
--- a/erpnext/utilities/doctype/contact/contact.json
+++ b/erpnext/utilities/doctype/contact/contact.json
@@ -9,7 +9,7 @@
{
"fieldname": "contact_section",
"fieldtype": "Section Break",
- "label": "Contact Details",
+ "label": "",
"options": "icon-user",
"permlevel": 0
},
@@ -176,7 +176,7 @@
"idx": 1,
"in_create": 0,
"in_dialog": 0,
- "modified": "2015-02-05 05:11:35.962993",
+ "modified": "2015-02-20 05:07:55.636970",
"modified_by": "Administrator",
"module": "Utilities",
"name": "Contact",
diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py
index 020455f..e5a4222 100644
--- a/erpnext/utilities/transaction_base.py
+++ b/erpnext/utilities/transaction_base.py
@@ -48,11 +48,11 @@
"ref_name": self.name
})
+ event.insert(ignore_permissions=True)
+
if frappe.db.exists("User", self.contact_by):
frappe.share.add("Event", event.name, self.contact_by)
- event.insert(ignore_permissions=True)
-
def validate_uom_is_integer(self, uom_field, qty_fields):
validate_uom_is_integer(self, uom_field, qty_fields)
@@ -87,6 +87,7 @@
if prevdoc_values[field] is not None:
self.validate_value(field, condition, prevdoc_values[field], doc)
+
def delete_events(ref_type, ref_name):
frappe.delete_doc("Event", frappe.db.sql_list("""select name from `tabEvent`
where ref_type=%s and ref_name=%s""", (ref_type, ref_name)), for_reload=True)