from netforce.model import Model, fields, get_model class AccountPayment(Model): _inherit="account.payment" def run_report(self,ids,context={}): obj=self.browse(ids)[0] hd_case_id=obj.related_id.id hd_case=get_model("clinic.hd.case").browse(hd_case_id) # TODO # set payment_id on hd case # send to action print form payment hd_case.write({ 'payment_id': obj.id, }) return { 'next': { 'name': 'report_clinic_payment_form', 'refer_id': hd_case_id, 'payment_id': obj.id, }, } AccountPayment.register()