FIX MouvementStock::origin is not an object

This commit is contained in:
Noé Cendrier 2023-12-14 10:20:50 +01:00
parent 5eb47adef1
commit 5c074a2bed

View file

@ -373,8 +373,8 @@ class MouvementStock extends CommonObject
}
} else { // If not found, we add record
$productlot = new Productlot($this->db);
$productlot->origin = !empty($this->origin) ? (empty($this->origin->origin_type) ? $this->origin->element : $this->origin->origin_type) : '';
$productlot->origin_id = !empty($this->origin) ? $this->origin->id : 0;
$productlot->origin = !empty($this->origin_type) ? $this->origin_type : '';
$productlot->origin_id = !empty($this->origin_id) ? $this->origin_id : 0;
$productlot->entity = $conf->entity;
$productlot->fk_product = $fk_product;
$productlot->batch = $batch;