diff --git a/project_task_sign_oca/README.rst b/project_task_sign_oca/README.rst new file mode 100644 index 00000000..31d4125d --- /dev/null +++ b/project_task_sign_oca/README.rst @@ -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 `_. +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Escodoo + +Contributors +~~~~~~~~~~~~ + +* `Escodoo `_: + + * Marcel Savegnago + * Wesley Oliveira + +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 `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/project_task_sign_oca/__init__.py b/project_task_sign_oca/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/project_task_sign_oca/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/project_task_sign_oca/__manifest__.py b/project_task_sign_oca/__manifest__.py new file mode 100644 index 00000000..bf7317eb --- /dev/null +++ b/project_task_sign_oca/__manifest__.py @@ -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", + ], +} diff --git a/project_task_sign_oca/demo/sign_oca_role.xml b/project_task_sign_oca/demo/sign_oca_role.xml new file mode 100644 index 00000000..0c438940 --- /dev/null +++ b/project_task_sign_oca/demo/sign_oca_role.xml @@ -0,0 +1,12 @@ + + + + + + Task Customer + expression + {{object.partner_id.id}} + + + diff --git a/project_task_sign_oca/demo/sign_oca_template.xml b/project_task_sign_oca/demo/sign_oca_template.xml new file mode 100644 index 00000000..30d72193 --- /dev/null +++ b/project_task_sign_oca/demo/sign_oca_template.xml @@ -0,0 +1,32 @@ + + + + + + Task Approval + + + + + + + + 1 + 10 + 10 + 30 + 4 + + + + diff --git a/project_task_sign_oca/i18n/project_task_sign_oca.pot b/project_task_sign_oca/i18n/project_task_sign_oca.pot new file mode 100644 index 00000000..250be8ab --- /dev/null +++ b/project_task_sign_oca/i18n/project_task_sign_oca.pot @@ -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 "Task Sign" +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 "" diff --git a/project_task_sign_oca/models/__init__.py b/project_task_sign_oca/models/__init__.py new file mode 100644 index 00000000..52bf9877 --- /dev/null +++ b/project_task_sign_oca/models/__init__.py @@ -0,0 +1,4 @@ +from . import project_task +from . import res_company +from . import res_config_settings +from . import sign_oca_request diff --git a/project_task_sign_oca/models/project_task.py b/project_task_sign_oca/models/project_task.py new file mode 100644 index 00000000..f4ceedf5 --- /dev/null +++ b/project_task_sign_oca/models/project_task.py @@ -0,0 +1,60 @@ +# Copyright 2024 - TODAY, Wesley Oliveira +# 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 diff --git a/project_task_sign_oca/models/res_company.py b/project_task_sign_oca/models/res_company.py new file mode 100644 index 00000000..5c382c4c --- /dev/null +++ b/project_task_sign_oca/models/res_company.py @@ -0,0 +1,14 @@ +# Copyright 2024 - TODAY, Wesley Oliveira +# 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", + ) diff --git a/project_task_sign_oca/models/res_config_settings.py b/project_task_sign_oca/models/res_config_settings.py new file mode 100644 index 00000000..4ca65732 --- /dev/null +++ b/project_task_sign_oca/models/res_config_settings.py @@ -0,0 +1,15 @@ +# Copyright 2024 - TODAY, Wesley Oliveira +# 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, + ) diff --git a/project_task_sign_oca/models/sign_oca_request.py b/project_task_sign_oca/models/sign_oca_request.py new file mode 100644 index 00000000..29165de7 --- /dev/null +++ b/project_task_sign_oca/models/sign_oca_request.py @@ -0,0 +1,39 @@ +# Copyright 2024 - TODAY, Wesley Oliveira +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class SignOcaRequest(models.Model): + _inherit = "sign.oca.request" + + task_id = fields.Many2one( + comodel_name="project.task", + string="Task", + compute="_compute_task_id", + readonly=True, + store=True, + ) + project_id = fields.Many2one( + comodel_name="project.project", + string="Project", + compute="_compute_project_id", + compute_sudo=True, + readonly=True, + store=True, + ) + + @api.depends("record_ref") + def _compute_task_id(self): + for item in self.filtered( + lambda x: x.record_ref and x.record_ref._name == "project.task" + ): + item.task_id = item.record_ref.id + + @api.depends("record_ref") + def _compute_project_id(self): + for item in self.filtered( + lambda x: x.record_ref and x.record_ref._name == "project.task" + ): + task = self.env["project.task"].browse(item.record_ref.id) + item.project_id = task.project_id diff --git a/project_task_sign_oca/readme/CONFIGURE.rst b/project_task_sign_oca/readme/CONFIGURE.rst new file mode 100644 index 00000000..6a0dcb3d --- /dev/null +++ b/project_task_sign_oca/readme/CONFIGURE.rst @@ -0,0 +1,14 @@ +#. 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. diff --git a/project_task_sign_oca/readme/CONTRIBUTORS.rst b/project_task_sign_oca/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..bc15bdce --- /dev/null +++ b/project_task_sign_oca/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Escodoo `_: + + * Marcel Savegnago + * Wesley Oliveira diff --git a/project_task_sign_oca/readme/DESCRIPTION.rst b/project_task_sign_oca/readme/DESCRIPTION.rst new file mode 100644 index 00000000..db9767d5 --- /dev/null +++ b/project_task_sign_oca/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows you to generate manual and automatic signature requests from project tasks to task customers. diff --git a/project_task_sign_oca/readme/USAGE.rst b/project_task_sign_oca/readme/USAGE.rst new file mode 100644 index 00000000..ba7585fe --- /dev/null +++ b/project_task_sign_oca/readme/USAGE.rst @@ -0,0 +1,17 @@ +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. diff --git a/project_task_sign_oca/static/description/icon.png b/project_task_sign_oca/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/project_task_sign_oca/static/description/icon.png differ diff --git a/project_task_sign_oca/static/description/index.html b/project_task_sign_oca/static/description/index.html new file mode 100644 index 00000000..e6bfe2b6 --- /dev/null +++ b/project_task_sign_oca/static/description/index.html @@ -0,0 +1,471 @@ + + + + + +Project Task Sign Oca + + + +
+

Project Task Sign Oca

+ + +

Beta License: AGPL-3 OCA/sign Translate me on Weblate Try me on Runboat

+

This module allows you to generate manual and automatic signature requests from project tasks to task customers.

+

Table of contents

+ +
+

Configuration

+
    +
  1. Go to Sign > Settings > Roles and create a role with the following data:
  2. +
+
    +
  • Partner type: Expression
  • +
  • Expression: {{object.partner_id.id}}
  • +
+
    +
  1. Go to Sign > Templates and create a template with the following data:
  2. +
+
    +
  • Model: Project Task
  • +
  • In one of the fields, you must set the previously created role.
  • +
+
    +
  1. (Optional) Go to Project > Configuration > Settings.
  2. +
+
    +
  • 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. +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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Escodoo
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

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 project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/project_task_sign_oca/tests/__init__.py b/project_task_sign_oca/tests/__init__.py new file mode 100644 index 00000000..fad82f87 --- /dev/null +++ b/project_task_sign_oca/tests/__init__.py @@ -0,0 +1 @@ +from . import test_project_task_sign_oca diff --git a/project_task_sign_oca/tests/test_project_task_sign_oca.py b/project_task_sign_oca/tests/test_project_task_sign_oca.py new file mode 100644 index 00000000..28b99e07 --- /dev/null +++ b/project_task_sign_oca/tests/test_project_task_sign_oca.py @@ -0,0 +1,109 @@ +# Copyright 2024 - TODAY, Wesley Oliveira +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.tests.common import Form, TransactionCase + + +class TestProjectTaskSignOca(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.company_id = cls.env.company + cls.template = cls.env.ref( + "project_task_sign_oca.sign_oca_template_project_task_demo" + ) + cls.customer_a = cls.env["res.partner"].create( + { + "name": "Test Customer A", + } + ) + cls.customer_b = cls.env["res.partner"].create( + { + "name": "Test Customer B", + } + ) + cls.project_a = cls.env["project.project"].create( + { + "name": "Test Project A", + } + ) + cls.project_b = cls.env["project.project"].create( + { + "name": "Test Project B", + } + ) + cls.task_a = cls.env["project.task"].create( + { + "name": "Test Task A", + "project_id": cls.project_a.id, + "partner_id": cls.customer_a.id, + "company_id": cls.company_id.id, + } + ) + cls.task_b = cls.env["project.task"].create( + { + "name": "Test Task B", + "project_id": cls.project_b.id, + "partner_id": cls.customer_b.id, + "company_id": cls.company_id.id, + } + ) + + def test_template_generate_multi_project_task(self): + tasks = self.task_a + self.task_b + wizard_form = Form( + self.env["sign.oca.template.generate.multi"].with_context( + default_model="project.task", active_ids=tasks.ids + ) + ) + wizard_form.template_id = self.template + action = wizard_form.save().generate() + requests = self.env[action["res_model"]].search(action["domain"]) + self.assertEqual(len(requests), 2) + request_a = requests.filtered(lambda x: x.task_id == self.task_a) + request_b = requests.filtered(lambda x: x.task_id == self.task_b) + self.assertIn(self.customer_a, request_a.mapped("signer_ids.partner_id")) + self.assertIn(self.customer_b, request_b.mapped("signer_ids.partner_id")) + + def test_project_task_create(self): + self.company_id.project_task_sign_oca_template_id = self.template + task_c = self.env["project.task"].create( + { + "name": "Test Task C", + "project_id": self.project_a.id, + "partner_id": self.customer_a.id, + "company_id": self.company_id.id, + } + ) + self.assertIn( + self.customer_a, + task_c.sign_request_ids.mapped("signer_ids.partner_id"), + ) + self.assertEqual(task_c.sign_request_count, 1) + self.assertEqual(task_c.sign_request_ids[0].task_id, task_c) + self.assertEqual(task_c.sign_request_ids[0].project_id, self.project_a) + + def test_project_task_write(self): + self.company_id.project_task_sign_oca_template_id = self.template + task_d = self.env["project.task"].create( + { + "name": "Test Task D", + "project_id": self.project_a.id, + "partner_id": False, + "company_id": self.company_id.id, + } + ) + self.assertFalse(task_d.sign_request_ids) + self.assertEqual(task_d.sign_request_count, 0) + task_d.write({"partner_id": self.customer_a.id}) + self.assertIn( + self.customer_a, + task_d.sign_request_ids.mapped("signer_ids.partner_id"), + ) + self.assertEqual(task_d.sign_request_count, 1) + task_d.write({"partner_id": self.customer_b.id}) + self.assertIn( + self.customer_b, + task_d.sign_request_ids.mapped("signer_ids.partner_id"), + ) + self.assertEqual(task_d.sign_request_count, 2) diff --git a/project_task_sign_oca/views/project_task.xml b/project_task_sign_oca/views/project_task.xml new file mode 100644 index 00000000..e155320d --- /dev/null +++ b/project_task_sign_oca/views/project_task.xml @@ -0,0 +1,33 @@ + + + + + + project.task.form (in project_task_sign_oca) + project.task + + + +
+ +
+
+
+ +
diff --git a/project_task_sign_oca/views/res_config_settings.xml b/project_task_sign_oca/views/res_config_settings.xml new file mode 100644 index 00000000..ffbcc069 --- /dev/null +++ b/project_task_sign_oca/views/res_config_settings.xml @@ -0,0 +1,43 @@ + + + + + + res.config.settings.view.form.inherit.project (in project_task_sign_oca) + res.config.settings + + + +
+
+
+ Task Sign +
+ Define a template to enable automatic sign requests for the task customer +
+
+
+
+
+
+
+
+ +
diff --git a/project_task_sign_oca/views/sign_oca_request.xml b/project_task_sign_oca/views/sign_oca_request.xml new file mode 100644 index 00000000..20eb4d65 --- /dev/null +++ b/project_task_sign_oca/views/sign_oca_request.xml @@ -0,0 +1,59 @@ + + + + + + sign.oca.request.search (in project_task_sign_oca) + sign.oca.request + + + + + + + + + + + + + + + + sign.oca.request.form (in project_task_sign_oca) + sign.oca.request + + + + + + + + + + + sign.oca.request.tree (in project_task_sign_oca) + sign.oca.request + + + + + + + + + + diff --git a/setup/project_task_sign_oca/odoo/addons/project_task_sign_oca b/setup/project_task_sign_oca/odoo/addons/project_task_sign_oca new file mode 120000 index 00000000..49f1f4b3 --- /dev/null +++ b/setup/project_task_sign_oca/odoo/addons/project_task_sign_oca @@ -0,0 +1 @@ +../../../../project_task_sign_oca \ No newline at end of file diff --git a/setup/project_task_sign_oca/setup.py b/setup/project_task_sign_oca/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/project_task_sign_oca/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)