aboutsummaryrefslogtreecommitdiffstats
path: root/servo/views
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-10-08 10:49:01 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-10-08 10:49:01 +0300
commitba1315d8a611f1b891cfd6610fbd053077357cb7 (patch)
tree23988641efd2fefaf9af4cbe3b2f26a143bc6558 /servo/views
parent2a7251afa0438b1472c66932a4c22d378ae15c28 (diff)
downloadServo-ba1315d8a611f1b891cfd6610fbd053077357cb7.tar.gz
Servo-ba1315d8a611f1b891cfd6610fbd053077357cb7.tar.bz2
Servo-ba1315d8a611f1b891cfd6610fbd053077357cb7.zip
Add Dispatch & Close
Diffstat (limited to 'servo/views')
-rw-r--r--servo/views/invoices.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/servo/views/invoices.py b/servo/views/invoices.py
index 2fb7b26..6b77c8b 100644
--- a/servo/views/invoices.py
+++ b/servo/views/invoices.py
@@ -159,6 +159,11 @@ def create_invoice(request, order_id=None, numbers=None):
messages.success(request, _(u'Order %s dispatched') % order.code)
except Exception as e:
messages.error(request, e)
+
+ if form.cleaned_data.get('close'):
+ order.close(request.user)
+ messages.success(request, _(u'Order %s closed') % order.code)
+
return redirect(order)
else:
messages.error(request, form.errors)