'Add sales documents to main account page'

@http.route()
def account(self, **kw):

    response = super(website_account, self).account(**kw)
    partner = request.env.user.partner_id
    SaleOrder = request.env['sale.order']
    Invoice = request.env['account.invoice']
    quotation_count = SaleOrder.search_count([('message_partner_ids', 'child_of', [partner.commercial_partner_id.id]), ('state', 'in', ['sent', 'cancel'])])
    order_count = SaleOrder.search_count([('message_partner_ids', 'child_of', [partner.commercial_partner_id.id]), ('state', 'in', ['sale', 'done'])])
    invoice_count = Invoice.search_count([('type', 'in', ['out_invoice', 'out_refund']), ('message_partner_ids', 'child_of', [partner.commercial_partner_id.id]), ('state', 'in', ['open', 'paid', 'cancel'])])
    response.qcontext.update({'quotation_count': quotation_count, 'order_count': order_count, 'invoice_count': invoice_count})
    return response
