diff --git a/product_attribute_archive/README.rst b/product_attribute_archive/README.rst new file mode 100644 index 00000000000..258cd5725da --- /dev/null +++ b/product_attribute_archive/README.rst @@ -0,0 +1 @@ +todo diff --git a/product_attribute_archive/__init__.py b/product_attribute_archive/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/product_attribute_archive/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_attribute_archive/__manifest__.py b/product_attribute_archive/__manifest__.py new file mode 100644 index 00000000000..d9c82929d3c --- /dev/null +++ b/product_attribute_archive/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2021 Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Product Attribute Archive", + "summary": """ + Add an active field on product attributes""", + "version": "14.0.1.0.0", + "license": "AGPL-3", + "author": "Akretion,Odoo Community Association (OCA)", + "depends": ["product"], + "data": [ + "views/product_attribute.xml", + ], + "website": "https://github.com/OCA/product-attribute", +} diff --git a/product_attribute_archive/models/__init__.py b/product_attribute_archive/models/__init__.py new file mode 100644 index 00000000000..ca81adb0e20 --- /dev/null +++ b/product_attribute_archive/models/__init__.py @@ -0,0 +1,2 @@ +from . import product_attribute +from . import product_attribute_value diff --git a/product_attribute_archive/models/product_attribute.py b/product_attribute_archive/models/product_attribute.py new file mode 100644 index 00000000000..d2a85a9e89d --- /dev/null +++ b/product_attribute_archive/models/product_attribute.py @@ -0,0 +1,10 @@ +# Copyright 2021 Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ProductAttribute(models.Model): + _inherit = "product.attribute" + + active = fields.Boolean(default=True) diff --git a/product_attribute_archive/models/product_attribute_value.py b/product_attribute_archive/models/product_attribute_value.py new file mode 100644 index 00000000000..58cb3e7a469 --- /dev/null +++ b/product_attribute_archive/models/product_attribute_value.py @@ -0,0 +1,10 @@ +# Copyright 2021 Akretion +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ProductAttributeValue(models.Model): + _inherit = "product.attribute.value" + + active = fields.Boolean(default=True) diff --git a/product_attribute_archive/readme/CONTRIBUTORS.rst b/product_attribute_archive/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..06a2116feb0 --- /dev/null +++ b/product_attribute_archive/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Kevin Khao diff --git a/product_attribute_archive/readme/DESCRIPTION.rst b/product_attribute_archive/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..62371bd956c --- /dev/null +++ b/product_attribute_archive/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows archival of product attributes and product attribute values. diff --git a/product_attribute_archive/readme/USAGE.rst b/product_attribute_archive/readme/USAGE.rst new file mode 100644 index 00000000000..132b3d0c98d --- /dev/null +++ b/product_attribute_archive/readme/USAGE.rst @@ -0,0 +1,7 @@ +Simply use the archive action on any product attribute. + +The attribute is then no longer usable on new products. + +Identical functionality on product attribute values. + +Existing variants are unaffected, only new ones. diff --git a/product_attribute_archive/static/description/icon.png b/product_attribute_archive/static/description/icon.png new file mode 100644 index 00000000000..3a0328b516c Binary files /dev/null and b/product_attribute_archive/static/description/icon.png differ diff --git a/product_attribute_archive/views/product_attribute.xml b/product_attribute_archive/views/product_attribute.xml new file mode 100644 index 00000000000..4bf072c8d4c --- /dev/null +++ b/product_attribute_archive/views/product_attribute.xml @@ -0,0 +1,41 @@ + + + + + + product.attribute.form + product.attribute + + + + + + + + + + + + + + product.attribute.tree + product.attribute + + + + + + + + + + {'active_test': False} + + +