Hi,
How to change below code to old api ................
res = self.env.ref('account.action_account_payments')? (not like odoo8 api before it like cr,uid,)
res = res.read(cr,uid,ids)[0]
res['domain'] = str([('id','in',[pay_id.id])])
data.payment_id = pay_id.id
return res