diff --git a/rma_account/models/account_move.py b/rma_account/models/account_move.py index 5bc0e1fc..4afe1ac9 100644 --- a/rma_account/models/account_move.py +++ b/rma_account/models/account_move.py @@ -26,7 +26,7 @@ class AccountMove(models.Model): "product_uom_id": line.uom_id.id, "product_id": line.product_id.id, "account_id": invoice_line.with_context( - {"journal_id": self.journal_id.id, "type": "in_invoice"} + **{"journal_id": self.journal_id.id, "type": "in_invoice"} )._default_account(), "price_unit": line.company_id.currency_id.with_context( date=self.date diff --git a/rma_account/models/rma_operation.py b/rma_account/models/rma_operation.py index bf21ab55..9b924a06 100644 --- a/rma_account/models/rma_operation.py +++ b/rma_account/models/rma_operation.py @@ -14,7 +14,6 @@ class RmaOperation(models.Model): ("delivered", "Based on Delivered Quantities"), ("received", "Based on Received Quantities"), ], - string="Refund Policy", default="no", ) diff --git a/rma_account/models/rma_order_line.py b/rma_account/models/rma_order_line.py index 745c0dac..0e0a78b1 100644 --- a/rma_account/models/rma_order_line.py +++ b/rma_account/models/rma_order_line.py @@ -90,13 +90,11 @@ class RmaOrderLine(models.Model): ("delivered", "Based on Delivered Quantities"), ("received", "Based on Received Quantities"), ], - string="Refund Policy", required=True, default="no", readonly=False, ) qty_to_refund = fields.Float( - string="Qty To Refund", copy=False, digits="Product Unit of Measure", readonly=True, @@ -104,7 +102,6 @@ class RmaOrderLine(models.Model): store=True, ) qty_refunded = fields.Float( - string="Qty Refunded", copy=False, digits="Product Unit of Measure", readonly=True, @@ -252,9 +249,9 @@ class RmaOrderLine(models.Model): if len(matching_inv_lines) > 1: raise UserError( _( - "There's an rma for the invoice line %s " - "and invoice %s" - % (line.account_move_line_id, line.account_move_line_id.move_id) + "There's an rma for the invoice line %(arg1)s and invoice %(arg2)s", + arg1=line.account_move_line_id, + arg2=line.account_move_line_id.move_id, ) ) return {} diff --git a/rma_account/tests/test_rma_account.py b/rma_account/tests/test_rma_account.py index b86eb3bd..6d07bf3a 100644 --- a/rma_account/tests/test_rma_account.py +++ b/rma_account/tests/test_rma_account.py @@ -155,7 +155,7 @@ class TestRmaAccount(common.SingleTransactionCase): def test_01_add_from_invoice_customer(self): """Test wizard to create RMA from a customer invoice.""" add_inv = self.rma_add_invoice_wiz.with_context( - { + **{ "customer": True, "active_ids": self.rma_group_customer.id, "active_model": "rma.order", @@ -178,7 +178,7 @@ class TestRmaAccount(common.SingleTransactionCase): def test_02_add_from_invoice_supplier(self): """Test wizard to create RMA from a vendor bill.""" add_inv = self.rma_add_invoice_wiz.with_context( - { + **{ "supplier": True, "active_ids": self.rma_group_supplier.id, "active_model": "rma.order", @@ -217,7 +217,11 @@ class TestRmaAccount(common.SingleTransactionCase): self.assertEqual(rma.qty_to_refund, 2.0) self.assertEqual(rma.qty_refunded, 0.0) make_refund = self.rma_refund_wiz.with_context( - {"customer": True, "active_ids": rma.ids, "active_model": "rma.order.line"} + **{ + "customer": True, + "active_ids": rma.ids, + "active_model": "rma.order.line", + } ).create({"description": "Test refund"}) make_refund.invoice_refund() rma.refund_line_ids.move_id.action_post() @@ -242,7 +246,7 @@ class TestRmaAccount(common.SingleTransactionCase): def test_06_default_journal(self): self.operation_1.write({"refund_journal_id": self.journal_sale.id}) add_inv = self.rma_add_invoice_wiz.with_context( - { + **{ "customer": True, "active_ids": self.rma_group_customer_2.id, "active_model": "rma.order", @@ -255,7 +259,11 @@ class TestRmaAccount(common.SingleTransactionCase): rma.action_rma_to_approve() rma.action_rma_approve() make_refund = self.rma_refund_wiz.with_context( - {"customer": True, "active_ids": rma.ids, "active_model": "rma.order.line"} + **{ + "customer": True, + "active_ids": rma.ids, + "active_model": "rma.order.line", + } ).create({"description": "Test refund"}) make_refund.invoice_refund() rma.refund_line_ids.move_id.action_post() diff --git a/rma_account/wizards/rma_add_account_move.xml b/rma_account/wizards/rma_add_account_move.xml index c88291f6..74413fbb 100644 --- a/rma_account/wizards/rma_add_account_move.xml +++ b/rma_account/wizards/rma_add_account_move.xml @@ -14,7 +14,7 @@ name="line_ids" domain="[('move_id.partner_id', '=', partner_id)]" > - + - + - +