Skip to content
Closed
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
94 changes: 94 additions & 0 deletions mrp_kit_drop_ship/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
=================
MRP Kit Drop Ship
=================

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

.. |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/14.0/mrp_kit_drop_ship
:alt: OCA/manufacture
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/manufacture-14-0/manufacture-14-0-mrp_kit_drop_ship
: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=14.0
:alt: Try me on Runboat

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

Without this module, if a product is being procured and has an existing Bill of
Materials of type Kit, the components of the product are going to be
procured, instead of the main product.

This module introduces the capability to ignore the existence of the kit
during procurement, when the procurement is associated with a dropship. That
is, when the product is going to be sourced from a third party vendor to the
customer.

Upon confirmation of the purchase order the system will still explode the
product into components within the drop ship picking.

**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_kit_drop_ship%0Aversion:%2014.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
~~~~~~~

* ForgeFlow

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

* `ForgeFlow <https://www.forgeflow.com>`_:

* Jordi Ballester Alomar <jordi.ballester@forgeflow.com>


* `Therp BV <https://www.therp.nl>`_:

* Tom Blauwendraat <tblauwendraat@therp.nl>
* Kevin Kahumba <kkahumba@therp.nl>

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/14.0/mrp_kit_drop_ship>`_ 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_kit_drop_ship/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2016 Antiun Ingenieria S.L. - Javier Iniesta
# Copyright 2019 Rubén Bravo <rubenred18@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import models
14 changes: 14 additions & 0 deletions mrp_kit_drop_ship/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2021 Forgeflow, S.L.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)
{
"name": "MRP Kit Drop Ship",
"summary": "Kits behave as normal products when drop shipped",
"version": "14.0.1.0.0",
"category": "Manufacturing",
"website": "https://github.com/OCA/manufacture",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"license": "LGPL-3",
"application": False,
"installable": True,
"depends": ["mrp", "stock_dropshipping"],
}
2 changes: 2 additions & 0 deletions mrp_kit_drop_ship/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import procurement_group
from . import mrp_bom
27 changes: 27 additions & 0 deletions mrp_kit_drop_ship/models/mrp_bom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2021 Forgeflow, S.L.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)

from odoo import api, models


class MrpBom(models.Model):
_inherit = "mrp.bom"

@api.model
def _bom_find(
self,
product_tmpl=None,
product=None,
picking_type=None,
company_id=False,
bom_type=False,
):
if self.env.context.get("ignore_kit", False):
return False
return super(MrpBom, self)._bom_find(
product_tmpl=product_tmpl,
product=product,
picking_type=picking_type,
company_id=company_id,
bom_type=bom_type,
)
29 changes: 29 additions & 0 deletions mrp_kit_drop_ship/models/procurement_group.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2021 Forgeflow, S.L.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html)

from odoo import api, models


class ProcurementGroup(models.Model):
_inherit = "procurement.group"

@api.model
def run(self, procurements, raise_user_error=True):
other_procurements = []
ret = False
for procurement in procurements:
rule = self._get_rule(
procurement.product_id, procurement.location_id, procurement.values
)
if (
rule.location_id.usage == "customer"
and rule.location_src_id.usage == "supplier"
):
ret = super(ProcurementGroup, self.with_context(ignore_kit=True)).run(
[procurement], raise_user_error
)
continue
other_procurements.append(procurement)
if not other_procurements:
return ret
return super(ProcurementGroup, self).run(other_procurements, raise_user_error)
9 changes: 9 additions & 0 deletions mrp_kit_drop_ship/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* `ForgeFlow <https://www.forgeflow.com>`_:

* Jordi Ballester Alomar <jordi.ballester@forgeflow.com>


* `Therp BV <https://www.therp.nl>`_:

* Tom Blauwendraat <tblauwendraat@therp.nl>
* Kevin Kahumba <kkahumba@therp.nl>
11 changes: 11 additions & 0 deletions mrp_kit_drop_ship/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Without this module, if a product is being procured and has an existing Bill of
Materials of type Kit, the components of the product are going to be
procured, instead of the main product.

This module introduces the capability to ignore the existence of the kit
during procurement, when the procurement is associated with a dropship. That
is, when the product is going to be sourced from a third party vendor to the
customer.

Upon confirmation of the purchase order the system will still explode the
product into components within the drop ship picking.
Loading
Loading