diff --git a/modules/automation/automation.py b/modules/automation/automation.py index 40fdebc..b451c71 100644 --- a/modules/automation/automation.py +++ b/modules/automation/automation.py @@ -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