diff --git a/product_tag_multi_company/README.rst b/product_tag_multi_company/README.rst new file mode 100644 index 00000000000..589514ee3b4 --- /dev/null +++ b/product_tag_multi_company/README.rst @@ -0,0 +1,82 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +========================= +Product Tag Multi Company +========================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:9802e3f2d716f871cd29a9817a66bfc5172212d473784454a418c262c7d7e7a1 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fmulti--company-lightgray.png?logo=github + :target: https://github.com/OCA/multi-company/tree/19.0/product_tag_multi_company + :alt: OCA/multi-company +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/multi-company-19-0/multi-company-19-0-product_tag_multi_company + :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/multi-company&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This modules adds multi-company management to product tags. + +**Table of contents** + +.. contents:: + :local: + +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 +------- + +* ForgeFlow + +Contributors +------------ + +- `ForgeFlow `__: + + - Laura Cazorla + +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/multi-company `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_tag_multi_company/__init__.py b/product_tag_multi_company/__init__.py new file mode 100644 index 00000000000..2afb07c8e6c --- /dev/null +++ b/product_tag_multi_company/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/product_tag_multi_company/__manifest__.py b/product_tag_multi_company/__manifest__.py new file mode 100644 index 00000000000..807f9d9a6ed --- /dev/null +++ b/product_tag_multi_company/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Product Tag Multi Company", + "summary": "This module add multi-company management to product tag", + "version": "19.0.1.0.0", + "license": "AGPL-3", + "category": "Product Management", + "author": "ForgeFlow, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/multi-company", + "depends": ["product"], + "data": [ + "security/ir_rules.xml", + "views/product_tag_views.xml", + "views/product_views.xml", + ], +} diff --git a/product_tag_multi_company/models/__init__.py b/product_tag_multi_company/models/__init__.py new file mode 100644 index 00000000000..f5550b6be83 --- /dev/null +++ b/product_tag_multi_company/models/__init__.py @@ -0,0 +1,6 @@ +# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import product_tag +from . import product_template +from . import product_product diff --git a/product_tag_multi_company/models/product_product.py b/product_tag_multi_company/models/product_product.py new file mode 100644 index 00000000000..fdb61a81a7d --- /dev/null +++ b/product_tag_multi_company/models/product_product.py @@ -0,0 +1,13 @@ +# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ProductProduct(models.Model): + _inherit = "product.product" + _check_company_auto = True + + additional_product_tag_ids = fields.Many2many( + check_company=True, + ) diff --git a/product_tag_multi_company/models/product_tag.py b/product_tag_multi_company/models/product_tag.py new file mode 100644 index 00000000000..0f9038a2309 --- /dev/null +++ b/product_tag_multi_company/models/product_tag.py @@ -0,0 +1,14 @@ +# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ProductTag(models.Model): + _inherit = "product.tag" + _check_company_auto = True + + company_id = fields.Many2one( + comodel_name="res.company", + default=lambda self: self.env.company, + ) diff --git a/product_tag_multi_company/models/product_template.py b/product_tag_multi_company/models/product_template.py new file mode 100644 index 00000000000..1c2aabfceb7 --- /dev/null +++ b/product_tag_multi_company/models/product_template.py @@ -0,0 +1,13 @@ +# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + _check_company_auto = True + + product_tag_ids = fields.Many2many( + check_company=True, + ) diff --git a/product_tag_multi_company/pyproject.toml b/product_tag_multi_company/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/product_tag_multi_company/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_tag_multi_company/readme/CONTRIBUTORS.md b/product_tag_multi_company/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..f06c6a52bbf --- /dev/null +++ b/product_tag_multi_company/readme/CONTRIBUTORS.md @@ -0,0 +1,2 @@ +- [ForgeFlow](https://forgeflow.com): + - Laura Cazorla \ diff --git a/product_tag_multi_company/readme/DESCRIPTION.md b/product_tag_multi_company/readme/DESCRIPTION.md new file mode 100644 index 00000000000..cf760bd21ef --- /dev/null +++ b/product_tag_multi_company/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This modules adds multi-company management to product tags. diff --git a/product_tag_multi_company/security/ir_rules.xml b/product_tag_multi_company/security/ir_rules.xml new file mode 100644 index 00000000000..5b74766c92f --- /dev/null +++ b/product_tag_multi_company/security/ir_rules.xml @@ -0,0 +1,11 @@ + + + + + Product Tag multi-company + + ['|',('company_id','=',False),('company_id', 'in', company_ids)] + + diff --git a/product_tag_multi_company/static/description/index.html b/product_tag_multi_company/static/description/index.html new file mode 100644 index 00000000000..6dde7709466 --- /dev/null +++ b/product_tag_multi_company/static/description/index.html @@ -0,0 +1,432 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Product Tag Multi Company

+ +

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

+

This modules adds multi-company management to product tags.

+

Table of contents

+ +
+

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

+
    +
  • ForgeFlow
  • +
+
+
+

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

+

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

+
+
+
+
+ + diff --git a/product_tag_multi_company/views/product_tag_views.xml b/product_tag_multi_company/views/product_tag_views.xml new file mode 100644 index 00000000000..a07d5f20dc0 --- /dev/null +++ b/product_tag_multi_company/views/product_tag_views.xml @@ -0,0 +1,28 @@ + + + + product.tag.form + product.tag + + + + + + + + + + product.tag.tree + product.tag + + + + + + + + diff --git a/product_tag_multi_company/views/product_views.xml b/product_tag_multi_company/views/product_views.xml new file mode 100644 index 00000000000..f9c31c6a690 --- /dev/null +++ b/product_tag_multi_company/views/product_views.xml @@ -0,0 +1,16 @@ + + + + product.template.view.tree + product.template + + + + + + + + +