how i get class site_survey(models.Model): id in another class class site_survey_cancellation(models.TransientModel):
code is below
class site_survey(models.Model):
_name = 'site.survey'
name = fields.Char(readonly=True)
@api.multi
def action_cancel(self):
# self.state = 'cancel'
self._context
return {
'name': ('Cancel Reason'),
'view_type': 'form',
'view_mode': 'form',
'res_model': 'site.survey.cancellation',
'view_id': False,
'type': 'ir.actions.act_window',
'target': 'new',
'res_id':self._context
}
class site_survey_cancellation(models.TransientModel):
_name = 'site.survey.cancellation'
cancel_note = fields.Char("Cancel Reason")
site_survey_id = ??????