Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add refund reasons to sample DB (#18419)

Anna Szczęchc91ffe084348
diff --git a/saleor/core/management/commands/populatedb.py b/saleor/core/management/commands/populatedb.py
index a2535119a7..748d180794 100644
--- a/saleor/core/management/commands/populatedb.py
+++ b/saleor/core/management/commands/populatedb.py
@@ -22,6 +22,7 @@ from ...utils.random_data import (
create_permission_groups,
create_products_by_schema,
create_shipping_zones,
+ create_site_settings,
create_staffs,
create_tax_classes,
create_users,
@@ -118,6 +119,8 @@ class Command(BaseCommand):
self.stdout.write(msg)
for msg in create_checkout_with_same_variant_in_multiple_lines():
self.stdout.write(msg)
+ for msg in create_site_settings():
+ self.stdout.write(msg)
if options["createsuperuser"]:
credentials = {
diff --git a/saleor/core/utils/random_data.py b/saleor/core/utils/random_data.py
index 2ed8dc79a6..a21a894eaa 100644
--- a/saleor/core/utils/random_data.py
+++ b/saleor/core/utils/random_data.py
@@ -103,6 +103,7 @@ from ...shipping.models import (
ShippingMethodType,
ShippingZone,
)
+from ...site.models import SiteSettings
from ...tax.models import TaxClass, TaxConfiguration
from ...tax.utils import get_tax_class_kwargs_for_order_line
from ...warehouse import WarehouseClickAndCollectOption
@@ -1789,6 +1790,18 @@ def create_pages():
yield f"Page {page.slug} created"
+def create_site_settings():
+ types = get_sample_data()
+ data = types["site.sitesettings"]
+
+ for settings_item in data:
+ pk = settings_item["pk"]
+ defaults = dict(settings_item["fields"])
+
+ SiteSettings.objects.update_or_create(pk=pk, defaults=defaults)
+ yield "Site settings updated"
+
+
def create_menus():
types = get_sample_data()
diff --git a/saleor/static/populatedb_data.json b/saleor/static/populatedb_data.json
index 8f82a2e98c..ea5d5695c5 100644
--- a/saleor/static/populatedb_data.json
+++ b/saleor/static/populatedb_data.json
@@ -9567,11 +9567,11 @@
"model": "site.sitesettings",
"pk": 1,
"fields": {
- "site": 1,
+ "site_id": 1,
"header_text": "Test Saleor - a sample shop!",
"description": "",
- "top_menu": 1,
- "bottom_menu": 2,
+ "top_menu_id": 1,
+ "bottom_menu_id": 2,
"include_taxes_in_prices": true,
"display_gross_prices": true,
"charge_taxes_on_shipping": true,
@@ -9580,7 +9580,7 @@
"automatic_fulfillment_digital_products": false,
"default_digital_max_downloads": null,
"default_digital_url_valid_days": null,
- "company_address": null,
+ "company_address_id": null,
"default_mail_sender_name": "",
"default_mail_sender_address": null,
"customer_set_password_url": null,
@@ -9593,7 +9593,8 @@
"gift_card_expiry_type": "never_expire",
"gift_card_expiry_period_type": null,
"gift_card_expiry_period": null,
- "automatically_fulfill_non_shippable_gift_card": true
+ "automatically_fulfill_non_shippable_gift_card": true,
+ "refund_reason_reference_type_id": 6
}
},
{
@@ -9733,6 +9734,90 @@
"created_at": "2025-10-14T06:38:16Z"
}
},
+ {
+ "model": "page.page",
+ "pk": 7,
+ "fields": {
+ "published_at": "2025-11-03T00:00:00Z",
+ "is_published": true,
+ "private_metadata": {},
+ "metadata": {},
+ "seo_title": "",
+ "seo_description": "",
+ "slug": "damaged-item",
+ "title": "Damaged Item",
+ "page_type": 6,
+ "content": {
+ "time": 1762137600000,
+ "blocks": [],
+ "version": "2.30.7"
+ },
+ "created_at": "2025-11-03T00:00:00Z"
+ }
+ },
+ {
+ "model": "page.page",
+ "pk": 8,
+ "fields": {
+ "published_at": "2025-11-03T00:00:00Z",
+ "is_published": true,
+ "private_metadata": {},
+ "metadata": {},
+ "seo_title": "",
+ "seo_description": "",
+ "slug": "package-lost",
+ "title": "Package Lost",
+ "page_type": 6,
+ "content": {
+ "time": 1762137600000,
+ "blocks": [],
+ "version": "2.30.7"
+ },
+ "created_at": "2025-11-03T00:00:00Z"
+ }
+ },
+ {
+ "model": "page.page",
+ "pk": 9,
+ "fields": {
+ "published_at": "2025-11-03T00:00:00Z",
+ "is_published": true,
+ "private_metadata": {},
+ "metadata": {},
+ "seo_title": "",
+ "seo_description": "",
+ "slug": "incorrect-address",
+ "title": "Incorrect Address",
+ "page_type": 6,
+ "content": {
+ "time": 1762137600000,
+ "blocks": [],
+ "version": "2.30.7"
+ },
+ "created_at": "2025-11-03T00:00:00Z"
+ }
+ },
+ {
+ "model": "page.page",
+ "pk": 10,
+ "fields": {
+ "published_at": "2025-11-03T00:00:00Z",
+ "is_published": true,
+ "private_metadata": {},
+ "metadata": {},
+ "seo_title": "",
+ "seo_description": "",
+ "slug": "package-not-picked-up-by-customer",
+ "title": "Package Not Picked Up by Customer",
+ "page_type": 6,
+ "content": {
+ "time": 1762137600000,
+ "blocks": [],
+ "version": "2.30.7"
+ },
+ "created_at": "2025-11-03T00:00:00Z"
+ }
+ },
{
"model": "page.pagetype",
"pk": 4,
@@ -9753,6 +9838,16 @@
"slug": "brand"
}
},
+ {
+ "model": "page.pagetype",
+ "pk": 6,
+ "fields": {
+ "private_metadata": {},
+ "metadata": {},
+ "name": "Refund Reason",
+ "slug": "refund-reason"
+ }
+ },
{
"model": "warehouse.warehouse",
"pk": "43bea6af-8cea-40cd-9760-cab77416f207",