Fixes in making credit note from Sales Return
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js
index 7dca72a..96b2cd5 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.js
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.js
@@ -211,10 +211,9 @@
},
callback: function(r) {
if(!r.exc) {
- var jv_name = frappe.model.make_new_doc_and_get_name('Journal Voucher');
- var jv = locals["Journal Voucher"][jv_name];
- $.extend(jv, r.message);
- loaddoc("Journal Voucher", jv_name);
+ var doclist = frappe.model.sync(r.message);
+ frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
+
}
}
});
@@ -266,20 +265,20 @@
customer: function() {
this.get_party_details({
- party: this.frm.doc.customer,
- party_type:"Customer",
+ party: this.frm.doc.customer,
+ party_type:"Customer",
doctype: this.frm.doc.doctype
});
},
supplier: function() {
this.get_party_details({
- party: this.frm.doc.supplier,
- party_type:"Supplier",
+ party: this.frm.doc.supplier,
+ party_type:"Supplier",
doctype: this.frm.doc.doctype
});
},
-
+
get_party_details: function(args) {
var me = this;
frappe.call({
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py
index 7629c3c..861d967 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.py
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.py
@@ -780,14 +780,10 @@
from erpnext.accounts.utils import get_balance_on
for r in result:
jv.append("entries", {
- "__islocal": 1,
- "doctype": "Journal Voucher Detail",
- "parentfield": "entries",
"account": r.get("account"),
"against_invoice": r.get("against_invoice"),
"against_voucher": r.get("against_voucher"),
- "balance": get_balance_on(r.get("account"), se.posting_date) \
- if r.get("account") else 0
+ "balance": get_balance_on(r.get("account"), se.posting_date) if r.get("account") else 0
})
return jv