1
0
forked from erp-dev/erp

feat: added n-to-1 relation between sales_order_item and printing_job model

This commit is contained in:
2025-12-11 18:09:10 +08:00
parent 633031d7cb
commit 1a8c446365
30 changed files with 41736 additions and 40 deletions

View File

@@ -312,7 +312,7 @@ CELERY_BEAT_SCHEDULE = {
},
'mdy_product_sync': {
'task': 'api_v1.tasks.sync_mdy_products',
'schedule': crontab(hour='*/1', minute=0),
'schedule': crontab(minute='*/10'),
'kwargs': {
'page_size': MDY_SYNC_PAGE_SIZE,
'max_pages': MDY_SYNC_MAX_PAGES,
@@ -321,7 +321,7 @@ CELERY_BEAT_SCHEDULE = {
},
'mdy_customer_sync': {
'task': 'api_v1.tasks.sync_mdy_customers',
'schedule': crontab(hour='*/1', minute=0),
'schedule': crontab(hour='*/5', minute=0),
'kwargs': {
'page_size': MDY_SYNC_PAGE_SIZE,
'max_pages': MDY_SYNC_MAX_PAGES,

View File

@@ -24,6 +24,11 @@ from rest_framework_simplejwt.views import (
# TokenRefreshView,
)
# 自定义后台站点标题simpleui 也会读取)
admin.site.site_header = "宇问科技"
admin.site.site_title = "宇问科技"
admin.site.index_title = "管理后台"
class CustomTokenObtainPairView(TokenObtainPairView):
"""自定义登录视图"""

View File

@@ -226,6 +226,18 @@ def pick_product(fields: dict) -> Product:
从字段字典中提取产品信息
"""
data = {k: fields.get(v, '') for k, v in product_type_map.items()}
def _to_int(value):
if value in ('', None):
return None
try:
return int(value)
except (TypeError, ValueError):
return None
data['pieces'] = _to_int(data.get('pieces'))
data['segment_size'] = _to_int(data.get('segment_size'))
return Product(**data)