I'm working with Odoo 10.
I'm calling a wizard from python code and want to populate a field in the wizard with a value, calculated in the method before calling the wizard.
The wizard is opening, but the field is empty.
How do I populate a field in a wizard with a value from context?
Code from wizard calling method:
return {
'name': _("Ordner erstellen"),
'type': 'ir.actions.act_window',
'view_type': 'form',
'view_mode': 'form',
'res_model': 'gilligkeller.crm.create_folder',
'view_id': viewid,
'target': 'new',
'context': {'src_path': src_path, 'dst_path': dst_path}
}
Code from wizard.py:
class create_folder(models.TransientModel):
_name = 'gilligkeller.crm.create_folder'
dst_path = fields.Char(string='Zielpfad')
@api.model
def default_get():
I tried using the default_get() methon in my wizard but couldn't get it working.
'context': {'default_dst_path': dst_path}
default key is essential.
try this: https://www.pinterest.com/pin/58054282686347608/