diff --git a/InvenTree/stock/forms.py b/InvenTree/stock/forms.py index 8145a17f89..5c84f3b4df 100644 --- a/InvenTree/stock/forms.py +++ b/InvenTree/stock/forms.py @@ -162,7 +162,6 @@ class EditStockItemForm(HelperForm): 'serial', 'batch', 'status', - 'notes', 'URL', 'delete_on_deplete', ] diff --git a/InvenTree/stock/migrations/0018_auto_20200202_0103.py b/InvenTree/stock/migrations/0018_auto_20200202_0103.py new file mode 100644 index 0000000000..9cf90ceebe --- /dev/null +++ b/InvenTree/stock/migrations/0018_auto_20200202_0103.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.9 on 2020-02-02 01:03 + +from django.db import migrations +import markdownx.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('stock', '0017_auto_20191118_2311'), + ] + + operations = [ + migrations.AlterField( + model_name='stockitem', + name='notes', + field=markdownx.models.MarkdownxField(blank=True, help_text='Stock Item Notes'), + ), + ] diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index 1122d4326c..d0bc23f14d 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -16,6 +16,8 @@ from django.contrib.auth.models import User from django.db.models.signals import pre_delete from django.dispatch import receiver +from markdownx.models import MarkdownxField + from mptt.models import TreeForeignKey from decimal import Decimal, InvalidOperation @@ -358,7 +360,7 @@ class StockItem(models.Model): choices=StockStatus.items(), validators=[MinValueValidator(0)]) - notes = models.CharField(max_length=250, blank=True, help_text=_('Stock Item Notes')) + notes = MarkdownxField(blank=True, help_text=_('Stock Item Notes')) # If stock item is incoming, an (optional) ETA field # expected_arrival = models.DateField(null=True, blank=True) diff --git a/InvenTree/stock/templates/stock/item.html b/InvenTree/stock/templates/stock/item.html index f6494edd93..38c1d7dcac 100644 --- a/InvenTree/stock/templates/stock/item.html +++ b/InvenTree/stock/templates/stock/item.html @@ -1,160 +1,12 @@ -{% extends "stock/stock_app_base.html" %} +{% extends "stock/item_base.html" %} + {% load static %} {% load inventree_extras %} {% load i18n %} -{% block content %} -
{{ item.part.full_name}} # {{ item.serial }}
- {% else %} -{{ item.quantity }} × {{ item.part.full_name }}
- {% endif %} --
Part | -- {% include "hover_image.html" with image=item.part.image hover=True %} - {{ item.part.full_name }} - | -|
{% trans "Belongs To" %} | -{{ item.belongs_to }} | -|
{% trans "Location" %} | -{{ item.location.name }} | -|
{% trans "Serial Number" %} | -{{ item.serial }} | -|
{% trans "Quantity" %} | -{% decimal item.quantity %} {% if item.part.units %}{{ item.part.units }}{% endif %} | -|
{% trans "Batch" %} | -{{ item.batch }} | -|
{% trans "Build" %} | -{{ item.build }} | -|
{% trans "Purchase Order" %} | -{{ item.purchase_order }} | -|
{% trans "Customer" %} | -{{ item.customer.name }} | -|
{% trans "URL" %} | -{{ item.URL }} | -|
{% trans "Supplier" %} | -{{ item.supplier_part.supplier.name }} | -|
{% trans "Supplier Part" %} | -{{ item.supplier_part.SKU }} | -|
{% trans "Last Updated" %} | -{{ item.updated }} | -|
{% trans "Last Stocktake" %} | - {% if item.stocktake_date %} -{{ item.stocktake_date }} {{ item.stocktake_user }} | - {% else %} -{% trans "No stocktake performed" %} | - {% endif %} -
{% trans "Status" %} | -{{ item.get_status_display }} | -|
{% trans "Notes" %} | -{{ item.notes }} | -
{{ item.part.full_name}} # {{ item.serial }}
+ {% else %} +{{ item.quantity }} × {{ item.part.full_name }}
+ {% endif %} ++
Part | ++ {% include "hover_image.html" with image=item.part.image hover=True %} + {{ item.part.full_name }} + | +|
{% trans "Belongs To" %} | +{{ item.belongs_to }} | +|
{% trans "Location" %} | +{{ item.location.name }} | +|
{% trans "Serial Number" %} | +{{ item.serial }} | +|
{% trans "Quantity" %} | +{% decimal item.quantity %} {% if item.part.units %}{{ item.part.units }}{% endif %} | +|
{% trans "Batch" %} | +{{ item.batch }} | +|
{% trans "Build" %} | +{{ item.build }} | +|
{% trans "Purchase Order" %} | +{{ item.purchase_order }} | +|
{% trans "Customer" %} | +{{ item.customer.name }} | +|
{% trans "URL" %} | +{{ item.URL }} | +|
{% trans "Supplier" %} | +{{ item.supplier_part.supplier.name }} | +|
{% trans "Supplier Part" %} | +{{ item.supplier_part.SKU }} | +|
{% trans "Last Updated" %} | +{{ item.updated }} | +|
{% trans "Last Stocktake" %} | + {% if item.stocktake_date %} +{{ item.stocktake_date }} {{ item.stocktake_user }} | + {% else %} +{% trans "No stocktake performed" %} | + {% endif %} +
{% trans "Status" %} | +{{ item.get_status_display }} | +