today = datetime.now().strftime('%Y%m%d')
subquery = session.query(GSCM_po.po).subquery()
items = session.query(Sales).filter(Sales.invoice_no == None,
Sales.cust_rcv_date != today,
Sales.billing_po.not_in(subquery)).all()
参考
https://stackoverflow.com/questions/38878897/how-to-make-a-subquery-in-sqlalchemy