Wednesday, April 23, 2025
1 change · master
Enhancements to existing features
The Sign app now supports envelopes, allowing one signing template to include multiple documents in a defined order. This makes it easier to manage contracts or document packs that need to be reviewed and signed together, while also improving how completed signed files are stored for future enhancements.
Original PR description
In this commit, we added the envelope feature on `sign.template` by allowing handling multiple attachments in the same template. The changes description and coding choices explanations are described…
In this commit, we added the envelope feature on `sign.template` by allowing handling multiple attachments in the same template. The changes description and coding choices explanations are described below. **SignDocument addition** For achieving this, we created a new class called `sign.document` and made `sign.template` point to multiple of them. This class stores an attachment and holds the order information in the template, as well points to its `sign.item` records, previously done in `sign.template`. All the rendering code got moved from `sign.template` to `sign.document` since it now stores the attachment, making the `sign.template` code a lot cleaner and easying the adaptation of the JavaScript rendering as well. **SignCompletedDocument addition** Before this PR, the storage for the completed document in the `sign.request` was just a single Binary field, and its functions were defined at `sign.template`. In this PR, we added a new model `sign.completed.document` for holding it as moving the document geration over there. This made us keep the simplicity of working with the Binary field (instead of `ir.attachment` directly), we were able to move a function over there making it more maintainable and allowing future improvements such as moving the certificates logic. task-4555838 Co-authored-by: Gabriel Felix <gdpf@odoo.com> Co-authored-by: Ahmad Elmaghraby <alah@odoo.com> Co-authored by: Abdelrahman Fawzy <abdh@odoo.com>