aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-10-01 00:46:28 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-10-01 00:46:28 +0300
commita86f9fd664c2db803450f5c67ae79c6b3cc94545 (patch)
treed34b224d6410cbca40f59730a5464ff3f8b25eff
parent0c6d66e7ced5f1c7843eba4221b08db79e56a021 (diff)
downloadServo-a86f9fd664c2db803450f5c67ae79c6b3cc94545.tar.gz
Servo-a86f9fd664c2db803450f5c67ae79c6b3cc94545.tar.bz2
Servo-a86f9fd664c2db803450f5c67ae79c6b3cc94545.zip
Stocking POs don't necessarily have SOs
-rw-r--r--servo/models/purchases.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/servo/models/purchases.py b/servo/models/purchases.py
index 636eab6..3a59a9b 100644
--- a/servo/models/purchases.py
+++ b/servo/models/purchases.py
@@ -283,13 +283,12 @@ class PurchaseOrderItem(AbstractOrderItem):
self.save()
def save(self, *args, **kwargs):
-
# The following four fields are used so much
# that we store them for fast access
if self.sales_order is None:
self.sales_order = self.purchase_order.sales_order
- if self.sales_order_ref == '':
+ if self.sales_order_ref == '' and self.sales_order:
self.sales_order_ref = self.sales_order.code
if self.purchase_order_ref == '':