In Odoo, you can use the "Stock Inventory" module to get a by-location inventory report, which will show both the quantity and value of the products in each location. Here are the steps you can follow to generate a by-location inventory report:
Go to the "Inventory" app in Odoo and select the "Inventories" menu option.
Click on the "Create" button to create a new inventory.
Select the locations for which you want to generate the report and set the appropriate date for the inventory.
In the "Inventory lines" tab, you will see a list of all the products in the selected locations, along with their current quantities and values.
You can filter the products by location by using the dropdown on the top right corner of the inventory lines tab.
Once you have the inventory, you can also export it in a variety of formats, like Excel, PDF, or CSV.
Alternatively, you can also use the stock.inventory.line model to filter by location and get the same data through a programmatic way.
Copy code
from odoo import api, fields, models
class StockInventoryLine(models.Model):
_inherit = 'stock.inventory.line'
location_id = fields.Many2one('stock.location', 'Location')
@api.model
def get_location_inventory(self, location_id):
inventory_lines = self.search([('location_id', '=', location_id)])
return inventory_lines
You can use the above method to get the inventory data of a specific location by passing the location's id to it.
Please note that these are basic examples and you may need to adapt them to your specific use case and add additional error handling and security measures as needed
Hello Talal, did you get the solution to this?
I'm also looking for a solution to this problem. I'd rather an odoo solution as opposed to a third party app