title: How to get products available quantity for individual stock (Odoo11)
body: <p>I am using <strong>odoo11(python3)</strong> and <em>develop a custom module.</em></p>
  
  <p>I would like to get products quantity (by hand or forecast) for an individual stock house.</p>
  
  <p>Just I select any individual stockhouse and show product quantity for this stockhouse.
  Actually, my target is two things
  1.Products total available quantity
  2.Products available quantity based on location
  This is my code</p>
  
  <pre><code>class Threshold(models.Model):
      _name="threshold.threshold"
      main_location=fields.Many2many("stock.warehouse", string="Main Location")
      product=fields.Many2many("product.template", string="Product")
      category=fields.Many2one("product.category", string="Category")
      attribute=fields.Many2many("product.attribute", string="Attribute")
      threshold_value=fields.Integer(string="Threshold Value")
      transfer_quantity=fields.Integer(string="Transfer Quantity")
      status_button=fields.Selection([('0','Active'),('1','Dissmiss')], default='0', index=True, string="Status")
      threshold_selection=fields.Selection([('0','Product'),('1','Category'),], default= '0', index=True, string="Threshold Selection")
  
  product_quantity=fields.Integer(compute="_product_based_on_warehouse", store=True)
  
  @api.depends('main_location','product_quantity')
  def _product_based_on_warehouse(self):
      count_products = 0 
  self.env['product.template'].with_context(warehouse=self.main_location).search([], limit=1)
  self.product_quantity=products print(f'Product Quantity: {self.product_quantity}')
  
  </code></pre>