From 31ebd47872da1ab9e644463de48a7753abe29994 Mon Sep 17 00:00:00 2001 From: aheficent Date: Tue, 19 Dec 2017 16:38:50 +0100 Subject: [PATCH] [MIG]rma v10 --- rma/{__openerp__.py => __manifest__.py} | 2 +- rma/models/procurement.py | 2 +- rma/models/product.py | 2 +- rma/models/product_category.py | 2 +- rma/models/res_partner.py | 2 +- rma/models/rma_operation.py | 2 +- rma/models/rma_order.py | 4 +-- rma/models/rma_order_line.py | 11 +++--- rma/models/stock.py | 2 +- rma/models/stock_warehouse.py | 2 +- rma/tests/test_rma.py | 2 +- rma/tests/test_rma_dropship.py | 2 +- rma/tests/test_supplier_rma.py | 2 +- rma/views/rma_order_line_view.xml | 36 +++++++++---------- rma/wizards/rma_add_stock_move.py | 4 +-- rma/wizards/rma_make_picking.py | 8 ++--- .../rma_order_line_make_supplier_rma.py | 6 ++-- .../rma_order_line_make_supplier_rma_view.xml | 4 +-- rma/wizards/stock_config_settings.py | 4 +-- rma/wizards/stock_config_settings.xml | 4 +-- 20 files changed, 50 insertions(+), 53 deletions(-) rename rma/{__openerp__.py => __manifest__.py} (97%) diff --git a/rma/__openerp__.py b/rma/__manifest__.py similarity index 97% rename from rma/__openerp__.py rename to rma/__manifest__.py index 574a2858..56dc20b2 100644 --- a/rma/__openerp__.py +++ b/rma/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'RMA (Return Merchandise Authorization)', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'license': 'LGPL-3', 'category': 'RMA', 'summary': 'Introduces the return merchandise authorization (RMA) process ' diff --git a/rma/models/procurement.py b/rma/models/procurement.py index eb4a46b7..bfca5855 100644 --- a/rma/models/procurement.py +++ b/rma/models/procurement.py @@ -2,7 +2,7 @@ # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from openerp import api, fields, models +from odoo import api, fields, models class ProcurementOrder(models.Model): diff --git a/rma/models/product.py b/rma/models/product.py index 5ee028ec..04557e21 100644 --- a/rma/models/product.py +++ b/rma/models/product.py @@ -2,7 +2,7 @@ # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from openerp import fields, models +from odoo import fields, models class ProductTemplate(models.Model): diff --git a/rma/models/product_category.py b/rma/models/product_category.py index 9674ad8d..927de271 100644 --- a/rma/models/product_category.py +++ b/rma/models/product_category.py @@ -2,7 +2,7 @@ # Copyright 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from openerp import fields, models +from odoo import fields, models class ProductCategory(models.Model): diff --git a/rma/models/res_partner.py b/rma/models/res_partner.py index 1ce4885f..32a5de7f 100644 --- a/rma/models/res_partner.py +++ b/rma/models/res_partner.py @@ -2,7 +2,7 @@ # Copyright 2017 Eficent Business and IT Consulting Services S.L. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from openerp import api, fields, models +from odoo import api, fields, models class ResPartner(models.Model): diff --git a/rma/models/rma_operation.py b/rma/models/rma_operation.py index eec8f38a..2c24165f 100644 --- a/rma/models/rma_operation.py +++ b/rma/models/rma_operation.py @@ -2,7 +2,7 @@ # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from openerp import api, fields, models +from odoo import api, fields, models class RmaOperation(models.Model): diff --git a/rma/models/rma_order.py b/rma/models/rma_order.py index 998a154c..f23fab1f 100644 --- a/rma/models/rma_order.py +++ b/rma/models/rma_order.py @@ -2,8 +2,8 @@ # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from openerp import api, fields, models, _ -from openerp.exceptions import UserError +from odoo import api, fields, models, _ +from odoo.exceptions import UserError from datetime import datetime diff --git a/rma/models/rma_order_line.py b/rma/models/rma_order_line.py index acfdf124..ba807d50 100644 --- a/rma/models/rma_order_line.py +++ b/rma/models/rma_order_line.py @@ -2,9 +2,9 @@ # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from openerp import api, fields, models, _ -from openerp.exceptions import ValidationError, UserError -from openerp.addons import decimal_precision as dp +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError, UserError +from odoo.addons import decimal_precision as dp import operator ops = {'=': operator.eq, '!=': operator.ne} @@ -74,9 +74,8 @@ class RmaOrderLine(models.Model): for move in rec.procurement_ids.mapped('move_ids').filtered( lambda m: m.state in states and op(m.location_id.usage, rec.type)): - qty += product_obj._compute_qty_obj( - move.product_uom, move.product_uom_qty, - rec.uom_id) + qty += product_obj._compute_quantity( + move.product_uom_qty, rec.uom_id) return qty @api.multi diff --git a/rma/models/stock.py b/rma/models/stock.py index c8fdaf88..1fad0b8f 100644 --- a/rma/models/stock.py +++ b/rma/models/stock.py @@ -2,7 +2,7 @@ # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from openerp import api, fields, models +from odoo import api, fields, models class StockPicking(models.Model): diff --git a/rma/models/stock_warehouse.py b/rma/models/stock_warehouse.py index 26ff4b08..52c26a61 100644 --- a/rma/models/stock_warehouse.py +++ b/rma/models/stock_warehouse.py @@ -2,7 +2,7 @@ # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from openerp import fields, models +from odoo import fields, models class StockWarehouse(models.Model): diff --git a/rma/tests/test_rma.py b/rma/tests/test_rma.py index 2e36b989..9bca7104 100644 --- a/rma/tests/test_rma.py +++ b/rma/tests/test_rma.py @@ -2,7 +2,7 @@ # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from openerp.tests import common +from odoo.tests import common class TestRma(common.TransactionCase): diff --git a/rma/tests/test_rma_dropship.py b/rma/tests/test_rma_dropship.py index a531734f..798d9a75 100644 --- a/rma/tests/test_rma_dropship.py +++ b/rma/tests/test_rma_dropship.py @@ -2,7 +2,7 @@ # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from openerp.addons.rma.tests import test_rma +from odoo.addons.rma.tests import test_rma class TestRmaDropship(test_rma.TestRma): diff --git a/rma/tests/test_supplier_rma.py b/rma/tests/test_supplier_rma.py index e67b55ba..8c83e039 100644 --- a/rma/tests/test_supplier_rma.py +++ b/rma/tests/test_supplier_rma.py @@ -2,7 +2,7 @@ # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from openerp.addons.rma.tests import test_rma +from odoo.addons.rma.tests import test_rma class TestSupplierRma(test_rma.TestRma): diff --git a/rma/views/rma_order_line_view.xml b/rma/views/rma_order_line_view.xml index c43b3dc9..6a184dc4 100644 --- a/rma/views/rma_order_line_view.xml +++ b/rma/views/rma_order_line_view.xml @@ -300,7 +300,7 @@ - + @@ -319,29 +319,27 @@ - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/rma/wizards/rma_add_stock_move.py b/rma/wizards/rma_add_stock_move.py index 4bbc4834..fd12a19f 100644 --- a/rma/wizards/rma_add_stock_move.py +++ b/rma/wizards/rma_add_stock_move.py @@ -2,8 +2,8 @@ # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from openerp import api, fields, models, _ -from openerp.exceptions import ValidationError +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError class RmaAddStockMove(models.TransientModel): diff --git a/rma/wizards/rma_make_picking.py b/rma/wizards/rma_make_picking.py index 02b97223..c716c9a2 100644 --- a/rma/wizards/rma_make_picking.py +++ b/rma/wizards/rma_make_picking.py @@ -3,10 +3,10 @@ # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) import time -from openerp import models, fields, api, _ -from openerp.exceptions import ValidationError -from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT as DT_FORMAT -import openerp.addons.decimal_precision as dp +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError +from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT as DT_FORMAT +import odoo.addons.decimal_precision as dp class RmaMakePicking(models.TransientModel): diff --git a/rma/wizards/rma_order_line_make_supplier_rma.py b/rma/wizards/rma_order_line_make_supplier_rma.py index 79723b01..91041b8f 100644 --- a/rma/wizards/rma_order_line_make_supplier_rma.py +++ b/rma/wizards/rma_order_line_make_supplier_rma.py @@ -2,9 +2,9 @@ # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -import openerp.addons.decimal_precision as dp -from openerp import _, api, fields, models -from openerp.exceptions import ValidationError +import odoo.addons.decimal_precision as dp +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError class RmaLineMakeSupplierRma(models.TransientModel): diff --git a/rma/wizards/rma_order_line_make_supplier_rma_view.xml b/rma/wizards/rma_order_line_make_supplier_rma_view.xml index 964c0e36..455eed25 100644 --- a/rma/wizards/rma_order_line_make_supplier_rma_view.xml +++ b/rma/wizards/rma_order_line_make_supplier_rma_view.xml @@ -1,7 +1,7 @@ - + @@ -85,5 +85,5 @@ - + diff --git a/rma/wizards/stock_config_settings.py b/rma/wizards/stock_config_settings.py index ab19c4c4..43058526 100644 --- a/rma/wizards/stock_config_settings.py +++ b/rma/wizards/stock_config_settings.py @@ -2,10 +2,10 @@ # © 2017 Eficent Business and IT Consulting Services S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) -from openerp import models, fields +from odoo import models, fields -class StockConfigSettings(models.Model): +class StockConfigSettings(models.TransientModel): _inherit = 'stock.config.settings' group_rma_delivery_address = fields.Selection([ diff --git a/rma/wizards/stock_config_settings.xml b/rma/wizards/stock_config_settings.xml index 2bcb851b..4df67cfa 100644 --- a/rma/wizards/stock_config_settings.xml +++ b/rma/wizards/stock_config_settings.xml @@ -1,5 +1,5 @@ - + stock.config.settings.rma @@ -14,4 +14,4 @@ - +