From ea1f1b398e9c5b7364bc807f48e1fa914a356e41 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 2 Feb 2022 12:40:10 +1100 Subject: [PATCH] Prevent AttributeError from being thrown Ref: https://github.com/inventree/InvenTree/issues/2587 --- InvenTree/stock/migrations/0064_auto_20210621_1724.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/stock/migrations/0064_auto_20210621_1724.py b/InvenTree/stock/migrations/0064_auto_20210621_1724.py index 361ad02c80..666de26189 100644 --- a/InvenTree/stock/migrations/0064_auto_20210621_1724.py +++ b/InvenTree/stock/migrations/0064_auto_20210621_1724.py @@ -43,7 +43,7 @@ def extract_purchase_price(apps, schema_editor): if lines.exists(): for line in lines: - if line.purchase_price is not None: + if getattr(line, 'purchase_price', None) is not None: # Copy pricing information across item.purchase_price = line.purchase_price