HI,
I have a model1(current code) with a button to create a new model named model.controle, I want to fill the id_controle by the id of the new created model. Any help. Thanks
id_controle = fields.Many2one('model.controle', strong='ID Controle')
@api.multi
def controle(self):
body = _("Dossier déplacé vers contrôle interne")
id_controle = ??
vals = {
'name': self.name,
'status_update': self.status_update,
'partner_id': self.partner_id.id,
}
self.env['model.controle'].sudo().create(vals)
self.message_post(body=body)
return self.write({'state': 'Controle', 'status_update': True})