Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] sign_oca: Migration to 17.0 #70

Draft
wants to merge 70 commits into
base: 17.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
6703431
[ADD] sign_oca
etobella Jul 24, 2023
0924fde
[FIX] sign_oca: wizard_id comodel
mariadforgeflow Oct 10, 2023
9c1dc75
[FIX] sign_oca: black, isort, prettier
etobella Nov 6, 2023
b830c14
[MIG] sign_oca: Migration to 16.0
etobella Nov 7, 2023
31c5551
Added translation using Weblate (Italian)
mymage Nov 28, 2023
7dba89b
[FIX] sign_oca: Add description sign.oca.request.log
etobella Dec 1, 2023
65b6f61
[FIX] sign_oca: oe_chatter should not be added on non mail.thread models
etobella Dec 1, 2023
01bb98d
Translated using Weblate (Italian)
mymage Dec 4, 2023
b863f78
[FIX] sign_oca: Add configure action to sign.oca.request.log
victoralmau Apr 17, 2024
1466009
[FIX] sign_oca: Add filename file to show binary correctly in UX
victoralmau Apr 17, 2024
70938c3
[IMP] sign_oca: Change t-raw to t-out
victoralmau Apr 17, 2024
14f7641
[FIX] sign_oca: Some fixes
PauBForgeFlow Feb 27, 2024
d471c1e
[IMP] sign_oca: preview requests
PauBForgeFlow Feb 23, 2024
5e3d06e
[IMP] sign_oca: Improve README
victoralmau Jan 22, 2024
6b62399
[IMP] sign_oca: Update .pot file
victoralmau Jan 18, 2024
e826200
[IMP] sign_oca: Add Administrator group + improve ACLs + add rules
victoralmau Sep 27, 2023
a196551
[FIX] sign_oca: Add authenticate() method to test_portal
victoralmau Sep 27, 2023
d45a7f3
[IMP] sign_oca: Add record_ref to requests
victoralmau Sep 27, 2023
d789b20
[IMP] sign_oca: Add _description to sign.oca.request.log
victoralmau Sep 27, 2023
3de0b24
[IMP] sign_oca: Add systray compatibility
victoralmau Sep 27, 2023
189e758
[IMP] sign_oca: Add sign button to sign.oca.request + signer to allow…
victoralmau Sep 28, 2023
f2a3a23
[IMP] sign_oca: Add model_id to templates
victoralmau Sep 28, 2023
f32bd24
[IMP] sign_oca: Improve roles to set partner type (empty, default or …
victoralmau Sep 29, 2023
5211824
[IMP] sign_oca: Add Wizard Generate Multi
victoralmau Sep 29, 2023
816fd10
[IMP] sign_oca: Link from partner to signer
BernatPForgeFlow Feb 28, 2024
9a4c68d
[IMP] sign_oca: Add Sign from template action from tree and form view
victoralmau Mar 5, 2024
735159f
[FIX] sign_oca: Small fixes in configure mode
BernatPForgeFlow Mar 5, 2024
67db1f0
[IMP] sign_oca: Add groups in partner link to request
PauBForgeFlow Mar 6, 2024
6c8a8e2
[FIX] sign_oca: Duplicated Sign button in request
PauBForgeFlow Mar 7, 2024
3c70d03
[FIX] sign_oca: Remove legacy code and rename fields
BernatPForgeFlow Mar 21, 2024
a45e5e6
[FIX] sign_oca: Allow to sign partners with multiple roles
PauBForgeFlow Apr 3, 2024
d2f788e
[FIX] sign_oca: Restrict items editing
PauBForgeFlow Apr 4, 2024
0f282c4
[IMP] sign_oca: Kanban and tree menu UX improvement
PauBForgeFlow Apr 3, 2024
158d034
[MIG] sign_oca: Migrate systray to owl
PauBForgeFlow Apr 16, 2024
298539c
[FIX] sign_oca: Avoid error when deleting an element in the configura…
victoralmau Apr 19, 2024
a61bd1a
[IMP] sign_oca: Hide the Sign from template action in sign.oca* models
victoralmau Apr 19, 2024
868e31f
[IMP] sign_oca: Improve USAGE section of README
victoralmau Apr 19, 2024
15cbc7a
[IMP] sign_oca: Migrate sign_oca.js to owl
PauBForgeFlow May 2, 2024
718adc9
[FIX] sign_oca: Sign from template when there is a role with partner_…
PauBForgeFlow May 7, 2024
49ac2cf
Added translation using Weblate (Spanish)
berisoft-arg May 12, 2024
1652a77
[IMP] sign_oca: Add pre_migration script
PauBForgeFlow May 10, 2024
4649570
[FIX] sign_oca: sign_oca_pdf checkFilledAll
PauBForgeFlow Apr 11, 2024
4bff661
[FIX] sign_oca: pre_migration script
PauBForgeFlow May 22, 2024
080c9de
[FIX] sign_oca: Get signer partner info
BernatPForgeFlow May 21, 2024
0624248
[IMP] sign_oca: Redirect at the end of the signature process
victoralmau May 23, 2024
c22a6a7
Translated using Weblate (Italian)
mymage May 23, 2024
e05b168
[FIX] sign_oca: Filter correctly next_items
BernatPForgeFlow May 21, 2024
eae1fe1
[IMP] sign_oca: Send to signers the final signed document
BernatPForgeFlow May 22, 2024
4820688
Translated using Weblate (Italian)
mymage Jun 4, 2024
0995270
[16.0][FIX]: Fix error on mig script when partner_type not exist
Jun 28, 2024
01247ea
[IMP] sign_oca: Use flex in order to show it properly
etobella Jul 7, 2024
cf29b6d
Added translation using Weblate (Portuguese (Brazil))
SottomaiorMacedoTec Jul 10, 2024
27d18aa
[FIX] sign_oca Fix who can sign
ivs-cetmix Jul 16, 2024
a8e8852
[FIX] sign_oca: Avoid access error with ir.model
victoralmau Jul 17, 2024
eea9817
Updated from template
ivs-cetmix Jul 17, 2024
de936ec
Translated using Weblate (Italian)
mymage Jul 29, 2024
0f402e9
[IMP] sign_oca: Allow to manage inalterability
etobella Dec 3, 2023
96cea8e
[IMP] sign_oca: Remove warning by using the proper function
etobella Dec 17, 2023
afcd123
[FIX] sign_oca: The id of the roles must be taken from role_id, not s…
etobella Aug 26, 2024
53e9328
Translated using Weblate (Italian)
mymage Aug 26, 2024
7a847f5
[IMP] sign_oca: Filter unsigned documents in user count
pedropabloalba Sep 11, 2024
8c88c2a
[IMP] sign_oca: Remove warning by several names with the same label
victoralmau Oct 4, 2024
e3446b3
[IMP] sign_oca: Add General settings menu item
victoralmau Oct 11, 2024
446b406
Translated using Weblate (Italian)
mymage Oct 14, 2024
e66df84
Translated using Weblate (Spanish)
victoralmau Oct 14, 2024
9a537c4
[IMP] sign_oca: Allow to store geolocalization
etobella Jan 19, 2024
4fd86a7
[FIX] sign_oca: Define the correct url to be set in the email that is…
victoralmau Nov 11, 2024
b1d142d
[IMP] sign_oca: pre-commit auto fixes
victoralmau Oct 30, 2024
bd3c52d
[MIG] sign_oca: Migration to 17.0
peluko00 May 17, 2024
75d32b5
[MIG] sign_oca: Finish migration
victoralmau Oct 30, 2024
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
174 changes: 174 additions & 0 deletions sign_oca/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
========
Sign Oca
========

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

.. |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/17.0/sign_oca
:alt: OCA/sign
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sign-17-0/sign-17-0-sign_oca
: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=17.0
:alt: Try me on Runboat

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

This module allows to create documents for signature inside Odoo using
OWL.

**Table of contents**

.. contents::
:local:

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

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
automatically displayed in the tree and form view (only for users with
Sign permissions).

Usage
=====

Creation of templates
---------------------

- Access Sign / Templates
- Create a new template
- Add a PDF File
- Access the configuration menu
- You can add a field by doing a right click inside a page
- Click on the field in order to delete or edit some configuration of
it
- The template is autosaved

Sign role
---------

- Access Sign / Settings / Roles
- Create a new role (Equipment employee for example)
- You can set the Partner type you need (empty, default or expression).
- With the expression option you can set: ${object.field_name.id}
- If you create a sign request from template signer will be auto-create
according to roles

Sign a document from template
-----------------------------

- Access Sign / Templates
- Press the Sign button from a template
- Fill all the possible partners that will sign the document
- You can link the template to a model (maintenance.equipment for
example)
- The signature action will be opened.
- There, you can fill all the data you need.
- Once you finish, press the sign button on the top
- When the last signer signs it, the final file will be generated as a
PDF

Sign a pending document
-----------------------

- Go to the pencil icon in the upper right corner (systray) of the sign
request to access the pending signatures.
- Press the Sign button from signer request
- The signature action will be opened.
- There, you can fill all the data you need.
- Once you finish, press the sign button on the top
- When the last signer signs it, the final file will be generated as a
PDF

Sign from template
------------------

- Go to any list view or form view (except sign.oca models), e.g.:
Contacts
- Select multiple records (3 for example).
- The "Sign from template" action will be available if there are any
sign templates created that are not linked to any model and/or any
linked to the corresponding model.
- Select a template.
- Click on the "Generate" button.
- 3 requests will be created (each linked to each selected record) BUT
no signer will be set.
- Some extra modules (e.g. maintenance_sign_oca) will automatically set
the signers for each request.

Known issues / Roadmap
======================

Tasks
-----

- Ensure that the signature is inalterable. Maybe we might need to use
some tools like endevise or pyHanko with a certificate. Signer can be
authenticated using OTP.

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%0Aversion:%2017.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
-------

* Dixmit

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

- Enric Tobella (`www.dixmit.com <http://www.dixmit.com>`__)
- `Tecnativa <https://www.tecnativa.com>`__:

- Víctor Martínez

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.

.. |maintainer-etobella| image:: https://github.com/etobella.png?size=40px
:target: https://github.com/etobella
:alt: etobella

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-etobella|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions sign_oca/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import controllers
from . import models
from . import wizards
71 changes: 71 additions & 0 deletions sign_oca/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Copyright 2023 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Sign Oca",
"summary": """
Allow to sign documents inside Odoo CE""",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"author": "Dixmit,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sign",
"depends": ["web_editor", "portal", "base_sparse_field"],
"data": [
"security/security.xml",
"views/menu.xml",
"data/data.xml",
"wizards/res_config_settings_views.xml",
"data/ir_sequence_data.xml",
"wizards/sign_oca_template_generate.xml",
"wizards/sign_oca_template_generate_multi.xml",
"views/res_partner_views.xml",
"views/sign_oca_request_log.xml",
"views/sign_oca_request.xml",
"security/ir.model.access.csv",
"views/sign_oca_field.xml",
"views/sign_oca_role.xml",
"views/sign_oca_template.xml",
"templates/assets.xml",
],
"demo": [
"demo/sign_oca_template.xml",
],
"assets": {
"web.assets_backend": [
"sign_oca/static/src/components/sign_oca_pdf_common/sign_oca_pdf_common.xml",
"sign_oca/static/src/components/sign_oca_configure/sign_oca_configure.xml",
"sign_oca/static/src/components/sign_oca_pdf/sign_oca_pdf.xml",
"sign_oca/static/src/elements/elements.xml",
"sign_oca/static/src/scss/sign_oca.scss",
"sign_oca/static/src/components/sign_oca_pdf_common/sign_oca_pdf_common.esm.js",
"sign_oca/static/src/components/sign_oca_configure/sign_oca_configure.esm.js",
"sign_oca/static/src/elements/text.esm.js",
"sign_oca/static/src/elements/signature.esm.js",
"sign_oca/static/src/elements/check.esm.js",
"sign_oca/static/src/components/sign_oca_pdf/sign_oca_pdf.esm.js",
"sign_oca/static/src/components/" "sign_oca/static/src/js/*.js",
"sign_oca/static/src/xml/*.xml",
],
"web.assets_frontend": [
"sign_oca/static/src/components/sign_oca_pdf_common/sign_oca_pdf_common.xml",
"sign_oca/static/src/components/sign_oca_configure/sign_oca_configure.xml",
"sign_oca/static/src/components/sign_oca_pdf/sign_oca_pdf.xml",
"sign_oca/static/src/elements/elements.xml",
"sign_oca/static/src/scss/sign_oca.scss",
"sign_oca/static/src/components/sign_oca_pdf_common/sign_oca_pdf_common.esm.js",
"sign_oca/static/src/elements/text.esm.js",
"sign_oca/static/src/elements/signature.esm.js",
"sign_oca/static/src/elements/check.esm.js",
"sign_oca/static/src/components/sign_oca_pdf/sign_oca_pdf.esm.js",
"sign_oca/static/src/components/sign_oca_pdf_portal/sign_oca_pdf_portal.esm.js",
"sign_oca/static/src/components/sign_oca_pdf_portal/sign_oca_pdf_portal.xml",
"sign_oca/static/src/scss/portal.scss",
"sign_oca/static/src/xml/*.xml",
],
"sign_oca.sign_assets": [
"sign_oca/static/src/scss/sign.scss",
"web/static/src/libs/fontawesome/css/font-awesome.css",
],
},
"maintainers": ["etobella"],
}
1 change: 1 addition & 0 deletions sign_oca/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import main
111 changes: 111 additions & 0 deletions sign_oca/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
from odoo import http
from odoo.exceptions import AccessError, MissingError
from odoo.http import request

from odoo.addons.base.models.assetsbundle import AssetsBundle
from odoo.addons.portal.controllers.portal import CustomerPortal


class SignController(http.Controller):
@http.route("/sign_oca/get_assets.<any(css,js):ext>", type="http", auth="public")
def get_sign_resources(self, ext):
bundle = "sign_oca.sign_assets"
files, _ = request.env["ir.qweb"]._get_asset_content(bundle)
asset = AssetsBundle(bundle, files)
mock_attachment = getattr(asset, ext)()

Check warning on line 15 in sign_oca/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

sign_oca/controllers/main.py#L12-L15

Added lines #L12 - L15 were not covered by tests
if isinstance(
mock_attachment, list
): # suppose that CSS asset will not required to be split in pages
mock_attachment = mock_attachment[0]
stream = request.env["ir.binary"]._get_stream_from(mock_attachment)
response = stream.get_response()
return response

Check warning on line 22 in sign_oca/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

sign_oca/controllers/main.py#L19-L22

Added lines #L19 - L22 were not covered by tests


class PortalSign(CustomerPortal):
@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")

Check warning on line 38 in sign_oca/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

sign_oca/controllers/main.py#L37-L38

Added lines #L37 - L38 were not covered by tests
if signer_sudo.signed_on:
return request.render(

Check warning on line 40 in sign_oca/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

sign_oca/controllers/main.py#L40

Added line #L40 was not covered by tests
"sign_oca.portal_sign_document_signed",
{
"signer": signer_sudo,
"company": signer_sudo.request_id.company_id,
},
)
return request.render(
"sign_oca.portal_sign_document",
{
"doc": signer_sudo.request_id,
"partner": signer_sudo.partner_id,
"signer": signer_sudo,
"access_token": access_token,
"sign_oca_backend_info": {
"access_token": access_token,
"signer_id": signer_sudo.id,
"lang": signer_sudo.partner_id.lang,
},
},
)

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

Check warning on line 74 in sign_oca/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

sign_oca/controllers/main.py#L73-L74

Added lines #L73 - L74 were not covered by tests
return http.Stream.from_binary_field(
signer_sudo.request_id, "data"
).get_response(mimetype="application/pdf")

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

Check warning on line 91 in sign_oca/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

sign_oca/controllers/main.py#L90-L91

Added lines #L90 - L91 were not covered by tests
return signer_sudo.get_info(access_token=access_token)

@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(

Check warning on line 104 in sign_oca/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

sign_oca/controllers/main.py#L103-L104

Added lines #L103 - L104 were not covered by tests
"sign.oca.request.signer", signer_id, access_token
)
except (AccessError, MissingError):
return request.redirect("/my")
return signer_sudo.action_sign(

Check warning on line 109 in sign_oca/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

sign_oca/controllers/main.py#L107-L109

Added lines #L107 - L109 were not covered by tests
items, access_token=access_token, latitude=latitude, longitude=longitude
)
Loading
Loading