重新创建sql view
select
c.id as x_id,
b.sequence as x_sequence,
c.name as x_employee_name,
b.start_date as x_start_date,
h.name as x_name,
b.end_date as x_end_date,
b.name as x_expense_name,
d.name as x_product_category_name,
e.name as x_sub_category_name,
f.name as x_project_name,
g.cost_center as x_expense_center,
b.state as x_state,
b.last_approve_date x_latest_approve_date,
sum(a.unit_amount) as x_unit_amount,
a.description as x_description
from hr_expense_expense b
left join hr_expense_line a
on b.id=a.expense_id
left join hr_employee c on c.id=b.employee_id
left join product_expense d on d.id=a.product_category_id
left join product_expense e on a.product_id=e.id
left join project_project f on b.project_id = f.id
left join cost_center g on b.employee_cost_center = g.id
left join hr_expense_category h on b.expense_type=h.id
where b.state='done'
group by x_latest_approve_date,x_id,x_name,x_product_category_name,x_sub_category_name,x_project_name,x_expense_center,x_state,x_sequence,x_employee_name,x_start_date,x_end_date,x_description,x_expense_name
order by x_start_date desc