• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/productrow.php
  • Класс: Bitrix\Crm\ProductRow
  • Вызов: ProductRow::normalizeMeasure
protected function normalizeMeasure(Result $result): void
{
	if ($this->tryNormalizeCurrentMeasure())
	{
		return;
	}

	if ($this->getProductId() > 0)
	{
		if ($this->trySetMeasureFromReference())
		{
			return;
		}
	}

	if ($this->trySetDefaultMeasure())
	{
		return;
	}

	$result->addError(new Error(
		"Invalid measure. Default measure and measure in reference were not found. ID = {$this->getId()}",
		static::ERROR_CODE_NORMALIZATION_MEASURE_INVALID,
	));
}