From 60cf21b44348191492282bbef209b63d1df0ac7e Mon Sep 17 00:00:00 2001 From: "Aung Ko Ko Lin (Quartile)" <45355704+AungKoKoLin1997@users.noreply.github.com> Date: Wed, 15 May 2024 09:45:13 +0700 Subject: [PATCH] [4540][ADD] mrp_stock_lot_analytic (#80) --- mrp_stock_lot_analytic/README.rst | 56 +++ mrp_stock_lot_analytic/__init__.py | 1 + mrp_stock_lot_analytic/__manifest__.py | 12 + mrp_stock_lot_analytic/models/__init__.py | 1 + .../models/mrp_production.py | 14 + mrp_stock_lot_analytic/readme/DESCRIPTION.md | 2 + .../static/description/index.html | 410 ++++++++++++++++++ .../odoo/addons/mrp_stock_lot_analytic | 1 + setup/mrp_stock_lot_analytic/setup.py | 6 + 9 files changed, 503 insertions(+) create mode 100644 mrp_stock_lot_analytic/README.rst create mode 100644 mrp_stock_lot_analytic/__init__.py create mode 100644 mrp_stock_lot_analytic/__manifest__.py create mode 100644 mrp_stock_lot_analytic/models/__init__.py create mode 100644 mrp_stock_lot_analytic/models/mrp_production.py create mode 100644 mrp_stock_lot_analytic/readme/DESCRIPTION.md create mode 100644 mrp_stock_lot_analytic/static/description/index.html create mode 120000 setup/mrp_stock_lot_analytic/odoo/addons/mrp_stock_lot_analytic create mode 100644 setup/mrp_stock_lot_analytic/setup.py diff --git a/mrp_stock_lot_analytic/README.rst b/mrp_stock_lot_analytic/README.rst new file mode 100644 index 00000000..b9e7a3a5 --- /dev/null +++ b/mrp_stock_lot_analytic/README.rst @@ -0,0 +1,56 @@ +====================== +MRP Stock Lot Analytic +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:2f0186e37d358eb2afa3a9220b33d6887dde2a936faa1b52b74a2d9b9352d757 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Faxls--custom-lightgray.png?logo=github + :target: https://github.com/qrtl/axls-custom/tree/16.0/mrp_stock_lot_analytic + :alt: qrtl/axls-custom + +|badge1| |badge2| |badge3| + +This module propagates the analytic distribution of the manufacturing +order (MO) to the generated lot of the produced 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/axls-custom `_ project on GitHub. + +You are welcome to contribute. diff --git a/mrp_stock_lot_analytic/__init__.py b/mrp_stock_lot_analytic/__init__.py new file mode 100644 index 00000000..0650744f --- /dev/null +++ b/mrp_stock_lot_analytic/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/mrp_stock_lot_analytic/__manifest__.py b/mrp_stock_lot_analytic/__manifest__.py new file mode 100644 index 00000000..bb009880 --- /dev/null +++ b/mrp_stock_lot_analytic/__manifest__.py @@ -0,0 +1,12 @@ +# Copyright 2024 Quartile Limited +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "MRP Stock Lot Analytic", + "version": "16.0.1.0.0", + "author": "Quartile Limited", + "website": "https://www.quartile.co", + "category": "Analytic", + "license": "AGPL-3", + "depends": ["stock_lot_analytic", "mrp_stock_analytic"], + "installable": True, +} diff --git a/mrp_stock_lot_analytic/models/__init__.py b/mrp_stock_lot_analytic/models/__init__.py new file mode 100644 index 00000000..a9e5f13e --- /dev/null +++ b/mrp_stock_lot_analytic/models/__init__.py @@ -0,0 +1 @@ +from . import mrp_production diff --git a/mrp_stock_lot_analytic/models/mrp_production.py b/mrp_stock_lot_analytic/models/mrp_production.py new file mode 100644 index 00000000..3f549480 --- /dev/null +++ b/mrp_stock_lot_analytic/models/mrp_production.py @@ -0,0 +1,14 @@ +# Copyright 2024 Quartile Limited +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class MrpProduction(models.Model): + _inherit = "mrp.production" + + def _prepare_stock_lot_values(self): + vals = super()._prepare_stock_lot_values() + if self.analytic_distribution: + vals["analytic_distribution"] = self.analytic_distribution + return vals diff --git a/mrp_stock_lot_analytic/readme/DESCRIPTION.md b/mrp_stock_lot_analytic/readme/DESCRIPTION.md new file mode 100644 index 00000000..f36b9865 --- /dev/null +++ b/mrp_stock_lot_analytic/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +This module propagates the analytic distribution of the manufacturing +order (MO) to the generated lot of the produced product. diff --git a/mrp_stock_lot_analytic/static/description/index.html b/mrp_stock_lot_analytic/static/description/index.html new file mode 100644 index 00000000..3316209d --- /dev/null +++ b/mrp_stock_lot_analytic/static/description/index.html @@ -0,0 +1,410 @@ + + + + + + +MRP Stock Lot Analytic + + + +
+

MRP Stock Lot Analytic

+ + +

Beta License: AGPL-3 qrtl/axls-custom

+

This module propagates the analytic distribution of the manufacturing +order (MO) to the generated lot of the produced 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/axls-custom project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/setup/mrp_stock_lot_analytic/odoo/addons/mrp_stock_lot_analytic b/setup/mrp_stock_lot_analytic/odoo/addons/mrp_stock_lot_analytic new file mode 120000 index 00000000..1813f0c9 --- /dev/null +++ b/setup/mrp_stock_lot_analytic/odoo/addons/mrp_stock_lot_analytic @@ -0,0 +1 @@ +../../../../mrp_stock_lot_analytic \ No newline at end of file diff --git a/setup/mrp_stock_lot_analytic/setup.py b/setup/mrp_stock_lot_analytic/setup.py new file mode 100644 index 00000000..28c57bb6 --- /dev/null +++ b/setup/mrp_stock_lot_analytic/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)