diff --git a/sale_product_pack_fixed_discount/README.rst b/sale_product_pack_fixed_discount/README.rst new file mode 100644 index 000000000..4c304298f --- /dev/null +++ b/sale_product_pack_fixed_discount/README.rst @@ -0,0 +1,93 @@ +================================ +Sale Product Pack Fixed Discount +================================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:fe519a2d50ceb35361a91cdeb528f0d927e3697577fa6830341329dea033d7a6 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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--pack-lightgray.png?logo=github + :target: https://github.com/OCA/product-pack/tree/14.0/sale_product_pack_fixed_discount + :alt: OCA/product-pack +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/product-pack-14-0/product-pack-14-0-sale_product_pack_fixed_discount + :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-pack&target_branch=14.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module is glue module between *Sale Product Pack* and *Sale fixed discount*'s modules. + +For the time being this avoid fixed discount on sale order lines linked +to a pack or a pack component excepted for pack with modifiable components. + +**Table of contents** + +.. contents:: + :local: + +Known issues / Roadmap +====================== + +* Add more support over different possible use cases + +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 +~~~~~~~ + +* Pierre Verkest +* + +Contributors +~~~~~~~~~~~~ + +* Pierre Verkest + +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. + +.. |maintainer-petrus-v| image:: https://github.com/petrus-v.png?size=40px + :target: https://github.com/petrus-v + :alt: petrus-v + +Current `maintainer `__: + +|maintainer-petrus-v| + +This module is part of the `OCA/product-pack `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_product_pack_fixed_discount/__init__.py b/sale_product_pack_fixed_discount/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/sale_product_pack_fixed_discount/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_product_pack_fixed_discount/__manifest__.py b/sale_product_pack_fixed_discount/__manifest__.py new file mode 100644 index 000000000..9e134448e --- /dev/null +++ b/sale_product_pack_fixed_discount/__manifest__.py @@ -0,0 +1,20 @@ +# Copyright 2023 Foodles (http://www.foodles.co). +# @author Pierre Verkest +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +{ + "name": "Sale Product Pack Fixed Discount", + "version": "14.0.1.0.0", + "category": "Sales", + "summary": "Glue module between sale product pack and sale fixed discount", + "website": "https://github.com/OCA/product-pack", + "author": ( + "Pierre Verkest , " + "Odoo Community Association (OCA), " + ), + "maintainers": ["petrus-v"], + "license": "AGPL-3", + "depends": ["sale_product_pack", "sale_fixed_discount"], + "data": ["views/sale_order_views.xml"], + "demo": [], + "installable": True, +} diff --git a/sale_product_pack_fixed_discount/i18n/fr.po b/sale_product_pack_fixed_discount/i18n/fr.po new file mode 100644 index 000000000..6f2cc906a --- /dev/null +++ b/sale_product_pack_fixed_discount/i18n/fr.po @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_product_pack_fixed_discount +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0+e\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: sale_product_pack_fixed_discount +#: model:ir.model.fields,field_description:sale_product_pack_fixed_discount.field_sale_order_line__display_name +msgid "Display Name" +msgstr "Nom d'affichage" + +#. module: sale_product_pack_fixed_discount +#: model:ir.model.fields,field_description:sale_product_pack_fixed_discount.field_sale_order_line__id +msgid "ID" +msgstr "ID" + +#. module: sale_product_pack_fixed_discount +#: model:ir.model.fields,field_description:sale_product_pack_fixed_discount.field_sale_order_line__pack_ok +msgid "Is Pack?" +msgstr "Est un pack ?" + +#. module: sale_product_pack_fixed_discount +#: model:ir.model.fields,help:sale_product_pack_fixed_discount.field_sale_order_line__pack_ok +msgid "Is a Product Pack?" +msgstr "Est un article Pack ?" + +#. module: sale_product_pack_fixed_discount +#: model:ir.model.fields,field_description:sale_product_pack_fixed_discount.field_sale_order_line____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: sale_product_pack_fixed_discount +#: model:ir.model,name:sale_product_pack_fixed_discount.model_sale_order_line +msgid "Sales Order Line" +msgstr "Ligne de commande" diff --git a/sale_product_pack_fixed_discount/i18n/sale_product_pack_fixed_discount.pot b/sale_product_pack_fixed_discount/i18n/sale_product_pack_fixed_discount.pot new file mode 100644 index 000000000..f409d0da5 --- /dev/null +++ b/sale_product_pack_fixed_discount/i18n/sale_product_pack_fixed_discount.pot @@ -0,0 +1,44 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_product_pack_fixed_discount +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0+e\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: sale_product_pack_fixed_discount +#: model:ir.model.fields,field_description:sale_product_pack_fixed_discount.field_sale_order_line__display_name +msgid "Display Name" +msgstr "" + +#. module: sale_product_pack_fixed_discount +#: model:ir.model.fields,field_description:sale_product_pack_fixed_discount.field_sale_order_line__id +msgid "ID" +msgstr "" + +#. module: sale_product_pack_fixed_discount +#: model:ir.model.fields,field_description:sale_product_pack_fixed_discount.field_sale_order_line__pack_ok +msgid "Is Pack?" +msgstr "" + +#. module: sale_product_pack_fixed_discount +#: model:ir.model.fields,help:sale_product_pack_fixed_discount.field_sale_order_line__pack_ok +msgid "Is a Product Pack?" +msgstr "" + +#. module: sale_product_pack_fixed_discount +#: model:ir.model.fields,field_description:sale_product_pack_fixed_discount.field_sale_order_line____last_update +msgid "Last Modified on" +msgstr "" + +#. module: sale_product_pack_fixed_discount +#: model:ir.model,name:sale_product_pack_fixed_discount.model_sale_order_line +msgid "Sales Order Line" +msgstr "" diff --git a/sale_product_pack_fixed_discount/models/__init__.py b/sale_product_pack_fixed_discount/models/__init__.py new file mode 100644 index 000000000..8eb9d1d40 --- /dev/null +++ b/sale_product_pack_fixed_discount/models/__init__.py @@ -0,0 +1 @@ +from . import sale_order_line diff --git a/sale_product_pack_fixed_discount/models/sale_order_line.py b/sale_product_pack_fixed_discount/models/sale_order_line.py new file mode 100644 index 000000000..25a154a6c --- /dev/null +++ b/sale_product_pack_fixed_discount/models/sale_order_line.py @@ -0,0 +1,12 @@ +# Copyright 2023 Foodles (http://www.foodles.co). +# @author Pierre Verkest +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +class SaleOrderLine(models.Model): + _inherit = "sale.order.line" + + pack_ok = fields.Boolean( + related="product_id.pack_ok", + ) diff --git a/sale_product_pack_fixed_discount/readme/CONTRIBUTORS.rst b/sale_product_pack_fixed_discount/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..638be8663 --- /dev/null +++ b/sale_product_pack_fixed_discount/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Pierre Verkest diff --git a/sale_product_pack_fixed_discount/readme/DESCRIPTION.rst b/sale_product_pack_fixed_discount/readme/DESCRIPTION.rst new file mode 100644 index 000000000..66d083d71 --- /dev/null +++ b/sale_product_pack_fixed_discount/readme/DESCRIPTION.rst @@ -0,0 +1,4 @@ +This module is glue module between *Sale Product Pack* and *Sale fixed discount*'s modules. + +For the time being this avoid fixed discount on sale order lines linked +to a pack or a pack component excepted for pack with modifiable components. diff --git a/sale_product_pack_fixed_discount/readme/ROADMAP.rst b/sale_product_pack_fixed_discount/readme/ROADMAP.rst new file mode 100644 index 000000000..43b6c1168 --- /dev/null +++ b/sale_product_pack_fixed_discount/readme/ROADMAP.rst @@ -0,0 +1 @@ +* Add more support over different possible use cases diff --git a/sale_product_pack_fixed_discount/static/description/index.html b/sale_product_pack_fixed_discount/static/description/index.html new file mode 100644 index 000000000..23a3ba889 --- /dev/null +++ b/sale_product_pack_fixed_discount/static/description/index.html @@ -0,0 +1,432 @@ + + + + + +Sale Product Pack Fixed Discount + + + +
+

Sale Product Pack Fixed Discount

+ + +

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

+

This module is glue module between Sale Product Pack and Sale fixed discount’s modules.

+

For the time being this avoid fixed discount on sale order lines linked +to a pack or a pack component excepted for pack with modifiable components.

+

Table of contents

+ +
+

Known issues / Roadmap

+
    +
  • Add more support over different possible use cases
  • +
+
+
+

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

+ +
+
+

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.

+

Current maintainer:

+

petrus-v

+

This module is part of the OCA/product-pack project on GitHub.

+

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

+
+
+
+ + diff --git a/sale_product_pack_fixed_discount/views/sale_order_views.xml b/sale_product_pack_fixed_discount/views/sale_order_views.xml new file mode 100644 index 000000000..2d82ac00a --- /dev/null +++ b/sale_product_pack_fixed_discount/views/sale_order_views.xml @@ -0,0 +1,49 @@ + + + + + sale.order + + + + + + + + + + + + + + + + sale.order + + + + {'invisible': ["|", ("pack_ok", "=", True), ("pack_parent_line_id", + "!=", False), ("pack_modifiable","=", False)]} + + + {'readonly': ["|", ("pack_ok", "=", True), + ("pack_parent_line_id", "!=", False), ("pack_modifiable","=", False)]} + + + + diff --git a/setup/sale_product_pack_fixed_discount/odoo/addons/sale_product_pack_fixed_discount b/setup/sale_product_pack_fixed_discount/odoo/addons/sale_product_pack_fixed_discount new file mode 120000 index 000000000..879a693ec --- /dev/null +++ b/setup/sale_product_pack_fixed_discount/odoo/addons/sale_product_pack_fixed_discount @@ -0,0 +1 @@ +../../../../sale_product_pack_fixed_discount \ No newline at end of file diff --git a/setup/sale_product_pack_fixed_discount/setup.py b/setup/sale_product_pack_fixed_discount/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/sale_product_pack_fixed_discount/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)