Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Introduce metadata (private and public) to Fulfilment model
Mira Szewczyk05e02b8210fa
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c9b3e0e75d..bc3d6c6222 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -102,6 +102,7 @@ All notable, unreleased changes to this project will be documented in this file.- Added the possibility to customize the sender address and name from the dashboard - #4820 by @NyanKiyoshi- Add customer set password url to Site settings - #4863 by @fowczarek- Add Fulfilment metadata - # @szewczykmira+- Add Fulfillment metadata - # @szewczykmira## 2.8.0diff --git a/saleor/order/migrations/0076_auto_20191018_0554.py b/saleor/order/migrations/0076_auto_20191018_0554.pynew file mode 100644index 0000000000..f38d7be12c--- /dev/null+++ b/saleor/order/migrations/0076_auto_20191018_0554.py@@ -0,0 +1,34 @@+# Generated by Django 2.2.6 on 2019-10-18 10:54++import django.contrib.postgres.fields.jsonb+from django.db import migrations++import saleor.core.utils.json_serializer+++class Migration(migrations.Migration):++ dependencies = [("order", "0075_auto_20191006_1433")]++ operations = [+ migrations.AddField(+ model_name="fulfillment",+ name="meta",+ field=django.contrib.postgres.fields.jsonb.JSONField(+ blank=True,+ default=dict,+ encoder=saleor.core.utils.json_serializer.CustomJsonEncoder,+ null=True,+ ),+ ),+ migrations.AddField(+ model_name="fulfillment",+ name="private_meta",+ field=django.contrib.postgres.fields.jsonb.JSONField(+ blank=True,+ default=dict,+ encoder=saleor.core.utils.json_serializer.CustomJsonEncoder,+ null=True,+ ),+ ),+ ]diff --git a/saleor/order/models.py b/saleor/order/models.pyindex 986bbb8074..bc7b4b042b 100644--- a/saleor/order/models.py+++ b/saleor/order/models.py@@ -429,7 +429,7 @@ class OrderLine(models.Model):return is_digital and has_digital-class Fulfillment(models.Model):+class Fulfillment(ModelWithMetadata):fulfillment_order = models.PositiveIntegerField(editable=False)order = models.ForeignKey(Order, related_name="fulfillments", editable=False, on_delete=models.CASCADE