mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-04 20:59:11 +00:00
Party is now dynamic link in JV and GL Entry
This commit is contained in:
@@ -49,16 +49,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "party_type",
|
"fieldname": "party_type",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Link",
|
||||||
"label": "Party Type",
|
"label": "Party Type",
|
||||||
"options": "\nCustomer\nSupplier",
|
"options": "DocType",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "party",
|
"fieldname": "party",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Dynamic Link",
|
||||||
"label": "Party",
|
"label": "Party",
|
||||||
"options": "[Select]",
|
"options": "party_type",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -203,7 +203,7 @@
|
|||||||
"icon": "icon-list",
|
"icon": "icon-list",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"in_create": 1,
|
"in_create": 1,
|
||||||
"modified": "2014-08-26 17:56:49.147121",
|
"modified": "2014-09-11 18:35:22.822064",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "GL Entry",
|
"name": "GL Entry",
|
||||||
|
|||||||
@@ -41,18 +41,12 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
me.frm.set_query("party", "entries", function(doc, cdt, cdn) {
|
me.frm.set_query("party_type", "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 {
|
return {
|
||||||
doctype: jvd.party_type
|
filters: {"name": ["in", ["Customer", "Supplier"]]}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$.each([["against_voucher", "Purchase Invoice", "supplier"],
|
$.each([["against_voucher", "Purchase Invoice", "supplier"],
|
||||||
["against_invoice", "Sales Invoice", "customer"]], function(i, opts) {
|
["against_invoice", "Sales Invoice", "customer"]], function(i, opts) {
|
||||||
me.frm.set_query(opts[0], "entries", function(doc, cdt, cdn) {
|
me.frm.set_query(opts[0], "entries", function(doc, cdt, cdn) {
|
||||||
|
|||||||
@@ -43,16 +43,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "party_type",
|
"fieldname": "party_type",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Link",
|
||||||
"label": "Party Type",
|
"label": "Party Type",
|
||||||
"options": "\nCustomer\nSupplier",
|
"options": "DocType",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "party",
|
"fieldname": "party",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Dynamic Link",
|
||||||
"label": "Party",
|
"label": "Party",
|
||||||
"options": "[Select]",
|
"options": "party_type",
|
||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -188,7 +188,7 @@
|
|||||||
],
|
],
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"modified": "2014-08-26 17:56:34.294770",
|
"modified": "2014-09-11 18:33:53.705093",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Journal Voucher Detail",
|
"name": "Journal Voucher Detail",
|
||||||
|
|||||||
Reference in New Issue
Block a user