mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 11:10:54 +00:00
Remove reliance on django-markdownx (#3231)
* Remove reliance on django-markdownx - We are now rendering notes on the client side using easymde - No longer any need to utilize the markdownx integration - Adds character limit for notes fields` * Adjust legacy migrations - remove references to markdownx * Fix bug for company notes field
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
# Generated by Django 2.2.9 on 2020-02-02 01:03
|
||||
|
||||
from django.db import migrations
|
||||
import markdownx.models
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@ -14,6 +13,6 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='stockitem',
|
||||
name='notes',
|
||||
field=markdownx.models.MarkdownxField(blank=True, help_text='Stock Item Notes'),
|
||||
field=models.TextField(blank=True, help_text='Stock Item Notes'),
|
||||
),
|
||||
]
|
||||
|
@ -1,7 +1,6 @@
|
||||
# Generated by Django 2.2.9 on 2020-02-06 12:13
|
||||
|
||||
from django.db import migrations
|
||||
import markdownx.models
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@ -14,6 +13,6 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='stockitem',
|
||||
name='notes',
|
||||
field=markdownx.models.MarkdownxField(blank=True, help_text='Stock Item Notes', null=True),
|
||||
field=models.TextField(blank=True, help_text='Stock Item Notes', null=True),
|
||||
),
|
||||
]
|
||||
|
@ -4,7 +4,6 @@ import InvenTree.fields
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
import markdownx.models
|
||||
import mptt.fields
|
||||
|
||||
|
||||
@ -56,7 +55,7 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='stockitem',
|
||||
name='notes',
|
||||
field=markdownx.models.MarkdownxField(blank=True, help_text='Stock Item Notes', null=True, verbose_name='Notes'),
|
||||
field=models.TextField(blank=True, help_text='Stock Item Notes', null=True, verbose_name='Notes'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='stockitem',
|
||||
|
19
InvenTree/stock/migrations/0077_alter_stockitem_notes.py
Normal file
19
InvenTree/stock/migrations/0077_alter_stockitem_notes.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Generated by Django 3.2.13 on 2022-06-20 07:28
|
||||
|
||||
import InvenTree.fields
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('stock', '0076_alter_stockitem_status'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='stockitem',
|
||||
name='notes',
|
||||
field=InvenTree.fields.InvenTreeNotesField(blank=True, help_text='Stock Item Notes', max_length=50000, null=True, verbose_name='Notes'),
|
||||
),
|
||||
]
|
@ -18,7 +18,6 @@ from django.urls import reverse
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from jinja2 import Template
|
||||
from markdownx.models import MarkdownxField
|
||||
from mptt.managers import TreeManager
|
||||
from mptt.models import MPTTModel, TreeForeignKey
|
||||
|
||||
@ -29,7 +28,8 @@ import InvenTree.tasks
|
||||
import label.models
|
||||
import report.models
|
||||
from company import models as CompanyModels
|
||||
from InvenTree.fields import InvenTreeModelMoneyField, InvenTreeURLField
|
||||
from InvenTree.fields import (InvenTreeModelMoneyField, InvenTreeNotesField,
|
||||
InvenTreeURLField)
|
||||
from InvenTree.models import InvenTreeAttachment, InvenTreeTree
|
||||
from InvenTree.serializers import extract_int
|
||||
from InvenTree.status_codes import StockHistoryCode, StockStatus
|
||||
@ -708,11 +708,7 @@ class StockItem(MetadataMixin, MPTTModel):
|
||||
choices=StockStatus.items(),
|
||||
validators=[MinValueValidator(0)])
|
||||
|
||||
notes = MarkdownxField(
|
||||
blank=True, null=True,
|
||||
verbose_name=_("Notes"),
|
||||
help_text=_('Stock Item Notes')
|
||||
)
|
||||
notes = InvenTreeNotesField(help_text=_('Stock Item Notes'))
|
||||
|
||||
purchase_price = InvenTreeModelMoneyField(
|
||||
max_digits=19,
|
||||
|
Reference in New Issue
Block a user