Merge pull request #27081 from rohitwaghchaure/fixed-donot-overrride-batch-no

fix: batch no reset on changing of qty
This commit is contained in:
rohitwaghchaure 2021-08-24 10:15:36 +05:30 committed by GitHub
commit 95866b736e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -394,6 +394,10 @@ erpnext.selling.SellingController = class SellingController extends erpnext.Tran
}
_set_batch_number(doc) {
if (doc.batch_no) {
return
}
let args = {'item_code': doc.item_code, 'warehouse': doc.warehouse, 'qty': flt(doc.qty) * flt(doc.conversion_factor)};
if (doc.has_serial_no && doc.serial_no) {
args['serial_no'] = doc.serial_no

View File

@ -278,6 +278,10 @@ def get_basic_details(args, item, overwrite_warehouse=True):
else:
args.uom = item.stock_uom
if (args.get("batch_no") and
item.name != frappe.get_cached_value('Batch', args.get("batch_no"), 'item')):
args['batch_no'] = ''
out = frappe._dict({
"item_code": item.name,
"item_name": item.item_name,