Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
120 changes: 120 additions & 0 deletions sign_oca_order/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
================================
Sign OCA Sequential Signing & CC
================================

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

.. |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_order
: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_order
: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|

This module extends OCA Sign with sequential (ordered) signing and CC
recipient functionality, similar to DocuSign's routing and carbon copy
features.

**Table of contents**

.. contents::
:local:

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

No special configuration needed. The module adds new fields to the sign
request form:

- **Signing Mode**: Choose "Parallel" (all at once, default) or
"Sequential" (ordered)
- **CC Recipients**: Partners who receive a copy of the signed document
after completion

When using sequential mode, set the signing order on each signer line.
Signers with the same order number sign simultaneously within that step.

Usage
=====

**Sequential Signing:**

1. Create a new sign request
2. Set Signing Mode to "Sequential"
3. Add signers and set their Signing Order (1, 2, 3...)
4. Send the request -- only order 1 signers are notified
5. After order 1 completes, order 2 signers are automatically notified
6. Repeat until all steps complete

**CC Recipients:**

1. Add partners to the CC Recipients field on the sign request
2. After all signers complete, CC recipients receive an email with the
signed PDF attached

**Parallel Groups:**

Signers with the same signing order number sign simultaneously. For
example:

- Order 1: Alice, Bob (both sign in parallel)
- Order 2: Carol (signs after Alice AND Bob complete)

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_order%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
-------

* Keboola

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

- `Keboola <https://www.keboola.com>`__:

- Jiri Manas

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_order>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions sign_oca_order/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2025 Keboola
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import controllers
from . import models
21 changes: 21 additions & 0 deletions sign_oca_order/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2025 Keboola
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Sign OCA Sequential Signing & CC",
"version": "18.0.1.0.0",
"category": "Sign",
"summary": "Sequential/ordered signing with CC recipients for OCA Sign",
"author": "Keboola, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sign",
"license": "AGPL-3",
"depends": ["sign_oca", "sign_oca_reminder"],
"development_status": "Beta",
"data": [
"data/mail_template_data.xml",
"views/sign_oca_request_views.xml",
"views/portal_templates.xml",
],
"installable": True,
"application": False,
"auto_install": False,
}
4 changes: 4 additions & 0 deletions sign_oca_order/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2025 Keboola
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import main
72 changes: 72 additions & 0 deletions sign_oca_order/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Copyright 2025 Keboola
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import http
from odoo.exceptions import AccessError, MissingError
from odoo.http import request

from odoo.addons.sign_oca.controllers.main import PortalSign


class PortalSignOrder(PortalSign):
"""Extend the portal sign controller to enforce sequential signing order.

When a sign request uses ``signing_mode == 'sequential'``, signers whose
``signer_state`` is still ``'waiting'`` are shown a "please wait" page
instead of the signing UI, and their JSON sign endpoint returns an error.
"""

@http.route(
["/sign_oca/document/<int:signer_id>/<string:access_token>"],
type="http",
auth="public",
website=True,
)
def get_sign_oca_access(self, signer_id, access_token, **kwargs):
try:
signer_sudo = self._document_check_access(
"sign.oca.request.signer", signer_id, access_token
)
except (AccessError, MissingError):
return request.redirect("/my")

sign_request = signer_sudo.request_id
if (
sign_request.signing_mode == "sequential"
and not signer_sudo.signed_on
and signer_sudo.signer_state == "waiting"
):
return request.render(
"sign_oca_order.portal_sign_document_waiting",
{
"signer": signer_sudo,
"company": sign_request.company_id,
"request_name": sign_request.name,
},
)
return super().get_sign_oca_access(signer_id, access_token, **kwargs)

@http.route(
["/sign_oca/sign/<int:signer_id>/<string:access_token>"],
type="json",
auth="public",
website=True,
)
def get_sign_oca_sign_access(
self, signer_id, access_token, items, latitude=False, longitude=False
):
try:
signer_sudo = self._document_check_access(
"sign.oca.request.signer", signer_id, access_token
)
except (AccessError, MissingError):
return request.redirect("/my")

if (
signer_sudo.request_id.signing_mode == "sequential"
and signer_sudo.signer_state == "waiting"
):
return {"error": "It is not your turn to sign yet."}
return super().get_sign_oca_sign_access(
signer_id, access_token, items, latitude=latitude, longitude=longitude
)
Loading
Loading