更新
This commit is contained in:
@@ -9,7 +9,7 @@ from math import ceil
|
||||
from typing import Any
|
||||
|
||||
from PySide6.QtCore import QDateTime, QModelIndex, QRectF, QSize, Qt
|
||||
from PySide6.QtGui import QColor, QFont, QIcon, QPainter, QPen, QPixmap, QTextDocument, QTextOption
|
||||
from PySide6.QtGui import QColor, QFont, QIcon, QPainter, QPen, QTextDocument, QTextOption
|
||||
from PySide6.QtWidgets import (
|
||||
QComboBox,
|
||||
QDateTimeEdit,
|
||||
@@ -398,7 +398,10 @@ def _order_warnings(row: Any) -> list[str]:
|
||||
return []
|
||||
herbs = get_value(source, "herbs", None)
|
||||
herbs = herbs if isinstance(herbs, (list, tuple)) else []
|
||||
names = [str(get_value(herb, "name", "") or "").strip() for herb in herbs]
|
||||
names = []
|
||||
for herb in herbs:
|
||||
raw_name = get_value(herb, "name", "")
|
||||
names.append(str("" if raw_name is None else raw_name).strip())
|
||||
names = [name for name in names if name]
|
||||
if not names:
|
||||
return ["请开方,当前处方药材为空白"]
|
||||
|
||||
Reference in New Issue
Block a user