From e112a7f973a437be318ceef85ea6f6e624d28cf5 Mon Sep 17 00:00:00 2001
From: Andrew Gavgavian <andg@odoo.com>
Date: Thu, 27 Apr 2023 21:46:35 +0000
Subject: [PATCH] [FIX] stock: fix report.stock.quantity search_read
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

	Currently `report.stock.quantity` has a field defined in it called `move_ids`:
	`move_ids = fields.One2many('stock.move',readonly=True)`

	This virtual field has no corresponding inverse field so when performing a search_read on the model, it fails
	in fields.py when trying to do:	`inverse_field = comodel._fields[inverse]`

	In addition, this field is apparently not used anywhere in the source code and not queried in the SQL View.

	This means the model can never be search_read by default.

	Since this field is never used, it isn't stored, and the model is `_auto = False`, removing it won't break any database.

closes odoo/odoo#120416

X-original-commit: e3b1a887a772333ebdb1682ffbbb695fe86030c1
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Andrew Gavgavian (andg) <andg@odoo.com>
---
 addons/stock/report/report_stock_quantity.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/addons/stock/report/report_stock_quantity.py b/addons/stock/report/report_stock_quantity.py
index 6592303f5cfc..50688b0ec6e7 100644
--- a/addons/stock/report/report_stock_quantity.py
+++ b/addons/stock/report/report_stock_quantity.py
@@ -18,7 +18,6 @@ class ReportStockQuantity(models.Model):
         ('out', 'Forecasted Deliveries'),
     ], string='State', readonly=True)
     product_qty = fields.Float(string='Quantity', readonly=True)
-    move_ids = fields.One2many('stock.move', readonly=True)
     company_id = fields.Many2one('res.company', readonly=True)
     warehouse_id = fields.Many2one('stock.warehouse', readonly=True)
 
-- 
GitLab