Skip to content

Commit

Permalink
[IMP] sign_oca: pre-commit auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
peluko00 committed May 17, 2024
1 parent 86dca08 commit ef43b4d
Show file tree
Hide file tree
Showing 18 changed files with 195 additions and 184 deletions.
138 changes: 73 additions & 65 deletions sign_oca/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@ Sign Oca
: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/16.0/sign_oca
: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-16-0/sign-16-0-sign_oca
: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=16.0
: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.
This module allows to create documents for signature inside Odoo using
OWL.

**Table of contents**

Expand All @@ -38,110 +39,117 @@ This module allows to create documents for signature inside Odoo using OWL.
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).
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
- 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
---------

- 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

-----------------------------

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

- 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.
- 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:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`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)

------------

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

* Víctor Martínez
- Víctor Martínez

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -161,6 +169,6 @@ 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/16.0/sign_oca>`_ project on GitHub.
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.
7 changes: 1 addition & 6 deletions sign_oca/models/sign_oca_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@


class SignOcaRequest(models.Model):

_name = "sign.oca.request"
_inherit = ["mail.thread", "mail.activity.mixin"]
_description = "Sign Request"
Expand Down Expand Up @@ -302,7 +301,6 @@ def create(self, vals_list):


class SignOcaRequestSigner(models.Model):

_name = "sign.oca.request.signer"
_inherit = "portal.mixin"
_description = "Sign Request Value"
Expand Down Expand Up @@ -341,10 +339,7 @@ def _compute_is_allow_signature(self):
def _compute_access_url(self):
result = super()._compute_access_url()
for record in self:
record.access_url = "/sign_oca/document/%s/%s" % (
record.id,
record.access_token,
)
record.access_url = f"/sign_oca/document/{record.id}/{record.access_token}"
return result

@api.onchange("role_id")
Expand Down
3 changes: 2 additions & 1 deletion sign_oca/models/sign_oca_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class SignOcaRole(models.Model):
default="empty",
help="This field is used to define how the partner"
" will be calculated in the different roles of "
"a request. This field will be used when the 'Sign from Template' action is triggered.",
"a request. This field will be used when the "
"'Sign from Template' action is triggered.",
)
default_partner_id = fields.Many2one(
comodel_name="res.partner", string="Default partner"
Expand Down
4 changes: 1 addition & 3 deletions sign_oca/models/sign_oca_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class SignOcaTemplate(models.Model):

_name = "sign.oca.template"
_description = "Sign Oca Template" # TODO
_inherit = ["mail.thread"]
Expand Down Expand Up @@ -112,7 +111,7 @@ def _prepare_sign_oca_request_vals_from_record(self, record):
return {
"name": self.name,
"template_id": self.id,
"record_ref": "%s,%s" % (record._name, record.id),
"record_ref": f"{record._name},{record.id}",
"signatory_data": self._get_signatory_data(),
"data": self.data,
"signer_ids": [
Expand All @@ -130,7 +129,6 @@ def _prepare_sign_oca_request_vals_from_record(self, record):


class SignOcaTemplateItem(models.Model):

_name = "sign.oca.template.item"
_description = "Sign Oca Template Item" # TODO

Expand Down
3 changes: 3 additions & 0 deletions sign_oca/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
5 changes: 5 additions & 0 deletions sign_oca/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
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).
4 changes: 0 additions & 4 deletions sign_oca/readme/CONFIGURE.rst

This file was deleted.

3 changes: 3 additions & 0 deletions sign_oca/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Enric Tobella (www.dixmit.com)
- [Tecnativa](https://www.tecnativa.com):
- Víctor Martínez
6 changes: 0 additions & 6 deletions sign_oca/readme/CONTRIBUTORS.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
This module allows to create documents for signature inside Odoo using OWL.
This module allows to create documents for signature inside Odoo using
OWL.
5 changes: 5 additions & 0 deletions sign_oca/readme/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 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.
6 changes: 0 additions & 6 deletions sign_oca/readme/ROADMAP.rst

This file was deleted.

57 changes: 57 additions & 0 deletions sign_oca/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
## 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.
Loading

0 comments on commit ef43b4d

Please sign in to comment.