Skip to content

Commit d36a7c2

Browse files
Merge pull request #46741 from frappe/mergify/bp/version-15/pr-46734
fix: decimal values causing incorrect batch picking (backport #46733) (backport #46734)
2 parents b548cc4 + 1b6aeba commit d36a7c2

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)