diff --git a/product_odoo_module/README.rst b/product_odoo_module/README.rst new file mode 100644 index 0000000..35bb9a4 --- /dev/null +++ b/product_odoo_module/README.rst @@ -0,0 +1,56 @@ +=================== +Product Odoo Module +=================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:a2e456066195696d9c952d975a122eb0a6724401937219b667aea7525c4caab4 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-qrtl%2Fqrtl--custom-lightgray.png?logo=github + :target: https://github.com/qrtl/qrtl-custom/tree/16.0/product_odoo_module + :alt: qrtl/qrtl-custom + +|badge1| |badge2| |badge3| + +This module adds attributes to product.template and product.product that +are required for module products. + +**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 +------- + +* Quartile + +Maintainers +----------- + +This module is part of the `qrtl/qrtl-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/product_odoo_module/__init__.py b/product_odoo_module/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/product_odoo_module/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/product_odoo_module/__manifest__.py b/product_odoo_module/__manifest__.py new file mode 100644 index 0000000..1d95bf9 --- /dev/null +++ b/product_odoo_module/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2024-2025 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Product Odoo Module", + "version": "16.0.1.0.0", + "category": "Product", + "author": "Quartile", + "website": "https://www.quartile.co", + "license": "AGPL-3", + "depends": ["product"], + "data": [ + "data/menuitem_data.xml", + "security/ir.model.access.csv", + "views/product_odoo_version_views.xml", + "views/product_template_views.xml", + "views/res_company_views.xml", + ], +} diff --git a/product_odoo_module/data/menuitem_data.xml b/product_odoo_module/data/menuitem_data.xml new file mode 100644 index 0000000..5681c05 --- /dev/null +++ b/product_odoo_module/data/menuitem_data.xml @@ -0,0 +1,8 @@ + + + diff --git a/product_odoo_module/models/__init__.py b/product_odoo_module/models/__init__.py new file mode 100644 index 0000000..7d51e3c --- /dev/null +++ b/product_odoo_module/models/__init__.py @@ -0,0 +1,3 @@ +from . import product_odoo_version +from . import product_template +from . import res_company diff --git a/product_odoo_module/models/product_odoo_version.py b/product_odoo_module/models/product_odoo_version.py new file mode 100644 index 0000000..0df0716 --- /dev/null +++ b/product_odoo_module/models/product_odoo_version.py @@ -0,0 +1,13 @@ +# Copyright 2025 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ProductOdooVersion(models.Model): + _name = "product.odoo.version" + _description = "Odoo Version" + _order = "name desc" + + name = fields.Char(required=True) + active = fields.Boolean(default=True) diff --git a/product_odoo_module/models/product_template.py b/product_odoo_module/models/product_template.py new file mode 100644 index 0000000..56e3055 --- /dev/null +++ b/product_odoo_module/models/product_template.py @@ -0,0 +1,26 @@ +# Copyright 2024-2025 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + is_odoo_module = fields.Boolean() + odoo_version_id = fields.Many2one("product.odoo.version") + license_type = fields.Selection( + [("agpl-3", "AGPL-3"), ("lgpl-3", "LGPL-3"), ("other", "Other proprietary")], + help="Select the type of license", + ) + complexity = fields.Selection([("high", "High"), ("mid", "Mid"), ("low", "Low")]) + popularity_factor = fields.Float() + loc = fields.Integer(string="Lines of Code") + amount = fields.Float(compute="_compute_amount", store=True) + amount_incl_mig = fields.Float(compute="_compute_amount", store=True) + + @api.depends("list_price", "popularity_factor", "loc") + def _compute_amount(self): + for rec in self: + rec.amount = rec.list_price * rec.loc * rec.popularity_factor + rec.amount_incl_mig = rec.amount * 2 diff --git a/product_odoo_module/models/res_company.py b/product_odoo_module/models/res_company.py new file mode 100644 index 0000000..3695036 --- /dev/null +++ b/product_odoo_module/models/res_company.py @@ -0,0 +1,13 @@ +# Copyright 2025 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResCompany(models.Model): + _inherit = "res.company" + + price_module_maint = fields.Float( + "Module Maintenance Price", + help="Standard maintenance cost per LOC (line of code).", + ) diff --git a/product_odoo_module/readme/DESCRIPTION.md b/product_odoo_module/readme/DESCRIPTION.md new file mode 100644 index 0000000..fdbedbd --- /dev/null +++ b/product_odoo_module/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module adds attributes to product.template and product.product that +are required for module products. diff --git a/product_odoo_module/security/ir.model.access.csv b/product_odoo_module/security/ir.model.access.csv new file mode 100644 index 0000000..5c91165 --- /dev/null +++ b/product_odoo_module/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_product_odoo_version_user,product.odoo.version.user,model_product_odoo_version,base.group_user,1,0,0,0 +access_product_odoo_version_manager,product.odoo.version.manager,model_product_odoo_version,base.group_system,1,1,1,1 diff --git a/product_odoo_module/static/description/index.html b/product_odoo_module/static/description/index.html new file mode 100644 index 0000000..cf43e6b --- /dev/null +++ b/product_odoo_module/static/description/index.html @@ -0,0 +1,409 @@ + + + + + +Product Odoo Module + + + +
+

Product Odoo Module

+ + +

Beta License: AGPL-3 qrtl/qrtl-custom

+

This module adds attributes to product.template and product.product that +are required for module products.

+

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

+
    +
  • Quartile
  • +
+
+
+

Maintainers

+

This module is part of the qrtl/qrtl-custom project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/product_odoo_module/views/product_odoo_version_views.xml b/product_odoo_module/views/product_odoo_version_views.xml new file mode 100644 index 0000000..9b56181 --- /dev/null +++ b/product_odoo_module/views/product_odoo_version_views.xml @@ -0,0 +1,24 @@ + + + product.odoo.version.tree + product.odoo.version + + + + + + + + + Odoo Versions + product.odoo.version + tree + + + diff --git a/product_odoo_module/views/product_template_views.xml b/product_odoo_module/views/product_template_views.xml new file mode 100644 index 0000000..1c6c5a8 --- /dev/null +++ b/product_odoo_module/views/product_template_views.xml @@ -0,0 +1,46 @@ + + + product.template.common.form + product.template + + + + + + + + + + + + + + + + + + + + + + + + product.template.search + product.template + + + + + + + + + diff --git a/product_odoo_module/views/res_company_views.xml b/product_odoo_module/views/res_company_views.xml new file mode 100644 index 0000000..93d4927 --- /dev/null +++ b/product_odoo_module/views/res_company_views.xml @@ -0,0 +1,14 @@ + + + res.company.form + res.company + + + + + + + + + + diff --git a/setup/product_odoo_module/odoo/addons/product_odoo_module b/setup/product_odoo_module/odoo/addons/product_odoo_module new file mode 120000 index 0000000..13a790c --- /dev/null +++ b/setup/product_odoo_module/odoo/addons/product_odoo_module @@ -0,0 +1 @@ +../../../../product_odoo_module \ No newline at end of file diff --git a/setup/product_odoo_module/setup.py b/setup/product_odoo_module/setup.py new file mode 100644 index 0000000..28c57bb --- /dev/null +++ b/setup/product_odoo_module/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)