Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
5819 Vues

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
Ignorer
Auteur Meilleure réponse

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
Ignorer

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

Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
1
mars 24
4299
3
mai 24
5290
1
juin 23
2964
0
mars 23
1801
1
juil. 25
325