From 8f2a0f3d79cafcfdb65a2bf3b09b5a464606dd9a Mon Sep 17 00:00:00 2001 From: Alchez Date: Fri, 6 Jul 2018 14:36:52 +0530 Subject: [PATCH] [Fix] Incorrect assignment of Serial No in POS Invoice (#14772) * Fix incorrect assignment of serial no in Sales Invoice through POS * Add conversion factor to quantity check --- erpnext/controllers/accounts_controller.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index cfc630a0a0..98cf8fc3ce 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -239,8 +239,9 @@ class AccountsController(TransactionBase): item.set(fieldname, value) elif fieldname == "serial_no": - stock_qty = item.get("stock_qty") * -1 if item.get("stock_qty") < 0 else item.get("stock_qty") - if stock_qty != len(get_serial_nos(item.get('serial_no'))): + item_qty = abs(item.get("qty")) * item.get("conversion_factor") + + if item_qty != len(get_serial_nos(item.get('serial_no'))): item.set(fieldname, value) if ret.get("pricing_rule"):