title: Odoo get data from another model with self.env
body: <p>For the Odoo warehouse module I have to do a check if all required fields have been filled when quality control wants to transfer the products to stock. 
  At this moment everything works but the location for quality control is currently hardcoded. This means that when someone is using another stock location for quality control they would have to change the code. </p>
  
  <p>I have searched trough the Odoo documentation and as far as I can see for the new api I have to use self.env instead of self.pool.get. (I added the old code as a comment.)
  When debugging it seems that stock.warehouse is in self.pool and not in self.env (But I guess this might just be one of those "Odoo" things). </p>
  
  <p>Second thing is that I have hardcoded the current company_id "1". 
  I think it would be best if that could also be best if that would be a variable. </p>
  
  <p>I hope someone can help me solve this. </p>
  
  <p>Thanks in advance</p>
  
  <pre><code>class stock_transfer_details(models.TransientModel):
      _inherit = "stock.transfer_details"
  
      @api.one
      def do_detailed_transfer(self):
          res = super(stock_transfer_details, self).do_detailed_transfer()
          # Check if all the required lot additional fields have been filled.
          # Else raise warning.
          # TODO Replace hardcoded Quality location by database reference
  
          warehouse = self.env("stock.warehouse").search([("company_id", "=", "1")])
          # self.pool.get("stock.warehouse").browse(cr, uid, item["wh_qc_stock_loc_id"], context=context)
  
          qc_location = warehouse.wh_qc_stock_loc_id
  
          missing_mandatory_fields = []
          if self.picking_source_location_id.id == 14:
              item_ids = self.mapped("item_ids")
              for item in item_ids:
                  additional_fields = item.lot_id.mapped("lot_lot_additional_fields")
                  for field in additional_fields:
                      if field.lot_additional_fields.mandatory and not field.value:
                          if item.lot_id.name not in missing_mandatory_fields:
                              missing_mandatory_fields.append(item.lot_id.name)
  
          if missing_mandatory_fields:
              error_message = "All required fields for the serial numbers must be filled! \n"
              error_message += "Serial numbers: \n"
              for item in missing_mandatory_fields:
                  error_message += item + "\n"
              raise exceptions.Warning(error_message)
  
          return res
  </code></pre>