This commit is contained in:
Oliver Walters 2019-04-17 00:21:11 +10:00
parent 5cd837be07
commit a3b544e2a4
3 changed files with 21 additions and 2 deletions

View File

@ -0,0 +1,19 @@
# Generated by Django 2.2 on 2019-04-16 14:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('part', '0008_auto_20190417_0013'),
]
operations = [
migrations.AlterField(
model_name='supplierpart',
name='part',
field=models.ForeignKey(limit_choices_to={'purchaseable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='supplier_parts', to='part.Part'),
),
]

View File

@ -459,7 +459,7 @@ class SupplierPart(models.Model):
# The part will have a field 'supplier_parts' which links to the supplier part options
part = models.ForeignKey(Part, on_delete=models.CASCADE,
related_name='supplier_parts',
limit_choices_to={'purchasable': True},
limit_choices_to={'purchaseable': True},
)
supplier = models.ForeignKey(Company, on_delete=models.CASCADE,

View File

@ -341,7 +341,7 @@ class SupplierPartCreate(AjaxCreateView):
form_class = EditSupplierPartForm
ajax_template_name = 'modal_form.html'
ajax_form_title = 'Create new Supplier Part'
template_name = 'company/partcreate.html'
#template_name = 'company/partcreate.html'
context_object_name = 'part'
def get_initial(self):