[14.0][IMP] rma_account: make refund policy editable in approved rmas

* small fix in tests
This commit is contained in:
AaronHForgeFlow
2022-01-19 18:16:13 +01:00
parent 44c5488b6c
commit 3f94eaf5a3
2 changed files with 3 additions and 4 deletions

View File

@@ -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",

View File

@@ -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