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 2b8a715 commit e474b2e
Show file tree
Hide file tree
Showing 14 changed files with 83 additions and 85 deletions.
63 changes: 33 additions & 30 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 @@ -39,62 +40,64 @@ 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 a document
~~~~~~~~~~~~~~~
---------------

* Access `Sign / Templates`
* Press the `Sign` button from a template
* Fill all the possible partners that will sign the document
* 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
- 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

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)
- Enric Tobella (`www.dixmit.com <http://www.dixmit.com>`__)

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

This module is maintained by the OCA.

Expand All @@ -114,6 +117,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 @@ -259,7 +258,6 @@ def create(self, vals_list):


class SignOcaRequestSigner(models.Model):

_name = "sign.oca.request.signer"
_inherit = "portal.mixin"
_description = "Sign Request Value"
Expand All @@ -275,10 +273,7 @@ class SignOcaRequestSigner(models.Model):
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

def get_info(self, access_token=False):
Expand Down
2 changes: 0 additions & 2 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 @@ -69,7 +68,6 @@ def add_item(self, item_vals):


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"
1 change: 1 addition & 0 deletions sign_oca/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Enric Tobella (www.dixmit.com)
1 change: 0 additions & 1 deletion 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.

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

- Access Sign / Templates
- Press the Sign button from a template
- Fill all the possible partners that will sign the document
- 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
21 changes: 0 additions & 21 deletions sign_oca/readme/USAGE.rst

This file was deleted.

29 changes: 16 additions & 13 deletions sign_oca/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,9 @@ <h1 class="title">Sign Oca</h1>
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:63288a7dea60d1069629ed9db642d36b60ad6a2bd20f006a3703584c03278bdf
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/sign/tree/16.0/sign_oca"><img alt="OCA/sign" src="https://img.shields.io/badge/github-OCA%2Fsign-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sign-16-0/sign-16-0-sign_oca"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/sign&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to create documents for signature inside Odoo using OWL.</p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/sign/tree/17.0/sign_oca"><img alt="OCA/sign" src="https://img.shields.io/badge/github-OCA%2Fsign-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/sign-17-0/sign-17-0-sign_oca"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/sign&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module allows to create documents for signature inside Odoo using
OWL.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
Expand All @@ -396,25 +397,27 @@ <h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<div class="section" id="creation-of-templates">
<h2><a class="toc-backref" href="#toc-entry-2">Creation of templates</a></h2>
<ul class="simple">
<li>Access <cite>Sign / Templates</cite></li>
<li>Access Sign / Templates</li>
<li>Create a new template</li>
<li>Add a PDF File</li>
<li>Access the configuration menu</li>
<li>You can add a field by doing a right click inside a page</li>
<li>Click on the field in order to delete or edit some configuration of it</li>
<li>Click on the field in order to delete or edit some configuration of
it</li>
<li>The template is autosaved</li>
</ul>
</div>
<div class="section" id="sign-a-document">
<h2><a class="toc-backref" href="#toc-entry-3">Sign a document</a></h2>
<ul class="simple">
<li>Access <cite>Sign / Templates</cite></li>
<li>Press the <cite>Sign</cite> button from a template</li>
<li>Access Sign / Templates</li>
<li>Press the Sign button from a template</li>
<li>Fill all the possible partners that will sign the document</li>
<li>The signature action will be opened.</li>
<li>There, you can fill all the data you need.</li>
<li>Once you finish, press the sign button on the top</li>
<li>When the last signer signs it, the final file will be generated as a PDF</li>
<li>When the last signer signs it, the final file will be generated as a
PDF</li>
</ul>
</div>
</div>
Expand All @@ -423,9 +426,9 @@ <h1><a class="toc-backref" href="#toc-entry-4">Known issues / Roadmap</a></h1>
<div class="section" id="tasks">
<h2><a class="toc-backref" href="#toc-entry-5">Tasks</a></h2>
<ul class="simple">
<li>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.</li>
<li>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.</li>
</ul>
</div>
</div>
Expand All @@ -434,7 +437,7 @@ <h1><a class="toc-backref" href="#toc-entry-6">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sign/issues">GitHub Issues</a>.
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
<a class="reference external" href="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</a>.</p>
<a class="reference external" href="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**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -448,7 +451,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Authors</a></h2>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-9">Contributors</a></h2>
<ul class="simple">
<li>Enric Tobella (www.dixmit.com)</li>
<li>Enric Tobella (<a class="reference external" href="http://www.dixmit.com">www.dixmit.com</a>)</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -460,7 +463,7 @@ <h2><a class="toc-backref" href="#toc-entry-10">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/etobella"><img alt="etobella" src="https://github.com/etobella.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sign/tree/16.0/sign_oca">OCA/sign</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sign/tree/17.0/sign_oca">OCA/sign</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down
6 changes: 2 additions & 4 deletions sign_oca/tests/test_sign_portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,12 @@ def test_portal(self):
self.assertEqual(
base64.b64decode(self.data),
self.url_open(
"/sign_oca/content/%s/%s"
% (self.request.signer_ids.id, self.request.signer_ids.access_token)
f"/sign_oca/content/{self.request.signer_ids.id}/{self.request.signer_ids.access_token}"
).content,
)
self.assertEqual(
self.url_open(
"/sign_oca/info/%s/%s"
% (self.request.signer_ids.id, self.request.signer_ids.access_token),
f"/sign_oca/info/{self.request.signer_ids.id}/{self.request.signer_ids.access_token}",
data="{}",
headers={"Content-Type": "application/json"},
).json()["result"]["items"][str(self.item["id"])],
Expand Down
1 change: 0 additions & 1 deletion sign_oca/wizards/sign_oca_template_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class SignOcaTemplateGenerate(models.TransientModel):

_name = "sign.oca.template.generate"
_description = "Generate a signature request"

Expand Down

0 comments on commit e474b2e

Please sign in to comment.