Party is now dynamic link in JV and GL Entry
diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.json b/erpnext/accounts/doctype/gl_entry/gl_entry.json
index 673eb47..ffb3f9b 100644
--- a/erpnext/accounts/doctype/gl_entry/gl_entry.json
+++ b/erpnext/accounts/doctype/gl_entry/gl_entry.json
@@ -49,16 +49,16 @@
},
{
"fieldname": "party_type",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Party Type",
- "options": "\nCustomer\nSupplier",
+ "options": "DocType",
"permlevel": 0
},
{
"fieldname": "party",
- "fieldtype": "Link",
+ "fieldtype": "Dynamic Link",
"label": "Party",
- "options": "[Select]",
+ "options": "party_type",
"permlevel": 0
},
{
@@ -203,7 +203,7 @@
"icon": "icon-list",
"idx": 1,
"in_create": 1,
- "modified": "2014-08-26 17:56:49.147121",
+ "modified": "2014-09-11 18:35:22.822064",
"modified_by": "Administrator",
"module": "Accounts",
"name": "GL Entry",
diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
index fcadad0..ad83607 100644
--- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
+++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js
@@ -41,18 +41,12 @@
});
});
- me.frm.set_query("party", "entries", function(doc, cdt, cdn) {
- var jvd = frappe.get_doc(cdt, cdn);
- if(!jvd.party_type) {
- frappe.throw(__("Please enter Party Type first"));
- } else {
- return {
- doctype: jvd.party_type
- }
+ me.frm.set_query("party_type", "entries", function(doc, cdt, cdn) {
+ return {
+ filters: {"name": ["in", ["Customer", "Supplier"]]}
}
});
-
$.each([["against_voucher", "Purchase Invoice", "supplier"],
["against_invoice", "Sales Invoice", "customer"]], function(i, opts) {
me.frm.set_query(opts[0], "entries", function(doc, cdt, cdn) {
diff --git a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.json b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.json
index 063e063..de15772 100644
--- a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.json
+++ b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.json
@@ -43,16 +43,16 @@
},
{
"fieldname": "party_type",
- "fieldtype": "Select",
+ "fieldtype": "Link",
"label": "Party Type",
- "options": "\nCustomer\nSupplier",
+ "options": "DocType",
"permlevel": 0
},
{
"fieldname": "party",
- "fieldtype": "Link",
+ "fieldtype": "Dynamic Link",
"label": "Party",
- "options": "[Select]",
+ "options": "party_type",
"permlevel": 0
},
{
@@ -188,7 +188,7 @@
],
"idx": 1,
"istable": 1,
- "modified": "2014-08-26 17:56:34.294770",
+ "modified": "2014-09-11 18:33:53.705093",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Voucher Detail",