From 1c76e23087b3dfa529058e477793be227c439fcf Mon Sep 17 00:00:00 2001 From: Aaron Henriquez Date: Thu, 9 May 2019 14:21:20 +0200 Subject: [PATCH] [ADD]rma_sale_operating_unit [FIX]rma_sale_analytic --- rma_sale_operating_unit/README.rst | 28 +++++++++++++++++++ rma_sale_operating_unit/__init__.py | 4 +++ rma_sale_operating_unit/__manifest__.py | 17 +++++++++++ rma_sale_operating_unit/wizards/__init__.py | 5 ++++ .../wizards/rma_order_line_make_sale_order.py | 19 +++++++++++++ 5 files changed, 73 insertions(+) create mode 100644 rma_sale_operating_unit/README.rst create mode 100644 rma_sale_operating_unit/__init__.py create mode 100644 rma_sale_operating_unit/__manifest__.py create mode 100644 rma_sale_operating_unit/wizards/__init__.py create mode 100644 rma_sale_operating_unit/wizards/rma_order_line_make_sale_order.py diff --git a/rma_sale_operating_unit/README.rst b/rma_sale_operating_unit/README.rst new file mode 100644 index 00000000..5324c1e4 --- /dev/null +++ b/rma_sale_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 Sale 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_sale_operating_unit/__init__.py b/rma_sale_operating_unit/__init__.py new file mode 100644 index 00000000..5f13e3ea --- /dev/null +++ b/rma_sale_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_sale_operating_unit/__manifest__.py b/rma_sale_operating_unit/__manifest__.py new file mode 100644 index 00000000..7a7a39e7 --- /dev/null +++ b/rma_sale_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 sale", + "version": "10.0.1.0.0", + "author": "Eficent," + "Odoo Community Association (OCA)", + "license": "LGPL-3", + "website": "http://www.eficent.com", + "category": "Analytic", + "depends": ["rma_sale_analytic", "rma_operating_unit"], + "data": [ + ], + 'installable': True, +} diff --git a/rma_sale_operating_unit/wizards/__init__.py b/rma_sale_operating_unit/wizards/__init__.py new file mode 100644 index 00000000..7d47d32f --- /dev/null +++ b/rma_sale_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_order_line_make_sale_order diff --git a/rma_sale_operating_unit/wizards/rma_order_line_make_sale_order.py b/rma_sale_operating_unit/wizards/rma_order_line_make_sale_order.py new file mode 100644 index 00000000..a4400ece --- /dev/null +++ b/rma_sale_operating_unit/wizards/rma_order_line_make_sale_order.py @@ -0,0 +1,19 @@ +# -*- 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 models, api + + +class RmaLineMakeSaleOrder(models.TransientModel): + _inherit = "rma.order.line.make.sale.order" + + @api.model + def _prepare_sale_order(self, line): + sale_line = super( + RmaLineMakeSaleOrder, self)._prepare_sale_order(line) + sale_line.update(operating_unit_id=line.operating_unit_id.id) + team = self.env['crm.team'].search( + [('operating_unit_id', '=', line.operating_unit_id.id)], limit=1) + sale_line.update(team_id=team.id) + return sale_line