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

Hello,

i would like my employees to sign documents together with the costumer on a tablet. i can't find a way to start document signing directly without sending an email to the costumer, i found out the link structure to access the portal and start signing. 

i would like to create an field named "x_portalurl" which contains:
('https://odoo-portal-link/'+sign_request.id+'/'+sign_request.access_token) 
the i can put this field in a view with wiidget 'URL'

hope someone can help.

Avatar
Zrušit
Autor Nejlepší odpověď

Hello Niyas,

thnx for reply. i'm not sure i'm doing this the right way....

i made an field in sign_request model named "x_portalurl" and pasted the code in the calculate field of x_portalurl but nothing is happening.

Avatar
Zrušit

Update the code in Question, make the URL field as a computed one and compute the URL from it

Nejlepší odpověď

Hi,

See the sample in survey module, how the public URL for the survey is created.

from werkzeug import urls
from odoo.addons.http_routing.models.ir_http import slug


def _compute_survey_url(self):
""" Computes a public URL for the survey """
base_url = '/' if self.env.context.get('relative_url') else \
self.env['ir.config_parameter'].sudo().get_param('web.base.url')
for survey in self:
survey.public_url = urls.url_join(base_url, "survey/start/%s" % (slug(survey)))


In the above code, base_url will give the URL of your instance and in the below line, you can make necessary changes,

survey.public_url = urls.url_join(base_url, "survey/start/%s" % (slug(survey)))


like,

survey.public_url = urls.url_join(base_url, "%s/%s" % (slug(sign_request.id, sign_request.access_token)))


Thanks

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
bře 24
4299
3
kvě 24
5290
1
čvn 23
2964
0
bře 23
1800
1
čvc 25
325