diff --git a/product_multi_category/README.rst b/product_multi_category/README.rst new file mode 100644 index 00000000000..c797708b9b8 --- /dev/null +++ b/product_multi_category/README.rst @@ -0,0 +1,102 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +========================= +Product - Many Categories +========================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:d38c2a76e0b5e8fb46666e4cfd465c62b7df2f08e2868ffd5b4b9e231325cc92 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fproduct--attribute-lightgray.png?logo=github + :target: https://github.com/OCA/product-attribute/tree/19.0/product_multi_category + :alt: OCA/product-attribute +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/product-attribute-19-0/product-attribute-19-0-product_multi_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/product-attribute&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module Extends the existing functionality of Odoo Products (One +product - One Category) to One product -> Many Categories + +*Note:* This module was built generically but in focus of the Magento +Odoo connector *Note 2:* The additional categories are only for +classification and does not affect other operations + +**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 +------- + +* Akretion +* Guewen Baconnier +* Camptocamp +* Avanzosc +* Sharoon Thomas +* Sodexis + +Contributors +------------ + +- Raphaël Valyi +- Renato Lima +- Sébastien BEAU +- Guewen Baconnier +- Yannick Vaucher +- Sharoon Thomas +- Avanzosc +- Mikel Arregi +- SodexisTeam +- Angel Moya +- Sudhir Arya +- Pimolnat Suntian +- Watthanun Khorchai + +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/product-attribute `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_multi_category/__init__.py b/product_multi_category/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/product_multi_category/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_multi_category/__manifest__.py b/product_multi_category/__manifest__.py new file mode 100644 index 00000000000..fe65ba3635d --- /dev/null +++ b/product_multi_category/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2009 Akretion,Guewen Baconnier,Camptocamp,Avanzosc,Sharoon Thomas,Sodexis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +{ + "name": "Product - Many Categories", + "version": "19.0.1.0.0", + "author": "Akretion,Guewen Baconnier,Camptocamp,Avanzosc," + "Sharoon Thomas,Sodexis,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/product-attribute", + "license": "AGPL-3", + "category": "Product Management", + "depends": ["base", "product"], + "data": ["views/product_view.xml"], + "installable": True, +} diff --git a/product_multi_category/i18n/ca.po b/product_multi_category/i18n/ca.po new file mode 100644 index 00000000000..96330389eff --- /dev/null +++ b/product_multi_category/i18n/ca.po @@ -0,0 +1,62 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_m2mcategories +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.6\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-12-20 17:16+0000\n" +"PO-Revision-Date: 2022-03-22 13:17+0000\n" +"Last-Translator: Noel estudillo \n" +"Language-Team: \n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" +"X-Launchpad-Export-Date: 2012-10-03 05:22+0000\n" +"X-Poedit-Language: Catalan\n" + +#. module: product_multi_category +#: model:ir.model.fields,field_description:product_multi_category.field_product_product__categ_ids +#: model:ir.model.fields,field_description:product_multi_category.field_product_template__categ_ids +msgid "Extra Categories" +msgstr "Categories extra" + +#. module: product_multi_category +#: model:ir.model,name:product_multi_category.model_product_template +msgid "Product" +msgstr "" + +#~ msgid "Product Template" +#~ msgstr "Categories de producte" + +#~ msgid "Invalid XML for View Architecture!" +#~ msgstr "XML invàlid per a la definició de la vista!" + +#~ msgid "Classification Categories" +#~ msgstr "Classificació en categories" + +#~ msgid "Product - Many Categories" +#~ msgstr "Producte - Moltes categories" + +#~ msgid "" +#~ "\n" +#~ " This module Extends the existing functionality of Open ERP Products " +#~ "(One product - One Catgory)\n" +#~ " to One product -> Many Categories\n" +#~ "\n" +#~ " *Note: This module was built generically but in focus of the Magento " +#~ "Open ERP connector\n" +#~ " " +#~ msgstr "" +#~ "\n" +#~ " Aquest mòdul estén la funcionalitat existent dels productes a OpenERP " +#~ "(Un producte -> Una categoria)\n" +#~ " a Un producte -> Moltes categories\n" +#~ "\n" +#~ " * Nota: Aquest mòdul ha estat construït de forma genèrica, i " +#~ "s'utilitza al connector OpenERP Magento\n" +#~ " " diff --git a/product_multi_category/i18n/de.po b/product_multi_category/i18n/de.po new file mode 100644 index 00000000000..e855fc6cb77 --- /dev/null +++ b/product_multi_category/i18n/de.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_multi_category +# +# Translators: +# Niki Waibel , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-05 02:44+0000\n" +"PO-Revision-Date: 2020-07-22 11:19+0000\n" +"Last-Translator: c2cdidier \n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.10\n" + +#. module: product_multi_category +#: model:ir.model.fields,field_description:product_multi_category.field_product_product__categ_ids +#: model:ir.model.fields,field_description:product_multi_category.field_product_template__categ_ids +msgid "Extra Categories" +msgstr "Zusätzliche Kategorien" + +#. module: product_multi_category +#: model:ir.model,name:product_multi_category.model_product_template +msgid "Product" +msgstr "" + +#~ msgid "Product Template" +#~ msgstr "Produktvorlage" diff --git a/product_multi_category/i18n/es.po b/product_multi_category/i18n/es.po new file mode 100644 index 00000000000..a4c67f589e6 --- /dev/null +++ b/product_multi_category/i18n/es.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_multi_category +# +# Translators: +# Pedro M. Baeza , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-05 02:44+0000\n" +"PO-Revision-Date: 2023-08-29 08:30+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: product_multi_category +#: model:ir.model.fields,field_description:product_multi_category.field_product_product__categ_ids +#: model:ir.model.fields,field_description:product_multi_category.field_product_template__categ_ids +msgid "Extra Categories" +msgstr "Categorías extra" + +#. module: product_multi_category +#: model:ir.model,name:product_multi_category.model_product_template +msgid "Product" +msgstr "Producto" + +#~ msgid "Product Template" +#~ msgstr "Plantilla de producto" diff --git a/product_multi_category/i18n/fr.po b/product_multi_category/i18n/fr.po new file mode 100644 index 00000000000..ad377caf16d --- /dev/null +++ b/product_multi_category/i18n/fr.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_multi_category +# +# Translators: +# OCA Transbot , 2017 +# guillaume bauer , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-29 02:55+0000\n" +"PO-Revision-Date: 2021-07-02 13:48+0000\n" +"Last-Translator: Denis Roussel (ACSONE) \n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: product_multi_category +#: model:ir.model.fields,field_description:product_multi_category.field_product_product__categ_ids +#: model:ir.model.fields,field_description:product_multi_category.field_product_template__categ_ids +msgid "Extra Categories" +msgstr "Catégories supplémentaires" + +#. module: product_multi_category +#: model:ir.model,name:product_multi_category.model_product_template +msgid "Product" +msgstr "" + +#~ msgid "Product Template" +#~ msgstr "Modèle de produit" diff --git a/product_multi_category/i18n/fr_BE.po b/product_multi_category/i18n/fr_BE.po new file mode 100644 index 00000000000..5cbbb77d655 --- /dev/null +++ b/product_multi_category/i18n/fr_BE.po @@ -0,0 +1,32 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_m2mcategories +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.6\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-11-25 13:31:57+0000\n" +"PO-Revision-Date: 2021-02-18 11:45+0000\n" +"Last-Translator: Yves Le Doeuff \n" +"Language-Team: \n" +"Language: fr_BE\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: product_multi_category +#: model:ir.model.fields,field_description:product_multi_category.field_product_product__categ_ids +#: model:ir.model.fields,field_description:product_multi_category.field_product_template__categ_ids +msgid "Extra Categories" +msgstr "Catégories supplémentaires" + +#. module: product_multi_category +#: model:ir.model,name:product_multi_category.model_product_template +msgid "Product" +msgstr "" + +#~ msgid "Product Template" +#~ msgstr "Modèle d'article" diff --git a/product_multi_category/i18n/hr.po b/product_multi_category/i18n/hr.po new file mode 100644 index 00000000000..170f68c1865 --- /dev/null +++ b/product_multi_category/i18n/hr.po @@ -0,0 +1,36 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_multi_category +# +# Translators: +# OCA Transbot , 2017 +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-29 05:48+0000\n" +"PO-Revision-Date: 2017-07-29 05:48+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: product_multi_category +#: model:ir.model.fields,field_description:product_multi_category.field_product_product__categ_ids +#: model:ir.model.fields,field_description:product_multi_category.field_product_template__categ_ids +#, fuzzy +msgid "Extra Categories" +msgstr "Dodatne kategorije" + +#. module: product_multi_category +#: model:ir.model,name:product_multi_category.model_product_template +msgid "Product" +msgstr "" + +#~ msgid "Product Template" +#~ msgstr "Predložak proizvoda" diff --git a/product_multi_category/i18n/it.po b/product_multi_category/i18n/it.po new file mode 100644 index 00000000000..5a12b184532 --- /dev/null +++ b/product_multi_category/i18n/it.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_multi_category +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-29 13:26+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" + +#. module: product_multi_category +#: model:ir.model.fields,field_description:product_multi_category.field_product_product__categ_ids +#: model:ir.model.fields,field_description:product_multi_category.field_product_template__categ_ids +msgid "Extra Categories" +msgstr "Categorie extra" + +#. module: product_multi_category +#: model:ir.model,name:product_multi_category.model_product_template +msgid "Product" +msgstr "Prodotto" diff --git a/product_multi_category/i18n/nl_NL.po b/product_multi_category/i18n/nl_NL.po new file mode 100644 index 00000000000..fb3e858388f --- /dev/null +++ b/product_multi_category/i18n/nl_NL.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_multi_category +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-27 04:44+0000\n" +"PO-Revision-Date: 2017-05-27 04:44+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: product_multi_category +#: model:ir.model.fields,field_description:product_multi_category.field_product_product__categ_ids +#: model:ir.model.fields,field_description:product_multi_category.field_product_template__categ_ids +msgid "Extra Categories" +msgstr "" + +#. module: product_multi_category +#: model:ir.model,name:product_multi_category.model_product_template +msgid "Product" +msgstr "" + +#~ msgid "Product Template" +#~ msgstr "Productsjabloon" diff --git a/product_multi_category/i18n/product_multi_category.pot b/product_multi_category/i18n/product_multi_category.pot new file mode 100644 index 00000000000..16e7a549375 --- /dev/null +++ b/product_multi_category/i18n/product_multi_category.pot @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_multi_category +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.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_multi_category +#: model:ir.model.fields,field_description:product_multi_category.field_product_product__categ_ids +#: model:ir.model.fields,field_description:product_multi_category.field_product_template__categ_ids +msgid "Extra Categories" +msgstr "" + +#. module: product_multi_category +#: model:ir.model,name:product_multi_category.model_product_template +msgid "Product" +msgstr "" diff --git a/product_multi_category/i18n/sv.po b/product_multi_category/i18n/sv.po new file mode 100644 index 00000000000..384b32fb705 --- /dev/null +++ b/product_multi_category/i18n/sv.po @@ -0,0 +1,30 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_m2mcategories +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.14\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-12-20 17:16+0000\n" +"PO-Revision-Date: 2010-11-23 02:21+0000\n" +"Last-Translator: Olivier Dony (OpenERP) \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-10-03 05:22+0000\n" +"X-Generator: Launchpad (build 16061)\n" + +#. module: product_multi_category +#: model:ir.model.fields,field_description:product_multi_category.field_product_product__categ_ids +#: model:ir.model.fields,field_description:product_multi_category.field_product_template__categ_ids +#, fuzzy +msgid "Extra Categories" +msgstr "Product - Many Categories" + +#. module: product_multi_category +#: model:ir.model,name:product_multi_category.model_product_template +msgid "Product" +msgstr "" diff --git a/product_multi_category/i18n/tr.po b/product_multi_category/i18n/tr.po new file mode 100644 index 00000000000..ec55e33de5e --- /dev/null +++ b/product_multi_category/i18n/tr.po @@ -0,0 +1,35 @@ +# Turkish translation for openobject-addons +# Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 +# This file is distributed under the same license as the openobject-addons package. +# FIRST AUTHOR , 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: openobject-addons\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2009-12-20 17:16+0000\n" +"PO-Revision-Date: 2011-02-21 08:51+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: Turkish \n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2012-10-03 05:22+0000\n" +"X-Generator: Launchpad (build 16061)\n" + +#. module: product_multi_category +#: model:ir.model.fields,field_description:product_multi_category.field_product_product__categ_ids +#: model:ir.model.fields,field_description:product_multi_category.field_product_template__categ_ids +#, fuzzy +msgid "Extra Categories" +msgstr "Ürün Kategorileri" + +#. module: product_multi_category +#: model:ir.model,name:product_multi_category.model_product_template +msgid "Product" +msgstr "" + +#, fuzzy +#~ msgid "Product Template" +#~ msgstr "Ürün Kategorileri" diff --git a/product_multi_category/models/__init__.py b/product_multi_category/models/__init__.py new file mode 100644 index 00000000000..9649db77a15 --- /dev/null +++ b/product_multi_category/models/__init__.py @@ -0,0 +1 @@ +from . import product diff --git a/product_multi_category/models/product.py b/product_multi_category/models/product.py new file mode 100644 index 00000000000..edc7fba8b3c --- /dev/null +++ b/product_multi_category/models/product.py @@ -0,0 +1,16 @@ +# Copyright 2009 Akretion,Guewen Baconnier,Camptocamp,Avanzosc,Sharoon Thomas,Sodexis +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + categ_ids = fields.Many2many( + comodel_name="product.category", + relation="product_categ_rel", + column1="product_id", + column2="categ_id", + string="Extra Categories", + ) diff --git a/product_multi_category/pyproject.toml b/product_multi_category/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/product_multi_category/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_multi_category/readme/CONTRIBUTORS.md b/product_multi_category/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..a17bdbe2264 --- /dev/null +++ b/product_multi_category/readme/CONTRIBUTORS.md @@ -0,0 +1,13 @@ +- Raphaël Valyi \ +- Renato Lima \ +- Sébastien BEAU \ +- Guewen Baconnier \ +- Yannick Vaucher \ +- Sharoon Thomas +- Avanzosc +- Mikel Arregi \ +- SodexisTeam \ +- Angel Moya \ +- Sudhir Arya \ +- Pimolnat Suntian \ +- Watthanun Khorchai \ diff --git a/product_multi_category/readme/DESCRIPTION.md b/product_multi_category/readme/DESCRIPTION.md new file mode 100644 index 00000000000..a360d894d31 --- /dev/null +++ b/product_multi_category/readme/DESCRIPTION.md @@ -0,0 +1,6 @@ +This module Extends the existing functionality of Odoo Products (One +product - One Category) to One product -\> Many Categories + +*Note:* This module was built generically but in focus of the Magento +Odoo connector *Note 2:* The additional categories are only for +classification and does not affect other operations diff --git a/product_multi_category/static/description/icon.png b/product_multi_category/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/product_multi_category/static/description/icon.png differ diff --git a/product_multi_category/static/description/index.html b/product_multi_category/static/description/index.html new file mode 100644 index 00000000000..ce57f858532 --- /dev/null +++ b/product_multi_category/static/description/index.html @@ -0,0 +1,450 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Product - Many Categories

+ +

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

+

This module Extends the existing functionality of Odoo Products (One +product - One Category) to One product -> Many Categories

+

Note: This module was built generically but in focus of the Magento +Odoo connector Note 2: The additional categories are only for +classification and does not affect other operations

+

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

+
    +
  • Akretion
  • +
  • Guewen Baconnier
  • +
  • Camptocamp
  • +
  • Avanzosc
  • +
  • Sharoon Thomas
  • +
  • Sodexis
  • +
+
+
+

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

+

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

+
+
+
+
+ + diff --git a/product_multi_category/tests/__init__.py b/product_multi_category/tests/__init__.py new file mode 100644 index 00000000000..33f55be9fc8 --- /dev/null +++ b/product_multi_category/tests/__init__.py @@ -0,0 +1 @@ +from . import test_product_multi_category diff --git a/product_multi_category/tests/test_product_multi_category.py b/product_multi_category/tests/test_product_multi_category.py new file mode 100644 index 00000000000..dd6b5e6278c --- /dev/null +++ b/product_multi_category/tests/test_product_multi_category.py @@ -0,0 +1,70 @@ +from odoo.fields import Command +from odoo.tests.common import TransactionCase + + +class TestProductMultiCategory(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + + ProductTemplate = cls.env["product.template"] + ProductCategory = cls.env["product.category"] + + # Create default and classification categories + cls.default_category = ProductCategory.create({"name": "Default Category"}) + cls.classification_category_1 = ProductCategory.create( + {"name": "Classification Category 1"} + ) + cls.classification_category_2 = ProductCategory.create( + {"name": "Classification Category 2"} + ) + + # Create a product with the default category + cls.product = ProductTemplate.create( + { + "name": "Multi-Category Test Product", + "categ_id": cls.default_category.id, + } + ) + + def _assign_classification_categories(self): + """Assign additional classification categories to the product""" + self.product.categ_ids = [ + Command.set( + [ + self.classification_category_1.id, + self.classification_category_2.id, + ] + ) + ] + + def test_assign_classification_categories(self): + """Test that both classification categories can be + assigned to a product.""" + self._assign_classification_categories() + self.assertEqual( + self.product.categ_ids, + self.classification_category_1 | self.classification_category_2, + "Product should have both classification categories assigned", + ) + + def test_remove_classification_category(self): + """Test removing one classification category + without affecting the other.""" + self._assign_classification_categories() + self.product.categ_ids = [Command.unlink(self.classification_category_1.id)] + self.assertEqual( + self.product.categ_ids, + self.classification_category_2, + "Product should have only the remaining classification category", + ) + + def test_default_category_unchanged(self): + """Ensure that the default category remains unchanged after + assigning classification categories.""" + self._assign_classification_categories() + self.assertEqual( + self.product.categ_id, + self.default_category, + "Default category should remain unchanged", + ) diff --git a/product_multi_category/views/product_view.xml b/product_multi_category/views/product_view.xml new file mode 100644 index 00000000000..5ab1c58f39f --- /dev/null +++ b/product_multi_category/views/product_view.xml @@ -0,0 +1,24 @@ + + + + product.normal.form + product.product + + + + + + + + + + product.template.only.form + product.template + + + + + + + +