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 <sagarsharma.s312@gmail.com>
This commit is contained in:
mergify[bot] 2023-12-01 14:10:31 +05:30 committed by GitHub
parent bf44e9ed64
commit f6c48e8ecf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -440,7 +440,7 @@ class BuyingController(SubcontractingController):
if allow_to_edit_stock_qty: if allow_to_edit_stock_qty:
d.stock_qty = flt(d.stock_qty, d.precision("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")) d.received_stock_qty = flt(d.received_stock_qty, d.precision("received_stock_qty"))
def validate_purchase_return(self): def validate_purchase_return(self):