1
0
forked from erp-dev/erp

feat: added fields into shipment and support external order system

This commit is contained in:
2026-01-14 19:13:20 +08:00
parent cae0f8434e
commit 8846446ecf
5 changed files with 205 additions and 0 deletions

View File

@@ -132,6 +132,30 @@ python manage.py backfill_merchant <merchant_id>
---
### 8. Shipment 模型兼容外部遗留系统字段
为出货单与外部系统对接预留字段与模型(暂未接入业务逻辑/API
#### Shipment 新增字段/方法
- `status`:状态(待送货 / 已交付 / 已取消),默认「待送货」
- `cancelled_at`:取消时间(可空)
- `cancelled_by`:取消人(可空,绑定用户)
- `external_id`:外部订单号(可空,长度 120
- `external_finished_products`:关联多个“外部成品表”(一对多,外键在外部成品表侧)
- `cancel(operator)`:取消出货单时自动记录取消时间与操作者
#### 新增模型ExternalFinishedProduct外部成品表
- 字段:`style_name``num_of_rolls``created_at`(来自 ModelBase`created_by`
#### Migration
- `shipment/migrations/0004_add_external_finished_product_and_shipment_status.py`
- `shipment/migrations/0005_fix_shipment_external_finished_product_relation.py`修正关系方向Shipment 1→N ExternalFinishedProduct
#### 测试
- 运行 `api_v1.views.shipment.test_api`13 个测试通过
---
## 待办
---