📅  最后修改于: 2022-03-11 14:47:30.551000             🧑  作者: Mango
query = "select sum(s.amount_total) as total , s.partner_id,
c.name from sale_order as s inner join res_partner as c
on s.partner_id =c.id group by s.partner_id,c.name
order by total desc"
//this will return the sum of amount_total group by custmer name ,
//you need to put this value inside the self.env.cr.execute(query)