In my code, I've write defalut_get method and it is perfectly working when I create new record. but, when I open existing record default value is not showing
here is my code:
@api.model
def default_get(self, fields):
print('fields ------------', fields)
res = super(SalesTarget, self).default_get(fields)
activity_stage_target_ids = [(5, 0, 0)]
stage_rec = self.env['crm.stage'].search([])
for stage in stage_rec:
line = (0, 0, {
'stage_id': stage.id
})
activity_stage_target_ids.append(line)
res.update({
'activity_stage_target_ids': activity_stage_target_ids,
})
return res