跳至內容
選單
此問題已被標幟
3 回覆
15367 瀏覽次數

Hi, Where i can get action ID (162) and put it to parameters in URL ?
i set href to a button like this

/web&debug=#id=1&view_type=form&model=res.partner.task&menu_id=126&action=162 

but i get error web.assets_backend.js:427 No type for action 


Thanks




頭像
捨棄
最佳答案

Hello simes

I think use like this, it's helpful for you.
action_id = self.env.ref('module_name.action_id', , raise_if_not_found=False)

Ex.
web&debug=#id=1&view_type=form&model=res.partner.task&menu_id=126&action=action_id.id

頭像
捨棄
作者

action_id = self.env.ref('contacts.Contacts',

raise_if_not_found=False)

print(action_id) // i got None

not work got error AttributeError: 'NoneType' object has no attribute 'id'

action_id = self.env.ref('module_name.action_id')

作者

tks it work

i go in form view click debug -> edit action -> get External ID

action_id = self.env.ref('External ID')

print(action_id.id) // 167

相關帖文 回覆 瀏覽次數 活動
3
3月 25
976
1
10月 24
5314
0
12月 22
1859
1
2月 18
5311
4
11月 24
76307