diff --git a/rma_purchase/models/purchase_order_line.py b/rma_purchase/models/purchase_order_line.py index 8f429635..bae355ce 100644 --- a/rma_purchase/models/purchase_order_line.py +++ b/rma_purchase/models/purchase_order_line.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 odoo import api, fields, models +from odoo import api, models class PurchaseOrderLine(models.Model): diff --git a/rma_purchase/tests/test_rma.py b/rma_purchase/tests/test_rma.py index 4a435c73..5ae50fb1 100644 --- a/rma_purchase/tests/test_rma.py +++ b/rma_purchase/tests/test_rma.py @@ -375,6 +375,8 @@ class TestRma(common.TransactionCase): proc.group_id]) domain = [('group_id', 'in', list(group_ids))] pickings = self.stockpicking.search(domain) + procurements[0].purchase_id = self._create_purchase_order().id + wizard._get_action(pickings, procurements) self.assertEquals(len(pickings), 2, "Incorrect number of pickings created") picking_out = pickings[1] diff --git a/rma_purchase/wizards/rma_add_purchase.py b/rma_purchase/wizards/rma_add_purchase.py index 81fe340b..1679442a 100644 --- a/rma_purchase/wizards/rma_add_purchase.py +++ b/rma_purchase/wizards/rma_add_purchase.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 odoo import api, fields, models +from odoo import _, api, fields, models from odoo.exceptions import ValidationError @@ -50,19 +50,19 @@ class RmaAddPurchase(models.TransientModel): operation = self.env['rma.operation'].search( [('type', '=', self.rma_id.type)], limit=1) if not operation: - raise ValidationError("Please define an operation first") + raise ValidationError(_("Please define an operation first")) if not operation.in_route_id or not operation.out_route_id: route = self.env['stock.location.route'].search( [('rma_selectable', '=', True)], limit=1) if not route: - raise ValidationError("Please define a rma route.") + raise ValidationError(_("Please define a rma route.")) if not operation.in_warehouse_id or not operation.out_warehouse_id: warehouse = self.env['stock.warehouse'].search( [('company_id', '=', self.rma_id.company_id.id), ('lot_rma_id', '!=', False)], limit=1) if not warehouse: - raise ValidationError("Please define a warehouse with a " - "default rma location.") + raise ValidationError(_("Please define a warehouse with a " + "default rma location.")) data = { 'partner_id': self.partner_id.id, 'purchase_order_line_id': line.id,