Skip to content

Instantly share code, notes, and snippets.

@aannganyelne
Created October 11, 2022 09:37
Show Gist options
  • Save aannganyelne/44a395ee4b14e8e8a6902d40c347dd18 to your computer and use it in GitHub Desktop.
Save aannganyelne/44a395ee4b14e8e8a6902d40c347dd18 to your computer and use it in GitHub Desktop.
Odoo Set Default Get Form Wizard
@api.model
def default_get(self, fields):
res = super(PresentationWizard, self).default_get(fields)
crm_lead_id = self.env.context.get('active_id')
crm_lead = self.env['crm.lead'].browse(crm_lead_id)
if 'attachment_doc' in fields:
res.update({'attachment_doc': crm_lead.file_prospect})
return res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment