diff --git a/product_brand_stock_account/README.rst b/product_brand_stock_account/README.rst new file mode 100644 index 000000000..a4aa01201 --- /dev/null +++ b/product_brand_stock_account/README.rst @@ -0,0 +1,80 @@ +=========================== +Product Brand Stock Account +=========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:e25ea809c04be7726826f7cb5bb4fe34779426d633dc416d8793e83c43d6c3d4 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fbrand-lightgray.png?logo=github + :target: https://github.com/OCA/brand/tree/17.0/product_brand_stock_account + :alt: OCA/brand +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/brand-17-0/brand-17-0-product_brand_stock_account + :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=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows to work with product_brand in Stock Account reports. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +1. "Brand" group and filter is now available in Stock and Account search + view + +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 +======= + +Contributors +------------ + +- Francesco Apruzzese +- `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_stock_account/__init__.py b/product_brand_stock_account/__init__.py new file mode 100644 index 000000000..b1f869105 --- /dev/null +++ b/product_brand_stock_account/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2023 Francesco Apruzzese +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/product_brand_stock_account/__manifest__.py b/product_brand_stock_account/__manifest__.py new file mode 100644 index 000000000..235b223de --- /dev/null +++ b/product_brand_stock_account/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2023 Francesco Apruzzese +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Product Brand Stock Account", + "summary": """ + This module allows to work with product_brand in Stock Account.""", + "version": "17.0.1.0.0", + "license": "AGPL-3", + "author": "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/brand", + "depends": ["product_brand", "stock_account"], + "data": ["views/stock_valuation_layer_views.xml"], +} diff --git a/product_brand_stock_account/i18n/es.po b/product_brand_stock_account/i18n/es.po new file mode 100644 index 000000000..daf7770ed --- /dev/null +++ b/product_brand_stock_account/i18n/es.po @@ -0,0 +1,33 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_brand_stock_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-12-28 20:34+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_stock_account +#: model:ir.model.fields,field_description:product_brand_stock_account.field_stock_valuation_layer__product_brand_id +#: model_terms:ir.ui.view,arch_db:product_brand_stock_account.view_inventory_valuation_search +msgid "Brand" +msgstr "Marca" + +#. module: product_brand_stock_account +#: model:ir.model.fields,help:product_brand_stock_account.field_stock_valuation_layer__product_brand_id +msgid "Select a brand for this product" +msgstr "Seleccione una marca para este producto" + +#. module: product_brand_stock_account +#: model:ir.model,name:product_brand_stock_account.model_stock_valuation_layer +msgid "Stock Valuation Layer" +msgstr "Nivel de Valoración de Existencias" diff --git a/product_brand_stock_account/i18n/it.po b/product_brand_stock_account/i18n/it.po new file mode 100644 index 000000000..76f1372db --- /dev/null +++ b/product_brand_stock_account/i18n/it.po @@ -0,0 +1,33 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_brand_stock_account +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-05-03 16:34+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_brand_stock_account +#: model:ir.model.fields,field_description:product_brand_stock_account.field_stock_valuation_layer__product_brand_id +#: model_terms:ir.ui.view,arch_db:product_brand_stock_account.view_inventory_valuation_search +msgid "Brand" +msgstr "Marca" + +#. module: product_brand_stock_account +#: model:ir.model.fields,help:product_brand_stock_account.field_stock_valuation_layer__product_brand_id +msgid "Select a brand for this product" +msgstr "Scegliere una marca per questo prodotto" + +#. module: product_brand_stock_account +#: model:ir.model,name:product_brand_stock_account.model_stock_valuation_layer +msgid "Stock Valuation Layer" +msgstr "Livello valutazione magazzino" diff --git a/product_brand_stock_account/i18n/product_brand_stock_account.pot b/product_brand_stock_account/i18n/product_brand_stock_account.pot new file mode 100644 index 000000000..525918280 --- /dev/null +++ b/product_brand_stock_account/i18n/product_brand_stock_account.pot @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_brand_stock_account +# +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" + +#. module: product_brand_stock_account +#: model:ir.model.fields,field_description:product_brand_stock_account.field_stock_valuation_layer__product_brand_id +#: model_terms:ir.ui.view,arch_db:product_brand_stock_account.view_inventory_valuation_search +msgid "Brand" +msgstr "" + +#. module: product_brand_stock_account +#: model:ir.model.fields,help:product_brand_stock_account.field_stock_valuation_layer__product_brand_id +msgid "Select a brand for this product" +msgstr "" + +#. module: product_brand_stock_account +#: model:ir.model,name:product_brand_stock_account.model_stock_valuation_layer +msgid "Stock Valuation Layer" +msgstr "" diff --git a/product_brand_stock_account/models/__init__.py b/product_brand_stock_account/models/__init__.py new file mode 100644 index 000000000..819426730 --- /dev/null +++ b/product_brand_stock_account/models/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2023 Francesco Apruzzese +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import stock_valuation_layer diff --git a/product_brand_stock_account/models/stock_valuation_layer.py b/product_brand_stock_account/models/stock_valuation_layer.py new file mode 100644 index 000000000..489faf38c --- /dev/null +++ b/product_brand_stock_account/models/stock_valuation_layer.py @@ -0,0 +1,15 @@ +# Copyright 2023 Francesco Apruzzese +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class StockValuationLayer(models.Model): + _inherit = "stock.valuation.layer" + + product_brand_id = fields.Many2one( + comodel_name="product.brand", + related="product_id.product_brand_id", + string="Brand", + store=True, + ) diff --git a/product_brand_stock_account/pyproject.toml b/product_brand_stock_account/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/product_brand_stock_account/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_brand_stock_account/readme/CONTRIBUTORS.md b/product_brand_stock_account/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..3491cb7cb --- /dev/null +++ b/product_brand_stock_account/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- Francesco Apruzzese \<\> +- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) + - Bhavesh Heliconia diff --git a/product_brand_stock_account/readme/DESCRIPTION.md b/product_brand_stock_account/readme/DESCRIPTION.md new file mode 100644 index 000000000..8a617db61 --- /dev/null +++ b/product_brand_stock_account/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module allows to work with product_brand in Stock Account reports. diff --git a/product_brand_stock_account/readme/USAGE.md b/product_brand_stock_account/readme/USAGE.md new file mode 100644 index 000000000..f757077fe --- /dev/null +++ b/product_brand_stock_account/readme/USAGE.md @@ -0,0 +1,2 @@ +1. "Brand" group and filter is now available in Stock and Account + search view diff --git a/product_brand_stock_account/static/description/icon.png b/product_brand_stock_account/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/product_brand_stock_account/static/description/icon.png differ diff --git a/product_brand_stock_account/static/description/index.html b/product_brand_stock_account/static/description/index.html new file mode 100644 index 000000000..bb6bef75e --- /dev/null +++ b/product_brand_stock_account/static/description/index.html @@ -0,0 +1,428 @@ + + + + + +Product Brand Stock Account + + + +
+

Product Brand Stock Account

+ + +

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

+

This module allows to work with product_brand in Stock Account reports.

+

Table of contents

+ +
+

Usage

+
    +
  1. “Brand” group and filter is now available in Stock and Account search +view
  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

+
+

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_stock_account/tests/__init__.py b/product_brand_stock_account/tests/__init__.py new file mode 100644 index 000000000..ee0617eb6 --- /dev/null +++ b/product_brand_stock_account/tests/__init__.py @@ -0,0 +1 @@ +from . import test_product_brand_stock_account diff --git a/product_brand_stock_account/tests/test_product_brand_stock_account.py b/product_brand_stock_account/tests/test_product_brand_stock_account.py new file mode 100644 index 000000000..c0df1ee99 --- /dev/null +++ b/product_brand_stock_account/tests/test_product_brand_stock_account.py @@ -0,0 +1,29 @@ +from odoo.addons.base.tests.common import BaseCommon + + +class TestStockValuationLayer(BaseCommon): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.product_brand = cls.env["product.brand"].create({"name": "Brand A"}) + cls.product = cls.env["product.product"].create( + { + "name": "Product A", + "product_brand_id": cls.product_brand.id, + } + ) + cls.stock_valuation_layer = cls.env["stock.valuation.layer"].create( + { + "product_id": cls.product.id, + "company_id": cls.env.ref("base.main_company").id, + "quantity": 10, + "unit_cost": 100.0, + } + ) + + def test_product_brand_id_on_stock_valuation_layer(self): + self.assertEqual( + self.stock_valuation_layer.product_brand_id, + self.product_brand, + "The product_brand_id should match the product's brand.", + ) diff --git a/product_brand_stock_account/views/stock_valuation_layer_views.xml b/product_brand_stock_account/views/stock_valuation_layer_views.xml new file mode 100644 index 000000000..344cf0401 --- /dev/null +++ b/product_brand_stock_account/views/stock_valuation_layer_views.xml @@ -0,0 +1,33 @@ + + + + + Inventory Valuation + stock.valuation.layer + + + + + + + + + + + + + stock.valuation.layer.tree + stock.valuation.layer + + + + + + + + +