跳至內容
選單
此問題已被標幟
2166 瀏覽次數

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?

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
9月 22
2272
1
8月 23
3600
1
6月 22
12570
1
8月 19
8906
2
8月 19
12719