diff --git a/rma_purchase_operating_unit/README.rst b/rma_purchase_operating_unit/README.rst new file mode 100644 index 000000000..05df2cc7a --- /dev/null +++ b/rma_purchase_operating_unit/README.rst @@ -0,0 +1,28 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-blue.png + :target: https://www.gnu.org/licenses/lgpl + :alt: License: LGPL-3 + +================================= +RMA Purchase with Operating Units +================================= + +This module introduces the following features: + +* Adds the operating unit to the quotation. + +Usage +===== + +* No changes. + + +Contributors +------------ + +* Aaron Henriquez + + +Maintainer +---------- + +This module is maintained by ForgeFlow. diff --git a/rma_purchase_operating_unit/__init__.py b/rma_purchase_operating_unit/__init__.py new file mode 100644 index 000000000..369983612 --- /dev/null +++ b/rma_purchase_operating_unit/__init__.py @@ -0,0 +1,3 @@ +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from . import wizards diff --git a/rma_purchase_operating_unit/__manifest__.py b/rma_purchase_operating_unit/__manifest__.py new file mode 100644 index 000000000..964c18500 --- /dev/null +++ b/rma_purchase_operating_unit/__manifest__.py @@ -0,0 +1,14 @@ +# Copyright 2023 ForgeFlow S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +{ + "name": "RMA Purchase with Operating Units", + "version": "15.0.1.0.0", + "author": "ForgeFlow," "Odoo Community Association (OCA)", + "license": "AGPL-3", + "website": "https://github.com/ForgeFlow/stock-rma", + "category": "RMA", + "depends": ["rma_operating_unit", "rma_purchase", "purchase_operating_unit"], + "data": [], + "installable": True, +} diff --git a/rma_purchase_operating_unit/wizards/__init__.py b/rma_purchase_operating_unit/wizards/__init__.py new file mode 100644 index 000000000..be04699d9 --- /dev/null +++ b/rma_purchase_operating_unit/wizards/__init__.py @@ -0,0 +1,3 @@ +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) + +from . import rma_line_make_purchase_order diff --git a/rma_purchase_operating_unit/wizards/rma_line_make_purchase_order.py b/rma_purchase_operating_unit/wizards/rma_line_make_purchase_order.py new file mode 100644 index 000000000..c8e4cc2a8 --- /dev/null +++ b/rma_purchase_operating_unit/wizards/rma_line_make_purchase_order.py @@ -0,0 +1,14 @@ +# Copyright 2023 ForgeFlow S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) + +from odoo import api, models + + +class RmaLineMakePurchaseOrder(models.TransientModel): + _inherit = "rma.order.line.make.purchase.order" + + @api.model + def _prepare_purchase_order(self, item): + res = super(RmaLineMakePurchaseOrder, self)._prepare_purchase_order(item) + res.update(operating_unit_id=item.line_id.operating_unit_id.id) + return res diff --git a/setup/rma_purchase_operating_unit/odoo/addons/rma_purchase_operating_unit b/setup/rma_purchase_operating_unit/odoo/addons/rma_purchase_operating_unit new file mode 120000 index 000000000..15e0f7d59 --- /dev/null +++ b/setup/rma_purchase_operating_unit/odoo/addons/rma_purchase_operating_unit @@ -0,0 +1 @@ +../../../../rma_purchase_operating_unit \ No newline at end of file diff --git a/setup/rma_purchase_operating_unit/setup.py b/setup/rma_purchase_operating_unit/setup.py new file mode 100644 index 000000000..28c57bb64 --- /dev/null +++ b/setup/rma_purchase_operating_unit/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)