Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
15426 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
Why XML in odoo ? แก้ไขแล้ว
3
มี.ค. 25
1013
Odoo action error แก้ไขแล้ว
1
ต.ค. 24
5399
0
ธ.ค. 22
1904
1
ก.พ. 18
5353
How can I inherit action? แก้ไขแล้ว
4
พ.ย. 24
76374