'This function returns an action that display invoices/refunds made for the given partners.'

def open_partner_history(self):

    action = self.env.ref('account.action_invoice_refund_out_tree').read()[0]
    action['domain'] = literal_eval(action['domain'])
    action['domain'].append(('partner_id', 'child_of', self.ids))
    return action
