From f6c48e8ecf05a4e6edd4023a7dd6a40b229f0fd2 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:10:31 +0530 Subject: [PATCH] fix: `AttributeError` while saving Purchase Invoice (backport #38482) (#38490) fix: `AttributeError` while saving Purchase Invoice (cherry picked from commit 60a81a563ef99ae892a821d27ae298730a0e2563) Co-authored-by: s-aga-r --- erpnext/controllers/buying_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 68ad97d7ba..54c97b4208 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -440,7 +440,7 @@ class BuyingController(SubcontractingController): if allow_to_edit_stock_qty: d.stock_qty = flt(d.stock_qty, d.precision("stock_qty")) - if d.get("received_stock_qty"): + if d.get("received_stock_qty") and d.meta.get_field("received_stock_qty"): d.received_stock_qty = flt(d.received_stock_qty, d.precision("received_stock_qty")) def validate_purchase_return(self):