diff --git a/stock_brand/README.rst b/stock_brand/README.rst new file mode 100644 index 000000000..bbe1473b1 --- /dev/null +++ b/stock_brand/README.rst @@ -0,0 +1,107 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +=========== +Stock Brand +=========== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:75bd15db099354f8668d20db77de49e30457831a285cb53eb1a4cfe13ee05ec4 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/stock_brand + :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-stock_brand + :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 streamlines the branding of shipping documents. It ensures +that the brand selected on a sale order is automatically applied to the +corresponding stock picking documents, providing consistent branding on +delivery slips and other related paperwork. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +1. Go to Sales > Sale Orders +2. Select or create a sale order +3. Enter the information and the brand +4. Confirm Sale order to create pickings +5. Print the delivery slip PDF report. It includes the information of + the brand. + +To do point 5, the `Brand External Report +Layout `__ +OCA module must be installed. + +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 +------- + +* Sunflower IT + +Contributors +------------ + +- Terrence Nzaywa +- `Heliconia Solutions Pvt. Ltd. `__ + + - Bhavesh Heliconia + +Other credits +------------- + +- Sunflower IT + +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/stock_brand/__init__.py b/stock_brand/__init__.py new file mode 100644 index 000000000..4e9990cb3 --- /dev/null +++ b/stock_brand/__init__.py @@ -0,0 +1,5 @@ +# Copyright (C) 2019 Sunflower IT +# License GNU Affero General Public License . + + +from . import models diff --git a/stock_brand/__manifest__.py b/stock_brand/__manifest__.py new file mode 100644 index 000000000..cdf65b23f --- /dev/null +++ b/stock_brand/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright (C) 2019 Sunflower IT +# License GNU Affero General Public License . + +{ + "name": "Stock Brand", + "summary": "Manage brands on stock picking documents", + "version": "19.0.1.0.0", + "category": "Warehouse", + "website": "https://github.com/OCA/brand", + "author": "Sunflower IT, Odoo Community Association (OCA)", + "license": "AGPL-3", + "depends": [ + "sale_brand", + "sale_stock", + ], + "data": [ + "views/stock_picking_views.xml", + ], + "installable": True, + "development_status": "Beta", +} diff --git a/stock_brand/i18n/it.po b/stock_brand/i18n/it.po new file mode 100644 index 000000000..c6b974bd7 --- /dev/null +++ b/stock_brand/i18n/it.po @@ -0,0 +1,57 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_brand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-09-16 11:42+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 5.10.4\n" + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__allowed_payment_mode_ids +msgid "Allowed Payment Mode" +msgstr "Metodo di pagamento consentito" + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__brand_id +msgid "Brand" +msgstr "Marca" + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__brand_use_level +msgid "Brand Use Level" +msgstr "Livello uso marca" + +#. module: stock_brand +#: model:ir.model.fields,help:stock_brand.field_stock_picking__brand_id +msgid "Brand to use for this picking." +msgstr "Marca da usare per questo prelievo." + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__company_id +msgid "Company" +msgstr "Azienda" + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__is_brand_required +msgid "Is Brand Required" +msgstr "La marca รจ richiesta" + +#. module: stock_brand +#: model:ir.model,name:stock_brand.model_sale_order +msgid "Sales Order" +msgstr "Ordine di vendita" + +#. module: stock_brand +#: model:ir.model,name:stock_brand.model_stock_picking +msgid "Transfer" +msgstr "Trasferimento" diff --git a/stock_brand/i18n/nl.po b/stock_brand/i18n/nl.po new file mode 100644 index 000000000..8786f2b7b --- /dev/null +++ b/stock_brand/i18n/nl.po @@ -0,0 +1,57 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_brand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-04-13 11:48+0000\n" +"PO-Revision-Date: 2025-04-13 11:48+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__allowed_payment_mode_ids +msgid "Allowed Payment Mode" +msgstr "" + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__brand_id +msgid "Brand" +msgstr "Merk" + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__brand_use_level +msgid "Brand Use Level" +msgstr "Merkgebruiksniveau" + +#. module: stock_brand +#: model:ir.model.fields,help:stock_brand.field_stock_picking__brand_id +msgid "Brand to use for this picking." +msgstr "Merk dat voor deze picking moet worden gebruikt." + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__company_id +msgid "Company" +msgstr "Bedrijf" + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__is_brand_required +msgid "Is Brand Required" +msgstr "" + +#. module: stock_brand +#: model:ir.model,name:stock_brand.model_sale_order +msgid "Sales Order" +msgstr "Verkooporder" + +#. module: stock_brand +#: model:ir.model,name:stock_brand.model_stock_picking +msgid "Transfer" +msgstr "Overdracht" diff --git a/stock_brand/i18n/stock_brand.pot b/stock_brand/i18n/stock_brand.pot new file mode 100644 index 000000000..9defacd23 --- /dev/null +++ b/stock_brand/i18n/stock_brand.pot @@ -0,0 +1,54 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_brand +# +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: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__allowed_payment_mode_ids +msgid "Allowed Payment Mode" +msgstr "" + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__brand_id +msgid "Brand" +msgstr "" + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__brand_use_level +msgid "Brand Use Level" +msgstr "" + +#. module: stock_brand +#: model:ir.model.fields,help:stock_brand.field_stock_picking__brand_id +msgid "Brand to use for this picking." +msgstr "" + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__company_id +msgid "Company" +msgstr "" + +#. module: stock_brand +#: model:ir.model.fields,field_description:stock_brand.field_stock_picking__is_brand_required +msgid "Is Brand Required" +msgstr "" + +#. module: stock_brand +#: model:ir.model,name:stock_brand.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: stock_brand +#: model:ir.model,name:stock_brand.model_stock_picking +msgid "Transfer" +msgstr "" diff --git a/stock_brand/models/__init__.py b/stock_brand/models/__init__.py new file mode 100644 index 000000000..ddd15007e --- /dev/null +++ b/stock_brand/models/__init__.py @@ -0,0 +1,5 @@ +# Copyright (C) 2019 Sunflower IT +# License GNU Affero General Public License . + +from . import stock_picking +from . import sale_order diff --git a/stock_brand/models/sale_order.py b/stock_brand/models/sale_order.py new file mode 100644 index 000000000..7630a8b82 --- /dev/null +++ b/stock_brand/models/sale_order.py @@ -0,0 +1,14 @@ +# Copyright (C) 2019 Sunflower IT +# License GNU Affero General Public License . + +from odoo import models + + +class SaleOrder(models.Model): + _inherit = "sale.order" + + def action_confirm(self): + res = super().action_confirm() + for order in self: + order.picking_ids.write({"brand_id": order.brand_id.id}) + return res diff --git a/stock_brand/models/stock_picking.py b/stock_brand/models/stock_picking.py new file mode 100644 index 000000000..f1bc09680 --- /dev/null +++ b/stock_brand/models/stock_picking.py @@ -0,0 +1,19 @@ +# Copyright (C) 2019 Sunflower IT +# License GNU Affero General Public License . + +from odoo import fields, models + + +class StockPicking(models.Model): + _name = "stock.picking" + _inherit = ["stock.picking", "res.brand.mixin"] + + brand_id = fields.Many2one( + help="Brand to use for this picking.", + ) + + def _is_brand_required(self): + self.ensure_one() + if self.picking_type_id.code in ("internal", "mrp_operation"): + return False + return super()._is_brand_required() diff --git a/stock_brand/pyproject.toml b/stock_brand/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/stock_brand/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/stock_brand/readme/CONTRIBUTORS.md b/stock_brand/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..ea520fc7b --- /dev/null +++ b/stock_brand/readme/CONTRIBUTORS.md @@ -0,0 +1,4 @@ +- Terrence Nzaywa \<, + \> +- [Heliconia Solutions Pvt. Ltd.](https://www.heliconia.io) + - Bhavesh Heliconia diff --git a/stock_brand/readme/CREDITS.md b/stock_brand/readme/CREDITS.md new file mode 100644 index 000000000..f14262882 --- /dev/null +++ b/stock_brand/readme/CREDITS.md @@ -0,0 +1 @@ +- Sunflower IT \<\> diff --git a/stock_brand/readme/DESCRIPTION.md b/stock_brand/readme/DESCRIPTION.md new file mode 100644 index 000000000..a4eb5f510 --- /dev/null +++ b/stock_brand/readme/DESCRIPTION.md @@ -0,0 +1 @@ +This module streamlines the branding of shipping documents. It ensures that the brand selected on a sale order is automatically applied to the corresponding stock picking documents, providing consistent branding on delivery slips and other related paperwork. diff --git a/stock_brand/readme/USAGE.md b/stock_brand/readme/USAGE.md new file mode 100644 index 000000000..be47d76d2 --- /dev/null +++ b/stock_brand/readme/USAGE.md @@ -0,0 +1,10 @@ +To use this module, you need to: + +1. Go to Sales \> Sale Orders +2. Select or create a sale order +3. Enter the information and the brand +4. Confirm Sale order to create pickings +5. Print the delivery slip PDF report. It includes the information of + the brand. + +To do point 5, the [Brand External Report Layout](https://github.com/OCA/brand/tree/18.0/brand_external_report_layout/README.rst) OCA module must be installed. diff --git a/stock_brand/static/description/icon.png b/stock_brand/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/stock_brand/static/description/icon.png differ diff --git a/stock_brand/static/description/index.html b/stock_brand/static/description/index.html new file mode 100644 index 000000000..aacd55b53 --- /dev/null +++ b/stock_brand/static/description/index.html @@ -0,0 +1,459 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Stock Brand

+ +

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

+

This module streamlines the branding of shipping documents. It ensures +that the brand selected on a sale order is automatically applied to the +corresponding stock picking documents, providing consistent branding on +delivery slips and other related paperwork.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to Sales > Sale Orders
  2. +
  3. Select or create a sale order
  4. +
  5. Enter the information and the brand
  6. +
  7. Confirm Sale order to create pickings
  8. +
  9. Print the delivery slip PDF report. It includes the information of +the brand.
  10. +
+

To do point 5, the Brand External Report +Layout +OCA module must be installed.

+
+
+

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

+
    +
  • Sunflower IT
  • +
+
+ + +
+

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/stock_brand/tests/__init__.py b/stock_brand/tests/__init__.py new file mode 100644 index 000000000..7b41c988a --- /dev/null +++ b/stock_brand/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright (C) 2019 Sunflower IT +# License GNU Affero General Public License . + +from . import test_sale_order diff --git a/stock_brand/tests/test_sale_order.py b/stock_brand/tests/test_sale_order.py new file mode 100644 index 000000000..7fb31356e --- /dev/null +++ b/stock_brand/tests/test_sale_order.py @@ -0,0 +1,38 @@ +from odoo import Command + +from odoo.addons.base.tests.common import BaseCommon + + +class TestSaleOrderStockPickingBrandID(BaseCommon): + def test_stock_picking_brand_id(self): + """ + Test stock.picking brand_id is same as sale.order's brand_id + """ + product = self.env["product.product"].create( + {"name": "Test Product", "type": "consu"} + ) + brand_id = self.env["res.brand"].create({"name": "Brand1"}) + vals = { + "partner_id": self.partner.id, + "partner_invoice_id": self.partner.id, + "partner_shipping_id": self.partner.id, + "brand_id": brand_id.id, + "order_line": [ + Command.create( + { + "name": product.name, + "product_id": product.id, + "product_uom_qty": 2, + "product_uom_id": product.uom_id.id, + "price_unit": product.list_price, + }, + ) + ], + "picking_policy": "direct", + } + self.so = self.env["sale.order"].create(vals) + + # confirm our standard so, check the picking brand id + self.so.action_confirm() + self.assertTrue(self.so.picking_ids, "Sale Stock: no picking created") + self.assertEqual(self.so.picking_ids[0].brand_id.id, self.so.brand_id.id) diff --git a/stock_brand/views/stock_picking_views.xml b/stock_brand/views/stock_picking_views.xml new file mode 100644 index 000000000..ac64485b2 --- /dev/null +++ b/stock_brand/views/stock_picking_views.xml @@ -0,0 +1,12 @@ + + + stock.picking.form.brand + stock.picking + + + + + + + + diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 000000000..dd6bb08d8 --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,2 @@ +odoo-addon-account_brand @ git+https://github.com/OCA/brand.git@refs/pull/303/head#subdirectory=account_brand +odoo-addon-sale_brand @ git+https://github.com/OCA/brand.git@refs/pull/305/head#subdirectory=sale_brand