Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ jobs:
include:
- container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest
# sales_team_security: incompatible with auditlog (for some reason)
include: "stock_owner_restriction,mrp_stock_owner_restriction,purchase_order_owner,mrp_subcontracting_owner,sales_team_security"
include: "stock_owner_restriction,mrp_stock_owner_restriction,mrp_mto_owner,purchase_order_owner,mrp_subcontracting_owner,sales_team_security"
name: test with OCB
makepot: "false"
- container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest
exclude: "stock_owner_restriction,mrp_stock_owner_restriction,purchase_order_owner,mrp_subcontracting_owner,sales_team_security"
exclude: "stock_owner_restriction,mrp_stock_owner_restriction,mrp_mto_owner,purchase_order_owner,mrp_subcontracting_owner,sales_team_security"
name: test with OCB
makepot: "false"
services:
Expand Down
71 changes: 71 additions & 0 deletions mrp_mto_owner/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
=============
Mrp MTO Owner
=============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:036c5cefeec5cb41b9c81c023c7253fc71755e3852d823e3f6ab518eae246fe4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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_owner
: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_owner
: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 owner_id 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_owner%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_owner>`_ 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_owner/__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_owner/__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 Owner",
"version": "16.0.1.0.0",
"author": "Quartile Limited, Odoo Community Association (OCA)",
"category": "Manufacturing",
"website": "https://github.com/OCA/manufacture",
"depends": ["mrp_stock_owner_restriction"],
"license": "AGPL-3",
"installable": True,
}
1 change: 1 addition & 0 deletions mrp_mto_owner/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import stock_rule
36 changes: 36 additions & 0 deletions mrp_mto_owner/models/stock_rule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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["owner_id"] = move_dest_ids[0].raw_material_production_id.owner_id.id
return vals
1 change: 1 addition & 0 deletions mrp_mto_owner/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module transfers the owner_id from the source MO to a newly created MO that is generated based on the stock rule.
Loading