From a41f6390b2c4aa18384ece3d329d552dacd19579 Mon Sep 17 00:00:00 2001 From: Aaron Henriquez Date: Thu, 9 May 2019 14:21:57 +0200 Subject: [PATCH] [ADD]rma_purchase_operating_unit [FIX]rma_purchase_analytic --- rma_purchase_operating_unit/README.rst | 28 +++++++++++++++++++ rma_purchase_operating_unit/__init__.py | 4 +++ rma_purchase_operating_unit/__manifest__.py | 17 +++++++++++ .../wizards/__init__.py | 5 ++++ .../wizards/rma_line_make_purchase_order.py | 15 ++++++++++ 5 files changed, 69 insertions(+) create mode 100644 rma_purchase_operating_unit/README.rst create mode 100644 rma_purchase_operating_unit/__init__.py create mode 100644 rma_purchase_operating_unit/__manifest__.py create mode 100644 rma_purchase_operating_unit/wizards/__init__.py create mode 100644 rma_purchase_operating_unit/wizards/rma_line_make_purchase_order.py diff --git a/rma_purchase_operating_unit/README.rst b/rma_purchase_operating_unit/README.rst new file mode 100644 index 00000000..f6f45939 --- /dev/null +++ b/rma_purchase_operating_unit/README.rst @@ -0,0 +1,28 @@ +.. image:: https://img.shields.io/badge/license-LGPLv3-blue.svg + :target: https://www.gnu.org/licenses/lgpl.html + :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 Eficent. diff --git a/rma_purchase_operating_unit/__init__.py b/rma_purchase_operating_unit/__init__.py new file mode 100644 index 00000000..5f13e3ea --- /dev/null +++ b/rma_purchase_operating_unit/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# 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 00000000..ab2ed568 --- /dev/null +++ b/rma_purchase_operating_unit/__manifest__.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- +# © 2017 Eficent Business and IT Consulting Services S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +{ + "name": "Analytic Account in RMA purchase", + "version": "10.0.1.0.0", + "author": "Eficent," + "Odoo Community Association (OCA)", + "license": "LGPL-3", + "website": "http://www.eficent.com", + "category": "Analytic", + "depends": ["rma_operating_unit", "rma_purchase"], + "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 00000000..4ae587e0 --- /dev/null +++ b/rma_purchase_operating_unit/wizards/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# © 2018 Eficent Business and IT Consulting Services S.L. +# 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 00000000..9a26dc4c --- /dev/null +++ b/rma_purchase_operating_unit/wizards/rma_line_make_purchase_order.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# © 2018 Eficent Business and IT Consulting Services 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