diff --git a/attribute_set_completeness/README.rst b/attribute_set_completeness/README.rst new file mode 100644 index 00000000..a24c8ba6 --- /dev/null +++ b/attribute_set_completeness/README.rst @@ -0,0 +1,89 @@ +========================== +Attribute Set Completeness +========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f8b14699a8f767d4a9ebd91a042aacd07606905af8292e7f3cb459f23958b77a + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fodoo--pim-lightgray.png?logo=github + :target: https://github.com/OCA/odoo-pim/tree/16.0/attribute_set_completeness + :alt: OCA/odoo-pim +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/odoo-pim-16-0/odoo-pim-16-0-attribute_set_completeness + :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/odoo-pim&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows the user define a completion rate on the model linked to an attribute set. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Go on an attribute set and fill in the section 'Completeness'. +Select the fields you want to take in account and set them their proportion on the completeness rate. +Then on the model linked to the attribute set you'll get 2 fields: completion rate and completion state + +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 +~~~~~~~ + +* ACSONE SA/NV + +Contributors +~~~~~~~~~~~~ + +* Cédric PIGEON +* Xavier Bouquiaux +* `Camptocamp `_ + + * Iván Todorovich + +* Dhara Solanki + +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/odoo-pim `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/attribute_set_completeness/__init__.py b/attribute_set_completeness/__init__.py new file mode 100644 index 00000000..f24d3e24 --- /dev/null +++ b/attribute_set_completeness/__init__.py @@ -0,0 +1,2 @@ +from . import components +from . import models diff --git a/attribute_set_completeness/__manifest__.py b/attribute_set_completeness/__manifest__.py new file mode 100644 index 00000000..27c28938 --- /dev/null +++ b/attribute_set_completeness/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright 2020 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Attribute Set Completeness", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/odoo-pim", + "depends": ["attribute_set", "component_event"], + "data": [ + "views/attribute_set.xml", + "security/attribute_set_completeness.xml", + "views/attribute_set_completeness.xml", + ], + "demo": [], +} diff --git a/attribute_set_completeness/components/__init__.py b/attribute_set_completeness/components/__init__.py new file mode 100644 index 00000000..4502c421 --- /dev/null +++ b/attribute_set_completeness/components/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2020 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import attribute_set_owner_event_listener diff --git a/attribute_set_completeness/components/attribute_set_owner_event_listener.py b/attribute_set_completeness/components/attribute_set_owner_event_listener.py new file mode 100644 index 00000000..6237bcd6 --- /dev/null +++ b/attribute_set_completeness/components/attribute_set_owner_event_listener.py @@ -0,0 +1,31 @@ +# Copyright 2020 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.addons.component.core import AbstractComponent +from odoo.addons.component_event import skip_if + + +class AttributeSetOwnerEventListener(AbstractComponent): + _name = "attribute.set.owner.event.listener" + _inherit = "base.event.listener" + + def _get_skip_if_condition_fields(self, record): + """Return the field names that trigger the condition""" + attribute_set = record.attribute_set_id + attribute_set_completeness = attribute_set.attribute_set_completeness_ids + field_names = attribute_set_completeness.mapped("field_id.name") + field_names.append("attribute_set_id") + return field_names + + def _get_skip_if_condition(self, record, **kwargs): + if not record.attribute_set_id: + return True + if set(self._get_skip_if_condition_fields(record)) & set(kwargs["fields"]): + return False + return True + + @skip_if( + lambda self, record, **kwargs: self._get_skip_if_condition(record, **kwargs) + ) + def on_record_write(self, record, fields=None): + record._compute_attribute_set_completed_ids() diff --git a/attribute_set_completeness/i18n/attribute_set_completeness.pot b/attribute_set_completeness/i18n/attribute_set_completeness.pot new file mode 100644 index 00000000..099aaf87 --- /dev/null +++ b/attribute_set_completeness/i18n/attribute_set_completeness.pot @@ -0,0 +1,168 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * attribute_set_completeness +# +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: attribute_set_completeness +#: model:ir.model,name:attribute_set_completeness.model_attribute_set +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness__attribute_set_id +msgid "Attribute Set" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model,name:attribute_set_completeness.model_attribute_set_completeness +msgid "Attribute Set Completeness" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_owner_mixin__attribute_set_completion_rate +msgid "Attribute Set Completion Rate" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_owner_mixin__attribute_set_completion_state +msgid "Attribute Set Completion State" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_owner_mixin__attribute_set_completed_ids +msgid "Attribute Set completed criterias" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_owner_mixin__attribute_set_not_completed_ids +msgid "Attribute Set not completed criterias" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness__available_field_ids +msgid "Attribute Set's fields" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,help:attribute_set_completeness.field_attribute_set_owner_mixin__attribute_set_completion_rate +msgid "Attribute set completeness percentage" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,help:attribute_set_completeness.field_attribute_set_owner_mixin__attribute_set_completion_state +msgid "Attribute set completeness status" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model,name:attribute_set_completeness.model_attribute_set_owner_mixin +msgid "Attribute set owner mixin" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields.selection,name:attribute_set_completeness.selection__attribute_set_owner_mixin__attribute_set_completion_state__complete +msgid "Complete" +msgstr "" + +#. module: attribute_set_completeness +#: model_terms:ir.ui.view,arch_db:attribute_set_completeness.attribute_set_form_view +msgid "Completeness" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set__attribute_set_completeness_ids +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_owner_mixin__attribute_set_completeness_ids +msgid "Completeness Requirements" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness__completion_rate +msgid "Completion Rate" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness__completion_rate_progress +msgid "Completion Rate Progress" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness__create_uid +msgid "Created by" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness__create_date +msgid "Created on" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set__display_name +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness__display_name +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_owner_mixin__display_name +msgid "Display Name" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness__field_description +msgid "Field Description" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness__field_id +msgid "Field Name" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,help:attribute_set_completeness.field_attribute_set_completeness__available_field_ids +msgid "Fields related to the Attribute set's attributes" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set__id +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness__id +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_owner_mixin__id +msgid "ID" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set____last_update +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness____last_update +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_owner_mixin____last_update +msgid "Last Modified on" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness__write_uid +msgid "Last Updated by" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness__write_date +msgid "Last Updated on" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields,field_description:attribute_set_completeness.field_attribute_set_completeness__model_id +msgid "Model" +msgstr "" + +#. module: attribute_set_completeness +#: model:ir.model.fields.selection,name:attribute_set_completeness.selection__attribute_set_owner_mixin__attribute_set_completion_state__not_complete +msgid "Not complete" +msgstr "" + +#. module: attribute_set_completeness +#: model_terms:ir.ui.view,arch_db:attribute_set_completeness.attribute_set_completeness_tree_view +msgid "Total" +msgstr "" + +#. module: attribute_set_completeness +#: code:addons/attribute_set_completeness/models/attribute_set.py:0 +#, python-format +msgid "Total of completion rate must be 100 %" +msgstr "" diff --git a/attribute_set_completeness/migrations/14.0.1.0.1/pre-migration.py b/attribute_set_completeness/migrations/14.0.1.0.1/pre-migration.py new file mode 100644 index 00000000..f0491f6a --- /dev/null +++ b/attribute_set_completeness/migrations/14.0.1.0.1/pre-migration.py @@ -0,0 +1,27 @@ +# Copyright 2022 Acsone SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +# when migrating to v14, 2 fields have been renamed +# completion_rate -> attribute_set_completion_rate +# completion_state -> attribute_set_completion_state +from openupgradelib import openupgrade + +field_renames = [ + ( + "attribute.set.owner.mixin", + "attribute.set.owner.mixin", + "completion_rate", + "attribute_set_completion_rate", + ), + ( + "attribute.set.owner.mixin", + "attribute.set.owner.mixin", + "completion_state", + "attribute_set_completion_state", + ), +] + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.rename_fields(env, field_renames) diff --git a/attribute_set_completeness/models/__init__.py b/attribute_set_completeness/models/__init__.py new file mode 100644 index 00000000..2f249ad7 --- /dev/null +++ b/attribute_set_completeness/models/__init__.py @@ -0,0 +1,3 @@ +from . import attribute_set_completeness +from . import attribute_set +from . import attribute_set_owner_mixin diff --git a/attribute_set_completeness/models/attribute_set.py b/attribute_set_completeness/models/attribute_set.py new file mode 100644 index 00000000..e2ec4caa --- /dev/null +++ b/attribute_set_completeness/models/attribute_set.py @@ -0,0 +1,25 @@ +# Copyright 2020 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError + + +class AttributeSet(models.Model): + _inherit = "attribute.set" + + attribute_set_completeness_ids = fields.One2many( + comodel_name="attribute.set.completeness", + inverse_name="attribute_set_id", + string="Completeness Requirements", + auto_join=True, + ) + + @api.constrains("attribute_set_completeness_ids") + def _check_attribute_set_completeness_ids(self): + for attr_set in self: + completion_config = attr_set.attribute_set_completeness_ids + if completion_config: + total = sum([rule.completion_rate for rule in completion_config]) + if total != 100.0: + raise ValidationError(_("Total of completion rate must be 100 %")) diff --git a/attribute_set_completeness/models/attribute_set_completeness.py b/attribute_set_completeness/models/attribute_set_completeness.py new file mode 100644 index 00000000..68af5c77 --- /dev/null +++ b/attribute_set_completeness/models/attribute_set_completeness.py @@ -0,0 +1,45 @@ +# Copyright 2020 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class AttributeSetCompleteness(models.Model): + _name = "attribute.set.completeness" + _description = "Attribute Set Completeness" + _rec_name = "field_id" + + attribute_set_id = fields.Many2one( + "attribute.set", required=True, ondelete="cascade" + ) + available_field_ids = fields.Many2many( + string="Attribute Set's fields", + comodel_name="ir.model.fields", + compute="_compute_available_field_ids", + help="Fields related to the Attribute set's attributes", + ) + field_id = fields.Many2one( + "ir.model.fields", "Field Name", required=True, ondelete="cascade" + ) + field_description = fields.Char( + related="field_id.field_description", + string="Field Description", + store=True, + readonly=True, + ) + completion_rate = fields.Float() + completion_rate_progress = fields.Float( + string="Completion Rate Progress", related="completion_rate", readonly=True + ) + model_id = fields.Many2one(related="attribute_set_id.model_id", readonly=True) + + @api.depends("attribute_set_id") + def _compute_available_field_ids(self): + for rec in self: + att_set_field_ids = rec.attribute_set_id.attribute_ids.mapped("field_id") + att_set_complete_ids = rec.attribute_set_id.attribute_set_completeness_ids + choosen_field_ids = att_set_complete_ids.mapped("field_id") + rec.available_field_ids = att_set_field_ids - choosen_field_ids + + def name_get(self): + return [(rec.id, rec.field_id.field_description) for rec in self] diff --git a/attribute_set_completeness/models/attribute_set_owner_mixin.py b/attribute_set_completeness/models/attribute_set_owner_mixin.py new file mode 100644 index 00000000..18808c88 --- /dev/null +++ b/attribute_set_completeness/models/attribute_set_owner_mixin.py @@ -0,0 +1,73 @@ +# Copyright 2020 ACSONE SA/NV +# Copyright 2021 Camptocamp (http://www.camptocamp.com). +# @author Iván Todorovich +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class AttributeSetOwnerMixin(models.AbstractModel): + _inherit = "attribute.set.owner.mixin" + + attribute_set_completeness_ids = fields.One2many( + related="attribute_set_id.attribute_set_completeness_ids", + ) + attribute_set_completed_ids = fields.Many2many( + comodel_name="attribute.set.completeness", + compute="_compute_attribute_set_completed_ids", + string="Attribute Set completed criterias", + ) + attribute_set_not_completed_ids = fields.Many2many( + comodel_name="attribute.set.completeness", + compute="_compute_attribute_set_not_completed_ids", + string="Attribute Set not completed criterias", + ) + attribute_set_completion_rate = fields.Float( + compute="_compute_attribute_set_completion_rate", + help="Attribute set completeness percentage", + store=True, + ) + attribute_set_completion_state = fields.Selection( + selection=[("complete", "Complete"), ("not_complete", "Not complete")], + compute="_compute_attribute_set_completion_state", + help="Attribute set completeness status", + store=True, + ) + + @api.depends("attribute_set_completeness_ids") + def _compute_attribute_set_completed_ids(self): + """Compute completed attribute set criterias""" + for rec in self: + rec.attribute_set_completed_ids = ( + rec.attribute_set_completeness_ids.filtered( + lambda c: bool(rec[c.field_id.name]) + ) + ) + + @api.depends("attribute_set_completed_ids") + def _compute_attribute_set_not_completed_ids(self): + """Compute not completed attribute set criterias""" + for rec in self: + rec.attribute_set_not_completed_ids = ( + rec.attribute_set_completeness_ids - rec.attribute_set_completed_ids + ) + + @api.depends("attribute_set_completed_ids") + def _compute_attribute_set_completion_rate(self): + """Compute the completion rate from completed criterias""" + for rec in self: + rec.attribute_set_completion_rate = ( + sum(rec.attribute_set_completed_ids.mapped("completion_rate")) + if rec.attribute_set_completed_ids + else 0.0 + ) + + @api.depends("attribute_set_completion_rate") + def _compute_attribute_set_completion_state(self): + """Compute the completion state""" + for rec in self: + rec.attribute_set_completion_state = ( + "complete" + if rec.attribute_set_completion_rate >= 100.0 + else "not_complete" + ) diff --git a/attribute_set_completeness/readme/CONTRIBUTORS.rst b/attribute_set_completeness/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..8dda8163 --- /dev/null +++ b/attribute_set_completeness/readme/CONTRIBUTORS.rst @@ -0,0 +1,7 @@ +* Cédric PIGEON +* Xavier Bouquiaux +* `Camptocamp `_ + + * Iván Todorovich + +* Dhara Solanki diff --git a/attribute_set_completeness/readme/DESCRIPTION.rst b/attribute_set_completeness/readme/DESCRIPTION.rst new file mode 100644 index 00000000..39fc3c1d --- /dev/null +++ b/attribute_set_completeness/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows the user define a completion rate on the model linked to an attribute set. diff --git a/attribute_set_completeness/readme/USAGE.rst b/attribute_set_completeness/readme/USAGE.rst new file mode 100644 index 00000000..fc01f51d --- /dev/null +++ b/attribute_set_completeness/readme/USAGE.rst @@ -0,0 +1,3 @@ +Go on an attribute set and fill in the section 'Completeness'. +Select the fields you want to take in account and set them their proportion on the completeness rate. +Then on the model linked to the attribute set you'll get 2 fields: completion rate and completion state diff --git a/attribute_set_completeness/security/attribute_set_completeness.xml b/attribute_set_completeness/security/attribute_set_completeness.xml new file mode 100644 index 00000000..a0c4a411 --- /dev/null +++ b/attribute_set_completeness/security/attribute_set_completeness.xml @@ -0,0 +1,23 @@ + + + + + attribute.set.completeness access for user group + + + + + + + + + attribute.set.completeness access for erp manager + + + + + + + + diff --git a/attribute_set_completeness/static/description/icon.png b/attribute_set_completeness/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/attribute_set_completeness/static/description/icon.png differ diff --git a/attribute_set_completeness/static/description/index.html b/attribute_set_completeness/static/description/index.html new file mode 100644 index 00000000..5bd1caec --- /dev/null +++ b/attribute_set_completeness/static/description/index.html @@ -0,0 +1,442 @@ + + + + + +Attribute Set Completeness + + + +
+

Attribute Set Completeness

+ + +

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

+

This module allows the user define a completion rate on the model linked to an attribute set.

+

Table of contents

+ +
+

Usage

+

Go on an attribute set and fill in the section ‘Completeness’. +Select the fields you want to take in account and set them their proportion on the completeness rate. +Then on the model linked to the attribute set you’ll get 2 fields: completion rate and completion state

+
+
+

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

+
    +
  • ACSONE SA/NV
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/attribute_set_completeness/test-requirements.txt b/attribute_set_completeness/test-requirements.txt new file mode 100644 index 00000000..66bc2cba --- /dev/null +++ b/attribute_set_completeness/test-requirements.txt @@ -0,0 +1 @@ +odoo_test_helper diff --git a/attribute_set_completeness/tests/__init__.py b/attribute_set_completeness/tests/__init__.py new file mode 100644 index 00000000..139786b1 --- /dev/null +++ b/attribute_set_completeness/tests/__init__.py @@ -0,0 +1 @@ +from . import test_attribute_set_completeness diff --git a/attribute_set_completeness/tests/res_partner_event_listener.py b/attribute_set_completeness/tests/res_partner_event_listener.py new file mode 100644 index 00000000..ff5c44f4 --- /dev/null +++ b/attribute_set_completeness/tests/res_partner_event_listener.py @@ -0,0 +1,10 @@ +# Copyright 2020 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo.addons.component.core import Component + + +class ResPartnerEventListener(Component): + _name = "res.partner.event.listener" + _inherit = ["attribute.set.owner.event.listener"] + + _apply_on = ["res.partner"] diff --git a/attribute_set_completeness/tests/test_attribute_set_completeness.py b/attribute_set_completeness/tests/test_attribute_set_completeness.py new file mode 100644 index 00000000..4e3cdb70 --- /dev/null +++ b/attribute_set_completeness/tests/test_attribute_set_completeness.py @@ -0,0 +1,120 @@ +# Copyright 2020 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo_test_helper import FakeModelLoader + +from odoo.exceptions import ValidationError + +from odoo.addons.component.tests.common import TransactionComponentCase + + +class TestAttributeSetCompleteness(TransactionComponentCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.model_id = cls.env.ref("base.model_res_partner").id + cls.group = cls.env["attribute.group"].create( + {"name": "My Group", "model_id": cls.model_id} + ) + vals = { + "nature": "custom", + "model_id": cls.model_id, + "attribute_type": "char", + "field_description": "Attribute test", + "name": "x_test", + "attribute_group_id": cls.group.id, + } + cls.attr1 = cls.env["attribute.attribute"].create(vals) + + vals.update({"name": "x_test2", "field_description": "Attribute test2"}) + cls.attr2 = cls.env["attribute.attribute"].create(vals) + + vals = { + "name": "My attribute Set", + "model_id": cls.model_id, + "attribute_ids": [(4, cls.attr1.id), (4, cls.attr2.id)], + "attribute_set_completeness_ids": [ + (0, 0, {"field_id": cls.attr1.field_id.id, "completion_rate": 50.0}), + (0, 0, {"field_id": cls.attr2.field_id.id, "completion_rate": 50.0}), + ], + } + cls.attr_set = cls.env["attribute.set"].create(vals) + + cls.loader = FakeModelLoader(cls.env, cls.__module__) + cls.loader.backup_registry() + from odoo.addons.attribute_set.tests.models import ResPartner + + cls.loader.update_registry([ResPartner]) + + from .res_partner_event_listener import ResPartnerEventListener # noqa: F401 + + ResPartnerEventListener._build_component(cls._components_registry) + + @classmethod + def tearDownClass(cls): + cls.loader.restore_registry() + super().tearDownClass() + + def test_completion_rate_constrains_create(self): + vals = { + "name": "My attribute Set Test", + "model_id": self.model_id, + "attribute_ids": [(4, self.attr1.id), (4, self.attr2.id)], + "attribute_set_completeness_ids": [ + (0, 0, {"field_id": self.attr1.field_id.id, "completion_rate": 50.0}), + (0, 0, {"field_id": self.attr2.field_id.id, "completion_rate": 10.0}), + ], + } + error_msg = "Total of completion rate must be 100 %" + with self.assertRaisesRegex(ValidationError, error_msg): + self.env["attribute.set"].create(vals) + + def test_completion_rate_constrains_write_low(self): + completion_rules = self.attr_set.attribute_set_completeness_ids + vals = { + "attribute_set_completeness_ids": [ + (2, completion_rules[0].id), + (0, 0, {"field_id": self.attr1.field_id.id, "completion_rate": 10.0}), + ] + } + error_msg = "Total of completion rate must be 100 %" + with self.assertRaisesRegex(ValidationError, error_msg): + self.attr_set.write(vals) + + def test_completion_rate_constrains_write_high(self): + completion_rules = self.attr_set.attribute_set_completeness_ids + vals = { + "attribute_set_completeness_ids": [ + (2, completion_rules[0].id), + ( + 0, + 0, + {"field_id": self.attr1.field_id.id, "completion_rate": 200.0}, + ), + ] + } + error_msg = "Total of completion rate must be 100 %" + with self.assertRaisesRegex(ValidationError, error_msg): + self.attr_set.write(vals) + + def test_completion_rate(self): + vals = {"name": "Test Partner"} + # Case 1: Create the partner + partner = self.env["res.partner"].create(vals) + self.assertEqual(partner.attribute_set_completion_state, "not_complete") + self.assertEqual(partner.attribute_set_completion_rate, 0.0) + # Case 2: Set an attribute set + partner.write({"attribute_set_id": self.attr_set.id}) + partner.invalidate_model() + self.assertEqual(partner.attribute_set_completion_state, "not_complete") + self.assertEqual(partner.attribute_set_completion_rate, 0.0) + # Case 3: Set a field (50% completion) + partner.write({"x_test": "test"}) + partner.invalidate_model() + self.assertEqual(partner.attribute_set_completion_state, "not_complete") + self.assertEqual(partner.attribute_set_completion_rate, 50.0) + # Case 4: Set another field (100% completion) + partner.write({"x_test2": "test"}) + partner.invalidate_model() + self.assertEqual(partner.attribute_set_completion_state, "complete") + self.assertEqual(partner.attribute_set_completion_rate, 100.0) diff --git a/attribute_set_completeness/views/attribute_set.xml b/attribute_set_completeness/views/attribute_set.xml new file mode 100644 index 00000000..51f093d0 --- /dev/null +++ b/attribute_set_completeness/views/attribute_set.xml @@ -0,0 +1,24 @@ + + + + + attribute.set.form (in attribute_set_completeness) + attribute.set + + + + + + + diff --git a/attribute_set_completeness/views/attribute_set_completeness.xml b/attribute_set_completeness/views/attribute_set_completeness.xml new file mode 100644 index 00000000..554df190 --- /dev/null +++ b/attribute_set_completeness/views/attribute_set_completeness.xml @@ -0,0 +1,27 @@ + + + + + attribute.set.completeness + + + + + + + + + + + + + diff --git a/pim/README.rst b/pim/README.rst new file mode 100644 index 00000000..453691f7 --- /dev/null +++ b/pim/README.rst @@ -0,0 +1,97 @@ +============================== +Product Information Management +============================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:90ca4229a4bc6ac1a4599e4c6215399a0a3e4721ae029bbc6497fcda6f43288c + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fodoo--pim-lightgray.png?logo=github + :target: https://github.com/OCA/odoo-pim/tree/16.0/pim + :alt: OCA/odoo-pim +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/odoo-pim-16-0/odoo-pim-16-0-pim + :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/odoo-pim&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +A basic module for Product Information Management. + +The module itself doesn't do anything. It only creates a new application menu "PIM" gathering native views about Products : + +- Products and Products Variants views +- Attributes +- Categories + +It also creates a new user group category with 3 access rights levels : + +- PIM Reader +- PIM User +- PIM Manager + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +Define your user **PIM access rights** in the Application Accesses as a Manager, User or Reader and the application menu "PIM" will appear. + +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 +~~~~~~~ + +* Akretion + +Contributors +~~~~~~~~~~~~ + +* Sébastien BEAU +* Clément Mombereau +* Cédric PIGEON +* Denis Roussel +* Dhara Solanki + +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/odoo-pim `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pim/__init__.py b/pim/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/pim/__manifest__.py b/pim/__manifest__.py new file mode 100644 index 00000000..e08bb42b --- /dev/null +++ b/pim/__manifest__.py @@ -0,0 +1,27 @@ +# Copyright 2020 Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Product Information Management", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "Akretion,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/odoo-pim", + "depends": [ + "product", + "product_attribute_set", + ], + "data": [ + "data/ir_module_category_data.xml", + "security/pim_security.xml", + "views/product_view.xml", + "views/pim_view.xml", + "views/attribute_set.xml", + "views/attribute_group.xml", + "views/attribute_attribute.xml", + "views/product_attribute_value.xml", + ], + "demo": [], + "installable": True, + "application": True, +} diff --git a/pim/data/ir_module_category_data.xml b/pim/data/ir_module_category_data.xml new file mode 100644 index 00000000..21da090c --- /dev/null +++ b/pim/data/ir_module_category_data.xml @@ -0,0 +1,8 @@ + + + + PIM + Manage your products catalogue easily + 2 + + diff --git a/pim/i18n/pim.pot b/pim/i18n/pim.pot new file mode 100644 index 00000000..209f900a --- /dev/null +++ b/pim/i18n/pim.pot @@ -0,0 +1,127 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pim +# +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: pim +#: model:res.groups,comment:pim.group_pim_manager +msgid "" +"\n" +" the user will be able to modify products and create attributes\n" +" " +msgstr "" + +#. module: pim +#: model:res.groups,comment:pim.group_pim_user +msgid "" +"\n" +" the user will be able to modify products but will not be authorized to\n" +" create attributes\n" +" " +msgstr "" + +#. module: pim +#: model:res.groups,comment:pim.group_pim_reader +msgid "" +"\n" +" the user will have only the right to consult the products catalogue\n" +" " +msgstr "" + +#. module: pim +#: model:ir.actions.act_window,name:pim.attribute_group_form_action +#: model:ir.ui.menu,name:pim.menu_attribute_group_action +msgid "Attribute Groups" +msgstr "" + +#. module: pim +#: model:ir.ui.menu,name:pim.main_menu_attribute +msgid "Attributes" +msgstr "" + +#. module: pim +#: model:ir.ui.menu,name:pim.menu_variant_attribute_value +msgid "Attributes Values" +msgstr "" + +#. module: pim +#: model:ir.ui.menu,name:pim.main_menu_category +msgid "Categories" +msgstr "" + +#. module: pim +#: model:ir.module.category,description:pim.module_category_pim +msgid "Manage your products catalogue easily" +msgstr "" + +#. module: pim +#: model:res.groups,name:pim.group_pim_manager +msgid "Manager" +msgstr "" + +#. module: pim +#: model:ir.module.category,name:pim.module_category_pim +#: model:ir.ui.menu,name:pim.root_menu_pim +msgid "PIM" +msgstr "" + +#. module: pim +#: model_terms:ir.ui.view,arch_db:pim.pim_product_template_tree_view +msgid "Product" +msgstr "" + +#. module: pim +#: model:ir.actions.act_window,name:pim.attribute_attribute_form_action +#: model:ir.ui.menu,name:pim.menu_attribute_attribute_action +msgid "Product Attribute" +msgstr "" + +#. module: pim +#: model:ir.actions.act_window,name:pim.attribute_set_form_action +#: model:ir.ui.menu,name:pim.menu_attribute_set_action +msgid "Product Attribute Sets" +msgstr "" + +#. module: pim +#: model:ir.actions.act_window,name:pim.product_attribute_value_action +#: model_terms:ir.ui.view,arch_db:pim.product_attribute_value_view_form +msgid "Product Attribute Values" +msgstr "" + +#. module: pim +#: model:ir.ui.menu,name:pim.menu_product_product +msgid "Product Variants" +msgstr "" + +#. module: pim +#: model:ir.actions.act_window,name:pim.product_template_action +#: model:ir.ui.menu,name:pim.main_menu_product +#: model:ir.ui.menu,name:pim.menu_product_template +msgid "Products" +msgstr "" + +#. module: pim +#: model:res.groups,name:pim.group_pim_reader +msgid "Reader" +msgstr "" + +#. module: pim +#: model:res.groups,name:pim.group_pim_user +msgid "User" +msgstr "" + +#. module: pim +#: model:ir.ui.menu,name:pim.main_menu_variant_attribute +#: model:ir.ui.menu,name:pim.menu_variant_attribute +msgid "Variants Attributes" +msgstr "" diff --git a/pim/readme/CONFIGURE.rst b/pim/readme/CONFIGURE.rst new file mode 100644 index 00000000..044a6dc4 --- /dev/null +++ b/pim/readme/CONFIGURE.rst @@ -0,0 +1 @@ +Define your user **PIM access rights** in the Application Accesses as a Manager, User or Reader and the application menu "PIM" will appear. diff --git a/pim/readme/CONTRIBUTORS.rst b/pim/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..4f9e1828 --- /dev/null +++ b/pim/readme/CONTRIBUTORS.rst @@ -0,0 +1,5 @@ +* Sébastien BEAU +* Clément Mombereau +* Cédric PIGEON +* Denis Roussel +* Dhara Solanki diff --git a/pim/readme/DESCRIPTION.rst b/pim/readme/DESCRIPTION.rst new file mode 100644 index 00000000..1fd17e08 --- /dev/null +++ b/pim/readme/DESCRIPTION.rst @@ -0,0 +1,13 @@ +A basic module for Product Information Management. + +The module itself doesn't do anything. It only creates a new application menu "PIM" gathering native views about Products : + +- Products and Products Variants views +- Attributes +- Categories + +It also creates a new user group category with 3 access rights levels : + +- PIM Reader +- PIM User +- PIM Manager diff --git a/pim/readme/ROADMAP.rst b/pim/readme/ROADMAP.rst new file mode 100644 index 00000000..e69de29b diff --git a/pim/readme/USAGE.rst b/pim/readme/USAGE.rst new file mode 100644 index 00000000..e69de29b diff --git a/pim/security/pim_security.xml b/pim/security/pim_security.xml new file mode 100644 index 00000000..c037ba18 --- /dev/null +++ b/pim/security/pim_security.xml @@ -0,0 +1,30 @@ + + + + + Reader + + + the user will have only the right to consult the products catalogue + + + + User + + + + the user will be able to modify products but will not be authorized to + create attributes + + + + Manager + + + + + the user will be able to modify products and create attributes + + + diff --git a/pim/static/description/icon.png b/pim/static/description/icon.png new file mode 100644 index 00000000..ffded50a Binary files /dev/null and b/pim/static/description/icon.png differ diff --git a/pim/static/description/index.html b/pim/static/description/index.html new file mode 100644 index 00000000..ab148aba --- /dev/null +++ b/pim/static/description/index.html @@ -0,0 +1,444 @@ + + + + + +Product Information Management + + + +
+

Product Information Management

+ + +

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

+

A basic module for Product Information Management.

+

The module itself doesn’t do anything. It only creates a new application menu “PIM” gathering native views about Products :

+
    +
  • Products and Products Variants views
  • +
  • Attributes
  • +
  • Categories
  • +
+

It also creates a new user group category with 3 access rights levels :

+
    +
  • PIM Reader
  • +
  • PIM User
  • +
  • PIM Manager
  • +
+

Table of contents

+ +
+

Configuration

+

Define your user PIM access rights in the Application Accesses as a Manager, User or Reader and the application menu “PIM” will appear.

+
+
+

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

+
    +
  • Akretion
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/pim/views/attribute_attribute.xml b/pim/views/attribute_attribute.xml new file mode 100644 index 00000000..9c22244b --- /dev/null +++ b/pim/views/attribute_attribute.xml @@ -0,0 +1,27 @@ + + + + Product Attribute + attribute.attribute + tree,form + + + + + + + diff --git a/pim/views/attribute_group.xml b/pim/views/attribute_group.xml new file mode 100644 index 00000000..14c3a3d9 --- /dev/null +++ b/pim/views/attribute_group.xml @@ -0,0 +1,20 @@ + + + + Attribute Groups + attribute.group + tree,form + + + + + + diff --git a/pim/views/attribute_set.xml b/pim/views/attribute_set.xml new file mode 100644 index 00000000..52fa4895 --- /dev/null +++ b/pim/views/attribute_set.xml @@ -0,0 +1,30 @@ + + + + + Product Attribute Sets + attribute.set + tree,form + + + + + + + diff --git a/pim/views/pim_view.xml b/pim/views/pim_view.xml new file mode 100644 index 00000000..5b076dae --- /dev/null +++ b/pim/views/pim_view.xml @@ -0,0 +1,67 @@ + + + + + Product Attribute Values + product.attribute.value + tree,form + + + + + + + + + + + + + diff --git a/pim/views/product_attribute_value.xml b/pim/views/product_attribute_value.xml new file mode 100644 index 00000000..6c97952b --- /dev/null +++ b/pim/views/product_attribute_value.xml @@ -0,0 +1,12 @@ + + + + product.attribute.value + + + + + + + + diff --git a/pim/views/product_view.xml b/pim/views/product_view.xml new file mode 100644 index 00000000..b5d9c9c4 --- /dev/null +++ b/pim/views/product_view.xml @@ -0,0 +1,43 @@ + + + + + pim.product.template.product.tree + product.template + 90 + + + + + + + + + + + + + + + + + Products + product.template + tree,kanban,form + + {"include_native_attribute": 1, "search_default_filter_to_sell": 1} + + diff --git a/pim_product_attribute_set_completeness/README.rst b/pim_product_attribute_set_completeness/README.rst new file mode 100644 index 00000000..d3bde23b --- /dev/null +++ b/pim_product_attribute_set_completeness/README.rst @@ -0,0 +1,92 @@ +====================================== +PIM Product Attribute Set Completeness +====================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d9b99ab38f868ce72c96ab6e0a908dfbeb2083ee2670dbc5e86e0a9d15383e21 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fodoo--pim-lightgray.png?logo=github + :target: https://github.com/OCA/odoo-pim/tree/16.0/pim_product_attribute_set_completeness + :alt: OCA/odoo-pim +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/odoo-pim-16-0/odoo-pim-16-0-pim_product_attribute_set_completeness + :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/odoo-pim&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds the completion rate and the completion state on the PIM products. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Completion rate and completion state are visible on the product form. +These 2 properties are also searchable through the search view ("Complete" and "Not Complete" filters). + +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 +~~~~~~~ + +* ACSONE SA/NV + +Contributors +~~~~~~~~~~~~ + +* Cédric PIGEON +* Xavier Bouquiaux +* `Camptocamp `_ + + * Iván Todorovich + +* Dhara Solanki + +* `Scalizer `_ + + * Michel Perrocheau + +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/odoo-pim `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/pim_product_attribute_set_completeness/__init__.py b/pim_product_attribute_set_completeness/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/pim_product_attribute_set_completeness/__manifest__.py b/pim_product_attribute_set_completeness/__manifest__.py new file mode 100644 index 00000000..d30d4ff6 --- /dev/null +++ b/pim_product_attribute_set_completeness/__manifest__.py @@ -0,0 +1,13 @@ +# Copyright 2020 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "PIM Product Attribute Set Completeness", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/odoo-pim", + "depends": ["pim", "product_attribute_set_completeness"], + "data": ["views/product_view.xml"], + "auto_install": True, +} diff --git a/pim_product_attribute_set_completeness/i18n/product_attribute_set_completeness.pot b/pim_product_attribute_set_completeness/i18n/product_attribute_set_completeness.pot new file mode 100644 index 00000000..0148b62e --- /dev/null +++ b/pim_product_attribute_set_completeness/i18n/product_attribute_set_completeness.pot @@ -0,0 +1,14 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * pim_product_attribute_set_completeness +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.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" diff --git a/pim_product_attribute_set_completeness/readme/CONTRIBUTORS.rst b/pim_product_attribute_set_completeness/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..0c9c7cad --- /dev/null +++ b/pim_product_attribute_set_completeness/readme/CONTRIBUTORS.rst @@ -0,0 +1,11 @@ +* Cédric PIGEON +* Xavier Bouquiaux +* `Camptocamp `_ + + * Iván Todorovich + +* Dhara Solanki + +* `Scalizer `_ + + * Michel Perrocheau diff --git a/pim_product_attribute_set_completeness/readme/DESCRIPTION.rst b/pim_product_attribute_set_completeness/readme/DESCRIPTION.rst new file mode 100644 index 00000000..1e7d8b75 --- /dev/null +++ b/pim_product_attribute_set_completeness/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module adds the completion rate and the completion state on the PIM products. diff --git a/pim_product_attribute_set_completeness/readme/USAGE.rst b/pim_product_attribute_set_completeness/readme/USAGE.rst new file mode 100644 index 00000000..59b61b17 --- /dev/null +++ b/pim_product_attribute_set_completeness/readme/USAGE.rst @@ -0,0 +1,2 @@ +Completion rate and completion state are visible on the product form. +These 2 properties are also searchable through the search view ("Complete" and "Not Complete" filters). diff --git a/pim_product_attribute_set_completeness/static/description/icon.png b/pim_product_attribute_set_completeness/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/pim_product_attribute_set_completeness/static/description/icon.png differ diff --git a/pim_product_attribute_set_completeness/static/description/index.html b/pim_product_attribute_set_completeness/static/description/index.html new file mode 100644 index 00000000..02624acb --- /dev/null +++ b/pim_product_attribute_set_completeness/static/description/index.html @@ -0,0 +1,448 @@ + + + + + +PIM Product Attribute Set Completeness + + + +
+

PIM Product Attribute Set Completeness

+ + +

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

+

This module adds the completion rate and the completion state on the PIM products.

+

Table of contents

+ +
+

Usage

+

Completion rate and completion state are visible on the product form. +These 2 properties are also searchable through the search view (“Complete” and “Not Complete” filters).

+
+
+

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

+
    +
  • ACSONE SA/NV
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/pim_product_attribute_set_completeness/views/product_view.xml b/pim_product_attribute_set_completeness/views/product_view.xml new file mode 100644 index 00000000..b77ea73c --- /dev/null +++ b/pim_product_attribute_set_completeness/views/product_view.xml @@ -0,0 +1,28 @@ + + + + pim.product.template.completeness.tree + product.template + + + + + + + + + diff --git a/product_attribute_set_completeness/README.rst b/product_attribute_set_completeness/README.rst new file mode 100644 index 00000000..d32bf2e9 --- /dev/null +++ b/product_attribute_set_completeness/README.rst @@ -0,0 +1,88 @@ +================================== +Product Attribute Set Completeness +================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:2e9f87bd79bfdb2e89f1c1c1ee9804195b1d8ef6fd53267e042a91087ecc3374 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fodoo--pim-lightgray.png?logo=github + :target: https://github.com/OCA/odoo-pim/tree/16.0/product_attribute_set_completeness + :alt: OCA/odoo-pim +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/odoo-pim-16-0/odoo-pim-16-0-product_attribute_set_completeness + :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/odoo-pim&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds the completion rate and the completion state on the products. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Completion rate and completion state are visible on the product form. +These 2 properties are also searchable through the search view ("Complete" and "Not Complete" filters). + +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 +~~~~~~~ + +* ACSONE SA/NV + +Contributors +~~~~~~~~~~~~ + +* Cédric PIGEON +* Xavier Bouquiaux +* `Camptocamp `_ + + * Iván Todorovich + +* Dhara Solanki + +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/odoo-pim `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_attribute_set_completeness/__init__.py b/product_attribute_set_completeness/__init__.py new file mode 100644 index 00000000..1377f57f --- /dev/null +++ b/product_attribute_set_completeness/__init__.py @@ -0,0 +1 @@ +from . import components diff --git a/product_attribute_set_completeness/__manifest__.py b/product_attribute_set_completeness/__manifest__.py new file mode 100644 index 00000000..cb8b80d9 --- /dev/null +++ b/product_attribute_set_completeness/__manifest__.py @@ -0,0 +1,13 @@ +# Copyright 2020 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Product Attribute Set Completeness", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/odoo-pim", + "depends": ["product_attribute_set", "attribute_set_completeness"], + "data": ["views/product_template_view.xml"], + "auto_install": True, +} diff --git a/product_attribute_set_completeness/components/__init__.py b/product_attribute_set_completeness/components/__init__.py new file mode 100644 index 00000000..e961b842 --- /dev/null +++ b/product_attribute_set_completeness/components/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2020 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from . import product_template_event_listener diff --git a/product_attribute_set_completeness/components/product_template_event_listener.py b/product_attribute_set_completeness/components/product_template_event_listener.py new file mode 100644 index 00000000..4d0a0640 --- /dev/null +++ b/product_attribute_set_completeness/components/product_template_event_listener.py @@ -0,0 +1,11 @@ +# Copyright 2020 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.addons.component.core import Component + + +class ProductTemplateEventListener(Component): + _name = "product.template.event.listener" + _inherit = ["attribute.set.owner.event.listener"] + + _apply_on = ["product.template"] diff --git a/product_attribute_set_completeness/i18n/product_attribute_set_completeness.pot b/product_attribute_set_completeness/i18n/product_attribute_set_completeness.pot new file mode 100644 index 00000000..b2a2fb81 --- /dev/null +++ b/product_attribute_set_completeness/i18n/product_attribute_set_completeness.pot @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_attribute_set_completeness +# +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: product_attribute_set_completeness +#: model_terms:ir.ui.view,arch_db:product_attribute_set_completeness.product_template_search_view +msgid "Complete" +msgstr "" + +#. module: product_attribute_set_completeness +#: model_terms:ir.ui.view,arch_db:product_attribute_set_completeness.product_template_search_view +msgid "Not Complete" +msgstr "" + +#. module: product_attribute_set_completeness +#: model_terms:ir.ui.view,arch_db:product_attribute_set_completeness.product_template_view_form +msgid "Not completed attributes" +msgstr "" diff --git a/product_attribute_set_completeness/readme/CONTRIBUTORS.rst b/product_attribute_set_completeness/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..8dda8163 --- /dev/null +++ b/product_attribute_set_completeness/readme/CONTRIBUTORS.rst @@ -0,0 +1,7 @@ +* Cédric PIGEON +* Xavier Bouquiaux +* `Camptocamp `_ + + * Iván Todorovich + +* Dhara Solanki diff --git a/product_attribute_set_completeness/readme/DESCRIPTION.rst b/product_attribute_set_completeness/readme/DESCRIPTION.rst new file mode 100644 index 00000000..4034b2c2 --- /dev/null +++ b/product_attribute_set_completeness/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module adds the completion rate and the completion state on the products. diff --git a/product_attribute_set_completeness/readme/USAGE.rst b/product_attribute_set_completeness/readme/USAGE.rst new file mode 100644 index 00000000..59b61b17 --- /dev/null +++ b/product_attribute_set_completeness/readme/USAGE.rst @@ -0,0 +1,2 @@ +Completion rate and completion state are visible on the product form. +These 2 properties are also searchable through the search view ("Complete" and "Not Complete" filters). diff --git a/product_attribute_set_completeness/static/description/icon.png b/product_attribute_set_completeness/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/product_attribute_set_completeness/static/description/icon.png differ diff --git a/product_attribute_set_completeness/static/description/index.html b/product_attribute_set_completeness/static/description/index.html new file mode 100644 index 00000000..012eb89e --- /dev/null +++ b/product_attribute_set_completeness/static/description/index.html @@ -0,0 +1,441 @@ + + + + + +Product Attribute Set Completeness + + + +
+

Product Attribute Set Completeness

+ + +

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

+

This module adds the completion rate and the completion state on the products.

+

Table of contents

+ +
+

Usage

+

Completion rate and completion state are visible on the product form. +These 2 properties are also searchable through the search view (“Complete” and “Not Complete” filters).

+
+
+

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

+
    +
  • ACSONE SA/NV
  • +
+
+
+

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

+

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

+
+
+
+ + diff --git a/product_attribute_set_completeness/views/product_template_view.xml b/product_attribute_set_completeness/views/product_template_view.xml new file mode 100644 index 00000000..e455338e --- /dev/null +++ b/product_attribute_set_completeness/views/product_template_view.xml @@ -0,0 +1,74 @@ + + + + + product.template + + + +
+ + + +
+
+ + + + + + + +
+ + product.template.search (in product_attribute_set_completeness) + product.template + + + + + + + + + +
diff --git a/setup/attribute_set_completeness/odoo/addons/attribute_set_completeness b/setup/attribute_set_completeness/odoo/addons/attribute_set_completeness new file mode 120000 index 00000000..5c35cedd --- /dev/null +++ b/setup/attribute_set_completeness/odoo/addons/attribute_set_completeness @@ -0,0 +1 @@ +../../../../attribute_set_completeness \ No newline at end of file diff --git a/setup/attribute_set_completeness/setup.py b/setup/attribute_set_completeness/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/attribute_set_completeness/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/pim/odoo/addons/pim b/setup/pim/odoo/addons/pim new file mode 120000 index 00000000..e4b55084 --- /dev/null +++ b/setup/pim/odoo/addons/pim @@ -0,0 +1 @@ +../../../../pim \ No newline at end of file diff --git a/setup/pim/setup.py b/setup/pim/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/pim/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/pim_product_attribute_set_completeness/odoo/addons/pim_product_attribute_set_completeness b/setup/pim_product_attribute_set_completeness/odoo/addons/pim_product_attribute_set_completeness new file mode 120000 index 00000000..b9ba7b9b --- /dev/null +++ b/setup/pim_product_attribute_set_completeness/odoo/addons/pim_product_attribute_set_completeness @@ -0,0 +1 @@ +../../../../pim_product_attribute_set_completeness \ No newline at end of file diff --git a/setup/pim_product_attribute_set_completeness/setup.py b/setup/pim_product_attribute_set_completeness/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/pim_product_attribute_set_completeness/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/setup/product_attribute_set_completeness/odoo/addons/product_attribute_set_completeness b/setup/product_attribute_set_completeness/odoo/addons/product_attribute_set_completeness new file mode 120000 index 00000000..4c816b87 --- /dev/null +++ b/setup/product_attribute_set_completeness/odoo/addons/product_attribute_set_completeness @@ -0,0 +1 @@ +../../../../product_attribute_set_completeness \ No newline at end of file diff --git a/setup/product_attribute_set_completeness/setup.py b/setup/product_attribute_set_completeness/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/product_attribute_set_completeness/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)