From e38f9e2d2045c4d5e4e71eea21cb37bb44047208 Mon Sep 17 00:00:00 2001 From: RemiFr82 Date: Sun, 15 Oct 2023 01:18:03 +0200 Subject: [PATCH] [ADD] product_variant_sequence module --- .../__manifest__.py | 3 +- product_variant_sequence/__init__.py | 1 + product_variant_sequence/__manifest__.py | 39 +++++++++++++++++++ product_variant_sequence/i18n/fr.po | 31 +++++++++++++++ product_variant_sequence/models/__init__.py | 1 + .../models/product_product.py | 11 ++++++ .../views/product_product.xml | 15 +++++++ 7 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 product_variant_sequence/__init__.py create mode 100644 product_variant_sequence/__manifest__.py create mode 100644 product_variant_sequence/i18n/fr.po create mode 100644 product_variant_sequence/models/__init__.py create mode 100644 product_variant_sequence/models/product_product.py create mode 100644 product_variant_sequence/views/product_product.xml diff --git a/product_variant_description_sale/__manifest__.py b/product_variant_description_sale/__manifest__.py index 651cb71..17ead03 100644 --- a/product_variant_description_sale/__manifest__.py +++ b/product_variant_description_sale/__manifest__.py @@ -3,7 +3,8 @@ "name": "Product Variant description", "version": "1.0.0", "summary": """ - This module allows to manage additional internal, sales and purchases descriptions on product variants + This module allows to manage additional sales description on product variants. + It appears as new line multi-line mention in sale orders and invoices lines description. """, "description": """ TO WRITE diff --git a/product_variant_sequence/__init__.py b/product_variant_sequence/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/product_variant_sequence/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_variant_sequence/__manifest__.py b/product_variant_sequence/__manifest__.py new file mode 100644 index 0000000..c4d6151 --- /dev/null +++ b/product_variant_sequence/__manifest__.py @@ -0,0 +1,39 @@ +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). +{ + "name": "Product Variant sequence", + "version": "1.0.0", + "summary": """ + This module adds a sequence for ordering product variants in tree view. + """, + "description": """ + TO WRITE + """, + "author": "RemiFr82", + "contributors": "", + "website": "https://remifr82.me", + "license": "LGPL-3", + "category": "Events", + # "price": 0, + # "currency": "EUR", + "application": False, + "installable": True, + "auto_install": False, + "pre_init_hook": "", + "post_init_hook": "", + "uninstall_hook": "", + "excludes": [], + "external_dependencies": [], + "depends": [ + "product", + ], + "data": [ + "views/product_product.xml", + ], + "assets": {}, + "css": [], + "images": [], + "js": [], + "test": [], + "demo": [], + "maintainer": "RemiFr82", +} diff --git a/product_variant_sequence/i18n/fr.po b/product_variant_sequence/i18n/fr.po new file mode 100644 index 0000000..6c86ca6 --- /dev/null +++ b/product_variant_sequence/i18n/fr.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * product_variant_sequence +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0+e-20230613\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-10-04 18:31+0000\n" +"PO-Revision-Date: 2023-10-04 18:31+0000\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_variant_sequence +#: model:ir.model,name:product_variant_sequence.model_product_product +msgid "Product Variant" +msgstr "Variante de produit" + +#. module: product_variant_sequence +#: model_terms:ir.ui.view,arch_db:product_variant_sequence.product_product_tree_view_inherit +msgid "Variant sequence" +msgstr "Séquence de variante" + +#. module: product_variant_sequence +#: model:ir.model.fields,field_description:product_variant_sequence.field_product_product__variant_sequence +msgid "Variant sequence" +msgstr "Séquence de variante" diff --git a/product_variant_sequence/models/__init__.py b/product_variant_sequence/models/__init__.py new file mode 100644 index 0000000..5c74c8c --- /dev/null +++ b/product_variant_sequence/models/__init__.py @@ -0,0 +1 @@ +from . import product_product diff --git a/product_variant_sequence/models/product_product.py b/product_variant_sequence/models/product_product.py new file mode 100644 index 0000000..fd4fd0c --- /dev/null +++ b/product_variant_sequence/models/product_product.py @@ -0,0 +1,11 @@ +from odoo import models, fields + + +class ProductProduct(models.Model): + _inherit = "product.product" + _order = "sequence, priority desc, default_code, name, id" + + variant_sequence = fields.Integer( + "Variant sequence", + default=1, + ) diff --git a/product_variant_sequence/views/product_product.xml b/product_variant_sequence/views/product_product.xml new file mode 100644 index 0000000..a2ed741 --- /dev/null +++ b/product_variant_sequence/views/product_product.xml @@ -0,0 +1,15 @@ + + + + + product.product.view.list.inherit + product.product + + + + + + + + + \ No newline at end of file