1
0
forked from erp-dev/erp

feat: added migrate for set id init value into 8000 of plate_order

This commit is contained in:
2025-11-20 13:01:44 +08:00
parent ad0b6a84d2
commit 6091280fdc
12 changed files with 931 additions and 606 deletions

View File

@@ -9,7 +9,7 @@ from . import models
class PlateOrderAdmin(admin.ModelAdmin):
list_display = (
'id',
'design_code',
'design_code_display',
'customer_name',
'style_name',
'plate_type',
@@ -47,7 +47,7 @@ class PlateOrderAdmin(admin.ModelAdmin):
'fields': ['customer', 'area', 'default_address', 'salesperson', 'merchandiser']
}),
('产品信息', {
'fields': ['style_name', 'fabric', 'width', 'production_method']
'fields': ['style_name', 'fabric', 'fabric_source', 'width', 'production_method']
}),
('开版信息', {
'fields': [
@@ -76,6 +76,10 @@ class PlateOrderAdmin(admin.ModelAdmin):
}),
]
@admin.display(description='设计编号')
def design_code_display(self, obj):
return obj.design_code or (str(obj.id) if obj.id else '-')
@admin.display(description='客户')
def customer_name(self, obj):
return obj.customer.name if obj.customer else '-'

View File

@@ -0,0 +1,23 @@
# Generated by Django 5.2.7 on 2025-11-20 02:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('printing', '0012_plateorder_process'),
]
operations = [
migrations.AddField(
model_name='plateorder',
name='fabric_source',
field=models.CharField(blank=True, max_length=100, null=True, verbose_name='布料来源'),
),
migrations.AlterField(
model_name='plateorder',
name='process',
field=models.IntegerField(default=2, verbose_name='关联流程'),
),
]

View File

@@ -0,0 +1,18 @@
# Generated by Django 5.2.7 on 2025-11-20 03:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('printing', '0013_plateorder_fabric_source_alter_plateorder_process'),
]
operations = [
migrations.RunSQL(
# 设置序列从 80000 开始(或你想要的任何值)
sql="SELECT setval('printing_plateorder_id_seq', 80000, false);",
reverse_sql="SELECT setval('printing_plateorder_id_seq', 1, false);"
),
]

View File

@@ -64,6 +64,7 @@ class PlateOrder(ModelBase):
# 产品信息
fabric = models.CharField(max_length=100, blank=True, null=True, verbose_name='布料')
fabric_source = models.CharField(max_length=100, blank=True, null=True, verbose_name='布料来源')
width = models.CharField(max_length=50, blank=True, null=True, verbose_name='幅宽')
style_name = models.CharField(max_length=100, blank=True, null=True, verbose_name='款号名称')

File diff suppressed because it is too large Load Diff