Skip to content

Commit

Permalink
[ADD] mrp_mto_analytic, purchase_mto_analytic
Browse files Browse the repository at this point in the history
  • Loading branch information
AungKoKoLin1997 committed Feb 23, 2024
1 parent f15eb0d commit 67d0fb4
Show file tree
Hide file tree
Showing 22 changed files with 1,243 additions and 0 deletions.
71 changes: 71 additions & 0 deletions mrp_mto_analytic/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
================
Mrp MTO Analytic
================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0b28305cead6c5290eec26a0be8867a26bb9a14ccc4a9981fafa5253e9dde027
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-OCA%2Fmanufacture-lightgray.png?logo=github
:target: https://github.com/OCA/manufacture/tree/16.0/mrp_mto_analytic
:alt: OCA/manufacture
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/manufacture-16-0/manufacture-16-0-mrp_mto_analytic
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/manufacture&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module transfers the analyic_distribution from the source MO to a newly created MO that is generated based on the stock rule.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/manufacture/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 <https://github.com/OCA/manufacture/issues/new?body=module:%20mrp_mto_analytic%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Quartile Limited

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/manufacture <https://github.com/OCA/manufacture/tree/16.0/mrp_mto_analytic>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions mrp_mto_analytic/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
12 changes: 12 additions & 0 deletions mrp_mto_analytic/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2024 Quartile Limited
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Mrp MTO Analytic",
"version": "16.0.1.0.0",
"author": "Quartile Limited, Odoo Community Association (OCA)",
"category": "Manufacturing",
"website": "https://github.com/OCA/manufacture",
"depends": ["mrp_stock_analytic"],
"license": "AGPL-3",
"installable": True,
}
1 change: 1 addition & 0 deletions mrp_mto_analytic/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_rule
38 changes: 38 additions & 0 deletions mrp_mto_analytic/models/stock_rule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright 2024 Quartile Limited
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models


class StockRule(models.Model):
_inherit = "stock.rule"

def _prepare_mo_vals(
self,
product_id,
product_qty,
product_uom,
location_dest_id,
name,
origin,
company_id,
values,
bom,
):
vals = super(StockRule, self)._prepare_mo_vals(
product_id,
product_qty,
product_uom,
location_dest_id,
name,
origin,
company_id,
values,
bom,
)
move_dest_ids = values.get("move_dest_ids")
if move_dest_ids:
vals["analytic_distribution"] = move_dest_ids[
0
].raw_material_production_id.analytic_distribution
return vals
1 change: 1 addition & 0 deletions mrp_mto_analytic/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module transfers the analyic_distribution from the source MO to a newly created MO that is generated based on the stock rule.
Loading

0 comments on commit 67d0fb4

Please sign in to comment.