From 48cec57368ae0d7e970f2ef94d286ea24405dcc4 Mon Sep 17 00:00:00 2001 From: SilvioGregorini Date: Tue, 13 Apr 2021 23:41:32 +0200 Subject: [PATCH] [FIX] rma_sale: fix CacheError in _prepare_rma_values() Lesser fix for sale.order.line.rma.wizard methods. When method '_prepare_rma_values' was called upon records where field 'picking_id' was empty, Odoo raised a CacheError when trying to access field 'move_id'. That happened because computed method '_compute_move_id' was not assigning a proper value to such field when 'picking_id' was empty. Once the computed method is fixed (by simply assigning 'False' as 'move_id' value when no picking is set), the CacheError is solved. --- rma_sale/__manifest__.py | 2 +- rma_sale/wizard/sale_order_rma_wizard.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rma_sale/__manifest__.py b/rma_sale/__manifest__.py index 4e2b0802..f31780f2 100644 --- a/rma_sale/__manifest__.py +++ b/rma_sale/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Return Merchandise Authorization Management - Link with Sales", "summary": "Sale Order - Return Merchandise Authorization (RMA)", - "version": "13.0.1.2.0", + "version": "13.0.1.2.1", "development_status": "Production/Stable", "category": "RMA", "website": "https://github.com/OCA/rma", diff --git a/rma_sale/wizard/sale_order_rma_wizard.py b/rma_sale/wizard/sale_order_rma_wizard.py index 77871d00..99270219 100644 --- a/rma_sale/wizard/sale_order_rma_wizard.py +++ b/rma_sale/wizard/sale_order_rma_wizard.py @@ -140,6 +140,8 @@ class SaleOrderLineRmaWizard(models.TransientModel): and r.sale_line_id.order_id == record.order_id ) ) + else: + record.move_id = False @api.depends("order_id") def _compute_allowed_product_ids(self):