Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

how to get url of current page

v6
By
Clément THOMAS
on 8/28/13, 5:20 AM 3,610 views

My question concern version 6.0 but answer for v7 are welcome too.

Url of pages in openerp can be shared easily by copy/paste (for example a link to specific order).

But how to know (or to re-write) url of a specific page in the code (to send it by email for example) ?

Thanks,

2

Marc Cassuto

--Marc Cassuto--
815
| 4 4 8
Montreal, Canada
--Marc Cassuto--


Marc Cassuto
On 8/28/13, 5:09 PM

Hello Clément,

this is exactly what does portal module :

`

try:
    self.pool.get(mail.model).check_access_rule(cr, related_user.id, [mail.res_id], 'read', context=context)

    url = partner_obj._get_signup_url_for_action(cr, related_user.id, [partner.id], action='', res_id=mail.res_id, model=mail.model, context=context)[partner.id]

    text = _("""<p>Access this document <a href="%s">directly in OpenERP</a></p>""") % url

except except_orm, e:

`

this code is from addons/portal/mail_mail.py.

regards, Marc.

PS: vote if you find this post useful

0
Daniel Kauffman
On 9/25/15, 1:04 AM

In Odoo 8:

base_url = self.env['ir.config_parameter'].get_param('web.base.url')

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/28/13, 5:20 AM
Seen: 3610 times
Last updated: 9/25/15, 1:04 AM