diff --git a/product_brand_purchase/README.rst b/product_brand_purchase/README.rst new file mode 100644 index 000000000..a050e700a --- /dev/null +++ b/product_brand_purchase/README.rst @@ -0,0 +1,93 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +====================== +Product Brand Purchase +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:57117ce32a3091dfe822a7e7999f104ca7d2811da178fecf3ab6d92d6a76946a + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fbrand-lightgray.png?logo=github + :target: https://github.com/OCA/brand/tree/19.0/product_brand_purchase + :alt: OCA/brand +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/brand-19-0/brand-19-0-product_brand_purchase + :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/brand&target_branch=19.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to work with product_brand in purchase reports. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +1. "Product Brands" menu is now accessible also under Purchase > + Configuration > Products + +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 +------------ + +- Quentin Groulard +- `Ooops404 `__: + + - Ilyas + +- `Heliconia Solutions Pvt. Ltd. `__ + + - Bhavesh Heliconia + +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/brand `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/product_brand_purchase/__init__.py b/product_brand_purchase/__init__.py new file mode 100644 index 000000000..65323532b --- /dev/null +++ b/product_brand_purchase/__init__.py @@ -0,0 +1 @@ +from . import reports diff --git a/product_brand_purchase/__manifest__.py b/product_brand_purchase/__manifest__.py new file mode 100644 index 000000000..8695f2cb3 --- /dev/null +++ b/product_brand_purchase/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2020 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Product Brand Purchase", + "summary": """ + This module allows to work with product_brand in purchase reports.""", + "version": "19.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/brand", + "depends": ["product_brand", "purchase"], + "data": ["reports/purchase_report_view.xml", "views/product_brand_view.xml"], +} diff --git a/product_brand_purchase/i18n/es.po b/product_brand_purchase/i18n/es.po new file mode 100644 index 000000000..316dd4c70 --- /dev/null +++ b/product_brand_purchase/i18n/es.po @@ -0,0 +1,33 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_brand_purchase +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-10-28 13:24+0000\n" +"Last-Translator: Ivorra78 \n" +"Language-Team: none\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_brand_purchase +#: model:ir.model.fields,field_description:product_brand_purchase.field_purchase_report__product_brand_id +#: model_terms:ir.ui.view,arch_db:product_brand_purchase.purchase_report_search_view +msgid "Brand" +msgstr "Marca" + +#. module: product_brand_purchase +#: model:ir.ui.menu,name:product_brand_purchase.menu_product_in_config_purchase_product_brand +msgid "Product Brands" +msgstr "Marcas de Producto" + +#. module: product_brand_purchase +#: model:ir.model,name:product_brand_purchase.model_purchase_report +msgid "Purchase Report" +msgstr "Informe de Compra" diff --git a/product_brand_purchase/i18n/it.po b/product_brand_purchase/i18n/it.po new file mode 100644 index 000000000..ee8f9c370 --- /dev/null +++ b/product_brand_purchase/i18n/it.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_brand_purchase +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-02-17 12:22+0000\n" +"Last-Translator: Francesco Foresti \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.14.1\n" + +#. module: product_brand_purchase +#: model:ir.model.fields,field_description:product_brand_purchase.field_purchase_report__product_brand_id +#: model_terms:ir.ui.view,arch_db:product_brand_purchase.purchase_report_search_view +msgid "Brand" +msgstr "Marca" + +#. module: product_brand_purchase +#: model:ir.model.fields,field_description:product_brand_purchase.field_purchase_report__display_name +msgid "Display Name" +msgstr "Nome visualizzato" + +#. module: product_brand_purchase +#: model:ir.model.fields,field_description:product_brand_purchase.field_purchase_report__id +msgid "ID" +msgstr "ID" + +#. module: product_brand_purchase +#: model:ir.model.fields,field_description:product_brand_purchase.field_purchase_report____last_update +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: product_brand_purchase +#: model:ir.ui.menu,name:product_brand_purchase.menu_product_in_config_purchase_product_brand +msgid "Product Brands" +msgstr "Marche del prodotto" + +#. module: product_brand_purchase +#: model:ir.model,name:product_brand_purchase.model_purchase_report +msgid "Purchase Report" +msgstr "Resoconto di acquisto" diff --git a/product_brand_purchase/i18n/nl.po b/product_brand_purchase/i18n/nl.po new file mode 100644 index 000000000..46e8f1d35 --- /dev/null +++ b/product_brand_purchase/i18n/nl.po @@ -0,0 +1,33 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_brand_purchase +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-08-09 13:22+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: none\n" +"Language: 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" +"X-Generator: Weblate 5.10.4\n" + +#. module: product_brand_purchase +#: model:ir.model.fields,field_description:product_brand_purchase.field_purchase_report__product_brand_id +#: model_terms:ir.ui.view,arch_db:product_brand_purchase.purchase_report_search_view +msgid "Brand" +msgstr "Merk" + +#. module: product_brand_purchase +#: model:ir.ui.menu,name:product_brand_purchase.menu_product_in_config_purchase_product_brand +msgid "Product Brands" +msgstr "Productmerken" + +#. module: product_brand_purchase +#: model:ir.model,name:product_brand_purchase.model_purchase_report +msgid "Purchase Report" +msgstr "Aankooprapport" diff --git a/product_brand_purchase/i18n/product_brand_purchase.pot b/product_brand_purchase/i18n/product_brand_purchase.pot new file mode 100644 index 000000000..f097b21e2 --- /dev/null +++ b/product_brand_purchase/i18n/product_brand_purchase.pot @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_brand_purchase +# +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_brand_purchase +#: model:ir.model.fields,field_description:product_brand_purchase.field_purchase_report__product_brand_id +#: model_terms:ir.ui.view,arch_db:product_brand_purchase.purchase_report_search_view +msgid "Brand" +msgstr "" + +#. module: product_brand_purchase +#: model:ir.ui.menu,name:product_brand_purchase.menu_product_in_config_purchase_product_brand +msgid "Product Brands" +msgstr "" + +#. module: product_brand_purchase +#: model:ir.model,name:product_brand_purchase.model_purchase_report +msgid "Purchase Report" +msgstr "" diff --git a/product_brand_purchase/pyproject.toml b/product_brand_purchase/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/product_brand_purchase/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_brand_purchase/readme/CONTRIBUTORS.md b/product_brand_purchase/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..da75f61de --- /dev/null +++ b/product_brand_purchase/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- Quentin Groulard \<\> +- [Ooops404](https://www.ooops404.com): + - Ilyas \<\> +- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) + - Bhavesh Heliconia diff --git a/product_brand_purchase/readme/DESCRIPTION.md b/product_brand_purchase/readme/DESCRIPTION.md new file mode 100644 index 000000000..cf424a86b --- /dev/null +++ b/product_brand_purchase/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module allows to work with product_brand in purchase reports. diff --git a/product_brand_purchase/readme/USAGE.md b/product_brand_purchase/readme/USAGE.md new file mode 100644 index 000000000..f1fc3b780 --- /dev/null +++ b/product_brand_purchase/readme/USAGE.md @@ -0,0 +1,2 @@ +1. "Product Brands" menu is now accessible also under Purchase \> + Configuration \> Products diff --git a/product_brand_purchase/reports/__init__.py b/product_brand_purchase/reports/__init__.py new file mode 100644 index 000000000..84b6eef84 --- /dev/null +++ b/product_brand_purchase/reports/__init__.py @@ -0,0 +1 @@ +from . import purchase_report diff --git a/product_brand_purchase/reports/purchase_report.py b/product_brand_purchase/reports/purchase_report.py new file mode 100644 index 000000000..01b4c2c7a --- /dev/null +++ b/product_brand_purchase/reports/purchase_report.py @@ -0,0 +1,19 @@ +# Copyright 2020 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models +from odoo.tools import SQL + + +class PurchaseReport(models.Model): + _inherit = "purchase.report" + + product_brand_id = fields.Many2one(comodel_name="product.brand", string="Brand") + + def _select(self): + select_str = super()._select() + return SQL("%s, t.product_brand_id as product_brand_id", select_str) + + def _group_by(self): + group_by_str = super()._group_by() + return SQL("%s, t.product_brand_id", group_by_str) diff --git a/product_brand_purchase/reports/purchase_report_view.xml b/product_brand_purchase/reports/purchase_report_view.xml new file mode 100644 index 000000000..22d9f1242 --- /dev/null +++ b/product_brand_purchase/reports/purchase_report_view.xml @@ -0,0 +1,19 @@ + + + + + purchase.report.search (in product_brand_purchase) + purchase.report + + + + + + + + diff --git a/product_brand_purchase/static/description/icon.png b/product_brand_purchase/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/product_brand_purchase/static/description/icon.png differ diff --git a/product_brand_purchase/static/description/index.html b/product_brand_purchase/static/description/index.html new file mode 100644 index 000000000..031c8d183 --- /dev/null +++ b/product_brand_purchase/static/description/index.html @@ -0,0 +1,445 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Product Brand Purchase

+ +

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

+

This module allows to work with product_brand in purchase reports.

+

Table of contents

+ +
+

Usage

+
    +
  1. “Product Brands” menu is now accessible also under Purchase > +Configuration > Products
  2. +
+
+
+

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

+

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

+
+
+
+
+ + diff --git a/product_brand_purchase/tests/__init__.py b/product_brand_purchase/tests/__init__.py new file mode 100644 index 000000000..30293f764 --- /dev/null +++ b/product_brand_purchase/tests/__init__.py @@ -0,0 +1 @@ +from . import test_product_brand_purchase diff --git a/product_brand_purchase/tests/test_product_brand_purchase.py b/product_brand_purchase/tests/test_product_brand_purchase.py new file mode 100644 index 000000000..94da98bc3 --- /dev/null +++ b/product_brand_purchase/tests/test_product_brand_purchase.py @@ -0,0 +1,47 @@ +# Copyright 2020 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.addons.base.tests.common import BaseCommon + + +class TestPurchaseReport(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + + cls.brand = cls.env["product.brand"].create({"name": "Test Brand"}) + cls.product = cls.env["product.product"].create( + { + "name": "Test Product", + "product_brand_id": cls.brand.id, + "type": "consu", + } + ) + cls.purchase_order = cls.env["purchase.order"].create( + { + "partner_id": cls.partner.id, + } + ) + cls.purchase_order_line = cls.env["purchase.order.line"].create( + { + "order_id": cls.purchase_order.id, + "product_id": cls.product.id, + "name": "Test Purchase Order Line", + "price_unit": 100.0, + "product_qty": 1.0, + } + ) + cls.purchase_order.button_confirm() + + def test_purchase_report_brand(self): + report = self.env["purchase.report"].search( + [("product_brand_id", "=", self.brand.id)] + ) + self.assertTrue( + report, "The purchase report should contain an entry for the product brand." + ) + self.assertEqual( + report[0].product_brand_id, + self.brand, + "The product brand in the report should match the created brand.", + ) diff --git a/product_brand_purchase/views/product_brand_view.xml b/product_brand_purchase/views/product_brand_view.xml new file mode 100644 index 000000000..bd337c80e --- /dev/null +++ b/product_brand_purchase/views/product_brand_view.xml @@ -0,0 +1,10 @@ + + + +