Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
5820 Ansichten

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
Verwerfen
Autor Beste Antwort

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
Verwerfen

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

Beste Antwort

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
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
März 24
4299
3
Mai 24
5291
1
Juni 23
2964
0
März 23
1801
1
Juli 25
325