Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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?

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
wrz 22
2269
1
sie 23
3599
1
cze 22
12570
1
sie 19
8904
2
sie 19
12718