Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
5809 Vizualizări

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.

Imagine profil
Abandonează
Autor Cel mai bun răspuns

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.

Imagine profil
Abandonează

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

Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
mar. 24
4287
3
mai 24
5287
1
iun. 23
2962
0
mar. 23
1798
1
iul. 25
323