Skip to Content
Menu
This question has been flagged

Im trying to automatically select the event.booth in my custom wizard

@api.model
def default_get(self, fields_list):
res = super(CreateOrderWizard, self).default_get(fields_list)
default_booth_id = self.env.context.get('default_event_booth_id', False)
print(default_booth_id)

res.update({'event_booth_id': default_booth_id})
res['event_booth_id'] = default_booth_id
return res

 ↑ This is what the default_get looks like and

<button context="{'default_event_booth_id': event_booth}" id="action_rectanglemaps_create_order" type="action" name="%(action_rectanglemaps_create_order)d" string="Angebot erstellen" icon="fa-pencil-square"/>


 ↑ This is what the button that is used to call the wizard looks like

The botton is in the correct view (the event.booth.form)

The print(default_booth_id) statement prints the correct id.

As you can see i tried to use

res.update({'event_booth_id': default_booth_id})
as well as

res['event_booth_id'] = default_booth_id

to set the id

Neither of them work.

What am i doing wrong?

Avatar
Discard
Related Posts Replies Views Activity
1
Sep 22
1501
1
Aug 23
2444
1
Jun 22
9882
1
Aug 19
7823
2
Aug 19
11540