diff --git a/product_sale_manufactured_for/README.rst b/product_sale_manufactured_for/README.rst new file mode 100644 index 00000000000..28b98469d9f --- /dev/null +++ b/product_sale_manufactured_for/README.rst @@ -0,0 +1,89 @@ +================================= +Product Manufactured for Customer +================================= + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:71f63bf443178246b20b668b51c5fb64ef16e1bb20d2c2b1eb77feba62f2a763 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fproduct--attribute-lightgray.png?logo=github + :target: https://github.com/OCA/product-attribute/tree/18.0/product_sale_manufactured_for + :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-18-0/product-attribute-18-0-product_sale_manufactured_for + :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=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Allows to indicate in products that they were made (i.e. manufactured) +specifically for some customers. + +In a sale order, allow to only select products from the UI that were +manufactured for the chosen customer. + +**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 +------- + +* Camptocamp + +Contributors +------------ + +- Thierry Ducrest +- Carlos Serra-Toro +- Simone Orsi +- Nhan Tran + +Other credits +------------- + +The migration of this module from 14.0 to 18.0 was financially supported +by Camptocamp + +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_sale_manufactured_for/__init__.py b/product_sale_manufactured_for/__init__.py new file mode 100644 index 00000000000..d4b7188d6e5 --- /dev/null +++ b/product_sale_manufactured_for/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2021 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) +from . import models diff --git a/product_sale_manufactured_for/__manifest__.py b/product_sale_manufactured_for/__manifest__.py new file mode 100644 index 00000000000..0c435d1dcb4 --- /dev/null +++ b/product_sale_manufactured_for/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2021 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) +{ + "name": "Product Manufactured for Customer", + "summary": "Allows to indicate in products that they were made " + "specifically for some customers.", + "version": "19.0.1.0.0", + "category": "Sales", + "website": "https://github.com/OCA/product-attribute", + "author": "Camptocamp, Odoo Community Association (OCA)", + "license": "AGPL-3", + "data": [ + "views/product_product.xml", + "views/sale_order.xml", + ], + "depends": [ + "product", + "sale", + "sale_commercial_partner", + ], +} diff --git a/product_sale_manufactured_for/i18n/es.po b/product_sale_manufactured_for/i18n/es.po new file mode 100644 index 00000000000..dce44f8f539 --- /dev/null +++ b/product_sale_manufactured_for/i18n/es.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_sale_manufactured_for +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-01-15 14:33+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_sale_manufactured_for +#: model:ir.model.fields,field_description:product_sale_manufactured_for.field_product_product__manufactured_for_partner_ids +#: model_terms:ir.ui.view,arch_db:product_sale_manufactured_for.product_normal_form_view +msgid "Manufactured for" +msgstr "Fabricado para" + +#. module: product_sale_manufactured_for +#: model:ir.model,name:product_sale_manufactured_for.model_product_product +msgid "Product Variant" +msgstr "" + +#~ msgid "Display Name" +#~ msgstr "Mostrar Nombre" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Última Modificación el" + +#~ msgid "Product" +#~ msgstr "Producto" diff --git a/product_sale_manufactured_for/i18n/it.po b/product_sale_manufactured_for/i18n/it.po new file mode 100644 index 00000000000..c0618d33969 --- /dev/null +++ b/product_sale_manufactured_for/i18n/it.po @@ -0,0 +1,40 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_sale_manufactured_for +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-02-05 12:06+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.6.2\n" + +#. module: product_sale_manufactured_for +#: model:ir.model.fields,field_description:product_sale_manufactured_for.field_product_product__manufactured_for_partner_ids +#: model_terms:ir.ui.view,arch_db:product_sale_manufactured_for.product_normal_form_view +msgid "Manufactured for" +msgstr "Prodotto per" + +#. module: product_sale_manufactured_for +#: model:ir.model,name:product_sale_manufactured_for.model_product_product +msgid "Product Variant" +msgstr "Variante prodotto" + +#~ msgid "Display Name" +#~ msgstr "Nome visualizzato" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima modifica il" + +#~ msgid "Product" +#~ msgstr "Prodotto" diff --git a/product_sale_manufactured_for/i18n/nl.po b/product_sale_manufactured_for/i18n/nl.po new file mode 100644 index 00000000000..9c7f133d401 --- /dev/null +++ b/product_sale_manufactured_for/i18n/nl.po @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_sale_manufactured_for +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\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" + +#. module: product_sale_manufactured_for +#: model:ir.model.fields,field_description:product_sale_manufactured_for.field_product_product__manufactured_for_partner_ids +#: model_terms:ir.ui.view,arch_db:product_sale_manufactured_for.product_normal_form_view +msgid "Manufactured for" +msgstr "" + +#. module: product_sale_manufactured_for +#: model:ir.model,name:product_sale_manufactured_for.model_product_product +msgid "Product Variant" +msgstr "" diff --git a/product_sale_manufactured_for/i18n/nl_NL.po b/product_sale_manufactured_for/i18n/nl_NL.po new file mode 100644 index 00000000000..73c92535d19 --- /dev/null +++ b/product_sale_manufactured_for/i18n/nl_NL.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_sale_manufactured_for +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 18.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2025-04-10 22:24+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: none\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" +"X-Generator: Weblate 5.10.4\n" + +#. module: product_sale_manufactured_for +#: model:ir.model.fields,field_description:product_sale_manufactured_for.field_product_product__manufactured_for_partner_ids +#: model_terms:ir.ui.view,arch_db:product_sale_manufactured_for.product_normal_form_view +msgid "Manufactured for" +msgstr "Geproduceerd voor" + +#. module: product_sale_manufactured_for +#: model:ir.model,name:product_sale_manufactured_for.model_product_product +msgid "Product Variant" +msgstr "Product Variant" diff --git a/product_sale_manufactured_for/i18n/product_sale_manufactured_for.pot b/product_sale_manufactured_for/i18n/product_sale_manufactured_for.pot new file mode 100644 index 00000000000..79bbbb08132 --- /dev/null +++ b/product_sale_manufactured_for/i18n/product_sale_manufactured_for.pot @@ -0,0 +1,25 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_sale_manufactured_for +# +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_sale_manufactured_for +#: model:ir.model.fields,field_description:product_sale_manufactured_for.field_product_product__manufactured_for_partner_ids +#: model_terms:ir.ui.view,arch_db:product_sale_manufactured_for.product_normal_form_view +msgid "Manufactured for" +msgstr "" + +#. module: product_sale_manufactured_for +#: model:ir.model,name:product_sale_manufactured_for.model_product_product +msgid "Product Variant" +msgstr "" diff --git a/product_sale_manufactured_for/models/__init__.py b/product_sale_manufactured_for/models/__init__.py new file mode 100644 index 00000000000..5c74c8c30f1 --- /dev/null +++ b/product_sale_manufactured_for/models/__init__.py @@ -0,0 +1 @@ +from . import product_product diff --git a/product_sale_manufactured_for/models/product_product.py b/product_sale_manufactured_for/models/product_product.py new file mode 100644 index 00000000000..b18a36cdd69 --- /dev/null +++ b/product_sale_manufactured_for/models/product_product.py @@ -0,0 +1,16 @@ +# Copyright 2020 Camptocamp SA +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) +from odoo import fields, models + + +class ProductProduct(models.Model): + _inherit = "product.product" + + manufactured_for_partner_ids = fields.Many2many( + comodel_name="res.partner", + relation="product_product_manuf_for_partner_rel", + column1="product_id", + column2="partner_id", + domain=["|", ("customer_rank", ">", 0), ("is_company", "=", True)], + string="Manufactured for", + ) diff --git a/product_sale_manufactured_for/pyproject.toml b/product_sale_manufactured_for/pyproject.toml new file mode 100644 index 00000000000..4231d0cccb3 --- /dev/null +++ b/product_sale_manufactured_for/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/product_sale_manufactured_for/readme/CONTRIBUTORS.md b/product_sale_manufactured_for/readme/CONTRIBUTORS.md new file mode 100644 index 00000000000..e62e862e8c5 --- /dev/null +++ b/product_sale_manufactured_for/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- Thierry Ducrest \<\> +- Carlos Serra-Toro \<\> +- Simone Orsi \<\> +- Nhan Tran \<\> +- Thomas Herbin \<\> diff --git a/product_sale_manufactured_for/readme/CREDITS.md b/product_sale_manufactured_for/readme/CREDITS.md new file mode 100644 index 00000000000..7777d29d620 --- /dev/null +++ b/product_sale_manufactured_for/readme/CREDITS.md @@ -0,0 +1 @@ +The migration of this module from 14.0 to 18.0 was financially supported by Camptocamp diff --git a/product_sale_manufactured_for/readme/DESCRIPTION.md b/product_sale_manufactured_for/readme/DESCRIPTION.md new file mode 100644 index 00000000000..0b2868fc4a5 --- /dev/null +++ b/product_sale_manufactured_for/readme/DESCRIPTION.md @@ -0,0 +1,5 @@ +Allows to indicate in products that they were made (i.e. manufactured) +specifically for some customers. + +In a sale order, allow to only select products from the UI that were +manufactured for the chosen customer. diff --git a/product_sale_manufactured_for/static/description/icon.png b/product_sale_manufactured_for/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/product_sale_manufactured_for/static/description/icon.png differ diff --git a/product_sale_manufactured_for/static/description/index.html b/product_sale_manufactured_for/static/description/index.html new file mode 100644 index 00000000000..b080a89bdea --- /dev/null +++ b/product_sale_manufactured_for/static/description/index.html @@ -0,0 +1,435 @@ + + + + + +Product Manufactured for Customer + + + +
+

Product Manufactured for Customer

+ + +

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

+

Allows to indicate in products that they were made (i.e. manufactured) +specifically for some customers.

+

In a sale order, allow to only select products from the UI that were +manufactured for the chosen customer.

+

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

+
    +
  • Camptocamp
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+

The migration of this module from 14.0 to 18.0 was financially supported +by Camptocamp

+
+
+

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_sale_manufactured_for/views/product_product.xml b/product_sale_manufactured_for/views/product_product.xml new file mode 100644 index 00000000000..688f57dcb55 --- /dev/null +++ b/product_sale_manufactured_for/views/product_product.xml @@ -0,0 +1,19 @@ + + + + product.product + + + + + + + + + + diff --git a/product_sale_manufactured_for/views/sale_order.xml b/product_sale_manufactured_for/views/sale_order.xml new file mode 100644 index 00000000000..558e7c05a0c --- /dev/null +++ b/product_sale_manufactured_for/views/sale_order.xml @@ -0,0 +1,44 @@ + + + + + sale.order.form + sale.order + + + + + + [('sale_ok', '=', True), + '&', + '|', + ('manufactured_for_partner_ids', 'in', [parent.commercial_partner_id]), + ('manufactured_for_partner_ids', '=', False), + '|', + ('company_id', '=', False), + ('company_id', '=', parent.company_id)] + + + + + + [('sale_ok', '=', True), + '&', + '|', + ('manufactured_for_partner_ids', 'in', [parent.commercial_partner_id]), + ('manufactured_for_partner_ids', '=', False), + '|', + ('company_id', '=', False), + ('company_id', '=', parent.company_id)] + + + + +