From 3f94eaf5a33e279a40f985bb8202e6427c6c9616 Mon Sep 17 00:00:00 2001 From: AaronHForgeFlow Date: Wed, 19 Jan 2022 18:16:13 +0100 Subject: [PATCH] [14.0][IMP] rma_account: make refund policy editable in approved rmas * small fix in tests --- rma_account/models/rma_order_line.py | 3 +-- rma_account/tests/test_rma_account.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/rma_account/models/rma_order_line.py b/rma_account/models/rma_order_line.py index cfdedfb6..745c0dac 100644 --- a/rma_account/models/rma_order_line.py +++ b/rma_account/models/rma_order_line.py @@ -93,8 +93,7 @@ class RmaOrderLine(models.Model): string="Refund Policy", required=True, default="no", - readonly=True, - states={"draft": [("readonly", False)], "approved": [("readonly", False)]}, + readonly=False, ) qty_to_refund = fields.Float( string="Qty To Refund", diff --git a/rma_account/tests/test_rma_account.py b/rma_account/tests/test_rma_account.py index b970ed34..b86eb3bd 100644 --- a/rma_account/tests/test_rma_account.py +++ b/rma_account/tests/test_rma_account.py @@ -220,7 +220,7 @@ class TestRmaAccount(common.SingleTransactionCase): {"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.post() + rma.refund_line_ids.move_id.action_post() rma._compute_refund_count() self.assertEqual(rma.refund_count, 1) self.assertEqual(rma.qty_to_refund, 0.0) @@ -258,7 +258,7 @@ class TestRmaAccount(common.SingleTransactionCase): {"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.post() + rma.refund_line_ids.move_id.action_post() rma._compute_refund_count() self.assertEqual( self.operation_1.refund_journal_id, rma.refund_line_ids.journal_id