Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 187 additions & 0 deletions sign_oca_sms/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
============
Sign Oca Sms
============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:357363f01f3db6c4376b426136118e16318057d64555f49d654f1405abcfa6c1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/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
:target: https://github.com/OCA/sign/tree/18.0/sign_oca_sms
:alt: OCA/sign
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sign-18-0/sign-18-0-sign_oca_sms
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/sign&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Sign OCA SMS Integration
------------------------

This module extends the functionality of Sign OCA by adding SMS
notification capabilities for document signing requests. It allows users
to send signature requests via SMS, in addition to the standard email
method, providing more flexibility in how signers are notified and can
access documents for signing.

Key Features
~~~~~~~~~~~~

- Send signature requests via SMS, email, or both
- Configure preferred contact method for each signer
- Track SMS delivery status
- Customizable SMS templates

**Table of contents**

.. contents::
:local:

Configuration
=============

Configuration Steps
~~~~~~~~~~~~~~~~~~~

1. **Configure SMS Template**

- Navigate to **Settings > Technical > Phone > SMS > SMS >
Templates**
- Locate the template named "Sign OCA: Sign Request Notification"
- Customize the SMS message as needed using the available
placeholders

Technical Notes
~~~~~~~~~~~~~~~

- The module adds a new selection field ``send_method`` with options:

- Email (default)
- SMS
- Email & SMS

- SMS messages include a secure link to access the document for signing

Usage
=====

Sending Signature Requests via SMS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1. **Initiating a Signature Request**

- Navigate to **Sign > New Request**
- Select or upload the document to be signed
- Add signers as you normally would
- In the sending options, choose your preferred method:

- **Email**: Send via email only (default)
- **SMS**: Send via SMS only
- **Email & SMS**: Send both email and SMS notifications

2. **Adding Signer Phone Numbers**

- When adding a signer, ensure their contact information includes a
valid phone number
- The system will use the mobile number if available, falling back to
the phone number
- You can also specify a custom phone number for each signer in the
signer details

3. **Customizing the SMS Message**

- The default SMS message includes:

- Recipient's name
- Name of the person requesting the signature
- Secure link to access the document
- Message (if provided)

- To customize the message:

- Go to **Settings > Technical > Phone > SMS > Templates**
- Find and edit "Sign OCA: Sign Request Notification"
- Use available placeholders to personalize the message

Tracking and Managing SMS Notifications
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- **Resending Notifications**:

- Open the signature request
- Click on the "Resend" button
- Select the preferred sending method

Best Practices
~~~~~~~~~~~~~~

1. **Consent and Privacy**

- Ensure you have consent to contact signers via SMS
- Include an opt-out mechanism in your communications

2. **Message Length**

- Keep SMS messages concise to avoid multiple message charges
- The secure link is automatically shortened by the system

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sign/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
`feedback <https://github.com/OCA/sign/issues/new?body=module:%20sign_oca_sms%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Kencove
* ForgeFlow

Contributors
------------

- ForgeFlow (https://www.forgeflow.com)

- BernatPForgeFlow <bernat.puig@forgeflow.com>
- Maria de Luna maria.de.luna@forgeflow.com

- `Trobz <https://www.trobz.com>`__:

- Do Anh Duy <duyda@trobz.com>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/sign <https://github.com/OCA/sign/tree/18.0/sign_oca_sms>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions sign_oca_sms/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizards
23 changes: 23 additions & 0 deletions sign_oca_sms/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2023 ForgeFlow S.L. (http://www.forgeflow.com)
# Copyright 2025 Kencove (https://www.kencove.com).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Sign Oca Sms",
"version": "18.0.1.0.0",
"category": "Sales/Sign",
"summary": "Kencove Sign Customizations",
"author": "Kencove, ForgeFlow, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sign",
"license": "AGPL-3",
"depends": [
"sms",
"sign_oca",
"html_text",
],
"data": [
"wizards/sign_oca_generate.xml",
"security/ir.model.access.csv",
"data/sms_template.xml",
],
"installable": True,
}
14 changes: 14 additions & 0 deletions sign_oca_sms/data/sms_template.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 ForgeFlow S.L. (http://www.forgeflow.com)
Copyright 2025 Kencove (https://www.kencove.com).
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
<data noupdate="0">
<record id="sign_oca_sms_template_notification" model="sms.template">
<field name="name">Sign OCA: Sign Request Notification</field>
<field
name="body"
>Hello {{ object.display_name }}, {{ ctx['requested_by_user'] }} has requested your signature on the following documents: {{ ctx['link'] }}, {{ ctx['message'] }}</field>
<field name="lang">{{ object.lang }}</field>
<field name="model_id" ref="base.model_res_partner" />
</record>
</data>
1 change: 1 addition & 0 deletions sign_oca_sms/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sign_oca_request
87 changes: 87 additions & 0 deletions sign_oca_sms/models/sign_oca_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Copyright 2023 ForgeFlow S.L. (http://www.forgeflow.com)
# Copyright 2025 Kencove (https://www.kencove.com).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


from odoo import fields, models
from odoo.exceptions import ValidationError


class SignOcaRequest(models.Model):
_inherit = "sign.oca.request"

def get_sms_message(self, signer, requested_by_user, message, link):
message = self.env._(
"Hello %(display_name)s, %(requested_by_user)s has requested "
"your signature on the following documents: %(link)s . %(message)s",
display_name=signer.display_name,
requested_by_user=requested_by_user,
link=link,
message=message,
)
return message

def _send_sign_sms(
self, message, link, signer_partner, requested_by_user, partner_phone_field
):
if not message:
message = "<p></p>"
message = self.env["ir.fields.converter"].text_from_html(message)
template = self.env.ref(
"sign_oca_sms.sign_oca_sms_template_notification"
).with_context(
**{
"requested_by_user": requested_by_user,
"message": message,
"link": link,
}
)
body = template._render_field("body", signer_partner.ids, compute_lang=True)[
signer_partner.id
]

composer = (
self.env["sms.composer"]
.with_context(
default_composition_mode="comment",
default_res_id=signer_partner.id,
default_res_model="res.partner",
default_template_id=False,
)
.create(
{
"body": body,
"number_field_name": partner_phone_field,
}
)
)

composer.action_send_sms()

def action_send_sms(self, sign_now=False, message=""):
self.ensure_one()
if self.state != "1_draft":
return
self._set_action_log("validate")
self.state = "2_signed"
if any(not signer.phone_field for signer in self.signer_ids):
raise ValidationError(self.env._("Please Select the Signer's Phone"))
for signer in self.signer_ids:
signer._portal_ensure_token()
if sign_now and signer.partner_id == self.env.user.partner_id:
continue

link = self.get_base_url() + signer.access_url
self._send_sign_sms(
message,
link,
signer.partner_id,
self.create_uid.name,
signer.phone_field,
)


class SignOcaRequestSigner(models.Model):
_inherit = "sign.oca.request.signer"

phone_field = fields.Char()
3 changes: 3 additions & 0 deletions sign_oca_sms/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
14 changes: 14 additions & 0 deletions sign_oca_sms/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
### Configuration Steps

1. **Configure SMS Template**
- Navigate to **Settings > Technical > Phone > SMS > SMS > Templates**
- Locate the template named "Sign OCA: Sign Request Notification"
- Customize the SMS message as needed using the available placeholders

### Technical Notes

- The module adds a new selection field `send_method` with options:
- Email (default)
- SMS
- Email & SMS
- SMS messages include a secure link to access the document for signing
6 changes: 6 additions & 0 deletions sign_oca_sms/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- ForgeFlow (<https://www.forgeflow.com>)
- BernatPForgeFlow \<<bernat.puig@forgeflow.com>\>
- Maria de Luna <maria.de.luna@forgeflow.com>

- [Trobz](https://www.trobz.com):
- Do Anh Duy \<<duyda@trobz.com>\>
10 changes: 10 additions & 0 deletions sign_oca_sms/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Sign OCA SMS Integration

This module extends the functionality of Sign OCA by adding SMS notification capabilities for document signing requests. It allows users to send signature requests via SMS, in addition to the standard email method, providing more flexibility in how signers are notified and can access documents for signing.

### Key Features

- Send signature requests via SMS, email, or both
- Configure preferred contact method for each signer
- Track SMS delivery status
- Customizable SMS templates
Loading