From e953962773f046e97056bde92f0772f51b713686 Mon Sep 17 00:00:00 2001 From: aheficent Date: Tue, 2 Jan 2018 13:05:09 +0100 Subject: [PATCH] [FIX]various fixes --- rma_account/wizards/rma_add_invoice.py | 10 +++++----- rma_account/wizards/rma_refund.py | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/rma_account/wizards/rma_add_invoice.py b/rma_account/wizards/rma_add_invoice.py index 44f352be..db087c61 100644 --- a/rma_account/wizards/rma_add_invoice.py +++ b/rma_account/wizards/rma_add_invoice.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 @@ -46,20 +46,20 @@ class RmaAddInvoice(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 an rma route") + raise ValidationError(_("Please define an 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, 'invoice_line_id': line.id, diff --git a/rma_account/wizards/rma_refund.py b/rma_account/wizards/rma_refund.py index 2e8df72a..1efb7b6e 100644 --- a/rma_account/wizards/rma_refund.py +++ b/rma_account/wizards/rma_refund.py @@ -165,7 +165,6 @@ class RmaRefund(models.TransientModel): return values @api.constrains('item_ids') - @api.one def check_unique_invoice_address_id(self): addresses = self.item_ids.mapped('invoice_address_id') if len(addresses) > 1: