Skip to content

Commit 1b6aeba

Browse files
rohitwaghchauremergify[bot]
authored andcommitted
fix: decimal values causing incorrect batch picking
(cherry picked from commit 7bfe703) (cherry picked from commit c5efdda)
1 parent 8951efb commit 1b6aeba

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

erpnext/controllers/subcontracting_controller.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,11 @@ def __set_serial_and_batch_bundle(self, item_row, rm_obj, qty):
545545
def __get_batch_nos_for_bundle(self, qty, key):
546546
available_batches = defaultdict(float)
547547

548+
precision = frappe.get_precision("Subcontracting Receipt Supplied Item", "consumed_qty")
548549
for batch_no, batch_qty in self.available_materials[key]["batch_no"].items():
550+
if flt(batch_qty, precision) <= 0:
551+
continue
552+
549553
qty_to_consumed = 0
550554
if qty > 0:
551555
if batch_qty >= qty:

0 commit comments

Comments
 (0)