Coverage for src/backend/InvenTree/company/migrations/0001_initial.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 17:47 +0000

1# Generated by Django 2.2 on 2019-05-20 12:04 

2 

3import company.models 

4import django.core.validators 

5from django.db import migrations, models 

6import django.db.models.deletion 

7 

8 

9class Migration(migrations.Migration): 

10 

11 initial = True 

12 

13 dependencies = [ 

14 ] 

15 

16 operations = [ 

17 migrations.CreateModel( 

18 name='Company', 

19 fields=[ 

20 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 

21 ('name', models.CharField(help_text='Company name', max_length=100, unique=True)), 

22 ('description', models.CharField(help_text='Description of the company', max_length=500)), 

23 ('website', models.URLField(blank=True, help_text='Company website URL')), 

24 ('address', models.CharField(blank=True, help_text='Company address', max_length=200)), 

25 ('phone', models.CharField(blank=True, help_text='Contact phone number', max_length=50)), 

26 ('email', models.EmailField(blank=True, help_text='Contact email address', max_length=254)), 

27 ('contact', models.CharField(blank=True, help_text='Point of contact', max_length=100)), 

28 ('URL', models.URLField(blank=True, help_text='Link to external company information')), 

29 ('image', models.ImageField(blank=True, max_length=255, null=True, upload_to=company.models.rename_company_image)), 

30 ('notes', models.TextField(blank=True)), 

31 ('is_customer', models.BooleanField(default=False, help_text='Do you sell items to this company?')), 

32 ('is_supplier', models.BooleanField(default=True, help_text='Do you purchase items from this company?')), 

33 ], 

34 options={ 

35 'verbose_name': 'Company', 

36 } 

37 ), 

38 migrations.CreateModel( 

39 name='Contact', 

40 fields=[ 

41 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 

42 ('name', models.CharField(max_length=100)), 

43 ('phone', models.CharField(blank=True, max_length=100)), 

44 ('email', models.EmailField(blank=True, max_length=254)), 

45 ('role', models.CharField(blank=True, max_length=100)), 

46 ], 

47 options={ 

48 'verbose_name': 'Contact', 

49 } 

50 ), 

51 migrations.CreateModel( 

52 name='SupplierPart', 

53 fields=[ 

54 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 

55 ('SKU', models.CharField(help_text='Supplier stock keeping unit', max_length=100)), 

56 ('manufacturer', models.CharField(blank=True, help_text='Manufacturer', max_length=100)), 

57 ('MPN', models.CharField(blank=True, help_text='Manufacturer part number', max_length=100)), 

58 ('URL', models.URLField(blank=True, help_text='URL for external supplier part link')), 

59 ('description', models.CharField(blank=True, help_text='Supplier part description', max_length=250)), 

60 ('note', models.CharField(blank=True, help_text='Notes', max_length=100)), 

61 ('base_cost', models.DecimalField(decimal_places=3, default=0, help_text='Minimum charge (e.g. stocking fee)', max_digits=10, validators=[django.core.validators.MinValueValidator(0)])), 

62 ('packaging', models.CharField(blank=True, help_text='Part packaging', max_length=50)), 

63 ('multiple', models.PositiveIntegerField(default=1, help_text='Order multiple', validators=[django.core.validators.MinValueValidator(1)])), 

64 ('minimum', models.PositiveIntegerField(default=1, help_text='Minimum order quantity (MOQ)', validators=[django.core.validators.MinValueValidator(1)])), 

65 ('lead_time', models.DurationField(blank=True, null=True)), 

66 ], 

67 options={ 

68 'db_table': 'part_supplierpart', 

69 'verbose_name': 'Supplier Part', 

70 }, 

71 ), 

72 migrations.CreateModel( 

73 name='SupplierPriceBreak', 

74 fields=[ 

75 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 

76 ('quantity', models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(1)])), 

77 ('cost', models.DecimalField(decimal_places=5, max_digits=10, validators=[django.core.validators.MinValueValidator(0)])), 

78 ('part', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pricebreaks', to='company.SupplierPart')), 

79 ], 

80 options={ 

81 'verbose_name': 'Supplier Price Break', 

82 'db_table': 'part_supplierpricebreak', 

83 }, 

84 ), 

85 ]