此查询非常慢,在我们升级Django 1.8.7 =>之后无法运行1.11.13
q = WorkReport.objects.filter(
~Q(case__customer=session.integration.null_customer),
~Q(product = None) | ~Q(work_type__bill_as_product = None),
~Q(case = None),
~Q(case__casesync__is_closed = True),
employee__company=session.integration.company,
productreportonquotationsync=None,
productreportonordersync=None,productreportsync=None,
productreportoncaseasinvoicesync = None,
approved=True)