Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
14666 Переглядів

I need to redirect the user to another site the user clicks on a specific button.

I'm trying doing this like described as below. But is does not work.

When the program reaches on the method index from the VrtxEvents controller, the system redirect the request to the location http://localhost:8069/www.gmail.com.

But the expected behavior is it redirect to the location www.gmail.com. 

My view

<record model="ir.ui.view" id="vrtx_view_event_tree">
<field name="name">event.event.tree</field>
<field name="model">event.event</field>
<field name="arch" type="xml">
<tree string="Events" create="false" edit="false" delete="false">
<field name="name" string="Name"/>
<field name="date_begin"/>
<field name="date_end"/>
<field name="state"/>
<button string="Click Here" name="pagseguro" type="object"/>
</tree>
</field>


My model

class Event(models.Model):
_inherit = "event.event"
@api.multi
def pagseguro(self):
return {
"url": "/vrtx_events/vrtx_events/",
"type": "ir.actions.act_url"
}


My controller class:

from openerp import http
from werkzeug.utils import redirect
class VrtxEvents(http.Controller):
@http.route('/vrtx_events/vrtx_events/', auth='public')
def index(self, **kw):
response = redirect("www.gmail.com")
return response

Аватар
Відмінити
Найкраща відповідь

If you are talking about the website builder of Odoo 8.0, you insert a building block containing a button and change the link to the desired place.

Аватар
Відмінити
Автор

Hi Ermin. I'm talking about a module that should redirect request to a external site. Thank you.

Related Posts Відповіді Переглядів Дія
2
серп. 25
181
0
серп. 25
291
1
серп. 25
683
Change position chatter Вирішено
1
серп. 25
530
4
лип. 25
1890