/**
  * @see parent::check()
  */
 function check()
 {
     if ($msg = parent::check()) {
         return $msg;
     }
     if ($this->location_id) {
         $this->completeField("object_id", "object_class");
         $location = $this->loadRefLocation();
         if ($location->object_class !== $this->object_class || $location->object_id != $this->object_id) {
             return "Le stock doit être associé à un emplacement de '" . $this->loadTargetObject() . "'";
         }
     }
     return null;
 }
 /**
  * @see parent::updatePlainFields()
  */
 function updatePlainFields()
 {
     parent::updatePlainFields();
     $this->completeField("group_id");
     if (!$this->group_id) {
         $this->group_id = CProductStockGroup::getHostGroup();
     }
 }
    /**
     * @see parent::getPerm()
     */
    function getPerm($permType)
    {
        return $this->loadRefProduct()->getPerm($permType) && $this->loadRefHost()->getPerm($permType);
    }
    /**
     * Returns the host object
     *
     * @return CGroups|CService|CBlocOperatoire
     */
    function loadRefHost()
    {
        trigger_error(__METHOD__ . " not implemented");
    }
    /**
     * Sets the host object
     *
     * @param CMbObject $host Host object
     *
     * @return void
     */
    function setHost(CMbObject $host)
    {
        trigger_error(__METHOD__ . " not implemented");
    }
}
if (CAppUI::conf("dPstock CProductStock allow_quantity_fractions")) {
    CProductStock::$allow_quantity_fractions = true;
}