2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Custom URL validators for more fields

This commit is contained in:
Oliver Walters
2019-09-14 00:08:49 +10:00
parent 4ac8353099
commit 70e07470db
7 changed files with 80 additions and 7 deletions

View File

@ -0,0 +1,24 @@
# Generated by Django 2.2.5 on 2019-09-13 14:07
import InvenTree.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('stock', '0014_auto_20190908_0918'),
]
operations = [
migrations.AlterField(
model_name='stockitem',
name='URL',
field=InvenTree.fields.InvenTreeURLField(blank=True, max_length=125),
),
migrations.AlterField(
model_name='stockitemtracking',
name='URL',
field=InvenTree.fields.InvenTreeURLField(blank=True, help_text='Link to external page for further information'),
),
]

View File

@ -23,6 +23,7 @@ from InvenTree import helpers
from InvenTree.status_codes import StockStatus
from InvenTree.models import InvenTreeTree
from InvenTree.fields import InvenTreeURLField
from part.models import Part
@ -308,7 +309,7 @@ class StockItem(models.Model):
serial = models.PositiveIntegerField(blank=True, null=True,
help_text='Serial number for this item')
URL = models.URLField(max_length=125, blank=True)
URL = InvenTreeURLField(max_length=125, blank=True)
batch = models.CharField(max_length=100, blank=True, null=True,
help_text='Batch code for this stock item')
@ -715,7 +716,7 @@ class StockItemTracking(models.Model):
notes = models.CharField(blank=True, max_length=512, help_text='Entry notes')
URL = models.URLField(blank=True, help_text='Link to external page for further information')
URL = InvenTreeURLField(blank=True, help_text='Link to external page for further information')
user = models.ForeignKey(User, on_delete=models.SET_NULL, blank=True, null=True)