diff --git a/agreement_category/README.rst b/agreement_category/README.rst new file mode 100644 index 000000000..a384e8b9b --- /dev/null +++ b/agreement_category/README.rst @@ -0,0 +1,106 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +==================== +Agreement - Category +==================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:7c6bfddf64bc58c7b9900d5f0728230df9e6cc95ceca82250e3758f903dcf432 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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%2Fagreement-lightgray.png?logo=github + :target: https://github.com/OCA/agreement/tree/19.0/agreement_category + :alt: OCA/agreement +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/agreement-19-0/agreement-19-0-agreement_category + :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/agreement&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +The Agreements app lets you classify agreements by type, but a type is a +flat list that also drives the sale/purchase domain of an agreement. + +This module adds tags on agreements, the same way contacts are tagged: + +- a new *Agreement Tags* model (``agreement.category``), maintained + from *Agreements > Configuration > Tags*, +- a *Tags* field on the agreement form and list view, +- agreements can be searched, filtered and grouped by tag. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To create agreement tags: + +1. Go to *Agreements > Configuration > Tags*. +2. Create a tag, pick a color. + +To tag an agreement: + +1. Go to *Agreements > Agreements* and open an agreement. +2. Add as many tags as needed in the *Tags* field. + +In the agreement list view, use *Group By > Tags* to review the +agreements per tag. + +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 +------- + +* glueckkanja AG + +Contributors +------------ + +- `glueckkanja AG `__: + + - Mohamed Osman + +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/agreement `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/agreement_category/__init__.py b/agreement_category/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/agreement_category/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/agreement_category/__manifest__.py b/agreement_category/__manifest__.py new file mode 100644 index 000000000..b1270d15f --- /dev/null +++ b/agreement_category/__manifest__.py @@ -0,0 +1,17 @@ +{ + "name": "Agreement - Category", + "summary": "Classify agreements with tags", + "version": "19.0.1.0.0", + "category": "Contract", + "author": "glueckkanja AG, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/agreement", + "license": "AGPL-3", + "depends": ["agreement"], + "data": [ + "security/ir.model.access.csv", + "views/agreement_category_views.xml", + "views/agreement_views.xml", + ], + "development_status": "Beta", + "installable": True, +} diff --git a/agreement_category/models/__init__.py b/agreement_category/models/__init__.py new file mode 100644 index 000000000..b5282549a --- /dev/null +++ b/agreement_category/models/__init__.py @@ -0,0 +1,2 @@ +from . import agreement_category +from . import agreement diff --git a/agreement_category/models/agreement.py b/agreement_category/models/agreement.py new file mode 100644 index 000000000..508c2bf1f --- /dev/null +++ b/agreement_category/models/agreement.py @@ -0,0 +1,14 @@ +from odoo import fields, models + + +class Agreement(models.Model): + _inherit = "agreement" + + category_ids = fields.Many2many( + "agreement.category", + column1="agreement_id", + column2="category_id", + string="Tags", + tracking=True, + help="Classify the agreement with as many tags as needed.", + ) diff --git a/agreement_category/models/agreement_category.py b/agreement_category/models/agreement_category.py new file mode 100644 index 000000000..76a8aa65b --- /dev/null +++ b/agreement_category/models/agreement_category.py @@ -0,0 +1,28 @@ +from random import randint + +from odoo import fields, models + + +class AgreementCategory(models.Model): + _name = "agreement.category" + _description = "Agreement Tags" + _order = "name" + + def _get_default_color(self): + return randint(1, 11) + + name = fields.Char(required=True, translate=True) + color = fields.Integer( + default=lambda self: self._get_default_color(), aggregator=False + ) + active = fields.Boolean( + default=True, + help="The active field allows you to hide the tag without removing it.", + ) + agreement_ids = fields.Many2many( + "agreement", + column1="category_id", + column2="agreement_id", + string="Agreements", + copy=False, + ) diff --git a/agreement_category/pyproject.toml b/agreement_category/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/agreement_category/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/agreement_category/readme/CONTRIBUTORS.md b/agreement_category/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..b010ee49c --- /dev/null +++ b/agreement_category/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- [glueckkanja AG](https://glueckkanja.com): + - Mohamed Osman \<\> diff --git a/agreement_category/readme/DESCRIPTION.md b/agreement_category/readme/DESCRIPTION.md new file mode 100644 index 000000000..837a14fe7 --- /dev/null +++ b/agreement_category/readme/DESCRIPTION.md @@ -0,0 +1,9 @@ +The Agreements app lets you classify agreements by type, but a type is a +flat list that also drives the sale/purchase domain of an agreement. + +This module adds tags on agreements, the same way contacts are tagged: + +- a new *Agreement Tags* model (`agreement.category`), maintained from + *Agreements \> Configuration \> Tags*, +- a *Tags* field on the agreement form and list view, +- agreements can be searched, filtered and grouped by tag. diff --git a/agreement_category/readme/USAGE.md b/agreement_category/readme/USAGE.md new file mode 100644 index 000000000..aa61141e0 --- /dev/null +++ b/agreement_category/readme/USAGE.md @@ -0,0 +1,12 @@ +To create agreement tags: + +1. Go to *Agreements \> Configuration \> Tags*. +2. Create a tag, pick a color. + +To tag an agreement: + +1. Go to *Agreements \> Agreements* and open an agreement. +2. Add as many tags as needed in the *Tags* field. + +In the agreement list view, use *Group By \> Tags* to review the agreements +per tag. \ No newline at end of file diff --git a/agreement_category/security/ir.model.access.csv b/agreement_category/security/ir.model.access.csv new file mode 100644 index 000000000..1cf71ec49 --- /dev/null +++ b/agreement_category/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_agreement_category_user,agreement.category.user,model_agreement_category,agreement.group_agreement_readonly,1,0,0,0 +access_agreement_category_manager,agreement.category.manager,model_agreement_category,agreement.group_agreement_manager,1,1,1,1 diff --git a/agreement_category/static/description/icon.png b/agreement_category/static/description/icon.png new file mode 100644 index 000000000..976ee9a35 Binary files /dev/null and b/agreement_category/static/description/icon.png differ diff --git a/agreement_category/static/description/index.html b/agreement_category/static/description/index.html new file mode 100644 index 000000000..40bccb7af --- /dev/null +++ b/agreement_category/static/description/index.html @@ -0,0 +1,456 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Agreement - Category

+ +

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

+

The Agreements app lets you classify agreements by type, but a type is a +flat list that also drives the sale/purchase domain of an agreement.

+

This module adds tags on agreements, the same way contacts are tagged:

+
    +
  • a new Agreement Tags model (agreement.category), maintained +from Agreements > Configuration > Tags,
  • +
  • a Tags field on the agreement form and list view,
  • +
  • agreements can be searched, filtered and grouped by tag.
  • +
+

Table of contents

+ +
+

Usage

+

To create agreement tags:

+
    +
  1. Go to Agreements > Configuration > Tags.
  2. +
  3. Create a tag, pick a color.
  4. +
+

To tag an agreement:

+
    +
  1. Go to Agreements > Agreements and open an agreement.
  2. +
  3. Add as many tags as needed in the Tags field.
  4. +
+

In the agreement list view, use Group By > Tags to review the +agreements per tag.

+
+
+

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

+
    +
  • glueckkanja AG
  • +
+
+ +
+

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

+

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

+
+
+
+
+ + diff --git a/agreement_category/views/agreement_category_views.xml b/agreement_category/views/agreement_category_views.xml new file mode 100644 index 000000000..3fe3d6737 --- /dev/null +++ b/agreement_category/views/agreement_category_views.xml @@ -0,0 +1,42 @@ + + + agreement.category.list + agreement.category + + + + + + + + + + agreement.category.form + agreement.category + +
+ + + + + + + +
+
+
+ + + Agreement Categories + agreement.category + list,form + + +
diff --git a/agreement_category/views/agreement_views.xml b/agreement_category/views/agreement_views.xml new file mode 100644 index 000000000..a96897ae0 --- /dev/null +++ b/agreement_category/views/agreement_views.xml @@ -0,0 +1,33 @@ + + + + agreement.form.category + agreement + + + + + + + + + agreement.list.category + agreement + + + + + + + +