I am trying to fetch all stock locations which are under a specific warehouse in Odoo 15. I tried the below code.
locations_dd.append(self.env['stock.location'].search([('warehouse_id','=',i)]).ids)
But I am getting the below error:
ERROR odoo15ee odoo.osv.expression: Non-stored field stock.location.warehouse_id cannot be searched.
How can I solve this?