Можно ли сделать через Django ORM запросы UNION по нескольким таблицам и потом результат использовать для FROM как общую таблицу.

Делал так qs = q1.union(q2, q3, all=True) но у qs нельзя уже дальше применять filter

Вот такой запрос должен быть в итоге:

SELECT
    m.id
    ,m.count
    ,m.tp__code
    ,sco.name AS name
FROM (
    SELECT branch_id as id, 'contracts' as tp__code, count(*) AS count FROM d_parts GROUP BY branch_id
    UNION ALL
    SELECT branch_id as id, 'newparts' as tp__code, count(*) AS count FROM d_new_parts GROUP BY branch_id
    UNION ALL
    SELECT branch_id as id, 'tires' as tp__code, count(*) AS count FROM d_tires GROUP BY branch_id
    UNION ALL
    SELECT branch_id as id, 'wheels' as tp__code, count(*) AS count FROM d_wheels GROUP BY branch_id
) as m
INNER JOIN branch sbr ON sbr.branch_id = m.id
INNER JOIN company sco ON sco.company_id = sbr.company_id