I wrote the following code to check if stage_id does not have a record, then stage_id.fold = True, where did I go wrong, please help, thanks
@api.onchange('stage_id')
def _onchange_stage_id(self):
res = super(CrmLead, self)._onchange_stage_id()
for r in self.env['crm.stage'].search([]).ids:
if not self.search('stage_id', '=', r.id):
self.r.fold = True
return res
Dương Đường . thank you, but for me it doesn't work, can you sp me me by email? tienentrust@gmail.com