Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
df24bcb
[ADD] mrp_subcontracting: Copied from 13.0
May 10, 2020
de9c881
[MIG] mrp_subcontracting: Adapt to OCA guidelines + initial work
Tardo May 10, 2020
728a386
[MIG] mrp_subcontracting: Adapt to v12 + make tests to pass
pedrobaeza May 10, 2020
5798dbb
[UPD] Update mrp_subcontracting.pot
oca-travis May 29, 2020
208d66f
[UPD] README.rst
OCA-git-bot May 29, 2020
3c80717
[ADD] icon.png
OCA-git-bot May 29, 2020
36c5644
Translated using Weblate (Portuguese (Brazil))
fcolus Jun 22, 2020
fdf1188
Translated using Weblate (Portuguese (Brazil))
fcolus Jul 28, 2020
1ca0f6e
Translated using Weblate (Japanese)
yostashiro Aug 4, 2020
696f886
[FIX] mrp_subcontracting: Avoid singleton error fetching production o…
pedrobaeza Aug 4, 2020
ec96051
Update translation files
oca-transbot Aug 4, 2020
5c3db46
Update translation files
oca-transbot Aug 16, 2020
017eea3
[FIX] Overwrite active_id context in create()
Sep 16, 2020
91e9868
[IMP] Simplify logic
Sep 17, 2020
4aa68d3
[FIX] Unit-test
Sep 17, 2020
25da184
mrp_subcontracting 12.0.1.0.2
OCA-git-bot Sep 18, 2020
466cd8a
[FIX] Skip processed MO when validating receipt
Nov 26, 2020
8ad09b1
mrp_subcontracting 12.0.1.0.3
OCA-git-bot Nov 26, 2020
4052157
[FIX] mrp_subcontracting: Make test resilient to purchase co-existence
pedrobaeza Dec 28, 2020
d361dcd
[FIX] mrp_subcontracting: Make test resilient to purchase co-existenc…
pedrobaeza Dec 28, 2020
c5a94d4
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Mar 15, 2021
dd66633
Translated using Weblate (Italian)
Apr 7, 2021
e2dca68
[FIX] mrp_subcontracting: Don't perform subcontracting on 0 quantity
pedrobaeza May 20, 2021
c4ab8a5
Apply dotfiles
hbrunn Oct 21, 2022
0dadc2c
[UPD] Update mrp_subcontracting.pot
Oct 25, 2022
a3cede6
mrp_subcontracting 12.0.1.0.6
OCA-git-bot Oct 25, 2022
bf1db5e
Update translation files
weblate Oct 25, 2022
a2dbe7e
Translated using Weblate (Italian)
francesco-ooops Dec 30, 2022
ccb8184
Translated using Weblate (Italian)
mymage Jan 9, 2023
ebbb71b
Translated using Weblate (Italian)
francesco-ooops Jan 18, 2023
daa8027
Translated using Weblate (Slovenian)
sysadminmatmoz Mar 30, 2023
9abdd4c
Translated using Weblate (Italian)
mymage Apr 12, 2023
2412352
Translated using Weblate (Italian)
francesco-ooops May 15, 2023
24ff3e9
Translated using Weblate (Italian)
francesco-ooops Jul 12, 2023
7f6ecfe
[UPD] README.rst
OCA-git-bot Sep 3, 2023
a6f134a
Translated using Weblate (Italian)
mymage Oct 23, 2024
cc10862
Translated using Weblate (Slovenian)
sysadminmatmoz Nov 24, 2025
b3d92e8
[MIG] mrp_subcontracting: migration to 11.0
OscarIndias Feb 10, 2026
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
93 changes: 93 additions & 0 deletions mrp_subcontracting/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
=======================
Subcontract Productions
=======================

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

.. |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-OCA%2Fmanufacture-lightgray.png?logo=github
:target: https://github.com/OCA/manufacture/tree/12.0/mrp_subcontracting
:alt: OCA/manufacture
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/manufacture-12-0/manufacture-12-0-mrp_subcontracting
: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=12.0
:alt: Try me on Runboat

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

This module is a backport of the one found in official Odoo 13.0, adapted
for this version.

For the configuration and usage, see Odoo documentation:

https://www.odoo.com/documentation/user/13.0/manufacturing/management/subcontracting.html

**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_subcontracting%0Aversion:%2012.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
~~~~~~~

* Odoo S.A.
* Tecnativa

Contributors
~~~~~~~~~~~~

* Odoo S.A.
* `Tecnativa <https://www.tecnativa.com>`__:

* Alexandre Díaz
* Pedro M. Baeza

Other credits
~~~~~~~~~~~~~

This module is a backport from Odoo SA and as such, it is not included in the
OCA CLA. That means we do not have a copy of the copyright on it like all other
OCA modules.

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/12.0/mrp_subcontracting>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions mrp_subcontracting/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).

from . import models
from . import wizard
from .hooks import post_init_hook, uninstall_hook
28 changes: 28 additions & 0 deletions mrp_subcontracting/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
# Copyright 2019 Odoo
# Copyright 2020 Tecnativa - Alexandre Díaz
# Copyright 2020 Tecnativa - Pedro M. Baeza

{
'name': "Subcontract Productions",
'version': '11.0.1.0.0',
"author": "Odoo S.A., Tecnativa, Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/manufacture',
'category': 'Manufacturing Orders & BOMs',
'depends': ['mrp'],
'data': [
'data/mrp_subcontracting_data.xml',
'views/mrp_bom_views.xml',
'views/res_partner_views.xml',
'views/stock_warehouse_views.xml',
'views/stock_move_views.xml',
'views/stock_picking_views.xml',
'views/supplier_info_views.xml',
],
'demo': [
'data/mrp_subcontracting_demo.xml',
],
"post_init_hook": "post_init_hook",
"uninstall_hook": "uninstall_hook",
"license": "LGPL-3",
}
11 changes: 11 additions & 0 deletions mrp_subcontracting/data/mrp_subcontracting_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="route_resupply_subcontractor_mto" model='stock.location.route'>
<field name="name">Resupply Subcontractor on Order</field>
<field name="company_id"></field>
<field name="sequence">5</field>
</record>
<function model="res.company" name="create_missing_subcontracting_location" />
</data>
</odoo>
32 changes: 32 additions & 0 deletions mrp_subcontracting/data/mrp_subcontracting_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="mrp_bom_subcontract" model="mrp.bom">
<field name="product_tmpl_id" ref="product.product_delivery_02"/>
<field name="product_uom_id" ref="product.product_uom_unit"/>
<field name="type">subcontract</field>
<field name="subcontractor_ids" eval="[(4, ref('base.res_partner_12'))]"/>
</record>

<record id="mrp_bom_line_subcontract" model="mrp.bom.line">
<field name="product_id" ref="mrp.product_product_computer_desk_screw"/>
<field name="product_qty">1</field>
<field name="product_uom_id" ref="product.product_uom_unit"/>
<field name="bom_id" ref="mrp_bom_subcontract"/>
</record>

<record id="product_supplierinfo_subcontracting" model="product.supplierinfo">
<field name="product_tmpl_id" ref="product.product_delivery_02_product_template"/>
<field name="name" ref="base.res_partner_12"/>
<field name="sequence">1</field>
<field name="delay">1</field>
<field name="min_qty">1</field>
<field name="price">27</field>
</record>

<record id="product.product_delivery_02" model="product.product">
<field name="route_ids" eval="[(4,ref('stock.route_warehouse0_mto'))]"></field>
</record>

</data>
</odoo>
25 changes: 25 additions & 0 deletions mrp_subcontracting/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
# Copyright 2019 Odoo
# Copyright 2020 Tecnativa - Alexandre Díaz
# Copyright 2020 Tecnativa - Pedro M. Baeza

from odoo import SUPERUSER_ID, api


def post_init_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
for warehouse in env["stock.warehouse"].search([]):
warehouse.write({"subcontracting_to_resupply": True})


def uninstall_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
warehouses = env["stock.warehouse"].search([])
subcontracting_routes = warehouses.mapped("subcontracting_route_id")
warehouses.write({"subcontracting_route_id": False})
# Fail unlink means that the route is used somewhere (e.g. route_id on
# procurement.rule). In this case, we don't try to do anything.
try:
subcontracting_routes.unlink()
except Exception:
pass
Loading