From d145ce5f6d3a1b5813dc641f8fd8c45d4bd30339 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 25 Jul 2018 12:46:51 -0500 Subject: [PATCH] Assign purchase to new receiving batch via uuid instead of object ref the latter was apparently causing session flush and would create the "dummy" batch in addition to the "real" one... --- tailbone/views/purchasing/receiving.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tailbone/views/purchasing/receiving.py b/tailbone/views/purchasing/receiving.py index c27f3d78..b6e24dd8 100644 --- a/tailbone/views/purchasing/receiving.py +++ b/tailbone/views/purchasing/receiving.py @@ -642,11 +642,11 @@ class ReceivingBatchView(PurchasingBatchView): """ purchase = self.get_purchase(po_form.validated[self.purchase_order_fieldname]) if isinstance(purchase, model.Purchase): - batch.purchase = purchase + batch.purchase_uuid = purchase.uuid department = self.department_for_purchase(purchase) if department: - batch.department = department + batch.department_uuid = department.uuid def configure_mobile_form(self, f): super(ReceivingBatchView, self).configure_mobile_form(f)