콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4437 화면

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
8월 25
22
2
8월 25
108
1
8월 25
262
1
8월 25
203
0
8월 25
178