Adding new tabs to admin views

Most views in admin support adding new tabs in admin through The Provides system.


To continue with this guide you should be familiar with the Addons

Example: Adding a new category tab from addon

As stated in The Provides system, the admin_category_form_part provide key can be used to add new tabs to the category view in admin.

Let’s say we want to create an addon named Category Addon that sets Category::status to CategoryStatus.INVISIBLE if the checkbox has been clicked. Makes sense right...


First, we have to create a simple Form for the field.

class AutomationForm(forms.Form):
    force_invisible = forms.BooleanField(label="Force invisible", default=False)


Then, we need a FormPart that will render the form within a given template.

class AutomationForm(forms.Form):
    force_invisible = forms.BooleanField(label="Force invisible", default=False)

class CategoryFormPart(FormPart):
    priority = 9
    name = "category_example_form"
    form = AutomationForm

    def get_form_defs(self):
        if not

        yield TemplatedFormDef(

    def form_valid(self, form):
        if in form.forms:
            if form[].cleaned_data.get("force_invisible", False):
                self.object.status = CategoryStatus.INVISIBLE


See FormPart for more information.

The Template

Now, lets add our template into our addons template folder defined in the CategoryFormPart: shuup/autoform/admin/autoform.jinja

{% from "shuup/admin/macros/general.jinja" import content_block %}
{% set magic_form = form["category_example_form"] %}

{% call content_block(_("Force"), icon="fa-magic") %}
    {{ bs3.render(magic_form) }}
{% endcall %}

The AppConfig

Next, we’ll add the admin_category_form_part definition to your provides ("category_tab_example.admin_module.form_parts.CategoryFormPart").

from shuup.apps import AppConfig

class CategoryAddonAppConfig(AppConfig):
    name = "category_addon"
    verbose_name = "Category Addon"
    label = "category_addon"

    provides = {
        "admin_category_form_part": [

Wrapping it all up

Adding new tabs to the admin is a simple and effective way of extending the functionality of your Shuup.

Tabs consist of three different items:

  • Form: you need a form to add functionality
  • FormSet: the “glue” between the Form and the template
  • the template for the form which shows the merchant what you are up to.

You can visit The Provides system to see which views are supported.