Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
15347 Lượt xem

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




Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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')

Tác giả

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
Why XML in odoo ? Đã xử lý
3
thg 3 25
958
Odoo action error Đã xử lý
1
thg 10 24
5294
0
thg 12 22
1857
1
thg 2 18
5296
4
thg 11 24
76282