Merge pull request #32527 from erikvanberkum/develop

FIX units product
This commit is contained in:
Laurent Destailleur 2025-01-05 17:41:09 +01:00 committed by GitHub
commit 001fc9107b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1363,19 +1363,19 @@ class Product extends CommonObject
$this->note_private = (isset($this->note_private) ? trim($this->note_private) : null);
$this->note_public = (isset($this->note_public) ? trim($this->note_public) : null);
$this->net_measure = price2num($this->net_measure);
$this->net_measure_units = (empty($this->net_measure_units) ? '' : trim((string) $this->net_measure_units));
$this->net_measure_units = (is_null($this->net_measure_units) ? '' : trim((string) $this->net_measure_units));
$this->weight = price2num($this->weight);
$this->weight_units = (empty($this->weight_units) ? '' : trim((string) $this->weight_units));
$this->weight_units = (is_null($this->weight_units) ? '' : trim((string) $this->weight_units));
$this->length = price2num($this->length);
$this->length_units = (empty($this->length_units) ? '' : trim((string) $this->length_units));
$this->length_units = (is_null($this->length_units) ? '' : trim((string) $this->length_units));
$this->width = price2num($this->width);
$this->width_units = (empty($this->width_units) ? '' : trim((string) $this->width_units));
$this->width_units = (is_null($this->width_units) ? '' : trim((string) $this->width_units));
$this->height = price2num($this->height);
$this->height_units = (empty($this->height_units) ? '' : trim((string) $this->height_units));
$this->height_units = (is_null($this->height_units) ? '' : trim((string) $this->height_units));
$this->surface = price2num($this->surface);
$this->surface_units = (empty($this->surface_units) ? '' : trim((string) $this->surface_units));
$this->surface_units = (is_null($this->surface_units) ? '' : trim((string) $this->surface_units));
$this->volume = price2num($this->volume);
$this->volume_units = (empty($this->volume_units) ? '' : trim((string) $this->volume_units));
$this->volume_units = (is_null($this->volume_units) ? '' : trim((string) $this->volume_units));
// set unit not defined
if (is_numeric($this->length_units)) {