feat: material增加字段
This commit is contained in:
parent
0cd2802b04
commit
37d3c29ab2
|
@ -0,0 +1,24 @@
|
||||||
|
# Generated by Django 3.2.12 on 2023-09-22 08:01
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('mtm', '0010_auto_20230921_1626'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='material',
|
||||||
|
name='parent',
|
||||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='mtm.material', verbose_name='父物料'),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='material',
|
||||||
|
name='process',
|
||||||
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='mtm.process', verbose_name='所在工序'),
|
||||||
|
),
|
||||||
|
]
|
|
@ -1,6 +1,17 @@
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from apps.system.models import CommonAModel, Dictionary, CommonBModel, CommonADModel, File, BaseModel
|
from apps.system.models import CommonAModel, Dictionary, CommonBModel, CommonADModel, File, BaseModel
|
||||||
|
|
||||||
|
class Process(CommonBModel):
|
||||||
|
"""
|
||||||
|
工序 belong_dept为所在车间
|
||||||
|
"""
|
||||||
|
name = models.CharField('工序名称', max_length=100)
|
||||||
|
cate = models.CharField('大类', max_length=10, default='')
|
||||||
|
sort = models.PositiveSmallIntegerField('排序', default=1)
|
||||||
|
instruction = models.ForeignKey(File, verbose_name='指导书', on_delete=models.SET_NULL, null=True, blank=True)
|
||||||
|
instruction_content = models.TextField('指导书内容', null=True, blank=True)
|
||||||
|
|
||||||
|
|
||||||
# Create your models here.
|
# Create your models here.
|
||||||
class Material(CommonAModel):
|
class Material(CommonAModel):
|
||||||
MA_TYPE_BASE = 0
|
MA_TYPE_BASE = 0
|
||||||
|
@ -32,6 +43,8 @@ class Material(CommonAModel):
|
||||||
unit = models.CharField('基准计量单位', default='个', max_length=10)
|
unit = models.CharField('基准计量单位', default='个', max_length=10)
|
||||||
count = models.PositiveIntegerField('物料库存总数', default=0)
|
count = models.PositiveIntegerField('物料库存总数', default=0)
|
||||||
count_safe = models.PositiveIntegerField('安全库存总数', null=True, blank=True)
|
count_safe = models.PositiveIntegerField('安全库存总数', null=True, blank=True)
|
||||||
|
process = models.ForeignKey(Process, verbose_name='所在工序', on_delete=models.CASCADE, null=True, blank=True)
|
||||||
|
parent = models.ForeignKey('self', null=True, blank=True, on_delete=models.SET_NULL, verbose_name='父物料')
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = '物料表'
|
verbose_name = '物料表'
|
||||||
|
@ -97,18 +110,6 @@ class Goal(CommonADModel):
|
||||||
unique_together = ("mgroup", "year", "goal_cate")
|
unique_together = ("mgroup", "year", "goal_cate")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Process(CommonBModel):
|
|
||||||
"""
|
|
||||||
工序 belong_dept为所在车间
|
|
||||||
"""
|
|
||||||
name = models.CharField('工序名称', max_length=100)
|
|
||||||
cate = models.CharField('大类', max_length=10, default='')
|
|
||||||
sort = models.PositiveSmallIntegerField('排序', default=1)
|
|
||||||
instruction = models.ForeignKey(File, verbose_name='指导书', on_delete=models.SET_NULL, null=True, blank=True)
|
|
||||||
instruction_content = models.TextField('指导书内容', null=True, blank=True)
|
|
||||||
|
|
||||||
|
|
||||||
class Route(CommonAModel):
|
class Route(CommonAModel):
|
||||||
"""
|
"""
|
||||||
工艺路线
|
工艺路线
|
||||||
|
|
Loading…
Reference in New Issue