items2 = items.groupby('order_id', as_index=False)['sum'].sum()
res = pd.merge(orders, items2, left_on='id', right_on='order_id')[['date',
    'sum', 'sum_delivery']]
res['sum2'] = res['sum'] + res['sum_delivery']
res.index = pd.to_datetime(res.date)
tmpdf = res.groupby(pd.TimeGrouper('M')).sum()[['sum2']]
How to aggregate and sum items by month?