-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
24 changed files
with
1,175 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
===================== | ||
Project Task Sign Oca | ||
===================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:ef9506e1ac22f6f38d91f32bddc1ab62a1f17703d1a3d3b449c1ca148240d7d4 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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/15.0/project_task_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-15-0/sign-15-0-project_task_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=15.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module allows you to generate manual and automatic signature requests from project tasks to task customers. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
#. Go to Sign > Settings > Roles and create a role with the following data: | ||
|
||
- Partner type: Expression | ||
- Expression: {{object.partner_id.id}} | ||
|
||
#. Go to Sign > Templates and create a template with the following data: | ||
|
||
- Model: Project Task | ||
- In one of the fields, you must set the previously created role. | ||
|
||
#. (Optional) Go to Project > Configuration > Settings. | ||
|
||
- In the Task Sign section, define a template to enable automatic task sing requests. | ||
- Use the template previously created. | ||
|
||
Usage | ||
===== | ||
|
||
Creating a Signature Request from a Project Task: | ||
- Go to Projects > Tasks. | ||
- Open an existing task or create a new one (make sure to fill in the `partner_id` field). | ||
- In the task tree or form view, click on the action "Sign from template". | ||
- Sign Requests will have been generated (and sent) linked to the selected project and task. | ||
|
||
Automatic Signature Request creation: | ||
- Define a template in Project > Configuration > Settings. | ||
- When an customer is assigned to a task, a Sign Request will be created (and sent) automatically. | ||
|
||
Viewing Signature Requests: | ||
- Go to Projects > Tasks. | ||
- Open a task with an associated signature request. | ||
- Click on the smart-button Sign Requests. | ||
- Click on any signature request to view its details, status, and progress. | ||
- Alternatively, go to Sign > Requests. | ||
- Use the Group By feature to group requests by Project and/or Task. | ||
|
||
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:%20project_task_sign_oca%0Aversion:%2015.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 | ||
~~~~~~~ | ||
|
||
* Escodoo | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* `Escodoo <https://www.escodoo.com.br>`_: | ||
|
||
* Marcel Savegnago <marcel.savegnago@escodoo.com.br> | ||
* Wesley Oliveira <wesley.oliveira@escodoo.com.br> | ||
|
||
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/15.0/project_task_sign_oca>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2024 - TODAY, Escodoo | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Project Task Sign Oca", | ||
"summary": """ | ||
Project Task Sign Oca""", | ||
"version": "15.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "Escodoo, Odoo Community Association (OCA)", | ||
"website": "https://github.com/OCA/sign", | ||
"depends": ["sign_oca", "project"], | ||
"data": [ | ||
"views/project_task.xml", | ||
"views/res_config_settings.xml", | ||
"views/sign_oca_request.xml", | ||
], | ||
"demo": [ | ||
"demo/sign_oca_role.xml", | ||
"demo/sign_oca_template.xml", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- Copyright 2024 - TODAY, Wesley Oliveira <wesley.oliveira@escodoo.com.br> | ||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
|
||
<record id="sign_role_project_task_customer" model="sign.oca.role"> | ||
<field name="name">Task Customer</field> | ||
<field name="partner_type">expression</field> | ||
<field name="expression_partner">{{object.partner_id.id}}</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- Copyright 2024 - TODAY, Wesley Oliveira <wesley.oliveira@escodoo.com.br> | ||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
|
||
<record id="sign_oca_template_project_task_demo" model="sign.oca.template"> | ||
<field name="name">Task Approval</field> | ||
<field name="model_id" ref="project.model_project_task" /> | ||
<field name="data" type="base64" file="sign_oca/tests/empty.pdf" /> | ||
</record> | ||
<record | ||
id="sign_oca_template_project_task_demo_item" | ||
model="sign.oca.template.item" | ||
> | ||
<field | ||
name="template_id" | ||
ref="project_task_sign_oca.sign_oca_template_project_task_demo" | ||
/> | ||
<field name="field_id" ref="sign_oca.sign_field_signature" /> | ||
<field | ||
name="role_id" | ||
ref="project_task_sign_oca.sign_role_project_task_customer" | ||
/> | ||
<field name="page">1</field> | ||
<field name="position_x">10</field> | ||
<field name="position_y">10</field> | ||
<field name="width">30</field> | ||
<field name="height">4</field> | ||
<field name="required" eval="True" /> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * project_task_sign_oca | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: project_task_sign_oca | ||
#: model_terms:ir.ui.view,arch_db:project_task_sign_oca.res_config_settings_view_form | ||
msgid "<span class=\"o_form_label\">Task Sign</span>" | ||
msgstr "" | ||
|
||
#. module: project_task_sign_oca | ||
#: model:ir.model,name:project_task_sign_oca.model_res_company | ||
msgid "Companies" | ||
msgstr "" | ||
|
||
#. module: project_task_sign_oca | ||
#: model:ir.model,name:project_task_sign_oca.model_res_config_settings | ||
msgid "Config Settings" | ||
msgstr "" | ||
|
||
#. module: project_task_sign_oca | ||
#: model_terms:ir.ui.view,arch_db:project_task_sign_oca.res_config_settings_view_form | ||
msgid "" | ||
"Define a template to enable automatic sign requests for the task customer" | ||
msgstr "" | ||
|
||
#. module: project_task_sign_oca | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_project_task__display_name | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_res_company__display_name | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_res_config_settings__display_name | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_sign_oca_request__display_name | ||
msgid "Display Name" | ||
msgstr "" | ||
|
||
#. module: project_task_sign_oca | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_project_task__id | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_res_company__id | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_res_config_settings__id | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_sign_oca_request__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: project_task_sign_oca | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_project_task____last_update | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_res_company____last_update | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_res_config_settings____last_update | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_sign_oca_request____last_update | ||
msgid "Last Modified on" | ||
msgstr "" | ||
|
||
#. module: project_task_sign_oca | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_sign_oca_request__project_id | ||
#: model_terms:ir.ui.view,arch_db:project_task_sign_oca.sign_oca_request_search_view | ||
msgid "Project" | ||
msgstr "" | ||
|
||
#. module: project_task_sign_oca | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_res_company__project_task_sign_oca_template_id | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_res_config_settings__project_task_sign_oca_template_id | ||
msgid "Project Task Sign Oca Template" | ||
msgstr "" | ||
|
||
#. module: project_task_sign_oca | ||
#: model:ir.model,name:project_task_sign_oca.model_sign_oca_request | ||
msgid "Sign Request" | ||
msgstr "" | ||
|
||
#. module: project_task_sign_oca | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_project_task__sign_request_ids | ||
#: model_terms:ir.ui.view,arch_db:project_task_sign_oca.view_task_form2 | ||
msgid "Sign Requests" | ||
msgstr "" | ||
|
||
#. module: project_task_sign_oca | ||
#: model_terms:ir.ui.view,arch_db:project_task_sign_oca.res_config_settings_view_form | ||
msgid "Sign Template" | ||
msgstr "" | ||
|
||
#. module: project_task_sign_oca | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_project_task__sign_request_count | ||
msgid "Sign request count" | ||
msgstr "" | ||
|
||
#. module: project_task_sign_oca | ||
#: model:ir.model,name:project_task_sign_oca.model_project_task | ||
#: model:ir.model.fields,field_description:project_task_sign_oca.field_sign_oca_request__task_id | ||
#: model_terms:ir.ui.view,arch_db:project_task_sign_oca.sign_oca_request_search_view | ||
msgid "Task" | ||
msgstr "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from . import project_task | ||
from . import res_company | ||
from . import res_config_settings | ||
from . import sign_oca_request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Copyright 2024 - TODAY, Wesley Oliveira <wesley.oliveira@escodoo.com.br> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class ProjectTask(models.Model): | ||
|
||
_inherit = "project.task" | ||
|
||
sign_request_ids = fields.One2many( | ||
comodel_name="sign.oca.request", | ||
inverse_name="task_id", | ||
string="Sign Requests", | ||
) | ||
sign_request_count = fields.Integer( | ||
string="Sign request count", | ||
compute="_compute_sign_request_count", | ||
compute_sudo=True, | ||
) | ||
|
||
@api.depends("sign_request_ids") | ||
def _compute_sign_request_count(self): | ||
for task in self: | ||
task.sign_request_count = len(task.sign_request_ids) | ||
|
||
def action_view_sign_requests(self): | ||
self.ensure_one() | ||
result = self.env["ir.actions.act_window"]._for_xml_id( | ||
"sign_oca.sign_oca_request_act_window" | ||
) | ||
result["domain"] = [("id", "in", self.sign_request_ids.ids)] | ||
return result | ||
|
||
def _generate_sign_oca_request(self): | ||
sign_request_obj = self.env["sign.oca.request"].sudo() | ||
for task in self: | ||
sign_template = task.company_id.project_task_sign_oca_template_id | ||
if sign_template: | ||
sign_template = sign_template.sudo() | ||
request = sign_request_obj.create( | ||
sign_template._prepare_sign_oca_request_vals_from_record(task) | ||
) | ||
request.action_send() | ||
|
||
@api.model_create_multi | ||
def create(self, vals_list): | ||
res = super().create(vals_list) | ||
for task in res: | ||
if task.partner_id: | ||
task._generate_sign_oca_request() | ||
return res | ||
|
||
def write(self, vals): | ||
old_partner_id = self.partner_id | ||
new_partner_id = vals.get("partner_id") | ||
res = super().write(vals) | ||
if new_partner_id and new_partner_id != old_partner_id: | ||
self._generate_sign_oca_request() | ||
return res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright 2024 - TODAY, Wesley Oliveira <wesley.oliveira@escodoo.com.br> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResCompany(models.Model): | ||
_inherit = "res.company" | ||
|
||
project_task_sign_oca_template_id = fields.Many2one( | ||
comodel_name="sign.oca.template", | ||
domain="[('model_id.model', '=', 'project.task')]", | ||
string="Project Task Sign Oca Template", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Copyright 2024 - TODAY, Wesley Oliveira <wesley.oliveira@escodoo.com.br> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class ResConfigSettings(models.TransientModel): | ||
_inherit = "res.config.settings" | ||
|
||
project_task_sign_oca_template_id = fields.Many2one( | ||
comodel_name="sign.oca.template", | ||
related="company_id.project_task_sign_oca_template_id", | ||
string="Project Task Sign Oca Template", | ||
readonly=False, | ||
) |
Oops, something went wrong.