Skip to content

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

Update title for stock and variants

Marcin Gębala60dccd9b85f0
diff --git a/saleor/dashboard/product/views.py b/saleor/dashboard/product/views.py
index df11d15422..86f6799174 100644
--- a/saleor/dashboard/product/views.py
+++ b/saleor/dashboard/product/views.py
@@ -96,10 +96,10 @@ def stock_edit(request, product_pk, stock_pk=None):
product = get_object_or_404(Product, pk=product_pk)
if stock_pk:
stock = get_object_or_404(Stock, pk=stock_pk)
- title = stock.variant
+ title = stock.variant.name
else:
stock = Stock()
- title = product
+ title = _('Add stock')
form = StockForm(request.POST or None, instance=stock, product=product)
if product.variants.exists():
if form.is_valid():
diff --git a/saleor/dashboard/templates/dashboard/product/stock_form.html b/saleor/dashboard/templates/dashboard/product/stock_form.html
index a85ab6268d..e2226a3060 100644
--- a/saleor/dashboard/templates/dashboard/product/stock_form.html
+++ b/saleor/dashboard/templates/dashboard/product/stock_form.html
@@ -9,6 +9,14 @@
{% block page_title %}{{ title }}{% endblock %}
+{% block breadcrumbs %}
+ <ul class="breadcrumbs breadcrumbs--with-menu">
+ <li><a href="{% url "dashboard:products" %}">{% trans "Products" %}</a></li>
+ <li><a href="{% url "dashboard:product-update" pk=product.pk %}"><i class="mdi-navigation-chevron-right"></i>{{ product }}</a></li>
+ <li><i class="mdi-navigation-chevron-right"></i> {{ title }}</li>
+ </ul>
+{% endblock %}
+
{% block content %}
<form method="post" id="product-form" enctype="multipart/form-data">
<div class="row">
diff --git a/saleor/dashboard/templates/dashboard/product/variant_form.html b/saleor/dashboard/templates/dashboard/product/variant_form.html
index 424469d212..678b3a0af6 100644
--- a/saleor/dashboard/templates/dashboard/product/variant_form.html
+++ b/saleor/dashboard/templates/dashboard/product/variant_form.html
@@ -9,6 +9,14 @@
{% block page_title %}{{ title }}{% endblock %}
+{% block breadcrumbs %}
+ <ul class="breadcrumbs breadcrumbs--with-menu">
+ <li><a href="{% url "dashboard:products" %}">{% trans "Products" %}</a></li>
+ <li><a href="{% url "dashboard:product-update" pk=product.pk %}"><i class="mdi-navigation-chevron-right"></i>{{ product }}</a></li>
+ <li><i class="mdi-navigation-chevron-right"></i> {{ title }}</li>
+ </ul>
+{% endblock %}
+
{% block content %}
<form method="post" id="variant-form" enctype="multipart/form-data">
<div class="row">