From 9f0197a8fe0edcb7cece68308785cf155878db50 Mon Sep 17 00:00:00 2001 From: Aungkokolin1997 Date: Wed, 29 May 2024 05:43:44 +0000 Subject: [PATCH] [ADD] custom_module_management --- custom_module_management/README.rst | 56 +++ custom_module_management/__init__.py | 1 + custom_module_management/__manifest__.py | 16 + custom_module_management/models/__init__.py | 2 + .../models/customer_info.py | 19 + .../models/product_product.py | 10 + .../readme/DESCRIPTION.md | 2 + .../security/ir.model.access.csv | 2 + .../static/description/index.html | 410 ++++++++++++++++++ .../views/customer_info_views.xml | 53 +++ .../views/product_product_views.xml | 20 + .../odoo/addons/custom_module_management | 1 + setup/custom_module_management/setup.py | 6 + 13 files changed, 598 insertions(+) create mode 100644 custom_module_management/README.rst create mode 100644 custom_module_management/__init__.py create mode 100644 custom_module_management/__manifest__.py create mode 100644 custom_module_management/models/__init__.py create mode 100644 custom_module_management/models/customer_info.py create mode 100644 custom_module_management/models/product_product.py create mode 100644 custom_module_management/readme/DESCRIPTION.md create mode 100644 custom_module_management/security/ir.model.access.csv create mode 100644 custom_module_management/static/description/index.html create mode 100644 custom_module_management/views/customer_info_views.xml create mode 100644 custom_module_management/views/product_product_views.xml create mode 120000 setup/custom_module_management/odoo/addons/custom_module_management create mode 100644 setup/custom_module_management/setup.py diff --git a/custom_module_management/README.rst b/custom_module_management/README.rst new file mode 100644 index 0000000..cdf4a2d --- /dev/null +++ b/custom_module_management/README.rst @@ -0,0 +1,56 @@ +======================== +Custom Module Management +======================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:2dd97579db2cf8083b4147a4dd4be4c8f36337e71c7ab2c39c646bcc71f82286 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-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/custom_module_management + :alt: qrtl/qrtl-custom + +|badge1| |badge2| |badge3| + +This module is designed to add customer information to the Odoo module +product. + +**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 Limited + +Maintainers +----------- + +This module is part of the `qrtl/qrtl-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/custom_module_management/__init__.py b/custom_module_management/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/custom_module_management/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/custom_module_management/__manifest__.py b/custom_module_management/__manifest__.py new file mode 100644 index 0000000..362c072 --- /dev/null +++ b/custom_module_management/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2024 Quartile Limited +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). +{ + "name": "Custom Module Management", + "version": "16.0.1.0.0", + "category": "Subscription", + "author": "Quartile Limited", + "website": "https://www.quartile.co", + "license": "LGPL-3", + "depends": ["sale", "product_odoo_module"], + "data": [ + "security/ir.model.access.csv", + "views/product_product_views.xml", + "views/customer_info_views.xml", + ], +} diff --git a/custom_module_management/models/__init__.py b/custom_module_management/models/__init__.py new file mode 100644 index 0000000..d21d77c --- /dev/null +++ b/custom_module_management/models/__init__.py @@ -0,0 +1,2 @@ +from . import product_product +from . import customer_info diff --git a/custom_module_management/models/customer_info.py b/custom_module_management/models/customer_info.py new file mode 100644 index 0000000..e03bcdc --- /dev/null +++ b/custom_module_management/models/customer_info.py @@ -0,0 +1,19 @@ +# Copyright 2024 Quartile Limited +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import fields, models + + +class CustomerInfo(models.Model): + _name = "custom.module.customerinfo" + + partner_id = fields.Many2one("res.partner", required=True) + product_id = fields.Many2one( + "product.product", + ondelete="cascade", + required=True, + domain=[("is_odoo_module", "=", True)], + ) + repo = fields.Char(string="Repository") + amount = fields.Float(related="product_id.amount", store=True) + amount_incl_mig = fields.Float(related="product_id.amount_incl_mig", store=True) diff --git a/custom_module_management/models/product_product.py b/custom_module_management/models/product_product.py new file mode 100644 index 0000000..1ce792f --- /dev/null +++ b/custom_module_management/models/product_product.py @@ -0,0 +1,10 @@ +# Copyright 2024 Quartile Limited +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). + +from odoo import fields, models + + +class ProductProduct(models.Model): + _inherit = "product.product" + + customer_infos = fields.One2many("custom.module.customerinfo", "product_id") diff --git a/custom_module_management/readme/DESCRIPTION.md b/custom_module_management/readme/DESCRIPTION.md new file mode 100644 index 0000000..f319660 --- /dev/null +++ b/custom_module_management/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module is designed to add customer information to the Odoo module +product. diff --git a/custom_module_management/security/ir.model.access.csv b/custom_module_management/security/ir.model.access.csv new file mode 100644 index 0000000..72bcf3d --- /dev/null +++ b/custom_module_management/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_custom_module_customerinfo,custom_module_customerinfo,model_custom_module_customerinfo,base.group_user,1,1,1,1 diff --git a/custom_module_management/static/description/index.html b/custom_module_management/static/description/index.html new file mode 100644 index 0000000..18764e0 --- /dev/null +++ b/custom_module_management/static/description/index.html @@ -0,0 +1,410 @@ + + + + + + +Custom Module Management + + + +
+

Custom Module Management

+ + +

Beta License: LGPL-3 qrtl/qrtl-custom

+

This module is designed to add customer information to the Odoo module +product.

+

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 Limited
  • +
+
+
+

Maintainers

+

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

+

You are welcome to contribute.

+
+
+
+ + diff --git a/custom_module_management/views/customer_info_views.xml b/custom_module_management/views/customer_info_views.xml new file mode 100644 index 0000000..11f683b --- /dev/null +++ b/custom_module_management/views/customer_info_views.xml @@ -0,0 +1,53 @@ + + + customer.info.search + custom.module.customerinfo + + + + + + + + + + + + + customer.info.tree + custom.module.customerinfo + + + + + + + + + + + + Custom Module Customer Info + custom.module.customerinfo + tree + + {'search_default_partner': 1, 'search_default_repo': 1} + + + diff --git a/custom_module_management/views/product_product_views.xml b/custom_module_management/views/product_product_views.xml new file mode 100644 index 0000000..e1d41b2 --- /dev/null +++ b/custom_module_management/views/product_product_views.xml @@ -0,0 +1,20 @@ + + + product.product.inherit + product.product + + + + + + + + + + + + + diff --git a/setup/custom_module_management/odoo/addons/custom_module_management b/setup/custom_module_management/odoo/addons/custom_module_management new file mode 120000 index 0000000..0b207e1 --- /dev/null +++ b/setup/custom_module_management/odoo/addons/custom_module_management @@ -0,0 +1 @@ +../../../../custom_module_management \ No newline at end of file diff --git a/setup/custom_module_management/setup.py b/setup/custom_module_management/setup.py new file mode 100644 index 0000000..28c57bb --- /dev/null +++ b/setup/custom_module_management/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)