forked from erp-dev/erp
feat: added type field into warehouse model
This commit is contained in:
@@ -34,17 +34,18 @@ class PlateOrderAdmin(admin.ModelAdmin):
|
||||
'customer__name',
|
||||
'salesperson__name',
|
||||
'merchandiser__name',
|
||||
'designer__name',
|
||||
)
|
||||
readonly_fields = ('progress_display', 'status_display')
|
||||
actions = ['advance_to_next_state_action', 'step_back_one_state_action', 'reset_progress_action']
|
||||
autocomplete_fields = ['customer', 'salesperson', 'merchandiser']
|
||||
autocomplete_fields = ['customer', 'salesperson', 'merchandiser', 'designer']
|
||||
|
||||
fieldsets = [
|
||||
('基本信息', {
|
||||
'fields': ['design_code', 'plate_type', 'plate_date', 'urgency_level']
|
||||
}),
|
||||
('客户信息', {
|
||||
'fields': ['customer', 'area', 'default_address', 'salesperson', 'merchandiser']
|
||||
'fields': ['customer', 'area', 'default_address', 'salesperson', 'merchandiser', 'designer']
|
||||
}),
|
||||
('产品信息', {
|
||||
'fields': ['style_name', 'fabric', 'fabric_source', 'width', 'production_method']
|
||||
|
||||
20
printing/migrations/0015_plateorder_designer.py
Normal file
20
printing/migrations/0015_plateorder_designer.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Generated by Django 5.2.7 on 2025-11-20 06:48
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('basic_info', '0011_remove_employee_job_type_employeetype_and_more'),
|
||||
('printing', '0014_auto_20251120_1144'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='plateorder',
|
||||
name='designer',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='plate_orders_as_designer', to='basic_info.employee', verbose_name='设计师'),
|
||||
),
|
||||
]
|
||||
@@ -40,6 +40,14 @@ class PlateOrder(ModelBase):
|
||||
related_name='plate_orders_as_merchandiser',
|
||||
verbose_name='跟单员'
|
||||
)
|
||||
designer = models.ForeignKey(
|
||||
basic_models.Employee,
|
||||
on_delete=models.PROTECT,
|
||||
null=True,
|
||||
blank=True,
|
||||
related_name='plate_orders_as_designer',
|
||||
verbose_name='设计师'
|
||||
)
|
||||
|
||||
# 客户和地址信息
|
||||
customer = models.ForeignKey(
|
||||
|
||||
@@ -39,7 +39,6 @@ class PlateOrderModelTestCase(TestCase):
|
||||
merchant=self.merchant,
|
||||
name='销售员',
|
||||
mobile='13800138000',
|
||||
job_type=basic_models.EmployeeTypeEnum.PRINTER,
|
||||
status=basic_models.EmployeeStatusEnum.ACTIVE
|
||||
)
|
||||
|
||||
@@ -47,7 +46,6 @@ class PlateOrderModelTestCase(TestCase):
|
||||
merchant=self.merchant,
|
||||
name='跟单员',
|
||||
mobile='13800138001',
|
||||
job_type=basic_models.EmployeeTypeEnum.ROLLING,
|
||||
status=basic_models.EmployeeStatusEnum.ACTIVE
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user