# Sign documents in tryton

**URL:** https://discuss.tryton.org/t/sign-documents-in-tryton/2052
**Category:** Ideas
**Created:** [December 9, 2019, 9:29am UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052 "2019-12-09T09:29:21Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![osloar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/osloar/32/599_2.png) [@osloar](https://discuss.tryton.org/u/osloar)
#### Post date: [December 9, 2019, 9:29am UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/1 "2019-12-09T09:29:21Z")

</div>

Hello one question  
I need to sign documents, sales, invoices, … directly from the tablet with tryton.

It’s possible?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [December 9, 2019, 4:31pm UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/2 "2019-12-09T16:31:27Z")

</div>

What do you mean by signing? What is the purpose?

---

<div class="post-metadata">

### Author: ![prak](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/prak/32/321_2.png) [@prak](https://discuss.tryton.org/u/prak)
#### Post date: [December 11, 2019, 10:25am UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/3 "2019-12-11T10:25:30Z")

</div>

@ced A question different from @osloar, is there any way to digitally sign the documents in Tryton using some Digital Signature that can be used at the client’s end?

For example, if a manager or an officer approves a certain Transaction, and wants the document to be digitally sign, then what is the way for it ?

Thanks in advance !!

---

<div class="post-metadata">

### Author: ![osloar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/osloar/32/599_2.png) [@osloar](https://discuss.tryton.org/u/osloar)
#### Post date: [December 11, 2019, 10:38am UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/4 "2019-12-11T10:38:54Z")

</div>

Hello, the idea is to be able to sign an invoice or a report such as an anesthesia without the need to print, scan and attach in the client file.

It is very similar to what @prak asks

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [December 11, 2019, 10:52am UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/5 "2019-12-11T10:52:12Z")

</div>

I do not understand what you are calling “signature”. For me, you must first define what are the purpose, the guarantee and the result.  
“Signing” is not a purpose, it is a mean for something else.

---

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [December 11, 2019, 11:02am UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/6 "2019-12-11T11:02:55Z")

</div>

Maybe this could help…

> **[GitHub - coopengo/trytond-cryptolog: Sign Tryton documents via Universign (Cryptolog)](https://github.com/coopengo/trytond-cryptolog)**
>
> Sign Tryton documents via Universign (Cryptolog)

[![](https://discuss-cdn.tryton.org/uploads/default/original/1X/7575000b761e25d1cf590e88fce7395bd1cd8dbe.jpeg "Two new modules for Tryton: Paybox payment system and electronic signature by Adrien Ben-Duc") ](https://www.youtube.com/watch?v=5-2YoMV1wX0&t=1090)

---

<div class="post-metadata">

### Author: ![semarie](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/semarie/32/112_2.png) [@semarie](https://discuss.tryton.org/u/semarie)
#### Post date: [December 11, 2019, 11:19am UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/7 "2019-12-11T11:19:51Z")

</div>

> [@prak](#):
>
> For example, if a manager or an officer approves a certain Transaction, and wants the document to be digitally sign, then what is the way for it ?

if you took care to properly configure group permissions and/or access rules, Tryton could enforce that only allowed users to be able to perform some actions. So if the action was done, it means an allowed person did it.

As example, for a Payment, only user in group `Payment Approval` could approve it. A user in group `Payment` could only create a new payment for approval, but it can’t be proceeded without approval.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [December 11, 2019, 11:56am UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/8 "2019-12-11T11:56:32Z")

</div>

After some reading on the web about the legal value of digital signature, I found that there are two kind of digital signature.  
The first could be named “handwritten digital signature”. It is about recording the handwritten of the user and store the image. This can be a strong proof only if the device records not only the “picture” but also the time and pressure, and there should be technical constraint that ensure the signature was linked to a specific document. This can only be done on dedicated hardware (not standard tablet). If only the “picture” is recorded than it is just the starting of a proof in front of justice. The last one could be implemented using library like [jSignature](https://github.com/brinley/jSignature)  
The second could be named “cryptographic digital signature”. This one use cryptographic means and proofs to ensure that parties are identified and that the document was not altered. Usually it required a trusted third-party (like with universign) (or trust network like with GPG).

What does it mean for Tryton, I think such feature should be implemented as an extension of `ir.attachment` (like [cryptolog](https://github.com/coopengo/trytond-cryptolog)) because signature is based on text document. There could be a set of modules that implements entrypoints that provide a web page which display the document and provide the form to sign it. The signature should be stored on the attachment which will make it readonly. The document should probably be PDF only and there should be a way to include the signature image inside (and any other cryptographic means).  
I do not think we should try to implement a widget for the clients because it will not work with third party workflow.

---

<div class="post-metadata">

### Author: ![osloar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/osloar/32/599_2.png) [@osloar](https://discuss.tryton.org/u/osloar)
#### Post date: [December 11, 2019, 12:13pm UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/9 "2019-12-11T12:13:36Z")

</div>

What is simply intended is that the client signs an authorization or a sale (as when the postman comes and makes you sign on the mobile). It is true that it does not have the validity that would be desired, but it serves to start a possible process, apart from saving paper and time, since it is signed and stored directly in the file.

---

<div class="post-metadata">

### Author: ![wifasoi](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/w/ed655f/32.png) [@wifasoi](https://discuss.tryton.org/u/wifasoi)
#### Post date: [December 11, 2019, 1:11pm UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/10 "2019-12-11T13:11:46Z")

</div>

> [@ced](#):
>
> The document should probably be PDF only and there should be a way to include the signature image inside (and any other cryptographic means).

Creating a libreoffice template with a sign line should work for this. ([Signing the Signature Line](https://help.libreoffice.org/6.1/en-US/text/swriter/01/signsignatureline.html)).  
This will work with libre office files (libreoffice will prompt it to sign the document), but I’m not sure if it will work with the equivalent PDF (It should work, but didn’t try it yet).  
When converted to pdf (via unoconv), the user can sign it with an external software (like adobe reader) via different methods (image, signature pad, electronic identity ecc..).  
Don’t know if there is a sane way to extract the signature information from the pdf.

Here in Italy PAs (public administrations) use a different system…  
They use a p7m envelope file ([https://www.ietf.org/rfc/rfc2633.txt](https://www.ietf.org/rfc/rfc2633.txt)) [in short: just an encrypted envelope with the signer private key, where you put the file you agree with].

So ced is right.. everyone does it differently 🙂

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [December 11, 2019, 1:16pm UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/11 "2019-12-11T13:16:43Z")

</div>

> [@wifasoi](#):
>
> Creating a libreoffice template with a sign line should work for this. ([Signing the Signature Line](https://help.libreoffice.org/6.1/en-US/text/swriter/01/signsignatureline.html)).

This is signing with a certificate. It is a complex setup that does not work for random customer.

> [@wifasoi](#):
>
> I’m not sure if it will work with the equivalent PDF

It does not. LibreOffice is not able to generate the equivalent in PDF. I think the PDF signature is only supported by Adobe products.

---

<div class="post-metadata">

### Author: ![German](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/german/32/143_2.png) [@German](https://discuss.tryton.org/u/German)
#### Post date: [December 11, 2019, 5:06pm UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/12 "2019-12-11T17:06:07Z")

</div>

Hello @osloar, @ced is right, you should define what it’s is a handwritten digital signature, and digital signature ( which most of time use a certificate ). For a handwritten digital signature I suggest you to create a small web app, after that you can integrate with trytond using extensions like Flask-tryton or ir.attachment model.

---

<div class="post-metadata">

### Author: ![albert](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/albert/32/21_2.png) [@albert](https://discuss.tryton.org/u/albert)
#### Post date: [December 12, 2019, 10:16pm UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/13 "2019-12-12T22:16:40Z")

</div>

For valid Bio Signatures we’ve been using VidSigner ([Validated ID - Proveedores de Firma Electrónica e Identidad Digital](https://www.validatedid.com/es/)) for a couple of years now. We recently published a generic module for managing personal data permissions using their API:

[https://bitbucket.org/nantic/trytond-party\_personal\_data\_permission](https://bitbucket.org/nantic/trytond-party_personal_data_permission)

These allow using iPad or other Android-based tablets, while still capturing the necessary biometric information required by (at least) Spanish law.

The module allows configuring configuring which VidSigner device is going to be used per employee and/or client IP address. The user sends a PDF generated in trytond to the VidSigner API, and the user can use a tablet to sign it using a pen. Once finished, the Tryton user can capture the signed PDF from the VidSigner API.

The image of the PDF is shown in Tryton and the PDF (signed by the user and cryptographically signed by ValidatedId, including the biometric information captured in the tablet) is stored as an attachment.

Some more information here:

https://www.youtube.com/embed/udF7t7N-bS4?feature=oembed&wmode=opaque

---

<div class="post-metadata">

### Author: ![osloar](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/osloar/32/599_2.png) [@osloar](https://discuss.tryton.org/u/osloar)
#### Post date: [December 17, 2019, 9:24am UTC](https://discuss.tryton.org/t/sign-documents-in-tryton/2052/14 "2019-12-17T09:24:55Z")

</div>

Hi Albert, thanks for answering. This option is already contemplated but it is extremely expensive for the business system that we have.

You cannot make the final customer pay a fee of 40 euros / month for integration.

That is why in our case it was something much simpler.

Thank you
