[FIX] rma_sale: backport fix from 15 (tests in 15)

This commit is contained in:
Jared Kipe
2022-08-29 19:06:57 +00:00
parent 38af74064f
commit 3467daedd9

View File

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