mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
Merge pull request #855 from SchrodingersGat/part-table
Add "IPN" column to part table
This commit is contained in:
commit
f563ac0dcb
@ -102,12 +102,14 @@ class InvenTreeTree(MPTTModel):
|
|||||||
name = models.CharField(
|
name = models.CharField(
|
||||||
blank=False,
|
blank=False,
|
||||||
max_length=100,
|
max_length=100,
|
||||||
validators=[validate_tree_name]
|
validators=[validate_tree_name],
|
||||||
|
help_text=_("Name"),
|
||||||
)
|
)
|
||||||
|
|
||||||
description = models.CharField(
|
description = models.CharField(
|
||||||
blank=False,
|
blank=True,
|
||||||
max_length=250
|
max_length=250,
|
||||||
|
help_text=_("Description (optional)")
|
||||||
)
|
)
|
||||||
|
|
||||||
# When a category is deleted, graft the children onto its parent
|
# When a category is deleted, graft the children onto its parent
|
||||||
|
24
InvenTree/part/migrations/0044_auto_20200605_0931.py
Normal file
24
InvenTree/part/migrations/0044_auto_20200605_0931.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Generated by Django 3.0.5 on 2020-06-05 09:31
|
||||||
|
|
||||||
|
import InvenTree.validators
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('part', '0043_auto_20200527_0005'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='partcategory',
|
||||||
|
name='description',
|
||||||
|
field=models.CharField(blank=True, help_text='Description', max_length=250),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='partcategory',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(help_text='Name', max_length=100, validators=[InvenTree.validators.validate_tree_name]),
|
||||||
|
),
|
||||||
|
]
|
18
InvenTree/part/migrations/0045_auto_20200605_0932.py
Normal file
18
InvenTree/part/migrations/0045_auto_20200605_0932.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.0.5 on 2020-06-05 09:32
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('part', '0044_auto_20200605_0931'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='partcategory',
|
||||||
|
name='description',
|
||||||
|
field=models.CharField(blank=True, help_text='Description (optional)', max_length=250),
|
||||||
|
),
|
||||||
|
]
|
24
InvenTree/stock/migrations/0046_auto_20200605_0931.py
Normal file
24
InvenTree/stock/migrations/0046_auto_20200605_0931.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Generated by Django 3.0.5 on 2020-06-05 09:31
|
||||||
|
|
||||||
|
import InvenTree.validators
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('stock', '0045_stockitem_customer'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='stocklocation',
|
||||||
|
name='description',
|
||||||
|
field=models.CharField(blank=True, help_text='Description', max_length=250),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='stocklocation',
|
||||||
|
name='name',
|
||||||
|
field=models.CharField(help_text='Name', max_length=100, validators=[InvenTree.validators.validate_tree_name]),
|
||||||
|
),
|
||||||
|
]
|
18
InvenTree/stock/migrations/0047_auto_20200605_0932.py
Normal file
18
InvenTree/stock/migrations/0047_auto_20200605_0932.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.0.5 on 2020-06-05 09:32
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('stock', '0046_auto_20200605_0931'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='stocklocation',
|
||||||
|
name='description',
|
||||||
|
field=models.CharField(blank=True, help_text='Description (optional)', max_length=250),
|
||||||
|
),
|
||||||
|
]
|
@ -95,6 +95,8 @@ function loadPartTable(table, url, options={}) {
|
|||||||
field: 'pk',
|
field: 'pk',
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
visible: false,
|
visible: false,
|
||||||
|
switchable: false,
|
||||||
|
searchable: false,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -103,9 +105,16 @@ function loadPartTable(table, url, options={}) {
|
|||||||
checkbox: true,
|
checkbox: true,
|
||||||
title: '{% trans 'Select' %}',
|
title: '{% trans 'Select' %}',
|
||||||
searchable: false,
|
searchable: false,
|
||||||
|
switchable: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
columns.push({
|
||||||
|
field: 'IPN',
|
||||||
|
title: 'IPN',
|
||||||
|
sortable: true,
|
||||||
|
}),
|
||||||
|
|
||||||
columns.push({
|
columns.push({
|
||||||
field: 'name',
|
field: 'name',
|
||||||
title: '{% trans 'Part' %}',
|
title: '{% trans 'Part' %}',
|
||||||
@ -231,6 +240,7 @@ function loadPartTable(table, url, options={}) {
|
|||||||
original: params,
|
original: params,
|
||||||
formatNoMatches: function() { return "{% trans "No parts found" %}"; },
|
formatNoMatches: function() { return "{% trans "No parts found" %}"; },
|
||||||
columns: columns,
|
columns: columns,
|
||||||
|
showColumns: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (options.buttons) {
|
if (options.buttons) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user