diff --git a/sign_oca/README.rst b/sign_oca/README.rst
index 5f2430f5..284099a7 100644
--- a/sign_oca/README.rst
+++ b/sign_oca/README.rst
@@ -1,7 +1,3 @@
-.. image:: https://odoo-community.org/readme-banner-image
- :target: https://odoo-community.org/get-involved?utm_source=readme
- :alt: Odoo Community Association
-
========
Sign Oca
========
@@ -17,7 +13,7 @@ Sign Oca
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
-.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
+.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsign-lightgray.png?logo=github
diff --git a/sign_oca/__manifest__.py b/sign_oca/__manifest__.py
index 1d02509b..16166db9 100644
--- a/sign_oca/__manifest__.py
+++ b/sign_oca/__manifest__.py
@@ -16,6 +16,7 @@
"views/sign_portal_oca_templates.xml",
"views/portal_templates.xml",
"data/data.xml",
+ "data/mail_template.xml",
"wizards/res_config_settings_views.xml",
"data/ir_sequence_data.xml",
"wizards/sign_oca_template_generate.xml",
diff --git a/sign_oca/data/mail_template.xml b/sign_oca/data/mail_template.xml
new file mode 100644
index 00000000..f3c8a11a
--- /dev/null
+++ b/sign_oca/data/mail_template.xml
@@ -0,0 +1,101 @@
+
+
+
+
+ New document to sign
+
+ {{ object.request_id.create_uid.email or '' }}
+ {{ object.partner_id.id }}
+ New document to sign
+ A notification to sign a document
+
+
+
+
+
+
+
+
+
+
+
+
+ has requested your signature on a document.
+
+
+ A document has been requested for your signature.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Warning do not forward this email to other people!
+ They will be able to access this document and sign it as yourself.
+
+
+
+
+ {{ object.request_id.user_id.partner_id.lang }}
+
+
+
+
+
+ New Document has been signed
+
+ {{ object.request_id.create_uid.email or '' }}
+ {{ object.partner_id.id }}
+ New Document has been signed
+ Notification for signed document
+
+
+
+
+
+
+
+
+
+ ()
+ has sent the signed document.
+
+
+ A fully signed document has been sent to you.
+
+
+
+
+ {{ object.request_id.user_id.partner_id.lang }}
+
+
+
diff --git a/sign_oca/models/sign_oca_request.py b/sign_oca/models/sign_oca_request.py
index 26c3c875..d23137cc 100644
--- a/sign_oca/models/sign_oca_request.py
+++ b/sign_oca/models/sign_oca_request.py
@@ -258,19 +258,10 @@ def action_send(self, sign_now=False, message=""):
signer._portal_ensure_token()
if sign_now and signer.partner_id == self.env.user.partner_id:
continue
- render_result = self.env["ir.qweb"]._render(
- "sign_oca.sign_oca_template_mail",
- {"record": signer, "body": message, "link": signer.access_url},
- engine="ir.qweb",
- minimal_qcontext=True,
- )
- self.env["mail.thread"].message_notify(
- body=render_result,
- partner_ids=signer.partner_id.ids,
- subject=_("New document to sign"),
- subtype_id=self.env.ref("mail.mt_comment").id,
- mail_auto_delete=False,
- email_layout_xmlid="mail.mail_notification_light",
+ template = self.env.ref("sign_oca.email_template_sign_document")
+ template.with_context(body=message, link=signer.access_url).send_mail(
+ signer.id,
+ force_send=True,
)
def action_send_signed_request(self):
@@ -292,19 +283,14 @@ def action_send_signed_request(self):
]
)
)
- # The message will not be linked to the record because we do not want
- # it happen.
- self.env["mail.thread"].message_notify(
- body=_(
- "%(name)s (%(email)s) has sent the signed document.",
- name=self.create_uid.name,
- email=self.create_uid.email,
- ),
- partner_ids=signer.partner_id.ids,
- subject=_("Signed document"),
- subtype_id=self.env.ref("mail.mt_comment").id,
- mail_auto_delete=False,
- attachment_ids=attachments.ids,
+ template = self.env.ref("sign_oca.email_template_signed_document")
+ email_values = {
+ "attachment_ids": [(6, 0, attachments.ids)],
+ }
+ template.send_mail(
+ signer.id,
+ force_send=True,
+ email_values=email_values,
)
def _check_signed(self):
diff --git a/sign_oca/static/description/index.html b/sign_oca/static/description/index.html
index 3c284787..b1bce0a8 100644
--- a/sign_oca/static/description/index.html
+++ b/sign_oca/static/description/index.html
@@ -3,7 +3,7 @@
-README.rst
+Sign Oca
-
+
+
Sign Oca
-
-
-
-
-
-
Sign Oca
-

+

This module allows to create documents for signature inside Odoo using
OWL.
Table of contents
@@ -404,7 +399,7 @@
Sign Oca
-
+
There is a wizard (sign.oca.template.generate.multi) that can be used
for any model needed. If there is a template without a linked model or
linked to a model (res.partner for example) an action will be
@@ -412,9 +407,9 @@
Sign permissions).
-
+
-
+
- Access Sign / Templates
- Create a new template
@@ -426,7 +421,7 @@
-
+
- Access Sign / Settings / Roles
- Create a new role (Equipment employee for example)
@@ -437,7 +432,7 @@
-
+
- Access Sign / Templates
- Press the Sign button from a template
@@ -452,7 +447,7 @@
-
+
- Go to the pencil icon in the upper right corner (systray) of the sign
request to access the pending signatures.
@@ -465,7 +460,7 @@
-
+
- Go to any list view or form view (except sign.oca models), e.g.:
Contacts
@@ -482,7 +477,7 @@
-
+
- customers who are using portal can sign their documents from portal
directly in addition to being able to sign them from emails.
@@ -490,9 +485,9 @@
-
+
-
+
- Ensure that the signature is inalterable. Maybe we might need to use
some tools like endevise or pyHanko with a certificate. Signer can be
@@ -501,7 +496,7 @@
-
+
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
@@ -509,15 +504,15 @@
Do not contact contributors directly about support or help with technical issues.
-