تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
15381 أدوات العرض

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
Why XML in odoo ? تم الحل
3
مارس 25
982
Odoo action error تم الحل
1
أكتوبر 24
5318
0
ديسمبر 22
1866
1
فبراير 18
5316
4
نوفمبر 24
76311