Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add status to fulfillemnt
Anna Siwikac6db2f10d7d
diff --git a/saleor/order/__init__.py b/saleor/order/__init__.pyindex 6bb06551b3..d85f71549d 100644--- a/saleor/order/__init__.py+++ b/saleor/order/__init__.py@@ -23,3 +23,12 @@ class OrderStatus:'order status', 'Partially fulfilled')),(FULFILLED, pgettext_lazy('order status', 'Fulfilled')),(CANCELED, pgettext_lazy('order status', 'Canceled'))]+++class FulfillmentStatus:+ FULFILLED = 'fulfilled'+ CANCELED = 'canceled'++ CHOICES = [+ (FULFILLED, pgettext_lazy('order status', 'Fulfilled')),+ (CANCELED, pgettext_lazy('order status', 'Canceled'))]diff --git a/saleor/order/migrations/0035_auto_20180222_0318.py b/saleor/order/migrations/0035_auto_20180222_0345.pysimilarity index 83%rename from saleor/order/migrations/0035_auto_20180222_0318.pyrename to saleor/order/migrations/0035_auto_20180222_0345.pyindex 2680150e7b..1477deb4b8 100644--- a/saleor/order/migrations/0035_auto_20180222_0318.py+++ b/saleor/order/migrations/0035_auto_20180222_0345.py@@ -1,4 +1,4 @@-# Generated by Django 2.0.2 on 2018-02-22 09:18+# Generated by Django 2.0.2 on 2018-02-22 09:45from django.db import migrations, modelsimport django.db.models.deletion@@ -24,6 +24,11 @@ class Migration(migrations.Migration):name='fulfillment_order',field=models.PositiveIntegerField(editable=False, null=True),),+ migrations.AddField(+ model_name='fulfillment',+ name='status',+ field=models.CharField(choices=[('fulfilled', 'Fulfilled'), ('canceled', 'Canceled')], default='fulfilled', max_length=32),+ ),migrations.AddField(model_name='order',name='shipping_method_name',diff --git a/saleor/order/models.py b/saleor/order/models.pyindex 8d9f383fd2..ab19ffd80b 100644--- a/saleor/order/models.py+++ b/saleor/order/models.py@@ -13,7 +13,7 @@ from payments import PaymentStatus, PurchasedItemfrom payments.models import BasePaymentfrom prices import Money, TaxedMoney-from . import OrderStatus+from . import FulfillmentStatus, OrderStatusfrom ..account.models import Addressfrom ..core.utils import ZERO_TAXED_MONEY, build_absolute_urifrom ..discount.models import Voucher@@ -203,6 +203,9 @@ class Fulfillment(models.Model):order = models.ForeignKey(Order, related_name='fulfillments', editable=False,on_delete=models.CASCADE)+ status = models.CharField(+ max_length=32, default=FulfillmentStatus.FULFILLED,+ choices=FulfillmentStatus.CHOICES)tracking_number = models.CharField(max_length=255, default='', blank=True)shipping_date = models.DateTimeField(default=now, editable=False)diff --git a/templates/dashboard/order/detail.html b/templates/dashboard/order/detail.htmlindex 3de454b37c..5d51e1b827 100644--- a/templates/dashboard/order/detail.html+++ b/templates/dashboard/order/detail.html@@ -411,6 +411,7 @@Fulfillment #{{ fulfillment }}{% endblocktrans %}</h5>+ {% render_status fulfillment.status fulfillment.get_status_display %}</div><div class="data-table-container"><table class="bordered highlight responsive data-table">