Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
22568 Zobrazení

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,

Avatar
Zrušit
Nejlepší odpověď

In Odoo 8:

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

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
pro 17
13629
1
bře 15
6271
0
bře 15
3805
1
bře 15
4134
2
led 24
13628