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

my button doesnt redirect to desired url

this is my pthon code
 @api.one   
 def btn_view_google_map(self):       
    return {           
        'type': 'ir.actions.act_url',           
        'name':'btn_view_google_map',           
        'url': "https://maps.google.com/?ll=0,0",            
         'target': 'new'       
      }


this is my xml view 
button name="btn_view_google_map" type="object" string="View On Google Maps" class="btn_primary" icon="fa-map"/


الصورة الرمزية
إهمال
أفضل إجابة

Hello Muhammad Zulfi Rusdani,

Hope you are doing well.

In your code, you write the @api.one above the function but the ir.action.act_url doesn't work with @api.one and it works with @api.multi If your Odoo version is less than 13 and If you use Odoo Version Greater than or Equal to 13 then don't write @api.multi so please rewrite the code like below.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

الصورة الرمزية
إهمال

@api.multi
def btn_view_google_map(self):
return {
'type': 'ir.actions.act_url',
'name':'btn_view_google_map',
'url': "https://maps.google.com/?ll=0,0",
'target': 'new'
}

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أغسطس 25
2
0
أغسطس 25
2
0
أغسطس 25
7
0
أغسطس 25
35
0
أغسطس 25
72