/**
  * @param ApiWarehouse[] $warehouses
  * @throws \Exception
  */
 public function processWarehouses($warehouses)
 {
     foreach ($warehouses as $item) {
         $odooId = $item->getIdOdoo();
         $found = $this->_repoAggWrhs->getByOdooId($odooId);
         if (!$found) {
             /** @var  $aggData AggWarehouse */
             $aggData = $this->_manObj->create(AggWarehouse::class);
             $aggData->setOdooId($odooId);
             $aggData->setCurrency($item->getCurrency());
             $aggData->setWebsiteId(Cfg::DEF_WEBSITE_ID_ADMIN);
             $aggData->setCode($item->getCode());
             $aggData->setNote('replicated from Odoo');
             $created = $this->_repoAggWrhs->create($aggData);
             if (!$created->getId()) {
                 throw new \Exception('Cannot replicate warehouse.');
             }
         }
     }
 }