Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2157 Ansichten

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Sept. 22
2267
1
Aug. 23
3596
1
Juni 22
12568
1
Aug. 19
8898
2
Aug. 19
12712