Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions agreement_category/README.rst
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/OCA/agreement/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/agreement/issues/new?body=module:%20agreement_category%0Aversion:%2019.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
-------

* glueckkanja AG

Contributors
------------

- `glueckkanja AG <https://glueckkanja.com>`__:

- Mohamed Osman <mohamed.osman@glueckkanja.com>

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 <https://github.com/OCA/agreement/tree/19.0/agreement_category>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions agreement_category/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions agreement_category/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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,
}
2 changes: 2 additions & 0 deletions agreement_category/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import agreement_category
from . import agreement
14 changes: 14 additions & 0 deletions agreement_category/models/agreement.py
Original file line number Diff line number Diff line change
@@ -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.",
)
28 changes: 28 additions & 0 deletions agreement_category/models/agreement_category.py
Original file line number Diff line number Diff line change
@@ -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,
)
3 changes: 3 additions & 0 deletions agreement_category/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions agreement_category/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [glueckkanja AG](https://glueckkanja.com):
- Mohamed Osman \<<mohamed.osman@glueckkanja.com>\>
9 changes: 9 additions & 0 deletions agreement_category/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -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.
12 changes: 12 additions & 0 deletions agreement_category/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 3 additions & 0 deletions agreement_category/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -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
Binary file added agreement_category/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading