Fixes #1635, Stock Reconcilation

This commit is contained in:
Anand Doshi 2014-05-14 15:10:00 +05:30
parent 5ce287d611
commit 39cc1df560
2 changed files with 6 additions and 4 deletions

View File

@ -20,7 +20,10 @@ erpnext.stock.StockReconciliation = erpnext.stock.StockController.extend({
"company": this.frm.doc.company
},
callback: function(r) {
if (!r.exc) me.frm.set_value("expense_account", r.message);
if (!r.exc) {
me.frm.set_value("expense_account", r.message);
me.frm.script_manager.trigger("refresh");
}
}
});
}

View File

@ -294,9 +294,8 @@ class StockReconciliation(StockController):
if not self.expense_account:
msgprint(_("Please enter Expense Account"), raise_exception=1)
elif not frappe.db.sql("""select * from `tabStock Ledger Entry`"""):
if frappe.db.get_value("Account", self.expense_account,
"report_type") == "Profit and Loss":
frappe.throw(_("'Profit and Loss' type Account {0} used be set for Opening Entry").format(self.expense_account))
if frappe.db.get_value("Account", self.expense_account, "report_type") == "Profit and Loss":
frappe.throw(_("Difference Account must be a 'Liability' type account, since this Stock Reconciliation is an Opening Entry"))
@frappe.whitelist()
def upload():