mirror of
https://github.com/OCA/rma.git
synced 2025-02-16 17:11:47 +02:00
[FIX] rma: avoid reopening a cancelled RMA when the reception is deleted
When we delete the reception for an RMA, we're setting it to draft automatically so we can confirm it again and create a new reception. This is unconvenient when the RMA is cancelled, as we don't wan't to reopen it automatically. TT41943
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
{
|
||||
"name": "Return Merchandise Authorization Management",
|
||||
"summary": "Return Merchandise Authorization (RMA)",
|
||||
"version": "15.0.1.1.1",
|
||||
"version": "15.0.1.1.2",
|
||||
"development_status": "Production/Stable",
|
||||
"category": "RMA",
|
||||
"website": "https://github.com/OCA/rma",
|
||||
|
||||
@@ -35,7 +35,9 @@ class StockMove(models.Model):
|
||||
rma_receiver = self.sudo().mapped("rma_receiver_ids")
|
||||
rma = self.sudo().mapped("rma_id")
|
||||
res = super().unlink()
|
||||
rma_receiver.write({"state": "draft"})
|
||||
rma_receiver.filtered(lambda x: x.state != "cancelled").write(
|
||||
{"state": "draft"}
|
||||
)
|
||||
rma.update_received_state()
|
||||
rma.update_replaced_state()
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user