From 3467daedd9a097f57935187b5cdd9a0f2d3496e4 Mon Sep 17 00:00:00 2001 From: Jared Kipe Date: Mon, 29 Aug 2022 19:06:57 +0000 Subject: [PATCH] [FIX] rma_sale: backport fix from 15 (tests in 15) --- rma_sale/models/rma.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/rma_sale/models/rma.py b/rma_sale/models/rma.py index d6668d3c..4bb8a94c 100644 --- a/rma_sale/models/rma.py +++ b/rma_sale/models/rma.py @@ -11,8 +11,15 @@ class SaleOrderLine(models.Model): def _get_protected_fields(self): res = super(SaleOrderLine, self)._get_protected_fields() context = self._context or {} - if context.get('rma_done') and 'product_uom_qty' in res: - res.remove('product_uom_qty') + if context.get('rma_done'): + if 'product_uom_qty' in res: + res.remove('product_uom_qty') + # technically used by product_cores to update related core pieces + if 'product_id' in res: + res.remove('product_id') + if 'product_uom' in res: + res.remove('product_uom') + return res return res