Merge branch 'hotfix'

This commit is contained in:
Saurabh 2018-01-29 18:53:53 +05:30
commit 32c2c474fd
3 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@ import frappe
from erpnext.hooks import regional_overrides from erpnext.hooks import regional_overrides
from frappe.utils import getdate from frappe.utils import getdate
__version__ = '10.0.16' __version__ = '10.0.17'
def get_default_company(user=None): def get_default_company(user=None):
'''Get default company for user''' '''Get default company for user'''

View File

@ -82,8 +82,8 @@ erpnext.accounts.JournalEntry = frappe.ui.form.Controller.extend({
$.each(this.frm.doc.accounts || [], function(i, jvd) { $.each(this.frm.doc.accounts || [], function(i, jvd) {
frappe.model.set_default_values(jvd); frappe.model.set_default_values(jvd);
}); });
var posting_date = this.frm.posting_date;
if(!this.frm.doc.amended_from) this.frm.doc.posting_date = this.frm.posting_date || frappe.datetime.get_today(); if(!this.frm.doc.amended_from) this.frm.set_value('posting_date', posting_date || frappe.datetime.get_today());
} }
}, },

View File

@ -115,7 +115,7 @@ def set_batch_nos(doc, warehouse_field, throw = False):
d.batch_no = get_batch_no(d.item_code, warehouse, qty, throw) d.batch_no = get_batch_no(d.item_code, warehouse, qty, throw)
else: else:
batch_qty = get_batch_qty(batch_no=d.batch_no, warehouse=warehouse) batch_qty = get_batch_qty(batch_no=d.batch_no, warehouse=warehouse)
if flt(batch_qty, d.precision("stock_qty")) < flt(qty, d.precision("stock_qty")): if flt(batch_qty, d.precision("qty")) < flt(qty, d.precision("qty")):
frappe.throw(_("Row #{0}: The batch {1} has only {2} qty. Please select another batch which has {3} qty available or split the row into multiple rows, to deliver/issue from multiple batches").format(d.idx, d.batch_no, batch_qty, d.stock_qty)) frappe.throw(_("Row #{0}: The batch {1} has only {2} qty. Please select another batch which has {3} qty available or split the row into multiple rows, to deliver/issue from multiple batches").format(d.idx, d.batch_no, batch_qty, d.stock_qty))
@frappe.whitelist() @frappe.whitelist()