This commit is contained in:
2026-01-26 21:00:36 +01:00
parent 985f4dc19d
commit 58b360ed6c

View File

@@ -206,10 +206,10 @@ class AutomationDocument(ModelSQL, ModelView, Workflow):
swr.wr = wr
ShipmentWR.save([swr])
doc.notes = (doc.notes or "") + f"Shipment found: {sh[0].number}\n"
logger.info("BL_NUMBER:%s",sh[0].bl_number)
t = Table('freight_booking_lots')
cursor = Transaction().connection.cursor()
cursor.execute(*t.select(
query = t.select(
t.BOOKING_NUMBER,
t.LOT_NUMBER,
t.LOT_NBR_BALES,
@@ -228,9 +228,12 @@ class AutomationDocument(ModelSQL, ModelView, Workflow):
t.SALE_CONTRACT_NUMBER,
t.SALE_DECLARATION_KEY,
where=(t.BOOKING_NUMBER == sh[0].bl_number)
))
)
cursor.execute(*query)
logger.info("QUERY:%s",*query)
rows = cursor.fetchall()
logger.info("ROWS:%s",rows)
if rows:
for row in rows:
#Purchase & Sale creation